added mcm cards. modified the page config.

This commit is contained in:
Salijoghli 2025-08-19 17:29:45 +04:00
parent c6f7ac9b7e
commit 1ca103a8fe
735 changed files with 3355 additions and 116018 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -1,18 +0,0 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(88, 158, 249, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(88, 158, 249, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(88, 158, 249, 0.3)"
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -1,17 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "transparent",
"borderBottomColor": "var(--neutral-30)",
"borderBottomStyle": "solid",
"borderBottomWidth": "1px",
"color": "var(--neutral-80)",
"fontSize": "12px",
"fontWeight": "bold",
"paddingLeft": "6px",
"paddingRight": "6px",
"textTransform": "uppercase",
"fill": "var(--neutral-70)"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -1,15 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "#2B2B2B",
"borderColor": "#909090",
"borderStyle": "solid",
"borderWidth": "0.5px",
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontSize": "14px",
"fontWeight": "bold",
"textAlign": "center"
}
}
}

View File

@ -1,9 +0,0 @@
{
"type": "AllOf",
"securityLevels": [
{
"name": "Authenticated",
"children": []
}
]
}

View File

@ -72,7 +72,7 @@
"shrink": 0
},
"props": {
"path": "Symbol-Views/Equipment-Views/JAM",
"path": "autStand/Equipment/JAM",
"style": {
"marginRight": "5px"
}
@ -242,7 +242,7 @@
]
}
},
"path": "Symbol-Views/Controller-Views/CommandControlStatus"
"path": "autStand/Equipment/Controller-Views/CommandControlStatus"
},
"type": "ia.display.view"
}
@ -428,7 +428,7 @@
"basis": "32px"
},
"props": {
"text": 0,
"text": 5,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
@ -457,7 +457,7 @@
"basis": "32px"
},
"props": {
"text": 0,
"text": 2,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
@ -515,7 +515,7 @@
"basis": "32px"
},
"props": {
"text": 0,
"text": 3,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
@ -544,7 +544,7 @@
"basis": "32px"
},
"props": {
"text": 0,
"text": 10,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
@ -609,17 +609,17 @@
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 0,
"High": 0,
"Diagnostic": 3,
"High": 5,
"Low": 0,
"Medium": 0
"Medium": 2
}
},
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.covert\u003d False\n\twhid \u003d self.session.custom.fc\n\tsession_id \u003d self.session.props.id\n\tpage_id \u003d \"Detailed-View: \" + self.view.params.tagProps[0]\n\tCommands.analytics.send_page_details(whid, session_id, page_id)\n\tnavigation.navigate_to_page.detailed_view(self, self.view.params.tagProps[0],self.view.params.tagProps[0], self.view.params.tagProps[3])"
"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"
@ -633,7 +633,7 @@
"custom.Total": {
"binding": {
"config": {
"expression": "{view.params.Counts.High} + {view.params.Counts.Medium} + {view.params.Counts.Low} + {view.params.Counts.Diag}"
"expression": "{this.custom.counts.Critical} + {this.custom.counts.Diagnostic} + {this.custom.counts.High} + {this.custom.counts.Low} + {this.custom.counts.Medium}"
},
"type": "expr"
}
@ -750,7 +750,7 @@
"enabled": true,
"rate": "3"
},
"queryPath": "GetActiveAlarmsByLocationAndPriority"
"queryPath": "Alarms-autStand/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},

View File

@ -1,58 +0,0 @@
{
"custom": {},
"params": {
"text": "value"
},
"propConfig": {
"params.text": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 30,
"width": 210
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "209px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "{view.params.text}"
},
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "Text/CenterAlign_with_Padding"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"alignItems": "center",
"justify": "center",
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
}

View File

@ -1,13 +0,0 @@
{
"base": {
"animation": {
"duration": "1s",
"keyframes": {
"0%": {
"backgroundColor": "#00CC00"
},
"100%": {}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,7 +0,0 @@
{
"base": {
"style": {
"borderStyle": "none"
}
}
}

View File

@ -0,0 +1,172 @@
{
"custom": {
"activityLogger": {
"alt_pageid": "card_view"
},
"pageid": "card_view"
},
"params": {},
"propConfig": {
"custom.activityLogger": {
"persistent": true
},
"custom.activityLogger.pageid": {
"binding": {
"config": {
"expression": "{page.props.path}"
},
"transforms": [
{
"code": "\tif value \u003d\u003d\u0027/\u0027 or value \u003d\u003d \u0027\u0027 or value \u003d\u003d None:\n\t\treturn self.custom.activityLogger.alt_pageid.lower()\n\telse:\n\t\treturn value[1:].lower()",
"type": "script"
}
],
"type": "expr"
}
}
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "FlexRepeater"
},
"position": {
"basis": "1080px"
},
"props": {
"alignContent": "flex-start",
"alignItems": "flex-start",
"elementPosition": {
"grow": 0,
"shrink": 0
},
"instances": [
{
"Counts": {
"Diag": 0,
"High": 0,
"Low": 0,
"Medium": 0
},
"area": "Bypass",
"instancePosition": {},
"instanceStyle": {
"classes": "",
"margin": "5px"
},
"subarea": "",
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
{
"Counts": {
"Diag": 0,
"High": 0,
"Low": 0,
"Medium": 0
},
"area": "Fluid Inbound Merges 1-4",
"instancePosition": {},
"instanceStyle": {
"classes": "",
"margin": "5px"
},
"subarea": "",
"tagProps": [
"MCM02",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
],
"path": "autStand/Equipment/Controller-Views/ControllerStatus",
"style": {
"overflow": "visible"
},
"wrap": "wrap"
},
"type": "ia.display.flex-repeater"
}
],
"custom": {
"Devices": [
[
"MCM01",
"Fluid Inbound Merges 1-4"
],
[
"MCM02",
"Fluid Inbound Merges 5-7"
]
],
"count": "value",
"delay": 2000,
"run_update": true
},
"events": {
"system": {
"onStartup": [
{
"config": {
"script": "\tautStand.Visualisation.home_page.create_home_page(self)"
},
"scope": "G",
"type": "script"
},
{
"config": {
"script": "\twhid \u003d self.session.custom.fc\n\tsession_id \u003d self.session.props.id\n\tpage_id \u003d self.view.params.page_name\n\tCommands.analytics.send_page_details(whid, session_id, page_id)"
},
"scope": "G",
"type": "script"
}
]
}
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.update": {
"binding": {
"config": {
"expression": "now({this.custom.delay})"
},
"type": "expr"
},
"onChange": {
"enabled": false,
"script": "\n if (self.session.custom.fc \u003d\u003d \u0027\u0027) or (self.session.custom.fc is None):\n \tself.getChild(\"FlexRepeater\").props.instances \u003d []\n \treturn\n \n if self.custom.run_update:\n \tautStand.Visualisation.home_page.update_home_status(self)"
}
}
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -1,8 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "transparent",
"margin": "1px"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -1,97 +0,0 @@
{
"custom": {},
"params": {
"Error_message": "none"
},
"propConfig": {
"params.Error_message": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 100,
"width": 242
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "200px"
},
"props": {
"color": "#FFFFFF",
"path": "material/error_outline",
"style": {
"backgroundColor": "#555555"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "250px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.Error_message"
},
"type": "property"
}
}
},
"props": {
"style": {
"backgroundColor": "#000000"
},
"textStyle": {
"color": "#FFFFFF",
"fontWeight": "bold",
"margin": 10,
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "200px"
},
"props": {
"direction": "column",
"style": {
"borderColor": "#FFFFFF",
"borderStyle": "solid",
"borderWidth": "1px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Error"
},
"props": {
"direction": "column",
"style": {
"classes": "Background-Styles/Controller"
}
},
"type": "ia.container.flex"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,17 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "var(--error)",
"borderTopLeftRadius": "4px",
"borderTopRightRadius": "4px",
"borderBottomLeftRadius": "4px",
"borderBottomRightRadius": "4px",
"color": "var(--neutral-10)",
"fontSize": "12px",
"fontWeight": "bold",
"lineHeight": "16px",
"padding": "2px",
"textAlign": "center"
}
}
}

View File

@ -1,732 +0,0 @@
{
"custom": {
"FillColour": "value",
"alarm_message": null,
"covert_mode": true,
"disconnected": false,
"display_icon": true,
"error": false,
"isMatch": 0,
"plc": "value",
"priority": 0,
"priority_string": "No active alarms",
"running": false,
"running_status": 0,
"searchId": "PLC01",
"show_error": false,
"show_running": true,
"state": 5,
"state_string": "Unknown"
},
"params": {
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.FillColour": {
"persistent": true
},
"custom.alarm_message": {
"persistent": true
},
"custom.covert_mode": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.display_icon": {
"binding": {
"config": {
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
},
"type": "expr"
},
"persistent": true
},
"custom.error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.isMatch": {
"binding": {
"config": {
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
},
"type": "expr"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.running": {
"binding": {
"config": {
"expression": "{view.custom.running_status} \u003d 3"
},
"type": "expr"
},
"persistent": true
},
"custom.running_status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.show_error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.show_running": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.state": {
"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": "coalesce({value},{view.params.forceFaultStatus},0)",
"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"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 100,
"width": 100
}
},
"root": {
"children": [
{
"meta": {
"name": "Spiral"
},
"position": {
"height": 0.005,
"width": 0.005,
"x": 0.0225,
"y": 0.0277
},
"props": {
"params": {
"tagProps": [
"",
"",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "Symbol-Views/Equipment-Views/Spiral"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "Spiral_Symbol"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,if({view.custom.running},{session.custom.colours.state5},{session.custom.colours.state0}),\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
},
{
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": 101,
"output": "State-Styles/State101"
},
{
"input": 102,
"output": "State-Styles/State102"
},
{
"input": 103,
"output": "State-Styles/State103"
},
{
"input": 104,
"output": "State-Styles/State104"
},
{
"input": 105,
"output": "State-Styles/State105"
},
{
"input": 106,
"output": "State-Styles/State106"
},
{
"input": 201,
"output": "State-Styles/State201"
},
{
"input": 202,
"output": "State-Styles/State202"
},
{
"input": 203,
"output": "State-Styles/State203"
},
{
"input": 204,
"output": "State-Styles/State204"
},
{
"input": 205,
"output": "State-Styles/State205"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
}
},
"props": {
"elements": [
{
"id": "defs2",
"name": "defs2",
"type": "defs"
},
{
"elements": [
{
"cx": "6.6145835",
"cy": "6.6145835",
"fill": {},
"id": "path234",
"name": "path234",
"r": "6.303678",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.23"
},
"type": "circle"
},
{
"cx": "6.6145835",
"cy": "6.6145835",
"fill": {
"paint": "transparent"
},
"id": "path234-7",
"name": "path234-7",
"r": "3.313657",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.221"
},
"type": "circle"
},
{
"d": "M 6.6188113,9.8749524 6.6103553,3.3542142",
"fill": {
"paint": "transparent"
},
"id": "path3429",
"name": "path3429",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.218"
},
"type": "path"
},
{
"d": "M 4.978764,9.47052 8.23181,3.819167",
"fill": {
"paint": "transparent"
},
"id": "path3429-8",
"name": "path3429-8",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.218"
},
"type": "path"
},
{
"d": "M 3.818909,8.2200703 9.461806,4.9523781",
"fill": {
"paint": "transparent"
},
"id": "path3429-8-2",
"name": "path3429-8-2",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.218"
},
"type": "path"
},
{
"d": "M 3.3168328,6.6175189 9.837571,6.6090589",
"fill": {
"paint": "transparent"
},
"id": "path3429-8-2-6",
"name": "path3429-8-2-6",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.218"
},
"type": "path"
},
{
"d": "M 3.7180036,4.9712623 6.8282074,6.7528116",
"fill": {
"paint": "transparent"
},
"id": "path3429-8-2-6-5",
"name": "path3429-8-2-6-5",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.219869"
},
"type": "path"
},
{
"d": "M 4.9523763,3.7647768 8.2200718,9.4076712",
"fill": {
"paint": "transparent"
},
"id": "path3429-8-2-6-5-5",
"name": "path3429-8-2-6-5-5",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.218"
},
"type": "path"
},
{
"cx": "6.6145835",
"cy": "6.6145835",
"fill": {
"opacity": "1",
"paint": "#fefefe"
},
"id": "path234-7-0",
"name": "path234-7-0",
"r": "0.26523831",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.218"
},
"type": "circle"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"style": {},
"viewBox": "0 0 13.229166 13.229167"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"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\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\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\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
},
"type": "expr"
}
},
"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": {
"aspectRatio": "1:1",
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -1,7 +0,0 @@
{
"base": {
"style": {
"color": "#808080"
}
}
}

View File

@ -1,33 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "var(--neutral-10)",
"borderColor": "var(--warning)",
"borderStyle": "solid",
"borderWidth": "1px",
"boxShadow": "none",
"color": "var(--warning)",
"fontWeight": "normal",
"margin": "5px",
"textTransform": "uppercase",
"fill": "var(--warning)"
}
},
"variants": [
{
"pseudo": "hover",
"animation": {
"duration": "0.2s",
"direction": "normal",
"iterationCount": "1",
"timingFunction": "ease",
"keyframes": {
"0%": {},
"100%": {
"backgroundColor": "var(--neutral-20)"
}
}
}
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -19,7 +19,7 @@
"component": {
"onActionPerformed": {
"config": {
"script": "\tmap_selected \u003d self.session.custom.alarm_filter.show_map\n\tself.custom.show \u003d False\n\tif not map_selected:\n\t\tsystem.perspective.navigate(\"/autStand\")\n\telse:\n\t\tsystem.perspective.navigate(\"/Home\")"
"script": "\tmap_selected \u003d self.session.custom.alarm_filter.show_map\n\tself.custom.show \u003d False\n\tif not map_selected:\n\t\tsystem.perspective.navigate(\"/autStand/home\")\n\telse:\n\t\tsystem.perspective.navigate(\"/autStand\")"
},
"scope": "G",
"type": "script"
@ -77,7 +77,7 @@
"component": {
"onActionPerformed": {
"config": {
"script": "\tif self.props.selected \u003d\u003d True and self.page.props.path \u003d\u003d \"/\":\n\t\tsystem.perspective.navigate(\"/MAP-Home\")\n\t\t\n\telif self.page.props.path \u003d\u003d \"/MAP-Home\":\n\t\tsystem.perspective.navigate(\"/\")"
"script": "\tif self.props.selected \u003d\u003d True and self.page.props.path \u003d\u003d \"/\":\n\t\tsystem.perspective.navigate(\"/autStand\")\n\t\t\n\telif self.page.props.path \u003d\u003d \"/autStand\":\n\t\tsystem.perspective.navigate(\"/autStand/home\")"
},
"scope": "G",
"type": "script"
@ -719,10 +719,10 @@
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.navigateBack()"
"page": "/"
},
"scope": "G",
"type": "script"
"scope": "C",
"type": "nav"
}
}
},
@ -730,7 +730,7 @@
"name": "Back",
"tooltip": {
"enabled": true,
"text": "Back"
"text": "Back to DEX"
}
},
"position": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

View File

@ -1,519 +0,0 @@
{
"custom": {
"alarm_message": null,
"covert_mode": true,
"disconnected": true,
"display_icon": true,
"plc": "System",
"priority": 0,
"priority_string": "No Active Alarms",
"running": false,
"searchId": "PLC01",
"state": 0,
"state_string": "Off(Inactive)"
},
"params": {
"angle": 0,
"directionLeft": false,
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"System/MCM01/Conveyor/UL1_3_VFD1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.covert_mode": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t0, True,\r\n\t\t1, True,\r\n\t\t2, {session.custom.alarm_filter.show_running},\r\n\t\t3, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t4, True,\r\n\t\t5, True,\r\n\t\t6, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t7, True,\r\n\t\t8, True,\r\n\t\t9, True,\r\n\t\t13, True,\r\n\t\t14, True,\r\n\t\t61, True,\r\n 131, True,\t\r\n\t\tFalse )",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "!isGood({value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.display_icon": {
"binding": {
"config": {
"expression": "{this.custom.covert_mode} \u003e 0"
},
"type": "expr"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": 0
},
{
"input": 1,
"output": 0
},
{
"input": 2,
"output": 0
},
{
"input": 3,
"output": 4
},
{
"input": 4,
"output": 1
},
{
"input": 5,
"output": 3
},
{
"input": 6,
"output": 4
},
{
"input": 7,
"output": 1
},
{
"input": 8,
"output": 1
},
{
"input": 9,
"output": 1
},
{
"input": 13,
"output": 1
},
{
"input": 14,
"output": 2
},
{
"input": 61,
"output": 4
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "No Active Alarms"
},
{
"input": 1,
"output": "No Active Alarms"
},
{
"input": 2,
"output": "No Active Alarms"
},
{
"input": 3,
"output": "Diagnostic"
},
{
"input": 4,
"output": "High"
},
{
"input": 5,
"output": "Low"
},
{
"input": 6,
"output": "Diagnostic"
},
{
"input": 7,
"output": "High"
},
{
"input": 8,
"output": "High"
},
{
"input": 9,
"output": "High"
},
{
"input": 13,
"output": "High"
},
{
"input": 14,
"output": "Medium"
},
{
"input": 61,
"output": "Diagnostic"
},
{
"input": 131,
"output": "Medium"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.running": {
"binding": {
"config": {
"expression": "{view.custom.state} \u003d 1"
},
"type": "expr"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n0, \"Off(Inactive)\",\r\n1, \"Enabled, Not Running\",\r\n2, \"Running\",\r\n3, \"Energy Management\",\r\n4, \"Jammed\",\r\n5, \"Full\",\r\n6, \"Maintenance Mode / Conveyor Stopped In Maintenance Mode\",\r\n7, \"Communication Fault\",\r\n8, \"VFD Fault\",\r\n9, \"E-Stop\",\r\n13,\"Encoder_Fault\",\r\n14,\"Stopped\",\r\n61,\"Conveyor Running In Maintenance Mode\",\r\n131, \"Disconnected\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.angle": {
"paramDirection": "input",
"persistent": true
},
"params.directionLeft": {
"paramDirection": "input",
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 29
}
},
"root": {
"children": [
{
"meta": {
"name": "RunningStatus"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "if(({view.custom.display_icon} || ({view.custom.show_running} \u0026\u0026 !{view.custom.show_error})) \u0026\u0026 !{view.params.directionLeft}, True, False)"
},
"type": "expr"
}
},
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \"#000000\",\r\n switch(\r\n toInt({view.custom.state}),\r\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 61, 131,\r\n \"#c2c2c2\", \"#c9fcc0\", \"#00ff11\", \"#00ffd0\", \"#ff8c00\",\r\n \"#0008ff\", \"#946446\", \"#ff0000\", \"#ff0000\", \"#ff0000\", \"#ff8c00\", \"#c2c2c2\", \"#B45C5C\", \"#c2c2c2\",\r\n \"#fff700\"\r\n )\r\n)\r\n"
},
"type": "expr"
}
},
"props.style.transform": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Maintenance/Direction"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},\"\")",
"type": "expression"
},
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scaleX(-1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
}
},
"props": {
"elements": [
{
"d": "M 0 0 L 40 0 L 40 0 L 70 30 L 40 60 L 40 60 L 0 60 L 30 30 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": "2"
},
"type": "path"
}
],
"style": {
"overflow": "hidden"
},
"viewBox": "-1.5 -1.5 73 63"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-VFD\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/High"
},
{
"input": 2,
"output": "Alarms-Styles/Medium"
},
{
"input": 3,
"output": "Alarms-Styles/Low"
},
{
"input": 4,
"output": "Alarms-Styles/Diagnostic"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string} + \", State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "view.custom.display_icon"
},
"type": "property"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"enabled": false,
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "solid"
},
{
"input": false,
"output": "none"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"justify": "center",
"style": {
"borderColor": "#FF0000",
"borderStyle": "none",
"borderWidth": "2px",
"cursor": "pointer"
}
},
"type": "ia.container.flex"
}
}

View File

@ -1,32 +0,0 @@
def build_row(**kwargs):
"""
Args:
Any number of arguments using kwargs key = value format.
Key StyleClass is used for adding formatting to the row.
StyleClass = {classes:value}
Returns:
A python dict with style formatting for perspective tables..
Raises:
KeyError: Raises an exception.
"""
row = {}
column ={}
for key,value in kwargs.items():
if key != "StyleClass":
column[key]={"value":value}
row["value"]=column
style_class = kwargs.get("StyleClass")
row["style"] = style_class
return row
def build_row_with_view(**kwargs):
row = {}
column ={}
for key,value in kwargs.items():
if key != "StyleClass":
column[key]= value
row["value"]=column
style_class = kwargs.get("StyleClass")
row["style"] = style_class
return row

View File

@ -1,656 +0,0 @@
{
"custom": {
"FillColour": "value",
"alarm_message": null,
"covert_mode": true,
"disconnected": false,
"display_icon": true,
"error": false,
"isMatch": 0,
"plc": "value",
"priority": 0,
"priority_string": "No active alarms",
"running": false,
"running_status": 0,
"searchId": "value",
"show_error": false,
"show_running": true,
"state": 5,
"state_string": "Unknown"
},
"params": {
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.FillColour": {
"persistent": true
},
"custom.alarm_message": {
"persistent": true
},
"custom.covert_mode": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.display_icon": {
"binding": {
"config": {
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
},
"type": "expr"
},
"persistent": true
},
"custom.error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.isMatch": {
"binding": {
"config": {
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
},
"type": "expr"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.running": {
"binding": {
"config": {
"expression": "{view.custom.running_status} \u003d 3"
},
"type": "expr"
},
"persistent": true
},
"custom.running_status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.show_error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.show_running": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.state": {
"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": "coalesce({value},{view.params.forceFaultStatus},0)",
"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"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 100,
"width": 100
}
},
"root": {
"children": [
{
"meta": {
"name": "PPI"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
},
{
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": 101,
"output": "State-Styles/State101"
},
{
"input": 102,
"output": "State-Styles/State102"
},
{
"input": 103,
"output": "State-Styles/State103"
},
{
"input": 104,
"output": "State-Styles/State104"
},
{
"input": 105,
"output": "State-Styles/State105"
},
{
"input": 106,
"output": "State-Styles/State106"
},
{
"input": 201,
"output": "State-Styles/State201"
},
{
"input": 202,
"output": "State-Styles/State202"
},
{
"input": 203,
"output": "State-Styles/State203"
},
{
"input": 204,
"output": "State-Styles/State204"
},
{
"input": 205,
"output": "State-Styles/State205"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
}
},
"props": {
"elements": [
{
"id": "defs1",
"name": "defs1",
"type": "defs"
},
{
"elements": [
{
"cx": "6.6145835",
"cy": "6.6145835",
"fill": {},
"id": "path1",
"name": "path1",
"r": "6.019948",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "circle"
},
{
"d": "m 2.1166666,8.5242134 h 3.175",
"fill": {
"paint": "transparent"
},
"id": "path2",
"name": "path2",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "path"
},
{
"d": "M 7.9374999,8.5242134 H 11.112492",
"fill": {
"paint": "transparent"
},
"id": "path3",
"name": "path3",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "path"
},
{
"d": "M 5.1593748,4.183724 V 8.4170573",
"fill": {
"paint": "transparent"
},
"id": "path5",
"name": "path5",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "path"
},
{
"d": "m 8.2020833,4.1405926 h -3.175",
"fill": {
"paint": "transparent"
},
"id": "path6",
"name": "path6",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "path"
},
{
"d": "M 8.0697914,4.183724 V 8.4170573",
"fill": {
"paint": "transparent"
},
"id": "path7",
"name": "path7",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"style": {},
"viewBox": "0 0 13.229166 13.229167"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"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\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\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\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
},
"type": "expr"
}
},
"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": {
"aspectRatio": "1:1",
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -1,447 +0,0 @@
{
"custom": {},
"params": {
"tagProps": [
"",
"",
"PLC",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 148,
"width": 362
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Spacer1"
},
"position": {
"basis": "20px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "NameField"
},
"position": {
"basis": "50px"
},
"props": {
"text": "NAME"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Spacer"
},
"position": {
"basis": "100px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DeviceName"
},
"position": {
"basis": "205px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.name"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Name"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Spacer1"
},
"position": {
"basis": "20px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "NameField"
},
"position": {
"basis": "50px"
},
"props": {
"text": "PRIORITY"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Spacer"
},
"position": {
"basis": "100px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Priority"
},
"position": {
"basis": "205px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"expression": "{/root.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 4,
"output": "Alarms-Styles/Critical"
},
{
"input": 3,
"output": "Alarms-Styles/High"
},
{
"input": 2,
"output": "Alarms-Styles/Medium"
},
{
"input": 1,
"output": "Alarms-Styles/Low"
},
{
"input": 0,
"output": "Alarms-Styles/Diagnostic"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "/root.custom.priority"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": 4,
"output": "Critical"
},
{
"input": 3,
"output": "High"
},
{
"input": 2,
"output": "Medium"
},
{
"input": 1,
"output": "Low"
},
{
"input": 0,
"output": "Warning"
},
{
"input": 5,
"output": "No active alarms"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "left"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Priority"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Spacer1"
},
"position": {
"basis": "20px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "NameField"
},
"position": {
"basis": "50px"
},
"props": {
"text": "TIMESTAMP"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Spacer"
},
"position": {
"basis": "100px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DeviceName"
},
"position": {
"basis": "205px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.timestamp"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "EventTime"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Spacer1"
},
"position": {
"basis": "20px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "NameField"
},
"position": {
"basis": "50px"
},
"props": {
"text": "DURATION"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Spacer"
},
"position": {
"basis": "91px"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Spacer_0"
},
"position": {
"basis": "199px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.duration"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "EventTime_0"
},
"position": {
"basis": "40px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel"
}
},
"type": "ia.container.flex"
}
],
"custom": {
"delay": 2000,
"duration": "",
"enable": true,
"name": "",
"priority": "",
"timestamp": ""
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.active_bit": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"1": "{view.params.tagProps[1]}"
},
"tagPath": "{0}/Alarms/{1}.IsActive"
},
"type": "tag"
}
},
"custom.shelved_bit": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"1": "{view.params.tagProps[1]}"
},
"tagPath": "{0}/Alarms/{1}.IsShelved"
},
"type": "tag"
}
},
"custom.update": {
"binding": {
"config": {
"expression": "now({this.custom.delay})"
},
"type": "expr"
},
"onChange": {
"enabled": null,
"script": "\tif self.custom.enable:\n\t\t\n\t\timport time\n\t\t\n\t\tdef convert(millis):\n\t\t\tmillis \u003d int(millis)\n\t\t\tseconds\u003d(millis/1000)%60\n\t\t\tseconds \u003d int(seconds)\n\t\t\tminutes\u003d(millis/(1000*60))%60\n\t\t\tminutes \u003d int(minutes)\n\t\t\thours\u003d(millis/(1000*60*60))\n\t\t\treturn(\"%d:%d:%d\" % (hours, minutes, seconds))\n\t\t\n\t\tdef update_custom_properties(name, timestamp, duration, priority):\n\t\t\tself.custom.name \u003d name\n\t\t\tself.custom.timestamp \u003d timestamp\n\t\t\tself.custom.duration \u003d duration\n\t\t\tself.custom.priority \u003d priority\n\t\t\n\t\tdef get_alarms():\n\t\t\talarm_dict \u003d system.tag.readBlocking(\"System/ActiveAlarms\")\n\t\t\talarms_decoded \u003d system.util.jsonDecode(alarm_dict[0].value)\n\t\t\treturn alarms_decoded\n\t\t\t\n\t\tdef get_tag_config():\n\t\t\tname \u003d\"\"\n\t\t\tpath \u003d self.view.params.tagProps[0]\n\t\t\tif system.tag.exists(path) and path !\u003d \"\":\n\t\t\t\ttag_config \u003d system.tag.getConfiguration(path)[0]\n\t\t\t\talarms \u003d tag_config.get(\"alarms\")\n\t\t\t\tfor alarm in alarms:\n\t\t\t\t\tif alarm.get(\"name\") \u003d\u003d self.view.params.tagProps[1]:\n\t\t\t\t\t\tname \u003d alarm.get(\"AdditionalInfo\")\n\t\t\t\t\t\tbreak\n\t\t\t\ttimestamp \u003d \"N/A\"\n\t\t\t\tduration \u003d \"N/A\"\n\t\t\t\tpriority \u003d 5\n\t\t\t\tupdate_custom_properties(name, timestamp, duration, priority)\n\t\t\t\t\t\n\t\tdef get_active_alarm():\n\t\t\ttagPath \u003d self.view.params.tagProps[0]\n\t\t\tprops_alarm_name \u003d str(self.view.params.tagProps[1])\n\t\t\ttag_display_path \u003d tagPath + \"/\" + props_alarm_name\n\t\t\talarms \u003d get_alarms()\n\t\t\tfor i in alarms:\n\t\t\t\tdisplaypath \u003d alarms[i].get(\"DisplayPath\")\n\t\t\t\talarm_name \u003d alarms[i].get(\"Name\")\n\t\t\t\tsystem.perspective.print(displaypath)\n\t\t\t\tif tag_display_path \u003d\u003d displaypath:\n\t\t\t\t\tname \u003d alarms[i].get(\"AddInfo\")\n\t\t\t\t\ttimestamp \u003d alarms[i].get(\"TimeStamp\")\n\t\t\t\t\tduration \u003d alarms[i].get(\"Duration\")\n\t\t\t\t\tduration \u003d convert(duration)\n\t\t\t\t\tpriority \u003d alarms[i].get(\"Priority\")\n\t\t\t\t\tupdate_custom_properties(name, timestamp, duration, priority)\n\t\t\t\t\tbreak\n\t\t\t\t\t\n\t\tif self.custom.active_bit and not self.custom.shelved_bit:\n\t\t\tget_active_alarm()\n\t\t\t\n\t\telse:\n\t\t\talarms \u003d get_tag_config()"
}
}
},
"props": {
"direction": "column",
"style": {
"borderRadius": "10x",
"borderStyle": "solid",
"classes": "PopUp-Styles/Information-Device"
}
},
"type": "ia.container.flex"
}
}

View File

@ -1,773 +0,0 @@
{
"custom": {
"api_region_name": "na",
"bucket_options": [
{
"label": "Image Files",
"value": "na-ignition-image-repo"
},
{
"label": "Source Files",
"value": "na-ignition-image-source"
}
],
"default_query_params": {
"bucket": null,
"object_key": null,
"site": null,
"view": null
},
"destination_view_suffix": null,
"object_key": null,
"stage_config": {
"account_id": "925510716640",
"endpoint": "https://scada-s3-management.narme-scada.rme.amazon.dev/",
"lambda_name": "RMESDScadaS3ManagementFlaskLambda-prod",
"region": "us-east-2",
"repo_bucket": "na-ignition-image-repo",
"s3_region": "us-east-1",
"source_bucket": "na-ignition-image-source"
},
"view_options_by_site_and_bucket": [],
"view_suffix": null,
"whid_options": []
},
"params": {
"query_params": {
"bucket": null,
"object_key": null,
"site": null,
"view": null
}
},
"propConfig": {
"custom.api_region_name": {
"binding": {
"config": {
"path": "session.custom.aws.prefix"
},
"type": "property"
},
"persistent": true
},
"custom.bucket_options": {
"binding": {
"config": {
"path": "view.custom.stage_config"
},
"transforms": [
{
"code": "\treturn [{\u0027value\u0027: value.repo_bucket, \u0027label\u0027: \u0027Image Files\u0027},\n\t\t\t{\u0027value\u0027: value.source_bucket, \u0027label\u0027: \u0027Source Files\u0027}]",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"custom.default_query_params": {
"persistent": true
},
"custom.object_key": {
"binding": {
"config": {
"path": "view.params.query_params"
},
"transforms": [
{
"code": "\tstage_config \u003d self.custom.stage_config\n\tbucket \u003d self.params.query_params.bucket\n\tsite \u003d self.params.query_params.site\n\tview \u003d self.params.query_params.view\n\tif bucket and site and view:\n\t\tif bucket \u003d\u003d stage_config.repo_bucket:\n\t\t\tsuffix \u003d \u0027.svg\u0027\n\t\t\tsubfolder \u003d \u0027images\u0027\n\t\telse:\n\t\t\tsuffix \u003d \u0027.drawio\u0027\n\t\t\tsubfolder \u003d \u0027source\u0027\n\t\treturn \"SCADA/%s/%s/%s%s\" % (site, subfolder, view, suffix)\n\telse:\n\t\treturn None\n",
"type": "script"
}
],
"type": "property"
},
"onChange": {
"enabled": null,
"script": "\td \u003d self.params.query_params\n\tif getattr(currentValue, \u0027value\u0027, None):\n\t\tself.params.query_params.object_key \u003d currentValue.value\n\t"
},
"persistent": true
},
"custom.stage_config": {
"binding": {
"config": {
"expression": "{view.custom.api_region_name}"
},
"transforms": [
{
"code": "\treturn AWS.s3.STAGE_CONFIG[\u0027prod\u0027][value]",
"type": "script"
}
],
"type": "expr"
},
"persistent": true
},
"custom.view_options_by_site_and_bucket": {
"binding": {
"config": {
"expression": "{view.params.query_params.site}+{view.params.query_params.bucket}"
},
"transforms": [
{
"code": "\tbucket \u003d self.params.query_params.bucket\n\tsite \u003d self.params.query_params.site\n\tif bucket and site:\n\t\tfrom AWS.s3 import S3Manager\n\t\tfrom helper.helper import sanitize_tree\n\t\tfrom pprint import pformat\n\t\t\n\t\tapi_stage \u003d \u0027prod\u0027\n\t\tusername \u003d self.session.props.auth.user.userName\n\t\tapi_region_name \u003d self.view.custom.api_region_name\n\t\t\n\t\ts3m \u003d S3Manager(api_stage, api_region_name, username)\n\t\tsuffix \u003d self.custom.view_suffix\n\t\tfiles \u003d sanitize_tree(s3m.fetch_object_list_by_site_and_bucket(site, bucket))\n\t\treturn [{\u0027value\u0027: x[\u0027Filename\u0027].replace(suffix,\u0027\u0027), \n\t\t\t\t\u0027label\u0027: x[\u0027Filename\u0027].replace(suffix,\u0027\u0027)} for x in files]\n\treturn []",
"type": "script"
}
],
"type": "expr"
},
"persistent": true
},
"custom.view_suffix": {
"binding": {
"config": {
"path": "view.params.query_params.bucket"
},
"transforms": [
{
"code": "\tif value:\n\t\tstage_config \u003d self.custom.stage_config\n\t\tif value \u003d\u003d stage_config.get(\u0027repo_bucket\u0027, None):\n\t\t\treturn \".svg\"\n\t\tif value \u003d\u003d stage_config.get(\"source_bucket\", None):\n\t\t\treturn \".drawio\"\n\treturn value",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"custom.whid_options": {
"binding": {
"config": {
"path": "view.params.query_params.bucket"
},
"transforms": [
{
"code": "\tif value:\n\t\tfrom AWS.s3 import S3Manager\n\t\t\n\t\tapi_stage \u003d \u0027prod\u0027\n\t\tusername \u003d self.session.props.auth.user.userName\n\t\tapi_region_name \u003d self.custom.api_region_name\n\t\t\n\t\ts3m \u003d S3Manager(\u0027prod\u0027, api_region_name, username)\n\t\t\n\t\treturn [{\u0027value\u0027: x, \u0027label\u0027: x} for x in s3m.fetch_site_list(value)]\n\treturn []",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"params.query_params": {
"onChange": {
"enabled": null,
"script": "\tif not missedEvents and origin in (\u0027Binding\u0027, \u0027Script\u0027, \u0027BindingWriteback\u0027):\n\t\tpayload \u003d currentValue.value\n\t\tsystem.perspective.sendMessage(\u0027list_versions_query_params_changed\u0027, payload, scope\u003d\u0027session\u0027)\n\t\t"
},
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 600
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"borderStyle": "none",
"classes": "Framework/Card/Title_transparent"
},
"text": "Select Query Params"
},
"type": "ia.display.label"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t# reset query params to default values \n\t# (stored in `view.custom.default_query_params`)\n\tself.view.params.query_params \u003d self.view.custom.default_query_params"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Clear Button",
"tooltip": {
"enabled": true,
"location": "bottom-right",
"text": "Clear Selections"
}
},
"position": {
"shrink": 0
},
"props": {
"image": {
"icon": {
"path": "material/clear_all"
}
},
"primary": false,
"style": {
"classes": "Input/Button/Secondary_minimal"
},
"text": ""
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t# refresh version table query via message handler\n\tsystem.perspective.sendMessage(\u0027refresh_version_table_data\u0027, scope\u003d\u0027session\u0027)\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Refresh Button",
"tooltip": {
"enabled": true,
"location": "bottom-right",
"text": "Refresh Data"
}
},
"position": {
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026!isNull({view.params.query_params.site})\r\n\u0026\u0026!isNull({view.params.query_params.view})\r\n\u0026\u0026!isNull({view.params.query_params.object_key})"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {
"path": "material/refresh"
}
},
"primary": false,
"style": {
"classes": "Input/Button/Secondary_minimal"
},
"text": ""
},
"type": "ia.input.button"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"grow": 1
},
"props": {
"justify": "flex-end"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer Header"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "Framework/Card/Title_transparent",
"marginBottom": "2px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "125px",
"shrink": 0
},
"props": {
"style": {
"classes": "Framework/Card/Label",
"textAlign": "right"
},
"text": "Bucket"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Dropdown"
},
"position": {
"basis": "540px",
"grow": 1
},
"propConfig": {
"props.options": {
"binding": {
"config": {
"path": "view.custom.bucket_options"
},
"type": "property"
}
},
"props.value": {
"binding": {
"config": {
"bidirectional": true,
"path": "view.params.query_params.bucket"
},
"type": "property"
}
}
},
"props": {
"dropdownOptionStyle": {
"overflowWrap": "break-word",
"whiteSpace": "normal"
},
"showClearIcon": true
},
"type": "ia.input.dropdown"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.view.params.query_params.bucket \u003d None\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Clear Button"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026{view.params.query_params.bucket}!\u003d\u0027\u0027"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {
"path": "material/clear"
}
},
"primary": false,
"style": {
"classes": "Input/Button/Secondary_minimal"
},
"text": ""
},
"type": "ia.input.button"
}
],
"meta": {
"name": "Bucket"
},
"position": {
"basis": "100%",
"grow": 1
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"shrink": 0
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "125px",
"shrink": 0
},
"props": {
"style": {
"classes": "Framework/Card/Label",
"textAlign": "right"
},
"text": "Site"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Dropdown"
},
"position": {
"basis": "540px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026len({view.params.query_params.bucket})\u003e0"
},
"type": "expr"
}
},
"props.options": {
"binding": {
"config": {
"path": "view.custom.whid_options"
},
"type": "property"
}
},
"props.value": {
"binding": {
"config": {
"bidirectional": true,
"path": "view.params.query_params.site"
},
"type": "property"
}
}
},
"props": {
"dropdownOptionStyle": {
"overflowWrap": "break-word",
"whiteSpace": "normal"
},
"showClearIcon": true
},
"type": "ia.input.dropdown"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.view.params.query_params.site \u003d None\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Clear Button"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "!isNull({view.params.query_params.site})\r\n\u0026\u0026{view.params.query_params.site}!\u003d\u0027\u0027"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {
"path": "material/clear"
}
},
"primary": false,
"style": {
"classes": "Input/Button/Secondary_minimal"
},
"text": ""
},
"type": "ia.input.button"
}
],
"meta": {
"name": "Site"
},
"position": {
"basis": "100%",
"grow": 1
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_2"
},
"position": {
"shrink": 0
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "125px",
"shrink": 0
},
"props": {
"style": {
"classes": "Framework/Card/Label",
"textAlign": "right"
},
"text": "View"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Dropdown"
},
"position": {
"basis": "540px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026len({view.params.query_params.bucket})\u003e0\r\n\u0026\u0026!isNull({view.params.query_params.site})\r\n\u0026\u0026len({view.params.query_params.site})\u003e0"
},
"type": "expr"
}
},
"props.options": {
"binding": {
"config": {
"path": "view.custom.view_options_by_site_and_bucket"
},
"type": "property"
}
},
"props.value": {
"binding": {
"config": {
"bidirectional": true,
"path": "view.params.query_params.view"
},
"type": "property"
}
}
},
"props": {
"dropdownOptionStyle": {
"overflowWrap": "break-word",
"whiteSpace": "normal"
},
"showClearIcon": true
},
"type": "ia.input.dropdown"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.view.params.query_params.view \u003d None\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Clear Button"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "!isNull({view.params.query_params.view})\r\n\u0026\u0026{view.params.query_params.view}!\u003d\u0027\u0027"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {
"path": "material/clear"
}
},
"primary": false,
"style": {
"classes": "Input/Button/Secondary_minimal"
},
"text": ""
},
"type": "ia.input.button"
}
],
"meta": {
"name": "View"
},
"position": {
"basis": "100%",
"grow": 1
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_3"
},
"position": {
"shrink": 0
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "125px",
"shrink": 0
},
"props": {
"style": {
"classes": "Framework/Card/Label",
"textAlign": "right"
},
"text": "Object Key"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.query_params.object_key"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Framework/Card/Value",
"textAlign": "left"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Object Key"
},
"position": {
"basis": "100%",
"grow": 1
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_4"
},
"position": {
"shrink": 0
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,7 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "#EEEEEE"
}
}
}

View File

@ -4,26 +4,56 @@
"$": [
"ds",
192,
1751989861336
1755595218713
],
"$columns": [
{
"data": [
null
"MCM01",
"MCM01",
"MCM01",
"MCM02",
"MCM03",
"MCM04",
"MCM04",
"MCM05",
"MCM06",
"MCM07",
"MCM07"
],
"name": "Location",
"type": "String"
},
{
"data": [
"Low"
"Diagnostic",
"High",
"Medium",
"Diagnostic",
"Diagnostic",
"Diagnostic",
"High",
"Diagnostic",
"Diagnostic",
"Diagnostic",
"High"
],
"name": "Priority",
"type": "String"
},
{
"data": [
1
3,
5,
2,
2,
1,
2,
5,
1,
1,
2,
3
],
"name": "Count",
"type": "Long"
@ -56,7 +86,7 @@
"enabled": true,
"rate": "1"
},
"queryPath": "GetActiveAlarmsByLocationAndPriority"
"queryPath": "Alarms-autStand/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@ -464,6 +464,7 @@
],
"custom": {
"priorities": {
"critical": false,
"diagnostic": false,
"high": false,
"low": false,
@ -2682,7 +2683,7 @@
"children": [
{
"custom": {
"SetFilter": false
"SetFilter": true
},
"events": {
"component": {
@ -2785,17 +2786,17 @@
"$": [
"ts",
192,
1750436956149
1755608469647
],
"$ts": 1750436956149
"$ts": 1755608469646
},
"startDate": {
"$": [
"ts",
192,
1750436956149
1755608469646
],
"$ts": 1750435156149
"$ts": 1755606669646
}
},
"meta": {
@ -2912,7 +2913,7 @@
"component": {
"onActionPerformed": {
"config": {
"script": "\tmessaging.message_handler.set_time_from_filters(self)\n\t"
"script": "\tautStand.messaging.message_handler.set_time_from_filters(self)\n\t"
},
"scope": "G",
"type": "script"
@ -2963,12 +2964,12 @@
},
"onChange": {
"enabled": null,
"script": "\tmessaging.message_handler.set_time_from_filters(self)"
"script": "\tautStand.messaging.message_handler.set_time_from_filters(self)"
}
}
},
"props": {
"formattedValue": "Jun 20, 2025 7:59 PM",
"formattedValue": "Aug 19, 2025 4:31 PM",
"style": {
"margin": 15
}
@ -3047,13 +3048,13 @@
},
"onChange": {
"enabled": null,
"script": "\tmessaging.message_handler.set_time_to_filters(self)"
"script": "\tautStand.messaging.message_handler.set_time_to_filters(self)"
},
"persistent": true
}
},
"props": {
"formattedValue": "Jun 20, 2025 8:29 PM",
"formattedValue": "Aug 19, 2025 5:01 PM",
"maxDate": {
"$": [
"ts",
@ -3068,10 +3069,10 @@
"value": {
"$": [
"ts",
201,
1750436956149
192,
1755608469647
],
"$ts": 1750436956149
"$ts": 1755608469646
}
},
"scripts": {
@ -3123,7 +3124,7 @@
"component": {
"onActionPerformed": {
"config": {
"script": "\tmessaging.message_handler.set_priority_filters(self)"
"script": "\tautStand.messaging.message_handler.set_priority_filters(self)"
},
"scope": "G",
"type": "script"
@ -3195,14 +3196,13 @@
}
],
"custom": {
"ShowFilters": false
"ShowFilters": true
},
"meta": {
"name": "Filters"
},
"position": {
"basis": "180px",
"display": false,
"grow": 1,
"shrink": 0
},
@ -3261,17 +3261,17 @@
"$": [
"ts",
192,
1755532385239
1755608469647
],
"$ts": 1750435156149
"$ts": 1755606669646
},
"time_to_filter": {
"$": [
"ts",
192,
1755532385239
1755608469647
],
"$ts": 1750436956149
"$ts": 1755608469646
}
},
"events": {
@ -4411,17 +4411,17 @@
"$": [
"ts",
192,
1755532385239
1755608469647
],
"$ts": 1750435156149
"$ts": 1755606669646
},
"time_to_filter": {
"$": [
"ts",
192,
1755532385239
1755608469647
],
"$ts": 1750436956149
"$ts": 1755608469646
},
"type_filters": null
},
@ -4678,7 +4678,6 @@
"contentStyle": {
"classes": "Background-Styles/Grey-Background"
},
"currentTabIndex": 2,
"menuType": "modern",
"style": {
"classes": "Background-Styles/Grey-Background"

View File

@ -1,17 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "var(--neutral-20)",
"borderBottomColor": "var(--neutral-30)",
"borderBottomStyle": "solid",
"borderBottomWidth": "1px",
"color": "var(--neutral-80)",
"fontSize": "12px",
"fontWeight": "bold",
"paddingLeft": "6px",
"paddingRight": "6px",
"textTransform": "uppercase",
"fill": "var(--neutral-70)"
}
}
}

View File

@ -1,300 +0,0 @@
{
"custom": {
"disconnected": true,
"plc": "System",
"priority": 0,
"priority_string": "Medium",
"searchId": "PLC01",
"state": 0,
"state_string": "Disabled",
"type": 0
},
"params": {
"directionLeft": false,
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"System/D2C/D2C_Chute_1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "!isGood({value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.type} \u003d 0,\r\n case(\r\n if(\r\n {view.custom.state} \u003d 0 || {view.custom.state} \u003d 3,\r\n {view.custom.state},\r\n 0\r\n ),\r\n 0, 0,\r\n 3, 3,\r\n 0\r\n ),\r\n if(\r\n {view.custom.type} \u003d 1,\r\n case(\r\n if(\r\n {view.custom.state} \u003e\u003d 1 \u0026\u0026 {view.custom.state} \u003c\u003d 6,\r\n {view.custom.state},\r\n 0\r\n ),\r\n 0, 0,\r\n 1, 2,\r\n 2, 3,\r\n 3, 3,\r\n 4, 1,\r\n 5, 3,\r\n 6, 3,\r\n 0\r\n ),\r\n if(\r\n {view.custom.type} \u003d 2,\r\n case(\r\n if(\r\n {view.custom.state} \u003e\u003d 1 \u0026\u0026 {view.custom.state} \u003c\u003d 4,\r\n {view.custom.state},\r\n 0\r\n ),\r\n 0, 0,\r\n 1, 2,\r\n 2, 3,\r\n 3, 3,\r\n 4, 1,\r\n 0\r\n ),\r\n 0\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.type} \u003d 0,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Medium\u0027,\r\n 3, \u0027Low\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 1,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Medium\u0027,\r\n 1, \u0027Low\u0027,\r\n 2, \u0027Low\u0027,\r\n 3, \u0027No Active Alarms\u0027,\r\n 4, \u0027Low\u0027,\r\n 5, \u0027Low\u0027,\r\n 6, \u0027High\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 2,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Medium\u0027,\r\n 1, \u0027No Active Alarms\u0027,\r\n 2, \u0027Low\u0027,\r\n 3, \u0027Low\u0027,\r\n 4, \u0027High\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 3,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027No Active Alarms\u0027,\r\n 1, \u0027Low\u0027,\r\n 2, \u0027High\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n \u0027Unknown\u0027\r\n )\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
},
"onChange": {
"enabled": null,
"script": "\tif self.custom.priority not in [1, 2, 3, 4, 5, 6, 0]:\n\t self.custom.priority_string \u003d \"Unknown\""
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.type} \u003d 0,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Disabled\u0027,\r\n 3, \u0027Full\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 1,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Disabled\u0027,\r\n 1, \u0027No Container\u0027,\r\n 2, \u0027Ready To Be Enabled\u0027,\r\n 3, \u0027Enabled\u0027,\r\n 4, \u0027Half Full\u0027,\r\n 5, \u0027Full\u0027,\r\n 6, \u0027Jammed\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 2,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Disabled\u0027,\r\n 1, \u0027Enabled\u0027,\r\n 2, \u0027Half Full\u0027,\r\n 3, \u0027Full\u0027,\r\n 4, \u0027Jammed\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n if(\r\n {view.custom.type} \u003d 3,\r\n case(\r\n {view.custom.state},\r\n 0, \u0027Enabled\u0027,\r\n 1, \u0027Full\u0027,\r\n 2, \u0027Jammed\u0027,\r\n \u0027Unknown\u0027\r\n ),\r\n \u0027Unknown\u0027\r\n )\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
},
"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
},
"params.directionLeft": {
"paramDirection": "input",
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 29
}
},
"root": {
"children": [
{
"meta": {
"name": "RunningStatus"
},
"position": {
"grow": 1
},
"propConfig": {
"position.rotate.angle": {
"binding": {
"config": {
"path": "view.params.directionLeft"
},
"transforms": [
{
"expression": "if({value}, \u0027180deg\u0027, \u00270deg\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"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#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 1, \u0027#FF4487\u0027,\r\n 2, \u0027#92FF00\u0027,\r\n 3, \u0027#CCFFCC\u0027,\r\n 4, \u0027#FFFF00\u0027,\r\n 5, \u0027#0000FF\u0027,\r\n 6, \u0027#FF8C00\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 if(\r\n {view.custom.type} \u003d 3, \r\n case(\r\n {view.custom.state},\r\n 0, \u0027#CCFFCC\u0027,\r\n 1, \u0027#0000FF\u0027,\r\n 2, \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)\r\n"
},
"type": "expr"
}
}
},
"props": {
"elements": [
{
"d": "M 0 0 L 40 0 L 40 0 L 70 30 L 40 60 L 40 60 L 0 60 L 0 0 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": 3
},
"type": "path"
}
],
"style": {
"overflow": "hidden"
},
"viewBox": "-1.5 -1.5 73 63"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-SNP\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/High"
},
{
"input": 2,
"output": "Alarms-Styles/Medium"
},
{
"input": 3,
"output": "Alarms-Styles/Low"
},
{
"input": 4,
"output": "Alarms-Styles/Diagnostic"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string} + \", State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
}
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}

View File

@ -1,58 +0,0 @@
{
"custom": {},
"params": {
"text": "value"
},
"propConfig": {
"params.text": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 30,
"width": 210
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "209px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "{view.params.text}"
},
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "Text/LeftAlign_with_Padding"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"alignItems": "center",
"justify": "center",
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,171 +0,0 @@
{
"custom": {
"filter_list": [
{
"color": "#8B008B",
"filter_id": 5,
"instancePosition": {},
"instanceStyle": {
"classes": ""
},
"text": "CP30"
},
{
"color": "#8B008B",
"filter_id": 3,
"instancePosition": {},
"instanceStyle": {
"classes": ""
},
"text": "CP71"
},
{
"color": "#8B008B",
"filter_id": 4,
"instancePosition": {},
"instanceStyle": {
"classes": ""
},
"text": "CP72"
}
]
},
"params": {
"filters": [
{
"color": "#8B008B",
"column": "controller",
"group": 0,
"id": 3,
"text": "CP71"
},
{
"color": "#8B008B",
"column": "controller",
"group": 0,
"id": 4,
"text": "CP72"
},
{
"color": "#8B008B",
"column": "controller",
"group": 0,
"id": 5,
"text": "CP30"
}
],
"group_name": "value"
},
"propConfig": {
"custom.filter_list": {
"binding": {
"config": {
"path": "view.params.filters"
},
"transforms": [
{
"code": "\tinstances \u003d []\n\tfor filter in value:\n\t\tinstance \u003d {\"instanceStyle\": {\n\t\t \t\t\t\"classes\": \"\"},\n\t\t \t\t\t \"instancePosition\": {}}\n\t \tinstance[\u0027text\u0027] \u003d filter.text\n\t \tinstance[\u0027color\u0027] \u003d filter.color\n\t \tinstance[\u0027filter_id\u0027] \u003d filter.id\n\t \tinstances.append(instance)\n\t\n\treturn sorted(instances, key\u003dlambda d: d[\u0027text\u0027])",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"params.filters": {
"paramDirection": "input",
"persistent": true
},
"params.group_name": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 178,
"width": 214
}
},
"root": {
"children": [
{
"meta": {
"name": "Title"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "UPPER({view.params.group_name})"
},
"type": "expr"
}
}
},
"props": {
"style": {
"borderBottomStyle": "solid",
"borderBottomWidth": 1,
"classes": "Title/Text",
"fontSize": 13,
"marginLeft": "10%",
"marginRight": "10%",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Filters"
},
"position": {
"basis": "138px",
"shrink": 0
},
"propConfig": {
"props.instances": {
"binding": {
"config": {
"path": "view.params.filters"
},
"transforms": [
{
"code": "\treturn sorted(value, key\u003dlambda d: d[\u0027text\u0027])",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"alignContent": "flex-start",
"direction": "column",
"path": "Objects/PowerTable/FilterMenuItem",
"style": {
"marginBottom": 5,
"marginLeft": "12%",
"marginRight": "12%"
},
"useDefaultViewWidth": false
},
"type": "ia.display.flex-repeater"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"overflow": "visible"
}
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

View File

@ -1,9 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "#FFFFFF",
"color": "#000000",
"fontFamily": "Arial"
}
}
}

View File

@ -1,11 +0,0 @@
import sys
def error_handler(whid, logger_name):
logger_name = "%s-%s" % (whid, logger_name)
logger = system.util.getLogger(logger_name)
provider = "[%s_SCADA_TAG_PROVIDER]" % (whid)
exc_type, exc_obj, tb = sys.exc_info()
lineno = tb.tb_lineno
logger.error("Error: %s, %s, %s" % (lineno, exc_type, exc_obj))
system.tag.writeBlocking([provider + "System/wbsckt_running"], [0])

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,10 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "#00CC00",
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontWeight": "bold"
}
}
}

View File

@ -1,175 +0,0 @@
{
"custom": {
"activityLogger": {
"start_time": {
"$": [
"ts",
192,
1709760479262
],
"$ts": 1709760479262
}
},
"show_alarms": false
},
"events": {
"system": {
"onShutdown": {
"config": {
"script": "\tactivityLog.logger.callLogger(self, \u0027page\u0027)\n\tactivityLog.productMetrics.callLogger(self, \u0027page\u0027)"
},
"scope": "G",
"type": "script"
},
"onStartup": {
"config": {
"script": "\tself.custom.activityLogger.start_time \u003d system.date.now()"
},
"scope": "G",
"type": "script"
}
}
},
"params": {
"detailedView": "",
"plcTagPath": ""
},
"propConfig": {
"custom.activityLogger": {
"persistent": true
},
"custom.activityLogger.alt_pageid": {
"binding": {
"config": {
"expression": "\"detailed_views/\"+ {view.params.detailedView}"
},
"type": "expr"
}
},
"custom.activityLogger.pageid": {
"binding": {
"config": {
"expression": "{page.props.path}"
},
"transforms": [
{
"code": "\tif value \u003d\u003d\u0027/\u0027 or value \u003d\u003d \u0027\u0027 or value \u003d\u003d None:\n\t\treturn self.custom.activityLogger.alt_pageid.lower()\n\telse:\n\t\treturn value[1:].lower()",
"type": "script"
}
],
"type": "expr"
}
},
"custom.show_alarms": {
"persistent": true
},
"params.detailedView": {
"paramDirection": "input",
"persistent": true
},
"params.plcTagPath": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "320px",
"grow": 1
},
"propConfig": {
"props.params.PLCTagPath": {
"binding": {
"config": {
"path": "view.params.plcTagPath"
},
"type": "property"
}
}
},
"props": {
"path": "Alarm-Views/Docked-Alarm"
},
"type": "ia.display.view"
}
],
"custom": {
"key": "value"
},
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "130px",
"display": false
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "show-south-dock",
"pageScope": true,
"script": "\tshow \u003d payload[\"show_alarms\"]\n\tsystem.perspective.print(show)\n\tself.position.display \u003d show",
"sessionScope": true,
"viewScope": false
}
]
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "320px",
"grow": 1
},
"propConfig": {
"props.path": {
"binding": {
"config": {
"expression": "\"Detailed-Views/\"+ {view.params.detailedView}"
},
"type": "expr"
}
}
},
"type": "ia.display.view"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"id": "Docked-East",
"type": "close"
},
"scope": "C",
"type": "dock"
}
}
},
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,604 +0,0 @@
{
"custom": {
"FillColour": "value",
"alarm_message": null,
"covert_mode": true,
"disconnected": false,
"display_icon": true,
"error": false,
"isMatch": 0,
"plc": "value",
"priority": 0,
"priority_string": "No active alarms",
"running": false,
"running_status": 0,
"searchId": "value",
"show_error": false,
"show_running": true,
"state": 5,
"state_string": "Unknown"
},
"params": {
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.FillColour": {
"persistent": true
},
"custom.alarm_message": {
"persistent": true
},
"custom.covert_mode": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.display_icon": {
"binding": {
"config": {
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
},
"type": "expr"
},
"persistent": true
},
"custom.error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.isMatch": {
"binding": {
"config": {
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
},
"type": "expr"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.running": {
"binding": {
"config": {
"expression": "{view.custom.running_status} \u003d 3"
},
"type": "expr"
},
"persistent": true
},
"custom.running_status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.show_error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.show_running": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.state": {
"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": "coalesce({value},{view.params.forceFaultStatus},0)",
"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"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 100,
"width": 100
}
},
"root": {
"children": [
{
"meta": {
"name": "Photocell (Lift)"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
},
{
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": 101,
"output": "State-Styles/State101"
},
{
"input": 102,
"output": "State-Styles/State102"
},
{
"input": 103,
"output": "State-Styles/State103"
},
{
"input": 104,
"output": "State-Styles/State104"
},
{
"input": 105,
"output": "State-Styles/State105"
},
{
"input": 106,
"output": "State-Styles/State106"
},
{
"input": 202,
"output": "State-Styles/State201"
},
{
"input": 201,
"output": "State-Styles/State202"
},
{
"input": 203,
"output": "State-Styles/State203"
},
{
"input": 204,
"output": "State-Styles/State204"
},
{
"input": 205,
"output": "State-Styles/State205"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
}
},
"props": {
"elements": [
{
"id": "defs1",
"name": "defs1",
"type": "defs"
},
{
"elements": [
{
"cx": "6.6145835",
"cy": "6.6145835",
"fill": {},
"id": "path1",
"name": "path1",
"r": "6.0761814",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.264583"
},
"type": "circle"
},
{
"cx": "6.6145835",
"cy": "6.6145835",
"fill": {
"opacity": "1",
"paint": "#000000"
},
"id": "path2",
"name": "path2",
"rx": "0.5251264",
"ry": "0.52512622",
"stroke": {
"dasharray": "none",
"paint": "#000000",
"width": "0.272664"
},
"type": "ellipse"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"style": {},
"viewBox": "0 0 13.229166 13.229167"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"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\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\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\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
},
"type": "expr"
}
},
"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": {
"aspectRatio": "1:1",
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -259,6 +259,168 @@
"title": "",
"viewPath": "autStand/Alarms/RealTime"
},
"/autStand/MCM01": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Detailed_Views/MCM01-FLUID INBOUND"
},
"/autStand/MCM02": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "show",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Detailed_Views/MCM02-NC SORTER"
},
"/autStand/home": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "auto",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 50,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Overview/Home"
},
"/cameras": {
"docks": {
"bottom": [
@ -446,114 +608,6 @@
},
"viewPath": "Windows/Help"
},
"/mcm01": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Detailed_Views/MCM01-FLUID INBOUND"
},
"/mcm02": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "show",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Detailed_Views/MCM02-NC SORTER"
},
"/statistics": {
"docks": {
"bottom": [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,151 +0,0 @@
{
"custom": {},
"params": {
"address": "test",
"params": {},
"path": "",
"system": {},
"title": "Card Title",
"useDefaultHeight": false,
"useDefaultWidth": false
},
"propConfig": {
"params.address": {
"paramDirection": "input",
"persistent": true
},
"params.params": {
"paramDirection": "input",
"persistent": true
},
"params.path": {
"paramDirection": "input",
"persistent": true
},
"params.system": {
"paramDirection": "input",
"persistent": true
},
"params.title": {
"paramDirection": "input",
"persistent": true
},
"params.useDefaultHeight": {
"paramDirection": "input",
"persistent": true
},
"params.useDefaultWidth": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 339,
"width": 369
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "20px",
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.title"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Framework/Card/Title"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.params": {
"binding": {
"config": {
"path": "view.params.params"
},
"type": "property"
}
},
"props.params.address": {
"binding": {
"config": {
"path": "view.params.address"
},
"type": "property"
}
},
"props.params.system": {
"binding": {
"config": {
"path": "view.params.system"
},
"type": "property"
}
},
"props.path": {
"binding": {
"config": {
"path": "view.params.path"
},
"type": "property"
}
},
"props.useDefaultViewHeight": {
"binding": {
"config": {
"path": "view.params.useDefaultHeight"
},
"type": "property"
}
},
"props.useDefaultViewWidth": {
"binding": {
"config": {
"path": "view.params.useDefaultWidth"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Framework/Card/Embedded"
}
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "Framework/Card/Card"
}
},
"type": "ia.container.flex"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,648 +0,0 @@
{
"custom": {
"alarm_message": null,
"covert_mode": true,
"disconnected": false,
"display_icon": true,
"error": false,
"isMatch": 0,
"plc": "value",
"priority": 0,
"priority_string": "No active alarms",
"running_status": 0,
"searchId": "PLC01",
"state": 5,
"state_string": "Unknown"
},
"params": {
"directionLeft": false,
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.alarm_message": {
"persistent": true
},
"custom.covert_mode": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.display_icon": {
"binding": {
"config": {
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
},
"type": "expr"
},
"persistent": true
},
"custom.error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.isMatch": {
"binding": {
"config": {
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
},
"type": "expr"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.running_status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.state": {
"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": "coalesce({value},{view.params.forceFaultStatus},0)",
"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"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.directionLeft": {
"paramDirection": "input",
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 25,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "PressureSwitch_2"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
},
{
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": 101,
"output": "State-Styles/State101"
},
{
"input": 102,
"output": "State-Styles/State102"
},
{
"input": 103,
"output": "State-Styles/State103"
},
{
"input": 104,
"output": "State-Styles/State104"
},
{
"input": 105,
"output": "State-Styles/State105"
},
{
"input": 106,
"output": "State-Styles/State106"
},
{
"input": 201,
"output": "State-Styles/State201"
},
{
"input": 202,
"output": "State-Styles/State202"
},
{
"input": 203,
"output": "State-Styles/State203"
},
{
"input": 204,
"output": "State-Styles/State204"
},
{
"input": 205,
"output": "State-Styles/State205"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
}
},
"props": {
"elements": [
{
"elements": [
{
"elements": [
{
"id": "stop1507",
"name": "stop1507",
"offset": "0",
"stopColor": "#020101",
"stopOpacity": "1",
"style": {
"stopColor": "#020101",
"stopOpacity": "1"
},
"type": "stop"
}
],
"id": "linearGradient1509",
"name": "linearGradient1509",
"type": "linearGradient"
},
{
"gradientTransform": "matrix(1.0156665,0,0,0.98457489,-0.22712617,-0.22017344)",
"gradientUnits": "userSpaceOnUse",
"href": "#linearGradient1509",
"id": "linearGradient3055",
"name": "linearGradient3055",
"type": "linearGradient",
"x1": "2.4719212",
"x2": "5.6080947",
"y1": "4.8826461",
"y2": "4.8826461"
}
],
"id": "defs2",
"name": "defs2",
"type": "defs"
},
{
"elements": [
{
"fill": {
"opacity": 1
},
"height": "11.216189",
"id": "rect5779",
"name": "rect5779",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"paint": "#000000",
"width": 1.2
},
"style": {
"paintOrder": "stroke fill markers"
},
"type": "rect",
"width": "11.21619",
"x": "7.7715612e-16",
"y": "0"
},
{
"elements": [
{
"fill": {
"opacity": "1",
"url": "url(#linearGradient3055)"
},
"id": "tspan1453",
"name": "tspan1453",
"stroke": {
"dasharray": "none",
"width": "0.116835"
},
"text": "P",
"type": "tspan",
"x": "0.99078566",
"y": "9.0214157"
}
],
"fill": {
"opacity": "1",
"url": "url(#linearGradient3055)"
},
"id": "text1455",
"name": "text1455",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"paint": "#000000",
"width": "0.116835"
},
"style": {
"InkscapeFontSpecification": "\u0027Arial Narrow, Normal\u0027",
"fontFamily": "\u0027Arial Narrow\u0027",
"fontSize": "9.7785px",
"paintOrder": "stroke fill markers"
},
"text": "P",
"transform": "scale(0.98457515,1.0156665)",
"type": "text",
"x": "0.99078566",
"y": "9.0214157"
},
{
"d": "M 7.1327097,2.9635882 9.9122555,5.8103519 6.9937326,8.2419488",
"fill": {
"opacity": "0.0131332",
"paint": "#020101"
},
"id": "path3213",
"name": "path3213",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"paint": "#000000",
"width": "0.663625"
},
"style": {
"paintOrder": "stroke fill markers"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"transform": "translate(0.22362278,0.22362278)",
"type": "group"
}
],
"preserveAspectRatio": "none",
"style": {},
"viewBox": "0 0 11.663437 11.663435"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"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\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\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\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
},
"type": "expr"
}
},
"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": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -1,334 +0,0 @@
{
"custom": {
"disconnected": true,
"plc": "MCM",
"priority": 0,
"priority_string": "No Active Alarms",
"searchId": "PLC01",
"state": 0,
"state_string": "Normal"
},
"params": {
"forceFaultStatus": null,
"forceRunningStatus": null,
"has_state": false,
"tagProps": [
"MCM",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "!isGood({value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 2,
"output": 1
},
{
"input": 3,
"output": 1
},
{
"input": 4,
"output": 1
},
{
"input": 5,
"output": 1
},
{
"input": 6,
"output": 1
},
{
"input": 7,
"output": 1
},
{
"input": 8,
"output": 1
},
{
"input": 9,
"output": 0
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.priority},\r\n1, \"High\",\r\n0, \"No Active Alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"Motor Was Faulted\",\r\n2, \"Power Branch Was Faulted\",\r\n3, \"Low Air Pressure Fault Was Present\",\r\n4, \"Encoder Fault\",\r\n5, \"Jam Fault\",\r\n6, \"Communication Faulted\",\r\n7, \"Estop Was Actuated\",\r\n8, \"Estopped Locally\",\r\n9, \"System Started\",\r\n0, \"Normal\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.has_state": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 46,
"width": 68
}
},
"root": {
"children": [
{
"meta": {
"name": "MCM"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \"#000000\",\r\n switch(\r\n toInt({view.custom.state}),\r\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, \r\n \"#B3B3B3\", \"#FF0000\", \"#FF0000\", \"#FF0000\", \"#FF8C00\",\r\n \"#FF8C00\", \"#FF0000\", \"#FF0000\", \"#FF0000\", \"#00FF00\",\r\n \"#FFFF00\"\r\n )\r\n)\r\n"
},
"type": "expr"
},
"onChange": {
"enabled": false,
"script": ""
}
},
"props.elements[1].style.fill": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"d": "M 1 0 H 60 V 40 H 1 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": 4
},
"type": "path"
},
{
"style": {
"classes": "",
"fontWeight": "bold"
},
"text": "MCM",
"type": "text",
"x": 11,
"y": 26
}
],
"preserveAspectRatio": "none",
"viewBox": "-0.5 -0.5 62 41"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-MCM\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string} + \", State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
}
},
"props": {
"aspectRatio": "68:47",
"mode": "percent",
"style": {
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

@ -1,13 +0,0 @@
{
"base": {
"animation": {
"duration": "1s",
"keyframes": {
"0%": {
"backgroundColor": "#FF8000B3"
},
"100%": {}
}
}
}
}

View File

@ -1,11 +0,0 @@
{
"base": {
"style": {
"borderColor": "#CCCCCC",
"borderStyle": "solid",
"borderWidth": "1px",
"borderRadius": "4px",
"padding": "4px"
}
}
}

View File

@ -1,13 +0,0 @@
{
"base": {
"animation": {
"duration": "1s",
"keyframes": {
"0%": {
"backgroundColor": "#007DFA"
},
"100%": {}
}
}
}
}

View File

@ -1,66 +0,0 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 1080,
"width": 400
}
},
"root": {
"children": [
{
"custom": {
"params": {},
"path": "value"
},
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "320px",
"grow": 1
},
"propConfig": {
"props.params.params": {
"binding": {
"config": {
"path": "this.custom.params"
},
"type": "property"
}
},
"props.path": {
"binding": {
"config": {
"path": "this.custom.path"
},
"type": "property"
}
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "select-side-view",
"pageScope": true,
"script": "\t# implement your handler here\n\tself.custom.path \u003d payload.get(\"path\")\n\tself.custom.params \u003d payload.get(\"params\")\n\tsystem.perspective.print(payload)\n\t",
"sessionScope": true,
"viewScope": false
}
]
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -1,92 +0,0 @@
{
"custom": {},
"params": {
"enabled": true,
"placeholder": "",
"target_message_handler": null,
"val": ""
},
"propConfig": {
"params.enabled": {
"paramDirection": "input",
"persistent": true
},
"params.placeholder": {
"paramDirection": "input",
"persistent": true
},
"params.target_message_handler": {
"paramDirection": "input",
"persistent": true
},
"params.val": {
"onChange": {
"enabled": null,
"script": "\tval \u003d currentValue.value\n\tif val:\n\t\tif self.params.target_message_handler:\n\t\t\tsystem.perspective.sendMessage(\n\t\t\t\tself.params.target_message_handler,\n\t\t\t\t{\u0027value\u0027: val},\n\t\t\t\tscope\u003d\u0027session\u0027\n\t\t\t)\n"
},
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 32,
"width": 200
}
},
"root": {
"children": [
{
"meta": {
"name": "Field Number"
},
"position": {
"basis": "172px",
"grow": 1,
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"path": "view.params.enabled"
},
"type": "property"
}
},
"props.placeholder": {
"binding": {
"config": {
"path": "view.params.placeholder"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.val"
},
"overlayOptOut": true,
"type": "property"
}
}
},
"props": {
"style": {
"margin": "2px",
"marginRight": "26px"
}
},
"type": "ia.input.text-field"
}
],
"meta": {
"name": "root"
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}

View File

@ -1,16 +0,0 @@
{
"base": {
"style": {
"cursor": "pointer",
"fill": "var(--callToAction)"
}
},
"variants": [
{
"pseudo": "hover",
"style": {
"fill": "var(--callToAction--hover)"
}
}
]
}

View File

@ -1,932 +0,0 @@
{
"custom": {},
"params": {
"value": {
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 396
}
},
"root": {
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Start_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Start",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Start \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#FFFFFF\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Start_PB_STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#00A700",
"inputType": "scalar",
"mappings": [
{
"input": 2,
"output": "#41E841"
},
{
"input": 4,
"output": "#41E841"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/not_started"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"color": "#000000",
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Stop_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Stop",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Stop \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#FFFFFF\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Stop_PB"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#CA0D0D",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/stop_circle"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Motor_Fault_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MotorFaultReset",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Motor Fault Reset \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Motor_Fault_Reset_PB_STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#DCDC03",
"inputType": "scalar",
"mappings": [
{
"input": 2,
"output": "#FCFF86"
},
{
"input": 4,
"output": "#FCFF86"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/refresh"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Power_Branch_Fault_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PowerBranchFaultReset",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Power Branch Fault Reset \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Power_Branch_Fault_Reset_PB_STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#DCDC03",
"inputType": "scalar",
"mappings": [
{
"input": 2,
"output": "#FCFF86"
},
{
"input": 4,
"output": "#FCFF86"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/power"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Low_Air_Pressure_Reset_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "LowAirPressureReset",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Low Air Pressure Reset \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#FFFFFF\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Low_Air_Pressure_Reset_PB_STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#0A0AA4",
"inputType": "scalar",
"mappings": [
{
"input": 2,
"output": "#5D5DFF"
},
{
"input": 4,
"output": "#5D5DFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/waves"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Jam_Restart_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "JAM_Reset",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Jam Reset \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Jam_Restart_PB_STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#D4D4D4",
"inputType": "scalar",
"mappings": [
{
"input": 4,
"output": "#FFFFFF"
},
{
"input": 2,
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/sync_problem"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.value.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+\"System/\"+tag_name +\"/\" + tag_name+\"/Setup_Motor_Speeds\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "SetupMotorSpeeds",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Setup Motor Speeds \u0027 + {view.params.value.tagProps[0]},\"You do not have Maintenance or Administrator role!\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#000000\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.value.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/{0}/{0}/Setup_Motor_Speeds"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#D4D4D4",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/speed"
},
"position": "top",
"width": 32
},
"style": {
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"custom.has_role": {
"binding": {
"config": {
"expression": "{session.custom.fc}"
},
"transforms": [
{
"code": "\trme_role \u003d value +\"-rme-c2c-all\"\n\troles \u003d (self.session.props.auth.user.roles)\n\tif (rme_role.lower() in roles \n\tor rme_role.upper() in roles \n\tor \"eurme-ignition-admins\" in roles):\n\t\treturn True\n\telse:\n\t\treturn False",
"type": "script"
}
],
"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"
}
}
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}

View File

@ -1,46 +0,0 @@
{
"custom": {},
"params": {
"Information": ""
},
"propConfig": {
"params.Information": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {},
"root": {
"children": [
{
"meta": {
"name": "Markdown"
},
"position": {
"basis": "200px",
"grow": 1
},
"propConfig": {
"props.source": {
"binding": {
"config": {
"bidirectional": true,
"path": "view.params.Information"
},
"type": "property"
}
}
},
"type": "ia.display.markdown"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"justify": "space-evenly"
},
"type": "ia.container.flex"
}
}

View File

@ -1,96 +0,0 @@
# These scripts are use to download data from the igniton project into any file type.
def download_file(filename, data , converter):
"""
This script will download data from ignition perspective to the users computer.
Args:
filename: The name of the file to be downloaded .
data: The data to be downloaded. May be a string, a byte[], or an InputStream. Strings will be written in UTF-8 encoding.
converter: This is a function that is used to convert the ignition data into the required format for the file.
If not conversion is required then pass a function that just returns original data.
Returns:
None.
Raises:
ValueError: Raises an Value erorr if no data or converter is provided.
"""
if not data:
raise ValueError("No data provided. Data is required to perform download ")
if not converter:
raise ValueError("Please provide a data converter to transform the data")
_data = converter(data)
system.perspective.download(filename, _data)
def device_data_converter(data):
"""
This script converts a list of dicts to a dataset, it uses the first dict to set the column headers in the dataset.
Args:
data: List of dictionaries.
Returns:
Ignition Data Set
Raises:
None
"""
dataset = []
for index,row in enumerate(data):
if index == 0:
header = row.keys()
row = []
for i in header:
value = data[index][i]
row.append(value)
dataset.append(row)
convert_data = system.dataset.toDataSet(header, dataset)
return system.dataset.toCSV(convert_data)
def detailed_views_converter(data):
"""
This script converts a list of dicts to a dataset, it uses the first dict to set the column headers in the dataset.
Args:
data: List of dictionaries.
Returns:
Ignition Data Set
Raises:
None
"""
dataset = []
for index,row in enumerate(data):
if index == 0:
header = row.keys()
row = []
for i in header:
if i == "Devices":
value = array_to_string(data[index][i])
else:
value = data[index][i]
row.append(value)
dataset.append(row)
convert_data = system.dataset.toDataSet(header, dataset)
return system.dataset.toCSV(convert_data)
def array_to_string(array , deliminator="#"):
converted = ""
if len(array) == 1:
return array[0]
for i , value in enumerate(array):
converted += value
if not i == len(array)-1:
converted += deliminator
return converted

View File

@ -1,15 +0,0 @@
{
"base": {
"style": {
"backgroundColor": "#008000",
"borderColor": "#000000",
"borderStyle": "solid",
"borderWidth": "0.5px",
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontSize": "14px",
"fontWeight": "bold",
"textAlign": "center"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -1,302 +0,0 @@
from datetime import datetime
import Queue
import copy
"""Global variables required so we can use different event timer scripts to perform
the writing of tag values seperateley from the reading of messages on the web socket.
State tags messages are queued into the global_queue, where they are read on a different
thread by the Update class and writen to tags. All alarms are written to global_alarms.
The alarms are then read by the Visualisation.status class where they are transformed into
an alarm state and written to tags. """
global_alarms = {}
global_states = set([])
global_queue = Queue.Queue(maxsize=100000)
global_first_connect = False
class A2C_MessageHandler():
"""
Handles the incoming A2C messages. Stores values in memory as dictionaries
and then writes them to tags.
Instance Attributes:
self.alarms: Holds the current active alarm data(dict).
self.state: Holds the current active state data(dict).
self.update_state: Flag, set when state data is available to write(bool)
self.update_alarms: Flag, set when alarm data is available to write(bool)
self.whid: Warehouse id for the site(str)
self.tag_provider: Tag provider to write tag values to(str)
self.A2C_MESSAGE_TYPES: Holds a reference to the methods called
for different message types(dict)
Returns:
NA.
Raises:
KeyError: NA.
"""
def __init__(self, whid):
global global_alarms
global global_first_connect
global_first_connect = False
global_alarms = {}
self.whid = whid
self.tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (self.whid)
self.logger = system.util.getLogger("%s-Web-Socket-Message-Handler" % (self.whid))
tag_to_read = "%sSystem/wbsckt_logging" % (self.tag_provider)
self.check_logger_active = system.tag.readBlocking([tag_to_read])[0].value
self.A2C_MESSAGE_TYPES = {
"SCADAMetricsInterface.StateChange": self.handle_state_message,
# "SCADAMetricsInterface.Event": self.handle_alarm_message,
"CloudMetricsInterface.Event": self.handle_alarm_message,
"ScadaCloud.Download": self.handle_download_message,
"ScadaCloud.Connection": self.handle_cloud_connection}
def message_logger(self, message):
if self.check_logger_active:
self.logger.info(message)
def message_lookup(self, message_type, message):
try:
self.A2C_MESSAGE_TYPES[message_type](message)
except KeyError as e:
self.message_logger("Message type not found:"
+ str(message))
def handle_message(self, message):
heartbeat_message = message.get("action")
message_type = message.get("payload", {}).get("payloadType")
format = message.get("payload", {}).get("format")
if message_type == "ScadaCloud.Batch":
messages = message.get("payload", {}).get("messages",[])
for i in messages:
message_type = i.get("payload", {}).get("payloadType")
self.message_lookup(message_type, i)
elif message_type !="ScadaCloud.Batch" and not heartbeat_message:
self.message_lookup(message_type, message)
else:
self.message_logger("Heartbeat:" + str(message))
tag_to_write = "%sSystem/wbsckt_heartbeat_interval" % (self.tag_provider)
current_time = system.date.now()
system.tag.writeAsync([tag_to_write], [current_time])
def handle_alarm_message(self, message):
global global_alarms
header = message.get("header",{})
payload = message.get("payload",{})
source = header.get("sourceId")
alarm_message = payload.get("message")
alarm_type = payload.get("type")
timestamp = payload.get("timestamp")
priority = payload.get("priority")
alarm_id = payload.get("id")
shelve_expiry = payload.get("shelveExpiryEpoch",0)
state = payload.get("state")
if (isinstance(source, unicode) and isinstance(alarm_message, unicode)
and isinstance(alarm_type, int)and isinstance(timestamp, long)
and isinstance(priority, int) and isinstance(shelve_expiry, int)
and isinstance(state, int)) and isinstance(alarm_id, int):
scada_alarm_message = {"sourceId": source,
"message": alarm_message,
"type": alarm_type,
"timestamp": timestamp,
"priority": priority,
"id": alarm_id,
"shelveExpiryEpoch": shelve_expiry,
"state": state}
alarm_id = "%s/alarm/%s" % (source, alarm_id)
if state == 0:
removed_value = global_alarms.pop(alarm_id, "No key found")
self.message_logger("Value removed from aws_data: "
+ str(removed_value) + ":" + str(alarm_id))
else:
global_alarms[alarm_id] = scada_alarm_message
self.message_logger("Value added to aws_data: "
+ str(scada_alarm_message))
else:
self.message_logger("Incorrect type value in message fields: "
+ str(message))
def handle_state_message(self, message):
global global_queue
header = message.get("header",{})
payload = message.get("payload",{})
source_id = header.get("sourceId")
state = payload.get("currentMachineState")
time_stamp = payload.get("timestamp")
if isinstance(source_id, unicode) and isinstance(state, int):
scada_state_message = {"timestamp": time_stamp,
"state":state}
global_queue.put([source_id, state])
self.message_logger("State message written to queue: "
+ str({source_id:scada_state_message}))
else:
self.message_logger("Incorrect type value in message fields: "
+ str(message))
def handle_download_message(self, message):
url = message.get("payload", {}).get("downloadUrl", None)
session_id = message.get("payload", {}).get("sessionId", None)
download = {}
payload = {"session_id":session_id, "url": url}
download["data"] = [payload]
tag_to_write = "%sSystem/download" % (self.tag_provider)
json_payload = system.util.jsonEncode(download)
system.tag.writeAsync([tag_to_write], [json_payload])
self.message_logger("Download message received: "
+ str(message))
def handle_cloud_connection(self, message):
global global_alarms
UNKNOWN = 3
ACTIVE = 1
header = message.get("header",{})
payload = message.get("payload",{})
component_type = payload.get("componentType")
timestamp = header.get("timestamp", 0)
event_type = payload.get("eventType")
component_id = payload.get("componentId")
scada_alarm_message = create_disconnect_message(component_id, timestamp, 1)
if event_type == "DISCONNECT":
self.message_logger(str(scada_alarm_message))
# #Call disconnect routine with a value 3 which is an unknown state.
self.alarms_disconnect(component_id, UNKNOWN, scada_alarm_message)
if event_type == "CONNECT":
#Call disconnect routine with a value 1 which is an active state.
self.alarms_disconnect(component_id, ACTIVE, scada_alarm_message)
if event_type == "SYNC" and component_type == "PLC":
alarm_id = "%s/alarm/%s" % (component_id, message)
for k,v in global_alarms.items():
if k.startswith(component_id):
global_alarms.pop(alarm_id, "No key found")
def alarms_disconnect(self, component_id, value, message):
global global_alarms
#Set alarms in the global_alarms to an unknown state.
#If component id == "DATABRIDGE" set all alarms to unknown
SITE_DISCONNECTS = ["DATABRIDGE", self.whid]
if component_id in SITE_DISCONNECTS:
site_disconnect = True
source_id = ""
else:
source_id = component_id
site_disconnect = False
for k,v in global_alarms.items():
device_name = k.split("/")[0]
if k.startswith(source_id) and device_name not in SITE_DISCONNECTS:
global_alarms[k]["state"] = value
alarm_id = "%s/alarm/%s" % (component_id, "Device disconnected")
#Set the alarms to true for device disconnects
if site_disconnect:
data_bridge_disconnect(self.whid, value, message, component_id)
else:
tag_path = "%s%s/DCN" % (self.tag_provider, source_id)
if value == 3:
create_disconnect_tags(self.whid, source_id)
global_alarms[alarm_id] = message
system.tag.writeBlocking([tag_path], [1])
else:
global_alarms.pop(alarm_id, "No key found")
system.tag.writeBlocking([tag_path], [0])
def create_disconnect_message(component_id, timestamp, state):
alarm_message = {"sourceId": component_id,
"message": "Device disconnected",
"type": 0,
"timestamp":timestamp,
"priority": 4,
"shelveExpiryEpoch": 0,
"state": state}
return alarm_message
def data_bridge_disconnect(whid, value, message, component_id):
global global_alarms
device_list = get_device_list(whid)
time_stamp = message.get("timestamp")
tags_to_write = []
values_to_write = []
if value == 3:
disconnect = True
else:
disconnect = False
for i in device_list:
create_disconnect_tags(whid, i)
alarm_id = "%s/alarm/%s" % (i, "Device disconnected")
tag_path = "[%s_SCADA_TAG_PROVIDER]%s/DCN" % (whid, i)
device_message = create_disconnect_message(i, time_stamp, 3)
tags_to_write.append(tag_path)
if disconnect:
global_alarms[alarm_id] = device_message
values_to_write.append(1)
else:
global_alarms.pop(alarm_id, "No key found")
values_to_write.append(0)
alarm_id = "%s/alarm/%s" % (component_id, "Device disconnected")
if disconnect:
global_alarms[alarm_id] = message
else:
global_alarms.pop(alarm_id, "No key found")
system.tag.writeAsync(tags_to_write, values_to_write)
def get_device_list(whid):
provider = "[%s_SCADA_TAG_PROVIDER]" % (whid)
tag_path = "%sConfiguration/DetailedViews" % (provider)
tags_to_read = system.tag.readBlocking([tag_path])
devices = system.util.jsonDecode(tags_to_read[0].value)
device_list = []
for k,v in devices.items():
for i in v:
device_list.append(i)
return device_list
def create_disconnect_tags(whid, component_id):
logger_name = "%s-Create-Disconnect-Tags" % (whid)
logger = system.util.getLogger(logger_name)
base = "[%s_SCADA_TAG_PROVIDER]%s" % (whid, component_id)
if not system.tag.exists(base + "/DCN"):
tag = {"name": "DCN",
"valueSource": "memory",
"dataType": "Boolean",
"value": True}
create_tag = system.tag.configure(base, tag)
if not create_tag[0].isGood():
logger.warn("Failed to create tag: " + str(source_id))
class Update():
def __init__(self):
tags_to_read = system.tag.readBlocking(["Configuration/FC"])
self.fc = tags_to_read[0].value
self.tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (self.fc)
self.tags_to_write = []
self.values_to_write = []
self.logger = system.util.getLogger("%s-Global variable reader"
% (self.fc))
def read_messages_from_queue(self):
size = global_queue.qsize()
self.logger.info("Queue size: " + str(size))
for i in range(0, size):
message = global_queue.get()
source_id ="%s%s/STATE" % (self.tag_provider, message[0])
create_tags_in_place(source_id, message[1], self.logger)
self.tags_to_write.append(source_id)
self.values_to_write.append(message[1])
def write_tags(self):
alarm_path = "%sSystem/aws_data" % ( self.tag_provider)
alarm_data = system.util.jsonEncode(global_alarms)
self.tags_to_write.append(alarm_path)
self.values_to_write.append(alarm_data)
system.tag.writeBlocking(self.tags_to_write, self.values_to_write)
self.logger.info("State messages written: " + str(len(self.values_to_write)))
def create_tags_in_place(source_id, value, logger):
base = source_id.replace("/STATE", "")
if not system.tag.exists(source_id):
tag = {"name": "STATE",
"valueSource": "memory",
"dataType": "Int1",
"value": value}
create_tag = system.tag.configure(base, tag)
if not create_tag[0].isGood():
logger.warn("Failed to create tag: " + str(source_id))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,7 +0,0 @@
{
"base": {
"style": {
"fontWeight": "bold"
}
}
}

Some files were not shown because too many files have changed in this diff Show More