fixed the null error in the header

This commit is contained in:
Salijoghli 2025-09-10 11:09:55 +04:00
parent 4075a0f363
commit 8e066d89f4
831 changed files with 5462 additions and 468158 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -1,15 +0,0 @@
def detailed_view(page_id):
"""
This function is used to naviagte to a page from a navigation button
This function takes one parameter "page_id. This is the id of the page
the user wishes to navigate to.
Args:
page_id : Target page the function will use to navigate to.
Returns:
None.
Raises:
None.
"""
system.perspective.navigate(page_id)

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)"
}
}
}

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": []
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

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"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

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

View File

@ -1,63 +1,23 @@
{
"custom": {
"activityLogger": {
"alt_pageid": "Header",
"start_time": {
"$": [
"ts",
192,
1757403432732
],
"$ts": 1757403432732
}
}
},
"events": {
"system": {
"onShutdown": {
"config": {
"script": "\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"
}
}
"largeView": false
},
"params": {
"params": {},
"size": "medium"
"params": {}
},
"propConfig": {
"custom.activityLogger": {
"persistent": true
},
"custom.activityLogger.pageid": {
"custom.largeView": {
"binding": {
"config": {
"path": "page.props.path"
"expression": "{page.props.dimensions.viewport.width} \u003e 800"
},
"transforms": [
{
"code": " if value \u003d\u003d\u0027/\u0027 or value \u003d\u003d \u0027\u0027 or value \u003d\u003d None:\n return self.custom.activityLogger.alt_pageid.lower()\n else:\n return value[1:].lower()\n\treturn value",
"type": "script"
}
],
"type": "property"
}
"type": "expr"
},
"persistent": true
},
"params.params": {
"paramDirection": "input",
"persistent": true
},
"params.size": {
"paramDirection": "input"
}
},
"props": {
@ -222,9 +182,9 @@
"position.display": {
"binding": {
"config": {
"expression": "{view.params.size} \u003d \"large\""
"path": "view.custom.largeView"
},
"type": "expr"
"type": "property"
}
}
},
@ -275,7 +235,7 @@
"position.display": {
"binding": {
"config": {
"expression": "{view.params.size} !\u003d \"large\""
"expression": "!{view.custom.largeView}"
},
"type": "expr"
}
@ -488,7 +448,7 @@
},
"onChange": {
"enabled": null,
"script": " db_tag_path \u003d \"[System]Gateway/Database/MariaDB/Available\"\n\t\n if not (system.tag.readBlocking([db_tag_path])[0].value):\n \tsystem.perspective.openPopup(\"errorPopup\",\u0027PopUp-Views/DatabaseError\u0027, title\u003d\"Database Error\")\n\t"
"script": " db_tag_path \u003d \"[System]Gateway/Database/MariaDB/Available\"\n\t\n if not (system.tag.readBlocking([db_tag_path])[0].value):\n \tsystem.perspective.openPopup(\"errorPopup\",\u0027autStand/PopUp-Views/DatabaseError\u0027, title\u003d\"Database Error\")\n\t"
},
"persistent": true
}
@ -499,188 +459,13 @@
},
"type": "ia.display.icon"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer 1"
},
"position": {
"basis": "20px"
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"custom": {
"buttonid": "HeaderNotifyIcon",
"entries": [
{
"PrimaryKey": "2024-05-08 10:17:51",
"author": "pll",
"body": "Introducing our brand new Announcement Feature! 🎉 Stay in the loop with important updates, new features, planned downtime events, all in one place. Never miss out again! Check it out now and stay tuned for the latest updates. 🔊",
"childproj": "https://eu-preprod.scada2.rme.amazon.dev: MAN2",
"expire": "2024-05-09 05:00:00",
"link1": "https://",
"link1title": "",
"link2": "https://",
"link2title": "",
"priority": "Healthy",
"publish": "2024-05-08 10:08:33",
"title": "📢 Exciting News! 📢",
"whids": ""
}
],
"entryCount": 1,
"highestPriority": 5
},
"events": {
"dom": {
"onClick": [
{
"config": {
"draggable": true,
"id": "ioNP2CXn",
"modal": true,
"overlayDismiss": true,
"resizable": true,
"showCloseIcon": true,
"title": "Notifications",
"type": "open",
"viewParams": {
"entryCount": "{/root/Icon_0.custom.entryCount}",
"instances": "{/root/Icon_0.custom.entries}"
},
"viewPath": "PopUp-Views/Notify-Tool/Notify-Popup",
"viewportBound": false
},
"scope": "C",
"type": "popup"
},
{
"config": {
"script": "\tbuttonid \u003d self.custom.buttonid\n\tactivityLog.productMetrics.callLogger(self.view, \u0027click\u0027, buttonid)"
},
"scope": "G",
"type": "script"
}
]
}
},
"meta": {
"name": "Icon_0",
"tooltip": {
"enabled": true,
"location": "bottom-right",
"style": {
"whiteSpace": "pre"
},
"text": "📢 Exciting News! 📢\n"
}
},
"position": {
"basis": "30px"
},
"propConfig": {
"custom.refreshMSG": {
"binding": {
"config": {
"expression": "now(600000)"
},
"type": "expr"
},
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.sendMessage(\u0027refreshNotifyIcon\u0027)"
}
},
"position.display": {
"binding": {
"config": {
"path": "view.custom.EntriesList"
},
"transforms": [
{
"code": "\tfrom datetime import datetime\n\t\n#\tRead entries from dynamo table\n\treturns \u003d notifyTool.ReadFromDynamo.DynamoReader()\n\tEntriesList \u003d returns[\u0027Items\u0027]\n\tEntriesList.reverse()\n#\treturn EntriesList\n\n#\tCreate empty list and now string\n\tpublishdates \u003d []\n\tnow \u003d datetime.now()\n\tnowstr \u003d str(now)[:19]\n\tactiveNotify \u003d False\n\twhid \u003d self.session.custom.fc\n\tstates \u003d {\u0027Healthy\u0027:5,\u0027Diagnostic\u0027:4, \u0027Low\u0027:3, \u0027Medium\u0027:2, \u0027High\u0027:1}\n#\tCheck EntriesList for active entries based on publish and expire times\n\tactiveEntries \u003d []\n\ttooltip \u003d []\n\tcount \u003d 0\n\thighestPriority \u003d 5\n\tfor e in EntriesList:\n\t\t\n\t\tif len(e[\u0027whids\u0027])\u003e0:\n\t\t\tif whid in e[\u0027whids\u0027]:\n\t\t\t\tif nowstr \u003e\u003d e[\u0027publish\u0027] and nowstr\u003c\u003dstr( e[\u0027expire\u0027]):\n\t\t\t\t\tactiveEntries.append(e)\n\t\t\t\t\ttooltip.append(e[\u0027title\u0027])\n\t\t\t\t\tactiveNotify \u003d True\n\t\t\t\t\tcount +\u003d1\n\t\t\t\t\tif states[e[\u0027priority\u0027]] \u003c highestPriority:\n\t\t\t\t\t\thighestPriority \u003d states[e[\u0027priority\u0027]]\n\t\telse:\n\t\t\tif nowstr \u003e\u003d e[\u0027publish\u0027] and nowstr\u003c\u003dstr( e[\u0027expire\u0027]):\n\t\t\t\tactiveEntries.append(e)\n\t\t\t\ttooltip.append(e[\u0027title\u0027])\n\t\t\t\tactiveNotify \u003d True\t\t\n\t\t\t\tcount +\u003d1\t\n\t\t\t\tif states[e[\u0027priority\u0027]] \u003c highestPriority:\n\t\t\t\t\thighestPriority \u003d states[e[\u0027priority\u0027]]\n\n\t\t\t\n\ttooltiptext \u003d \u0027\u0027\n\tfor i in tooltip:\n\t\ttooltiptext+\u003d i+\u0027\\n\u0027\n\tself.custom.entries \u003d activeEntries\n\tself.custom.highestPriority \u003d highestPriority\n\tself.custom.entryCount \u003d count\n\tself.meta.tooltip.text \u003d tooltiptext\t\n\n\n#\treturn returns\n#\treturn activeEntries\n\treturn activeNotify",
"type": "script"
}
],
"type": "property"
}
},
"props.color": {
"binding": {
"config": {
"path": "this.custom.highestPriority"
},
"transforms": [
{
"fallback": "state5",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "state1"
},
{
"input": 2,
"output": "state2"
},
{
"input": 3,
"output": "state3"
},
{
"input": 4,
"output": "state4"
},
{
"input": 5,
"output": "state5"
}
],
"outputType": "scalar",
"type": "map"
},
{
"code": "\ttest \u003d self.session.custom.colours.colour_impaired\n\tstatecolor \u003d self.session.custom.colours[value]\n\treturn statecolor",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/campaign",
"style": {
"marginLeft": 5,
"marginRight": 5
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "refreshNotifyIcon",
"pageScope": true,
"script": "\n\tself.refreshBinding(\u0027props.color\u0027)\n\tself.refreshBinding(\u0027position.display\u0027)",
"sessionScope": true,
"viewScope": false
}
]
},
"type": "ia.display.icon"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_3"
},
"position": {
"basis": "20px",
"basis": "10px",
"shrink": 0
},
"props": {
@ -694,30 +479,21 @@
},
"events": {
"dom": {
"onClick": [
{
"config": {
"draggable": false,
"id": "TZyBcXB7",
"modal": true,
"overlayDismiss": true,
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewPath": "PopUp-Views/Legend_Popup/Legend-popup-view",
"viewportBound": true
},
"scope": "C",
"type": "popup"
"onClick": {
"config": {
"draggable": false,
"id": "TZyBcXB7",
"modal": true,
"overlayDismiss": true,
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewPath": "autStand/PopUp-Views/Legend_Popup/Legend-popup-view",
"viewportBound": true
},
{
"config": {
"script": "\tbuttonid \u003d self.custom.buttonid\n\tactivityLog.productMetrics.callLogger(self.view, \u0027click\u0027, buttonid)"
},
"scope": "G",
"type": "script"
}
]
"scope": "C",
"type": "popup"
}
}
},
"meta": {
@ -736,14 +512,27 @@
"color": "#FFFFFF",
"path": "material/legend_toggle",
"style": {
"classes": "",
"marginRight": 20
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"children": [
{
"meta": {
"hasDelegate": true,
"name": "Spacer End"
},
"position": {
"basis": "10px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
@ -791,7 +580,8 @@
"name": "Label"
},
"position": {
"basis": "41px"
"basis": "41px",
"grow": 1
},
"propConfig": {
"props.text": {
@ -801,7 +591,7 @@
"enabled": true,
"rate": "3"
},
"queryPath": "GetActiveAlarmsByLocationAndPriority",
"queryPath": "Alarms-autStand/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
},
"transforms": [
@ -830,7 +620,7 @@
}
},
"position": {
"basis": "80px"
"basis": "75px"
},
"propConfig": {
"meta.tooltip.text": {
@ -845,25 +635,12 @@
"props": {
"justify": "flex-end",
"style": {
"cursor": "pointer"
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_2"
},
"position": {
"basis": "20px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"custom": {
"covert": true
@ -1092,22 +869,14 @@
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "{view.params.size} !\u003d \"small\""
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "session.props.auth.user.userName"
"path": "session.props.auth.user"
},
"transforms": [
{
"code": "\tif len(value) \u003d\u003d 0 or value \u003d\u003d \"null\":\n\t return \"Sign In\"\n\telse:\n\t return value.split(\"@\")[0]",
"code": "\tif not value: # None or empty\n\t return \"Sign In\"\n\telse:\n\t username \u003d value.get(\"username\", \"\")\n\t return username.split(\"@\")[0] if username else \"Sign In\"",
"type": "script"
}
],
@ -1197,7 +966,10 @@
"name": "root"
},
"props": {
"justify": "flex-end"
"justify": "flex-end",
"style": {
"background": "rgb(43,43,43)"
}
},
"type": "ia.container.flex"
}

View File

@ -1,604 +0,0 @@
{
"custom": {
"color": "#FF0000",
"priority": "High",
"state": "EStopped"
},
"params": {
"directionLeft": false,
"forceFaultStatus": null,
"tagProps": [
"System/MCM01/Conveyor/EXTENDO/UL1_1_EX1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
],
"type": 1
},
"propConfig": {
"custom.color": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Color"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#C2C2C2"
},
{
"input": 1,
"output": "#FF0000"
},
{
"input": 2,
"output": "#FFA500"
},
{
"input": 3,
"output": "#0008FF"
},
{
"input": 4,
"output": "#00FF00"
},
{
"input": 5,
"output": "#FFF700"
},
{
"input": 6,
"output": "#87CEEB"
},
{
"input": 7,
"output": "#90EE90"
},
{
"input": 8,
"output": "#964B00"
},
{
"input": 9,
"output": "#FFFFFF"
},
{
"input": 10,
"output": "#000000"
},
{
"input": 11,
"output": "#8B0000"
},
{
"input": 12,
"output": "#808080"
},
{
"input": 13,
"output": "#8B8000"
},
{
"input": 14,
"output": "#006400"
},
{
"input": 15,
"output": "#FFFFC5"
},
{
"input": 16,
"output": "#00008B"
},
{
"input": 17,
"output": "#FF7276"
},
{
"input": 18,
"output": "#556B2F"
},
{
"input": 19,
"output": "#B43434"
},
{
"input": 20,
"output": "#4682B4"
},
{
"input": 21,
"output": "#FFD700"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Priority"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "No Active Alarms"
},
{
"input": 1,
"output": "High"
},
{
"input": 2,
"output": "Medium"
},
{
"input": 3,
"output": "Low"
},
{
"input": 4,
"output": "Diagnostic"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"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"
},
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "Closed"
},
{
"input": 1,
"output": "Actuated"
},
{
"input": 2,
"output": "Communication Faulted"
},
{
"input": 3,
"output": "Conveyor Running In Maintenance Mode"
},
{
"input": 4,
"output": "Disabled"
},
{
"input": 5,
"output": "Disconnected"
},
{
"input": 6,
"output": "Stopped"
},
{
"input": 7,
"output": "Enabled Not Running"
},
{
"input": 8,
"output": "Encoder Fault"
},
{
"input": 9,
"output": "Energy Management"
},
{
"input": 10,
"output": "ESTOP Was Actuated"
},
{
"input": 11,
"output": "EStopped"
},
{
"input": 12,
"output": "EStopped Locally"
},
{
"input": 13,
"output": "Extended Faulted"
},
{
"input": 14,
"output": "Full"
},
{
"input": 15,
"output": "Gaylord Start Pressed"
},
{
"input": 16,
"output": "Jam Fault"
},
{
"input": 17,
"output": "Jammed"
},
{
"input": 18,
"output": "Loading Allowed"
},
{
"input": 19,
"output": "Loading Not Allowed"
},
{
"input": 20,
"output": "Low Air Pressure Fault Was Present"
},
{
"input": 21,
"output": "Maintenance Mode"
},
{
"input": 22,
"output": "Conveyor Stopped In Maintenance Mode"
},
{
"input": 23,
"output": "Motor Faulted"
},
{
"input": 24,
"output": "Motor Was Faulted"
},
{
"input": 25,
"output": "Normal"
},
{
"input": 26,
"output": "Off Inactive"
},
{
"input": 27,
"output": "Open"
},
{
"input": 28,
"output": "PLC Ready To Run"
},
{
"input": 29,
"output": "Package Release Pressed"
},
{
"input": 30,
"output": "Power Branch Was Faulted"
},
{
"input": 31,
"output": "Pressed"
},
{
"input": 32,
"output": "Ready To Receive"
},
{
"input": 33,
"output": "Running"
},
{
"input": 34,
"output": "Started"
},
{
"input": 35,
"output": "Stopped"
},
{
"input": 36,
"output": "System Started"
},
{
"input": 37,
"output": "Unknown"
},
{
"input": 38,
"output": "VFD Fault"
},
{
"input": 39,
"output": "Conveyor Running In Power Saving Mode"
},
{
"input": 40,
"output": "Conveyor Jogging In Maintenance Mode"
},
{
"input": 41,
"output": "VFD Reset Required"
},
{
"input": 42,
"output": "Jam Reset Push Button Pressed"
},
{
"input": 43,
"output": "Start Push Button Pressed"
},
{
"input": 44,
"output": "Stop Push Button Pressed"
},
{
"input": 45,
"output": "No Container"
},
{
"input": 46,
"output": "Ready To Be Enabled"
},
{
"input": 47,
"output": "Half Full"
},
{
"input": 48,
"output": "Enabled"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.directionLeft": {
"paramDirection": "input",
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
},
"params.type": {
"paramDirection": "input",
"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.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[2].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
}
},
"props": {
"elements": [
{
"d": "M 50 0 L 65 0 L 80 30 L 65 60 L 50 60 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": "2"
},
"type": "path"
},
{
"d": "M 45 0 L 25 0 L 25 30 L 25 60 L 45 60 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": "2"
},
"type": "path"
},
{
"d": "M 0 0 L 20 0 L 20 30 L 20 60 L 0 60 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-Extendo\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": "High",
"output": "Alarms-Styles/High"
},
{
"input": "Medium",
"output": "Alarms-Styles/Medium"
},
{
"input": "Low",
"output": "Alarms-Styles/Low"
},
{
"input": "Diagnostic",
"output": "Alarms-Styles/Diagnostic"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.state} !\u003d \"Closed\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
}
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}

View File

@ -1,442 +0,0 @@
{
"custom": {
"alarm_message": null,
"disconnected": false,
"plc": "value",
"priority": 0,
"priority_string": "No active alarms",
"searchId": "PLC01",
"state": 0
},
"params": {
"forceFaultStatus": null,
"tagProps": [
"value",
"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": 3,
"output": 1
},
{
"input": 2,
"output": 1
},
{
"input": 1,
"output": 1
}
],
"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": "High"
},
{
"input": 2,
"output": "High"
},
{
"input": 3,
"output": "High"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"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"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 0,
"output": 0
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 25,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "JR_Button"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"transforms": [
{
"fallback": "#585858",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#000000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#D5D5D5"
},
{
"input": 1,
"output": "#FFFFFF"
},
{
"input": 2,
"output": "#47FF47"
},
{
"input": 3,
"output": "#FFFF47"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"expression": "if({session.custom.colours.colour_impaired} \u003d True,\r\n{view.custom.state} + 100,\r\n{view.custom.state})"
},
"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": [
{
"d": "M 0,0 H 20 V 20 H 0 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "1.5"
},
"type": "path"
},
{
"d": "m 17,10.5 a 7,7 0 0 1 -7,7 7,7 0 0 1 -7,-7 7,7 0 0 1 7,-7 7,7 0 0 1 7,7 z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "1"
},
"type": "path"
}
],
"style": {},
"viewBox": "0 0 20 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\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,
"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/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"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},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_buttons"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

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

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: 156 KiB

View File

@ -1,348 +0,0 @@
{
"custom": {
"alarm_message": null,
"disconnected": true,
"plc": "value",
"priority": 0,
"priority_string": "No Active Alarms",
"searchId": "PLC01",
"state": 0,
"state_string": "Disabled"
},
"params": {
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.alarm_message": {
"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}/Alarm/Pressed"
},
"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": 2
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 2
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n0, \"No Active Alarms\",\r\n1, \"Low\",\r\n2, \"No Active Alarms\",\r\n3, \"Low\",\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\n0, \"Disabled\",\r\n1, \"Pressed\",\r\n2, \"Normal\",\r\n3, \"Pressed\",\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": 25,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "Estop",
"tooltip": {
"style": {
"fontSize": 16
}
}
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \u0027#999999\u0027,\r\n if(\r\n {view.custom.state} \u003d 1 || {view.custom.state} \u003d 2 || {view.custom.state} \u003d 3,\r\n \u0027#D5D5D5\u0027,\r\n if(\r\n {view.custom.state} \u003d 0,\r\n \u0027#D5D5D5\u0027,\r\n \u0027#fff700\u0027\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#7DFF7D"
},
{
"input": 2,
"output": "#00FF00"
},
{
"input": 3,
"output": "#7DFF7D"
},
{
"input": 0,
"output": "#00CC00"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"d": "M 0,0 H 20 V 20 H 0 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": 1.5
},
"type": "path"
},
{
"d": "m 17,10.5 a 7,7 0 0 1 -7,7 7,7 0 0 1 -7,-7 7,7 0 0 1 7,-7 7,7 0 0 1 7,7 z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
}
],
"viewBox": "0 0 20 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-SS-BTN\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/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.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": "session.custom.alarm_filter.show_buttons"
},
"type": "property"
}
}
},
"props": {
"aspectRatio": "1:1",
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -1,19 +0,0 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
COUNT(*) AS Inducted,
SUM(alltable.ACTUAL_DEST <> 'S03999') AS Sorted,
SUM(alltable.DivertStatus = 7) AS DestinationInvalid,
SUM(alltable.DivertStatus = 16) AS DestinationNone,
SUM(alltable.DivertStatus = 12) AS DestinationDisabled,
SUM(alltable.DivertStatus = 5) AS DestinationFull,
SUM(alltable.DivertStatus = 2) AS Unexpected,
SUM(alltable.DivertStatus = 6) AS DestinationFault,
SUM(alltable.DivertStatus = 14) AS DivertFail,
SUM(alltable.DivertStatus = 4) AS GapError,
SUM(alltable.DivertStatus = 17) AS Lost,
SUM(alltable.DivertStatus = 3) AS TrackingError,
SUM(alltable.DivertStatus = 1) AS Unknown,
SUM(alltable.DivertStatus = 21) AS Unsafe
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 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

View File

@ -1,939 +0,0 @@
{
"custom": {
"PLC_list": [
"MCM01",
"MCM02",
"MCM03",
"MCM04",
"MCM05",
"MCM06",
"MCM07"
],
"color": "#C2C2C2",
"running_state": -1,
"type": "Enable",
"views_data": []
},
"params": {
"tagProps": [
"System/MCM06/Chute/NC/S02_203CH",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.PLC_list": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"transforms": [
{
"code": "\tdevices \u003d system.util.jsonDecode(value)\n\tplcList \u003d []\n\tfor k in devices.keys():\n\t\tplcList.append(k)\n\t\t\n\treturn(sorted(set(plcList)))\n",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"custom.color": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}",
"type": "{view.custom.type}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/{type}/Color"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#C2C2C2"
},
{
"input": 1,
"output": "#FF0000"
},
{
"input": 2,
"output": "#FFA500"
},
{
"input": 3,
"output": "#0008FF"
},
{
"input": 4,
"output": "#00FF00"
},
{
"input": 5,
"output": "#FFF700"
},
{
"input": 6,
"output": "#87CEEB"
},
{
"input": 7,
"output": "#90EE90"
},
{
"input": 8,
"output": "#964B00"
},
{
"input": 9,
"output": "#FFFFFF"
},
{
"input": 10,
"output": "#000000"
},
{
"input": 11,
"output": "#8B0000"
},
{
"input": 12,
"output": "#808080"
},
{
"input": 13,
"output": "#8B8000"
},
{
"input": 14,
"output": "#006400"
},
{
"input": 15,
"output": "#FFFFC5"
},
{
"input": 16,
"output": "#00008B"
},
{
"input": 17,
"output": "#FF7276"
},
{
"input": 18,
"output": "#556B2F"
},
{
"input": 19,
"output": "#B43434"
},
{
"input": 20,
"output": "#4682B4"
},
{
"input": 21,
"output": "#FFD700"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.running_state": {
"binding": {
"config": {
"expression": "try(jsonGet({session.custom.state_messages},{this.custom.tag_path_to_lookup}),-1)\t\r\n"
},
"transforms": [
{
"expression": "if({value} !\u003d -1, try(jsonGet({value},\"state\"),4),{value})",
"type": "expression"
}
],
"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}/Button_Type"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "UNKNOWN",
"inputType": "scalar",
"mappings": [
{
"input": 5,
"output": "Chute_JR"
},
{
"input": 4,
"output": "GS"
},
{
"input": 3,
"output": "PR"
},
{
"input": 2,
"output": "Start"
},
{
"input": 1,
"output": "JR"
},
{
"input": 6,
"output": "Enable"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.views_data": {
"binding": {
"config": {
"struct": {
"equipment_id": "{view.params.tagProps[0]}"
},
"waitOnAll": true
},
"transforms": [
{
"code": "\tproject_info \u003d system.perspective.getProjectInfo()\n\t#self.custom.views_data \u003d project_info\n\tviews \u003d project_info.get(\"views\")\n\t#equipment_id \u003d self.view.params.tagProps[0]\n\tviews_data \u003d [i for i in views if i[\"path\"].startswith(\"Custom-Views/\"+ value.equipment_id)]\n\t#self.custom.views_data \u003d views_data\n\t\n\treturn views_data",
"type": "script"
}
],
"type": "expr-struct"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"width": 400
}
},
"root": {
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "\u0027Source ID: \u0027 + {view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"style": {
"color": "#FFFF",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 10
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.closeDock(\u0027Docked-East-BTN\u0027)\n\tself.getSibling(\"tabs\").props.currentTabIndex \u003d 0"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Icon",
"tooltip": {
"enabled": true,
"style": {
"cursor": "pointer"
},
"text": "Close faceplate"
}
},
"props": {
"path": "material/close",
"style": {
"cursor": "pointer",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
}
},
"type": "ia.display.icon"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "30px",
"shrink": 0
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "32px",
"display": false
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "if({../AlarmTable.props.params.length_of_table_data} \u003d 0, True, False)"
},
"enabled": false,
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "Labels/Label_1",
"marginTop": 20
},
"text": "No Active Alarms"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "AlarmStatusTable"
},
"position": {
"basis": "400px",
"grow": 1
},
"propConfig": {
"props.filters.active.text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"code": "\treturn value[1:]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"columns": {
"active": {
"displayPath": {
"enabled": false
},
"priority": {
"enabled": false
},
"source": {
"enabled": false
},
"state": {
"enabled": false
}
}
},
"filters": {
"active": {
"priorities": {
"critical": false,
"high": false,
"low": false,
"medium": false
},
"states": {
"clearUnacked": false
}
}
},
"refreshRate": 500,
"toolbar": {
"enabled": false
}
},
"type": "ia.display.alarmstatustable"
}
],
"meta": {
"name": "Active_tab"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "NameField"
},
"position": {
"basis": "50%",
"grow": 1
},
"props": {
"style": {
"paddingLeft": 20
},
"text": "NAME"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DeviceName"
},
"position": {
"basis": "50%",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"code": " return value.rsplit(\u0027/\u0027, 1)[-1]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"backgroundColor": "#FFFFFF",
"classes": "Text-Styles/Ariel-Bold-12pt",
"paddingLeft": 10
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Name"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel",
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "35px"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "NameField"
},
"position": {
"basis": "50%",
"grow": 1
},
"props": {
"style": {
"paddingLeft": 20
},
"text": "BUTTON LIGHT"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "PB_Light"
},
"position": {
"basis": "50%",
"grow": 1
},
"propConfig": {
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"paddingLeft": 10
},
"textStyle": {
"color": "#C2C2C2"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Name"
},
"position": {
"basis": "35px",
"shrink": 2
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "35px"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Info_tab"
},
"position": {
"tabIndex": 1
},
"props": {
"direction": "column",
"style": {
"margin-left": ""
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Start_PB\"\n\tsystem.tag.writeBlocking([tag_path],[True])\n\ttag_path2 \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/JR_PB\"\n\tsystem.tag.writeBlocking([tag_path2],[True])\n\ttag_path3 \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/GS_PB\"\n\tsystem.tag.writeBlocking([tag_path3],[True])\n\ttag_path4 \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Enable_Chute_PB\"\n\tsystem.tag.writeBlocking([tag_path4],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"basis": "80px",
"grow": 1
},
"propConfig": {
"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": {
"path": "view.custom.type"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": "Start",
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.image.icon.path": {
"binding": {
"config": {
"path": "view.custom.type"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": "PR",
"output": "material/not_started"
},
{
"input": "Start",
"output": "material/not_started"
},
{
"input": "JR",
"output": "material/sync_problem"
},
{
"input": "GS",
"output": "material/not_started"
},
{
"input": "Chute_JR",
"output": "material/sync_problem"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.type"
},
"transforms": [
{
"fallback": "UNKNOWN",
"inputType": "scalar",
"mappings": [
{
"input": "PR",
"output": "ENABLE"
},
{
"input": "Start",
"output": "START"
},
{
"input": "JR",
"output": "JAM RESET"
},
{
"input": "GS",
"output": "GAYLORD START"
},
{
"input": "Chute_JR",
"output": "CHUTE JAM RESET"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.textStyle.color": {
"binding": {
"config": {
"path": "view.custom.type"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": "Start",
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"icon": {}
},
"style": {
"classes": "Background-Styles/Controller"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "Reset Jam"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel",
"padding": ""
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "100px",
"grow": 1
},
"props": {
"direction": "column",
"style": {
"gap": 6,
"paddingBottom": 20,
"paddingLeft": 10,
"paddingRight": 10,
"paddingTop": 13
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Commands_tab"
},
"position": {
"tabIndex": 2
},
"props": {
"direction": "column",
"style": {
"paddingTop": 1
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "tabs"
},
"position": {
"grow": 1
},
"propConfig": {
"props.tabs": {
"binding": {
"config": {
"path": "view.custom.type"
},
"transforms": [
{
"code": "\t# This script runs whenever view.custom.type changes\n\tif value \u003d\u003d \"PR\" or value \u003d\u003d \"Enable\":\n\t\treturn [\"Alarms\", \"Info\"]\n\telse:\n\t\treturn [\"Alarms\", \"Info\", \"Commands\"]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"menuType": "modern",
"tabSize": {
"width": 1000
},
"tabStyle": {
"active": {
"classes": "",
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 10
},
"inactive": {
"classes": "",
"color": "#B8B8B8",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 10
}
}
},
"type": "ia.container.tab"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "670px",
"grow": 1
},
"props": {
"style": {
"border-top": "1px solid white",
"gap": ""
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "800px",
"grow": 1
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "Buttons/Button-Menu"
}
},
"type": "ia.container.flex"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

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"
}
}

View File

@ -1,19 +0,0 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(round(COUNT(*)/COUNT(*) * 100,2),'%') AS Inducted,
concat(round(SUM(alltable.ACTUAL_DEST <> 'S03999')/COUNT(*) * 100,2),'%') AS Sorted,
concat(round(SUM(alltable.DivertStatus = 7)/COUNT(*) * 100,2),'%') AS DestinationInvalid,
concat(round(SUM(alltable.DivertStatus = 16)/COUNT(*) * 100,2),'%') AS DestinationNone,
concat(round(SUM(alltable.DivertStatus = 12)/COUNT(*) * 100,2),'%') AS DestinationDisabled,
concat(round(SUM(alltable.DivertStatus = 5)/COUNT(*) * 100,2),'%') AS DestinationFull,
concat(round(SUM(alltable.DivertStatus = 2)/COUNT(*) * 100,2),'%') AS Unexpected,
concat(round(SUM(alltable.DivertStatus = 6)/COUNT(*) * 100,2),'%') AS DestinationFault,
concat(round(SUM(alltable.DivertStatus = 14)/COUNT(*) * 100,2),'%') AS DivertFail,
concat(round(SUM(alltable.DivertStatus = 4)/COUNT(*) * 100,2),'%') AS GapError,
concat(round(SUM(alltable.DivertStatus = 17)/COUNT(*) * 100,2),'%') AS Lost,
concat(round(SUM(alltable.DivertStatus = 3)/COUNT(*) * 100,2),'%') AS TrackingError,
concat(round(SUM(alltable.DivertStatus = 1)/COUNT(*) * 100,2),'%') AS Unknown,
concat(round(SUM(alltable.DivertStatus = 21)/COUNT(*) * 100,2),'%') AS Unsafe
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

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,49 +0,0 @@
def handleClick(data):
if not data or len(data) != 1:
return
row = data[0]
clickedTagPath = row.get("FullTag", "")
MCM = row.get("Location", "")
MCM_Pages_Map = {
"MCM01": "Detailed-Views/MCM01 Fluid Inbound Merges 1-4",
"MCM02": "Detailed-Views/MCM02 Fluid Inbound Merges 5-7",
"MCM03": "Detailed-Views/MCM03 Non Con",
"MCM04": "Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve",
"MCM05": "Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve",
"MCM06": "Detailed-Views/MCM06 Non Con",
"MCM07": "Detailed-Views/MCM07 Bypass",
}
page = MCM_Pages_Map.get(MCM)
if not page:
return
device = row.get("Device", "")
if not device or not clickedTagPath:
return
pathToDevice = ""
# check for the mcm
if "MCM" in device:
parts = clickedTagPath.split("/")
pathToDevice = "/".join(parts[:3])
else:
index = clickedTagPath.find(device)
if index == -1:
return
pathToDevice = clickedTagPath[:index + len(device)]
priority = row.get("Priority", "")
#combining with priority
combined = pathToDevice + "||" + priority
# Navigate to target view, passing the tag to highlight
system.perspective.navigate(view = page, params = {'highlightTagPath': str(combined)})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

View File

@ -1,537 +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": "value",
"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))\n\n"
},
"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": 100,
"width": 100
}
},
"root": {
"children": [
{
"meta": {
"name": "ARSAW"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "if({session.custom.colours}[\"state\"+{value}] \u003d null, \r\n{session.custom.colours}[\"Fallback\"],\r\n{session.custom.colours}[\"state\"+{value}])",
"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": [
{
"d": "m 25,50.5 a 25,25 0 0 1 -25,-25 25,25 0 0 1 25,-25 25,25 0 0 1 25,25 25,25 0 0 1 -25,25 z",
"fill": {},
"name": "Circle",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
},
{
"d": "M 8.3000002,34.740002 H 31.04 v 4.26 H 8.3000002 Z M 26.77,12 h 4.260001 V 34.74 H 26.77 Z M 16.110001,12 H 24.64 v 17.049999 h -8.529999 z m 17.059997,0 h 8.53 v 17.049999 h -8.53 z",
"fill": {
"paint": "#000000"
},
"name": "ARSAW",
"type": "path"
}
],
"style": {},
"viewBox": "-0.5 -0.5 51 52"
},
"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: 139 KiB

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: 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"
}
}

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"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

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

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: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

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,19 +0,0 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(cast(COUNT(*) as char),' pph') AS Inducted,
concat(cast(SUM(alltable.ACTUAL_DEST <> 'S03999') as char),' pph') AS Sorted,
concat(cast(SUM(alltable.DivertStatus = 7) as char),' pph') AS DestinationInvalid,
concat(cast(SUM(alltable.DivertStatus = 16) as char),' pph') AS DestinationNone,
concat(cast(SUM(alltable.DivertStatus = 12) as char),' pph') AS DestinationDisabled,
concat(cast(SUM(alltable.DivertStatus = 5) as char),' pph') AS DestinationFull,
concat(cast(SUM(alltable.DivertStatus = 2) as char),' pph') AS Unexpected,
concat(cast(SUM(alltable.DivertStatus = 6) as char),' pph') AS DestinationFault,
concat(cast(SUM(alltable.DivertStatus = 14) as char),' pph') AS DivertFail,
concat(cast(SUM(alltable.DivertStatus = 4) as char),' pph') AS GapError,
concat(cast(SUM(alltable.DivertStatus = 17) as char),' pph') AS Lost,
concat(cast(SUM(alltable.DivertStatus = 3) as char),' pph') AS TrackingError,
concat(cast(SUM(alltable.DivertStatus = 1) as char),' pph') AS Unknown,
concat(cast(SUM(alltable.DivertStatus = 21) as char),' pph') AS Unsafe
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

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"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

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,10 +0,0 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
COUNT(*) AS Inducted,
concat(cast(SUM(alltable.ACTUAL_DEST <> 'S03999') as char),' pph') AS Sorted,
concat(cast(SUM(alltable.ACTUAL_DEST = 'S03999' AND (alltable.DivertStatus = 7 OR alltable.DivertStatus = 8 OR alltable.DivertStatus = 9 OR alltable.DivertStatus = 10 OR alltable.DivertStatus = 12 OR alltable.DivertStatus = 16)) as char),' pph') AS AwcsRecirc,
concat(cast(SUM(alltable.ACTUAL_DEST = 'S03999' AND (alltable.DivertStatus = 2 OR alltable.DivertStatus = 5 OR alltable.DivertStatus = 18 OR alltable.DivertStatus = 19 or alltable.DivertStatus = 20)) as char),' pph') AS OperationalRecirc,
concat(cast(SUM(alltable.ACTUAL_DEST = 'S03999' AND (alltable.DivertStatus = 1 OR alltable.DivertStatus = 3 OR alltable.DivertStatus = 4 OR alltable.DivertStatus = 6 OR alltable.DivertStatus = 13 OR alltable.DivertStatus = 14 OR alltable.DivertStatus = 17 OR alltable.DivertStatus = 21)) as char),' pph') AS MachineRecirc
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

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

View File

@ -1,67 +0,0 @@
SELECT
Active.id AS ID,
Active.eventtime AS StartTimestamp,
Clear.eventtime AS EndTimestamp,
CONCAT(
LPAD(FLOOR(Active.duration_seconds / 3600), 2, '0'), ':',
LPAD(FLOOR((Active.duration_seconds % 3600) / 60), 2, '0'), ':',
LPAD(Active.duration_seconds % 60, 2, '0')
) AS Duration,
CONCAT(Active.displaypath, ' - ', SUBSTRING_INDEX(Active.source, ':/alm:', -1)) AS Description,
CASE Active.priority
WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low'
WHEN 2 THEN 'Medium'
WHEN 3 THEN 'High'
WHEN 4 THEN 'Critical'
ELSE 'Unknown'
END AS Priority,
CONCAT(
Active.displaypath,
'.HMI.',
SUBSTRING_INDEX(aed.strValue, '/', -1)
) AS Tag,
SUBSTRING_INDEX(SUBSTRING_INDEX(aed.strValue, '/', 2), '/', -1) AS Location, aed.strValue AS FullTag,
Active.displaypath AS Device
FROM (
SELECT
ae.id,
ae.eventtime,
ae.eventid,
ae.source,
ae.priority,
ae.displaypath,
TIMESTAMPDIFF(SECOND, ae.eventtime, COALESCE(ae_clear.eventtime, NOW())) AS duration_seconds
FROM alarm_events ae
LEFT JOIN alarm_events ae_clear
ON ae.eventid = ae_clear.eventid
AND ae_clear.eventtype = 1
WHERE ae.eventtype = 0
AND ae.displaypath NOT LIKE '%System Startup%'
AND ae.source NOT LIKE '%System Startup%'
GROUP BY ae.id
) AS Active
LEFT JOIN (
SELECT eventid, MIN(eventtime) AS eventtime
FROM alarm_events
WHERE eventtype = 1
GROUP BY eventid
) AS Clear
ON Active.eventid = Clear.eventid
LEFT JOIN (
SELECT aed.id, aed.strValue
FROM alarm_event_data aed
WHERE aed.propname = 'myTag'
GROUP BY aed.id
) AS aed
ON aed.id = Active.id
ORDER BY Active.eventtime DESC;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -1,33 +0,0 @@
SELECT
SUBSTRING_INDEX(SUBSTRING_INDEX(strValue, '/', 2), '/', -1) AS Location,
CASE priority
WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low'
WHEN 2 THEN 'Medium'
WHEN 3 THEN 'High'
WHEN 4 THEN 'Critical'
ELSE 'Unknown'
END AS Priority,
COUNT(*) AS Count
FROM (
SELECT
ae.id,
ae.eventid,
ae.priority,
aed.strValue
FROM alarm_events ae
LEFT JOIN alarm_event_data aed
ON ae.id = aed.id
AND aed.propname = 'myTag'
WHERE ae.eventtype = 0
AND NOT EXISTS (
SELECT 1
FROM alarm_events ae_clear
WHERE ae_clear.eventid = ae.eventid
AND ae_clear.eventtype = 1
)
AND ae.displaypath NOT LIKE '%System Startup%'
AND ae.source NOT LIKE '%System Startup%'
) AS Active
GROUP BY Location, Priority
ORDER BY Location, Priority;

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

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"
}
}
}

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