Merge pull request 'Fix JR button and DeviceStatus' (#135) from beka-3 into main

Reviewed-on: #135
This commit is contained in:
gigi.mamaladze 2025-06-23 13:36:56 +00:00
commit 06bfc3cc2a
6 changed files with 125 additions and 158 deletions

View File

@ -1,6 +1,14 @@
{
"custom": {
"PLC_list": null,
"PLC_list": [
"MCM01",
"MCM02",
"MCM03",
"MCM04",
"MCM05",
"MCM06",
"MCM07"
],
"running_state": -1,
"state": 0,
"views_data": []
@ -204,6 +212,11 @@
"basis": "30px",
"shrink": 0
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{

View File

@ -204,6 +204,11 @@
"basis": "30px",
"shrink": 0
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{

View File

@ -6,11 +6,11 @@
"MCM03",
"MCM04",
"MCM05",
"MCM06",
"MCM07"
"MCM06"
],
"running_state": -1,
"state": 0,
"type": 0,
"views_data": []
},
"params": {
@ -112,6 +112,27 @@
},
"persistent": true
},
"custom.type": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Chute_Type"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.views_data": {
"binding": {
"config": {
@ -1733,6 +1754,22 @@
"position": {
"grow": 1
},
"propConfig": {
"props.tabs": {
"binding": {
"config": {
"path": "view.custom.type"
},
"transforms": [
{
"code": "\t# This script runs whenever view.custom.type changes\n\tif value \u003d\u003d 0:\n\t\treturn [\"Alarms\", \"Info\"]\n\telse:\n\t\treturn [\"Alarms\", \"Info\", \"Commands\"]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"menuType": "modern",
"tabSize": {
@ -1755,12 +1792,7 @@
"fontWeight": "bold",
"paddingLeft": 10
}
},
"tabs": [
"Alarms",
"Info",
"Commands"
]
}
},
"type": "ia.container.tab"
}

View File

@ -30,14 +30,14 @@
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"expression": "!isGood({value})",
"type": "expression"
}
],
@ -218,27 +218,9 @@
"props.color": {
"binding": {
"config": {
"path": "view.custom.state"
"expression": "if(\r\n {view.custom.disconnected},\r\n \u0027#D3D3D3\u0027,\r\n if(\r\n {view.custom.state} \u003d 1,\r\n \u0027#FF0000\u0027,\r\n if(\r\n {view.custom.state} \u003d 0,\r\n \u0027#00D900\u0027,\r\n \u0027#fff700\u0027\r\n )\r\n )\r\n)\r\n"
},
"transforms": [
{
"fallback": "#00CC00",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#FF0000"
},
{
"input": 0,
"output": "#00CC00"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
"type": "expr"
}
}
},
@ -273,6 +255,7 @@
"name": "root",
"text": "",
"tooltip": {
"enabled": true,
"style": {}
}
},
@ -290,6 +273,14 @@
{
"input": 1,
"output": "Alarms-Styles/High"
},
{
"input": 2,
"output": "Alarms-Styles/High"
},
{
"input": 3,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
@ -314,37 +305,10 @@
},
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"transforms": [
{
"fallback": "Disconnects/Device-Connected",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Disconnects/Device-Disconnected"
},
{
"input": false,
"output": "Disconnects/Device-Connected"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"direction": "column",
"style": {}
"direction": "column"
},
"type": "ia.container.flex"
}

View File

@ -1,5 +1,6 @@
{
"custom": {
"alarm_message": null,
"disconnected": false,
"plc": "value",
"priority": 0,
@ -29,14 +30,14 @@
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"expression": "!isGood({value})",
"type": "expression"
}
],
@ -69,6 +70,14 @@
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 3,
"output": 1
},
{
"input": 2,
"output": 1
},
{
"input": 1,
"output": 1
@ -92,13 +101,21 @@
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "No active alarms"
},
{
"input": 1,
"output": "High"
},
{
"input": 0,
"output": "No active alarms"
"input": 2,
"output": "High"
},
{
"input": 3,
"output": "High"
}
],
"outputType": "scalar",
@ -189,6 +206,28 @@
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"transforms": [
{
"fallback": "#585858",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#000000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
@ -290,9 +329,7 @@
"elements": [
{
"d": "M 0,0 H 20 V 20 H 0 Z",
"fill": {
"paint": "#585858"
},
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
@ -343,20 +380,6 @@
}
},
"propConfig": {
"meta.tooltip.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state5},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.style.classes": {
"binding": {
"config": {
@ -369,7 +392,7 @@
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
"output": "Alarms-Styles/High"
},
{
"input": 2,
@ -391,24 +414,10 @@
"type": "expr"
}
},
"meta.tooltip.style.color": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t\u0027#FFFFFF\u0027)\r\n\t)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
@ -420,32 +429,6 @@
},
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"transforms": [
{
"fallback": "Disconnects/Device-Connected",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Disconnects/Device-Disconnected"
},
{
"input": false,
"output": "Disconnects/Device-Connected"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {

View File

@ -195,7 +195,7 @@
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \"#FFFFFF\",\r\n if(\r\n {view.custom.type} \u003d 0,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027#c2c2c2\u0027,\r\n 3, \u0027#0008FF\u0027,\r\n \u0027#fff700\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 1,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027#c2c2c2\u0027,\r\n 1, \u0027#C9FCC0\u0027,\r\n 2, \u0027#7F83FF\u0027,\r\n 3, \u0027#0008FF\u0027,\r\n 4, \u0027#FF8C00\u0027,\r\n 5, \u0027#FF4487\u0027,\r\n 6, \u0027#92FF00\u0027,\r\n \u0027#fff700\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 2,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027#c2c2c2\u0027,\r\n 1, \u0027#C9FCC0\u0027,\r\n 2, \u0027#7F83FF\u0027,\r\n 3, \u0027#0008FF\u0027,\r\n 4, \u0027#FF8C00\u0027,\r\n \u0027#FFFFFF\u0027\r\n ),\r\n \u0027#fff700\u0027\r\n )\r\n )\r\n )\r\n)\r\n"
"expression": "if(\r\n {view.custom.disconnected},\r\n \"#FFFFFF\",\r\n if(\r\n {view.custom.type} \u003d 0,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027#c2c2c2\u0027,\r\n 3, \u0027#0000FF\u0027,\r\n \u0027#fff700\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 1,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027#c2c2c2\u0027,\r\n 1, \u0027#CCFFCC\u0027,\r\n 2, \u0027#FFFF00\u0027,\r\n 3, \u0027#0000FF\u0027,\r\n 4, \u0027#FF8C00\u0027,\r\n 5, \u0027#FF4487\u0027,\r\n 6, \u0027#92FF00\u0027,\r\n \u0027#fff700\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 2,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027#c2c2c2\u0027,\r\n 1, \u0027#CCFFCC\u0027,\r\n 2, \u0027#FFFF00\u0027,\r\n 3, \u0027#0000FF\u0027,\r\n 4, \u0027#FF8C00\u0027,\r\n \u0027#FFFFFF\u0027\r\n ),\r\n \u0027#fff700\u0027\r\n )\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
}
@ -290,40 +290,10 @@
},
"type": "expr"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"enabled": false,
"transforms": [
{
"fallback": "Disconnects/Device-Connected",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Disconnects/Device-Disconnected"
},
{
"input": false,
"output": "Disconnects/Device-Connected"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"justify": "center",
"style": {
"classes": "Disconnects/Device-Connected"
}
"justify": "center"
},
"type": "ia.container.flex"
}