BNA8/.resources/d3914d7af6bee438bac772bac1628ec3d0d6c8e563d1a34317d07ef6a6efb0ec

789 lines
23 KiB
Plaintext

{
"custom": {},
"params": {
"Status": "",
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"params.Status": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 212,
"width": 336
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "400px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"type": "property"
}
}
},
"props": {
"textStyle": {
"textIndent": "10px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "JAM",
"tooltip": {
"enabled": true,
"text": "Jams"
}
},
"position": {
"basis": "24px",
"shrink": 0
},
"props": {
"path": "autStand/Equipment/JAM",
"style": {
"marginRight": "5px"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "10px",
"grow": 1
},
"props": {
"style": {
"marginRight": "10px"
},
"text": 0,
"textStyle": {
"textAlign": "end"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "60px"
},
"props": {
"style": {
"backgroundColor": "#555555",
"key": "value"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"marginLeft": 10
},
"text": "AREA",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "195px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.area_display"
},
"type": "property"
}
}
},
"props": {
"style": {
"marginLeft": 50
},
"textStyle": {
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5,
"borderLeftColor": "#555555",
"borderLeftStyle": "none",
"borderLeftWidth": 0.5,
"borderRightColor": "#555555",
"borderRightStyle": "none",
"borderRightWidth": 0.5,
"borderTopColor": "#555555",
"borderTopStyle": "solid",
"borderTopWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"marginLeft": 10
},
"text": "STATUS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "200px"
},
"propConfig": {
"props.params.value.tagProps[0]": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"params": {
"key": "value",
"value": {
"tagProps": [
null,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"path": "autStand/Equipment/Controller-Views/CommandControlStatus"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "80px"
},
"props": {
"justify": "space-around",
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "25px"
},
"propConfig": {
"props.color": {
"binding": {
"config": {
"path": "/root.custom.counts"
},
"transforms": [
{
"code": "\tfor v in value.values():\n\t\tif v \u003e 0:\n\t\t\treturn \"red\"\n\treturn \"\"",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/notifications_active",
"style": {
"classes": "",
"marginLeft": 10
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "100px"
},
"props": {
"style": {
"marginLeft": 10
},
"text": "ACTIVE ALARMS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_3"
},
"position": {
"basis": "80px"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"text": "High",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Medium",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Low",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Diag",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Total",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "200px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"text": 5,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\thigh \u003d payload.get(\"High\",0)\n\tself.props.text \u003d high",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"text": 2,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tmedium \u003d payload.get(\"Medium\",0)\n\tself.props.text \u003d medium",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"text": 0,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tlow \u003d payload.get(\"Low\",0)\n\tself.props.text \u003d low",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"text": 3,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tdiag \u003d payload.get(\"Diagnostic\",0)\n\tself.props.text \u003d diag",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"text": 10,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tcritical \u003d payload.get(\"Critical\",0)\n\thigh \u003d payload.get(\"High\",0)\n\tmed \u003d payload.get(\"Medium\",0)\n\tlow \u003d payload.get(\"Low\",0)\n\tdiag \u003d payload.get(\"Diagnostic\",0)\n\t\n\ttotal \u003d critical + high + med + low + diag\n\tself.props.text \u003d total\n\t",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "200px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "334px"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_2"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"marginBottom": 5,
"marginLeft": 10,
"marginRight": 10
}
},
"type": "ia.container.flex"
}
],
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 3,
"High": 5,
"Low": 0,
"Medium": 2
}
},
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tDETAILED_VIEWS \u003d {\n\t\t\"MCM01\": \"/autStand/MCM01\",\n\t\t\"MCM02\": \"/autStand/MCM02\"\n\t}\n\tpage \u003d self.view.params.tagProps[0]\n\t\n\tsystem.perspective.navigate(DETAILED_VIEWS[page])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.Total": {
"binding": {
"config": {
"expression": "{this.custom.counts.Critical} + {this.custom.counts.Diagnostic} + {this.custom.counts.High} + {this.custom.counts.Low} + {this.custom.counts.Medium}"
},
"type": "expr"
}
},
"custom.area": {
"binding": {
"config": {
"expression": "jsonGet({this.custom.plc_dict}, \"Area\")"
},
"type": "expr"
}
},
"custom.area_display": {
"binding": {
"config": {
"expression": "if(len({this.custom.sub_area})\u003e0,\r\nconcat({this.custom.area} + \"/\" + {this.custom.sub_area}),\r\n{this.custom.area})"
},
"type": "expr"
}
},
"custom.counts": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.sendMessage(\"update-alarm-count\", self.custom.counts, \"view\")"
}
},
"custom.plc_dict": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"transforms": [
{
"expression": "jsonGet({value}, {view.params.tagProps[0]})",
"type": "expression"
}
],
"type": "tag"
}
},
"custom.provider": {
"binding": {
"config": {
"expression": "\"[\"+{session.custom.fc}+\"_SCADA_TAG_PROVIDER]\""
},
"type": "expr"
}
},
"custom.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
},
"transforms": [
{
"expression": "if(isNull({value}), 0, {value})",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 4,
"output": 1
},
{
"input": 3,
"output": 2
},
{
"input": 2,
"output": 3
},
{
"input": 1,
"output": 4
},
{
"input": 0,
"output": 5
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"custom.sub_area": {
"binding": {
"config": {
"expression": "jsonGet({this.custom.plc_dict}, \"SubArea\")"
},
"type": "expr"
}
},
"custom.table": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "Alarms-autStand/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},
"onChange": {
"enabled": null,
"script": "\ttry:\n\t\tMCM \u003d self.view.params.tagProps[0]\n\t\tdata \u003d currentValue.value\n\t\t\n\t\t# Convert dataset to PyDataSet\n\t\trows \u003d system.dataset.toPyDataSet(data)\n\t\t\n\t\t# Initialize counts dictionary with first-letter uppercase keys\n\t\tcounts \u003d {\n\t\t\t\"Low\": 0,\n\t\t\t\"Medium\": 0,\n\t\t\t\"High\": 0,\n\t\t\t\"Critical\": 0,\n\t\t\t\"Diagnostic\": 0\n\t\t}\n\t\t\n\t\t# Loop through rows and filter for current MCM\n\t\tfor row in rows:\n\t\t\tif row[\"Location\"] \u003d\u003d MCM:\n\n\t\t\t\tpriority \u003d row[\"Priority\"].capitalize()\n\t\t\t\tif priority in counts:\n\t\t\t\t\tcounts[priority] \u003d row[\"Count\"]\n\t\t\n\t\tself.custom.counts \u003d counts\n\t\n\texcept Exception as e:\n\t\tsystem.perspective.print(\"Error gaq dzma: \" + str(e))"
}
},
"meta.visible": {
"binding": {
"config": {
"expression": "if({session.custom.covert} \u003d False \u0026\u0026 {this.custom.status} \u003d 5, False, True)"
},
"type": "expr"
}
}
},
"props": {
"direction": "column",
"style": {
"animationFillMode": "both",
"borderBottomLeftRadius": 10,
"borderBottomRightRadius": 10,
"borderColor": "#555555",
"borderStyle": "solid",
"borderTopLeftRadius": 10,
"borderTopRightRadius": 10,
"borderWidth": 1,
"box-shadow": "5px 5px 5px grey",
"classes": "Background-Styles/Controller",
"cursor": "pointer"
}
},
"type": "ia.container.flex"
}
}