BNA8/.resources/fe2476ef972b03f61d4b8fc924ab506f9ecd26217a22bcf72da7fe1a7d4fbca5

371 lines
9.7 KiB
Plaintext

{
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 0,
"High": 2,
"Low": 0,
"Medium": 1,
"Total": 3
}
},
"params": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"value": {
"tagProps": [
"MCM01"
]
}
},
"propConfig": {
"custom.totalAlarms": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"type": "tag"
},
"onChange": {
"enabled": null,
"script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\t# Initialize counts\n\tcounts \u003d {\n\t \"Critical\": 0,\n\t \"High\": 0,\n\t \"Medium\": 0,\n\t \"Low\": 0,\n\t \"Diagnostic\": 0,\n\t \"Total\": 0\n\t}\n\t\n\t# Safety check\n\tif queryData is None or queryData.rowCount \u003d\u003d 0:\n\t self.custom.counts \u003d counts\n\t return\n\t\n\t# Loop through dataset\n\tfor row in range(queryData.rowCount):\n\t location \u003d queryData.getValueAt(row, \"Location\")\n\t priority \u003d queryData.getValueAt(row, \"Priority\")\n\t count \u003d queryData.getValueAt(row, \"Count\")\n\t\n\t if location \u003d\u003d MCM:\n\t key \u003d priority.capitalize()\n\t if key in counts:\n\t counts[key] +\u003d count\n\t counts[\"Total\"] +\u003d count\n\t\n\t# Write result\n\tself.custom.counts \u003d counts\n"
}
},
"params.classes": {
"paramDirection": "input",
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "High_Label"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
},
"text": "High"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Med_Label"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
},
"text": "Med"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Low_Label"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
},
"text": "Low"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Diag_Label"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
},
"text": "Diag"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Total_Label"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
},
"text": "Total"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_Header"
},
"position": {
"basis": "25px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "High_Value"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.High"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Med_Value"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Medium"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Low_Value"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Low"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Diag_Value"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Diagnostic"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Total_Value"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Total"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_Values"
},
"position": {
"basis": "25px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
}
],
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}