BNA8/.resources/8b4da3e1e618647ed163875ca5a4ebde5e25c592ff6e9bc9f40c2120eca5a711

211 lines
5.6 KiB
Plaintext

{
"custom": {
"state": {
"$": [
"ds",
192,
1762615945641
],
"$columns": [
{
"data": [
"MCM01",
"MCM01",
"MCM01",
"MCM02",
"MCM02"
],
"name": "Location",
"type": "String"
},
{
"data": [
"High",
"Low",
"Medium",
"High",
"Medium"
],
"name": "Priority",
"type": "String"
},
{
"data": [
23,
10,
2,
9,
1
],
"name": "Count",
"type": "Long"
}
]
},
"status": ""
},
"params": {
"value": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "1"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},
"onChange": {
"enabled": null,
"script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\tif not queryData:\n\t self.custom.status \u003d \"\"\n\t\n\t# Define priority order from highest to lowest\n\tpriority_order \u003d [\"Critical\", \"High\", \"Medium\", \"Low\", \"Diagnostic\"]\n\texisting_priorities \u003d set()\n\tmyPriority \u003d \"\"\n\t\n\t# Populate the set\n\tfor row in range(queryData.rowCount):\n\t mcm_val \u003d queryData.getValueAt(row, 0)\n\t severity \u003d queryData.getValueAt(row, 1).capitalize()\n\t count \u003d queryData.getValueAt(row, 2)\n\t\n\t if mcm_val \u003d\u003d MCM and count \u003e 0:\n\t existing_priorities.add(severity)\n\t\n\t# Find the highest one that exists\n\tfor priority in priority_order:\n\t if priority in existing_priorities:\n\t myPriority \u003d priority\n\t break\n\t\n\tself.custom.status \u003d myPriority"
},
"persistent": true
},
"custom.status": {
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.navigate(self.view.params.value.tagProps[0])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Label"
},
"position": {
"grow": 1
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.status"
},
"transforms": [
{
"fallback": "State-Styles/Background-Fill/State5",
"inputType": "scalar",
"mappings": [
{
"input": "High",
"output": "State-Styles/Background-Fill/State1"
},
{
"input": "Medium",
"output": "State-Styles/Background-Fill/State2"
},
{
"input": "Low",
"output": "State-Styles/Background-Fill/State3"
},
{
"input": "Diagnostic",
"output": "State-Styles/Background-Fill/State4"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.status"
},
"transforms": [
{
"fallback": "HEALTHY",
"inputType": "scalar",
"mappings": [
{
"input": "Diagnostic",
"output": "DIAGNOSTIC"
},
{
"input": "Low",
"output": "HALF WORKFLOW"
},
{
"input": "Medium",
"output": "CONTROLLED STOP"
},
{
"input": "High",
"output": "UNCONTROLLED STOP"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"borderColor": "#555555",
"borderStyle": "none",
"cursor": "pointer",
"fontSize": 12,
"marginBottom": 8,
"marginTop": 8,
"textAlign": "center"
},
"textStyle": {
"fontSize": 12,
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}