BNA8/.resources/495c374a023b01e6177e2bbe590dc112df397e456aa58fc5d92a37dc6467c56d

114 lines
3.4 KiB
Plaintext

{
"custom": {
"class": "Alarms-Styles/NoAlarm-Black"
},
"params": {
"TEST": "Source Id: System/MCM02/Beacon/S03_CH113_BCN1_A, State: Normal",
"TEST1": "Device Disconnected",
"text": "Air Pressure Reset"
},
"propConfig": {
"custom.class": {
"binding": {
"config": {
"path": "view.params.text"
},
"transforms": [
{
"code": "\t# value \u003d view.params.text\n\t\n\tif value is None:\n\t\treturn \"Alarms-Styles/NoAlarm-Black\"\n\t\n\t# Extract the priority text safely\n\ttext \u003d str(value).strip()\n\t\n\t# If the text includes \"Priority:\", split and clean it\n\tif \"Priority:\" in text:\n\t\ttext \u003d text.split(\"Priority:\", 1)[1].strip()\n\t\n\t# Standardize casing for matching\n\ttext \u003d text.lower()\n\t\n\t# Match against known priorities\n\tif text.startswith(\"high\"):\n\t\treturn \"Alarms-Styles/High\"\n\telif text.startswith(\"medium\"):\n\t\treturn \"Alarms-Styles/Medium\"\n\telif text.startswith(\"low\"):\n\t\treturn \"Alarms-Styles/Low\"\n\telif \"no active alarms\" in text:\n\t\treturn \"Alarms-Styles/NoAlarm\"\n\telif \"diagnostic\" in text:\n\t\treturn \"Alarms-Styles/Diagnostic\"\n\t\n\t# Fallback\n\treturn \"Alarms-Styles/NoAlarm-Black\"\n",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"params.TEST": {
"paramDirection": "input",
"persistent": true
},
"params.TEST1": {
"paramDirection": "input",
"persistent": true
},
"params.key_1": {
"paramDirection": "input",
"persistent": true
},
"params.priority": {
"paramDirection": "input",
"persistent": true
},
"params.text": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 500
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.style.color": {
"binding": {
"config": {
"expression": "if(\r\n {view.params.text} \u003d \"Device Disconnected\",\r\n \"#fff\",\r\n if(\r\n {view.custom.class} \u003d \"Alarms-Styles/NoAlarm\"\r\n || {view.custom.class} \u003d \"Alarms-Styles/NoAlarm-Black\",\r\n \"#fff\",\r\n \"#000\"\r\n )\r\n)\r\n"
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.text"
},
"type": "property"
}
}
},
"props": {
"style": {
"fontSize": "9px",
"overflow": "visible",
"textAlign": "left",
"whiteSpace": "pre",
"width": "auto"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.class"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"overflow": "visible"
}
},
"type": "ia.container.coord"
}
}