89 lines
2.6 KiB
Plaintext
89 lines
2.6 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": 17,
|
|
"width": 375
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Label"
|
|
},
|
|
"position": {
|
|
"height": "auto",
|
|
"width": "auto"
|
|
},
|
|
"propConfig": {
|
|
"props.text": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.params.text"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"style": {
|
|
"color": "#fff",
|
|
"fontSize": "8px",
|
|
"overflow": "visible",
|
|
"textAlign": "left",
|
|
"whiteSpace": "nowrap"
|
|
}
|
|
},
|
|
"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": {
|
|
"style": {
|
|
"overflow": "visible",
|
|
"overflowX": "visible"
|
|
}
|
|
},
|
|
"type": "ia.container.coord"
|
|
}
|
|
} |