BNA8/.resources/9d08b182c490bfd74f440d812089ce85d1786cb5732a9c97bbc39466a5e706c7

104 lines
3.0 KiB
Plaintext

{
"custom": {},
"params": {
"text": "Source Id: System/MCM02/Beacon/S03_CH113_BCN1_A, Priority: No Alarms, State: Normal"
},
"propConfig": {
"params.key": {
"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": {
"path": "view.params.text"
},
"transforms": [
{
"code": "\tif \"Priority\" not in value:\n\t\treturn \"#fff\"\n\treturn \"#000\"",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.text"
},
"type": "property"
}
}
},
"props": {
"style": {
"fontSize": "9px",
"maxWidth": 480,
"overflow": "visible",
"textAlign": "left",
"whiteSpace": "pre",
"width": "auto"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"props.style.classes": {
"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 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"
}
}
},
"props": {
"mode": "percent",
"style": {
"overflow": "visible"
}
},
"type": "ia.container.coord"
}
}