Compare commits

...

No commits in common. "main" and "guga" have entirely different histories.
main ... guga

2697 changed files with 618565 additions and 742486 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
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)

View File

@ -1,626 +0,0 @@
{
"custom": {
"color": "#000000",
"priority": "No Active Alarms",
"state": "Offline"
},
"params": {
"demoColor": -1,
"demoState": -1,
"tagProps": [
"value",
"System/MCM02/SOL/NCS1_1_SOL48",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"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": "if(\r\n {view.params.demoColor} \u003e\u003d 0,\r\n {view.params.demoColor},\r\n coalesce({value}, -1)\r\n)\r\n",
"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.divertingLeft": {
"persistent": true
},
"custom.divertingRight": {
"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},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": "if(\r\n {view.params.demoState} \u003e\u003d 0,\r\n {view.params.demoState},\r\n coalesce({value}, -1)\r\n)\r\n",
"type": "expression"
},
{
"fallback": "Offline",
"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"
},
{
"input": 49,
"output": "Tipper Faulted"
},
{
"input": 54,
"output": "Diverting"
},
{
"input": 50,
"output": "OK"
},
{
"input": 51,
"output": "DISCONNECTED"
},
{
"input": 52,
"output": "FAULTED"
},
{
"input": 53,
"output": "FAULTED/DISCONNECTED"
},
{
"input": 101,
"output": "Diverting"
},
{
"input": 102,
"output": "Diverting Left"
},
{
"input": 103,
"output": "Diverting Right"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.demoColor": {
"paramDirection": "input",
"persistent": true
},
"params.demoState": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 50
}
},
"root": {
"children": [
{
"meta": {
"name": "SOL"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"expression": "if ({view.custom.state} \u003d \"Offline\", \"#fff\", \"#000\")"
},
"type": "expr"
}
}
},
"props": {
"elements": [
{
"fill": {},
"height": "47.417244",
"id": "beaconSquare",
"name": "beaconSquare",
"stroke": {
"paint": "#000000",
"width": "2.36887"
},
"type": "rect",
"width": "47.337795",
"x": "1.450278",
"y": "1.3708278"
},
{
"fill": {},
"id": "beaconLabel",
"name": "beaconLabel",
"stroke": {
"width": "1.15193"
},
"style": {
"classes": "",
"fontSize": "21px",
"textAnchor": "middle"
},
"text": "SOL",
"textAnchor": "middle",
"type": "text",
"x": "24.958401",
"y": "31.781378"
}
],
"viewBox": "0 0 50 50"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-Conv\u0027)\n\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":\"\"} )"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"draggable": false,
"id": "LZ5nPg42{view.params.tagProps[0]}",
"modal": false,
"overlayDismiss": false,
"position": {
"relativeLocation": "top-right"
},
"positionType": "relative",
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewParams": {
"text": "{/root.meta.tooltip.text}"
},
"viewPath": "autStand/Custom_Views/Tooltip",
"viewportBound": false
},
"scope": "C",
"type": "popup"
},
"onMouseLeave": {
"config": {
"draggable": true,
"id": "LZ5nPg42{view.params.tagProps[0]}",
"modal": false,
"overlayDismiss": false,
"resizable": true,
"showCloseIcon": true,
"type": "close",
"viewPath": "autStand/Custom_Views/Tooltip",
"viewportBound": false
},
"scope": "C",
"type": "popup"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.state} !\u003d \"Offline\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_solenoids"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer",
"overflow": "visible",
"userSelect": "None"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,7 @@
{
"base": {
"style": {
"marginBottom": "2px"
}
}
}

View File

@ -0,0 +1,17 @@
{
"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

@ -0,0 +1,12 @@
{
"base": {
"style": {
"backgroundColor": "#AAAAAA",
"borderColor": "#808080",
"borderStyle": "none",
"color": "#555555",
"margin": "5px",
"fill": "#2B2B2B"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 B

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,603 +0,0 @@
{
"custom": {
"color": "#C2C2C2",
"priority": "No Active Alarms"
},
"params": {
"demoColor": -1,
"tagProps": [
"System/MCM02/Encoder/ENSH/NCS1_1_ENSH1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"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": "if(\r\n {view.params.demoColor} \u003e\u003d 0,\r\n {view.params.demoColor},\r\n coalesce({value}, 0)\r\n)\r\n",
"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},0)",
"type": "expression"
},
{
"fallback": "UNKNOWN",
"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},-1)",
"type": "expression"
},
{
"fallback": "Offline",
"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"
},
{
"input": 49,
"output": "Tipper Faulted"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"params.demoColor": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 20
}
},
"root": {
"children": [
{
"meta": {
"name": "EncoderIcon"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
}
},
"props": {
"elements": [
{
"cx": 12,
"cy": "12",
"fill": {},
"name": "statusCircle",
"rx": "10",
"ry": "10",
"stroke": {
"paint": "#000000",
"width": "2"
},
"type": "ellipse"
},
{
"d": "M 4.6516854,13.685393 H 9.8292135",
"fill": {},
"name": "segLeft",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
},
{
"d": "M 9.6000004,13.469662 V 8.2112357",
"fill": {},
"name": "segUpLeft",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
},
{
"d": "M 19.829214,13.685393 H 14.651685",
"fill": {},
"name": "segRight",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
},
{
"d": "M 14.880899,13.469662 V 8.211236",
"fill": {},
"name": "segUpRight",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
},
{
"d": "m 9.8154019,8.4404597 4.8815551,0.013462",
"fill": {},
"name": "segTop",
"stroke": {
"paint": "#000000",
"width": 1
},
"type": "path"
}
],
"viewBox": "0 0 24 24"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":\"\"} )"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"draggable": false,
"id": "LZ5nPg42{view.params.tagProps[0]}",
"modal": false,
"overlayDismiss": false,
"position": {
"relativeLocation": "top-right"
},
"positionType": "relative",
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewParams": {
"text": "{/Encoder.meta.tooltip.text}"
},
"viewPath": "autStand/Custom_Views/Tooltip",
"viewportBound": false
},
"scope": "C",
"type": "popup"
},
"onMouseLeave": {
"config": {
"draggable": true,
"id": "LZ5nPg42{view.params.tagProps[0]}",
"modal": false,
"overlayDismiss": false,
"resizable": true,
"showCloseIcon": true,
"type": "close",
"viewPath": "autStand/Custom_Views/Tooltip",
"viewportBound": false
},
"scope": "C",
"type": "popup"
}
}
},
"meta": {
"name": "Encoder",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.state} !\u003d \"Offline\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_encoders"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer",
"userSelect": "none"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,17 @@
{
"base": {
"style": {
"backgroundColor": "var(--neutral-60)",
"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,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,
SUM(alltable.ACTUAL_DEST NOT IN ('S013001', 'S012069', 'S011076')) AS Sorted,
SUM(alltable.ACTUAL_DEST IN ('S013001', 'S012069', 'S011076') AND (alltable.DivertStatus & (128|256|512|1024|4096|65536)) > 0) AS AwcsRecirc,
SUM(alltable.ACTUAL_DEST IN ('S013001', 'S012069', 'S011076') AND (alltable.DivertStatus & (4|32|262144|524288|1048576)) > 0) AS OperationalRecirc,
SUM(alltable.ACTUAL_DEST IN ('S013001', 'S012069', 'S011076') AND (alltable.DivertStatus & (2|8|16|64|8192|16384|131072|2097152)) > 0) AS MachineRecirc
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

@ -1,58 +0,0 @@
SELECT
roundtime AS `Round Time`,
sLocation_ID AS `Location ID`,
CONCAT(COALESCE(Success_pct, 0), '%') AS `Success Percentage`,
CONCAT(COALESCE(Unknown_pct, 0), '%') AS `Unknown Percentage`,
CONCAT(COALESCE(Unexpected_Container_pct, 0), '%') AS `Unexpected Container Percentage`,
CONCAT(COALESCE(Tracking_Error_pct, 0), '%') AS `Tracking Error Percentage`,
CONCAT(COALESCE(Gap_Error_pct, 0), '%') AS `Gap Error Percentage`,
CONCAT(COALESCE(Destination_Full_pct, 0), '%') AS `Destination Full Percentage`,
CONCAT(COALESCE(Destination_Non_Operational_pct, 0), '%') AS `Destination Non Operational Percentage`,
CONCAT(COALESCE(Invalid_Destination_pct, 0), '%') AS `Invalid Destination Percentage`,
CONCAT(COALESCE(Scanner_Error_pct, 0), '%') AS `Scanner Error Percentage`,
CONCAT(COALESCE(Destination_Disabled_pct, 0), '%') AS `Destination Disabled Percentage`,
CONCAT(COALESCE(Throughput_Limit_pct, 0), '%') AS `Throughput Limit Percentage`,
CONCAT(COALESCE(Failed_To_Divert_pct, 0), '%') AS `Failed To Divert Percentage`,
CONCAT(COALESCE(No_Destination_Received_pct, 0), '%') AS `No Destination Received Percentage`,
CONCAT(COALESCE(Lost_Container_pct, 0), '%') AS `Lost Container Percentage`,
CONCAT(COALESCE(Dimension_Error_pct, 0), '%') AS `Dimension Error Percentage`,
CONCAT(COALESCE(Weight_Error_pct, 0), '%') AS `Weight Error Percentage`,
CONCAT(COALESCE(Container_Utilization_pct, 0), '%') AS `Container Utilization Percentage`,
CONCAT(COALESCE(Unable_To_Divert_pct, 0), '%') AS `Unable To Divert Percentage`,
CONCAT(COALESCE(Destination_Not_Attempted_pct, 0), '%') AS `Destination Not Attempted Percentage`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
sLocation_ID,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Success_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 1 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Unknown_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 2 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Unexpected_Container_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 3 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Tracking_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 4 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Gap_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Full_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 6 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Non_Operational_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 7 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Invalid_Destination_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 IN (8, 9, 10) THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Scanner_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 12 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Disabled_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 13 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Throughput_Limit_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 14 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Failed_To_Divert_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 16 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS No_Destination_Received_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 17 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Lost_Container_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 18 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Dimension_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 19 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Weight_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 20 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Container_Utilization_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 21 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Unable_To_Divert_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 22 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Not_Attempted_pct
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND (COALESCE(:locationid, '') = '' OR sLocation_ID = :locationid)
GROUP BY roundtime, sLocation_ID
ORDER BY roundtime ASC
) basa;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

View File

@ -0,0 +1,58 @@
{
"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"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,209 +0,0 @@
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
sScanner_Name AS `Scanner Name`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_bad_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total Bad Reads`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_comm_fault), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total Comm Faults`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_good_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total Good Reads`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_multi_items), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total Multi Items`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_multi_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total Multi Reads`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_no_data), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total No Data`,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_no_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS `Total No Reads`
FROM scanner_reads
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sScanner_Name = :scannername OR :scannername IS NULL OR :scannername = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sScanner_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
'S03aa' AS `Scanner Name`,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS `Total Bad Reads`,
'0%' AS `Total Comm Faults`,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS `Total Good Reads`,
'0%' AS `Total Multi Items`,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS `Total Multi Reads`,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS `Total No Data`,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS `Total No Reads`
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:scannername IS NULL OR :scannername = '' OR :scannername = 'S03aa')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
ORDER BY `Start Timestamp` ASC;

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,169 @@
{
"custom": {
"alarmHighlight": "",
"areaHover": [],
"currentGraphic": "Windows/Graphics/Overview",
"demoHighlight": "",
"dexmanager": {
"config": {
"font": "bold 12px Arial",
"highlight": "#ff0"
},
"highlight": [],
"show": {
"Beacons": false,
"ConveyorLabels": true,
"ConveyorPatterns": true,
"Conveyors": true,
"DivertPaddles": true,
"EIPs": false,
"Encoders": false,
"Estops": false,
"Gaylords": true,
"LimitSwitches": false,
"MCPs": false,
"PhotoEyes": false,
"PushButtons": false,
"Scanners": false,
"VFDs": false
}
},
"heatmapSettings": {
"alarms": [],
"alarmsText": "",
"data": {
"$": [
"ds",
192,
1602856991637
],
"$columns": [
{
"data": [],
"name": "firsttime",
"type": "Date"
},
{
"data": [],
"name": "lasttime",
"type": "Date"
},
{
"data": [],
"name": "duration",
"type": "String"
},
{
"data": [],
"name": "count",
"type": "Long"
},
{
"data": [],
"name": "device",
"type": "String"
},
{
"data": [],
"name": "description",
"type": "String"
}
]
},
"devices": [],
"devicesText": "",
"enabled": false,
"shifts": [],
"shiftsText": "",
"time": {
"end": "2020-07-30 00:00:00",
"start": "2020-07-29 00:00:00"
}
},
"isMobile": false,
"timewidget": {
"endDate": {
"$": [
"ts",
192,
1646422591477
],
"$ts": 1646438400000
},
"mode": "currentDay",
"startDate": {
"$": [
"ts",
192,
1646422591477
],
"$ts": 1646352000000
},
"update": {
"$": [
"ts",
192,
1646422591477
],
"$ts": 1646422591465
}
}
},
"propConfig": {
"props.auth": {
"access": "PRIVATE",
"persistent": false
},
"props.device.accelerometer": {
"access": "SYSTEM",
"persistent": false
},
"props.device.identifier": {
"access": "SYSTEM",
"persistent": false
},
"props.device.timezone": {
"access": "SYSTEM",
"persistent": false
},
"props.device.type": {
"access": "SYSTEM",
"persistent": false
},
"props.device.userAgent": {
"access": "SYSTEM",
"persistent": false
},
"props.gateway": {
"access": "SYSTEM",
"persistent": false
},
"props.geolocation.data": {
"access": "SYSTEM",
"persistent": false
},
"props.geolocation.permissionGranted": {
"access": "SYSTEM",
"persistent": false
},
"props.host": {
"access": "SYSTEM",
"persistent": false
},
"props.id": {
"access": "SYSTEM",
"persistent": false
},
"props.lastActivity": {
"access": "SYSTEM",
"persistent": false
}
},
"props": {
"address": "127.0.0.1",
"device": {},
"geolocation": {},
"locale": "en-US",
"timeZoneId": "Asia/Tbilisi"
}
}

View File

@ -1,24 +0,0 @@
SELECT
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS StartTimestamp,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS EndTimestamp,
-- Total is now the sum of Merge, Transport, and Sorter counts
(COALESCE(c.MergeCount,0) + COALESCE(c.TransportCount,0) + COALESCE(c.SorterCount,0)) AS Total,
-- New individual metrics
COALESCE(c.MergeCount,0) AS Merge_MCM01,
COALESCE(c.TransportCount,0) AS Transport_MCM01,
COALESCE(c.SorterCount,0) AS Sorter_MCM02
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
-- New metric: Merge_MCM01
SUM(Merge_MCM01 = 1) AS MergeCount,
-- New metric: Transport_MCM01
SUM(Transport_MCM01 = 1) AS TransportCount,
-- Kept metric: Sorter_MCM02
SUM(Sorter_MCM02 = 1) AS SorterCount
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
) AS c ON 1=1;

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,289 @@
{
"custom": {
"disconnected": true,
"plc": "",
"searchId": "value",
"state": 1,
"string": "Running"
},
"params": {
"name": "amber",
"tagProps": [
"/system/mcm01/test",
"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.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
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Starting",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Running"
},
{
"input": 2,
"output": "EStop or Faulted"
},
{
"input": 3,
"output": "Gridlock Prevention"
},
{
"input": 4,
"output": "Full"
},
{
"input": 5,
"output": "Jammed"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.name": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 20
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "substring({view.params.name}, 0, 1)"
},
"type": "expr"
}
}
},
"props": {
"textStyle": {
"fontSize": "20px",
"textAlign": "center",
"textTransform": "uppercase"
}
},
"type": "ia.display.label"
}
],
"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
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_beacons"
},
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#808080",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#00FF00"
},
{
"input": 2,
"output": "#FF0000"
},
{
"input": 3,
"output": "#FF00FF"
},
{
"input": 4,
"output": "#0000D9"
},
{
"input": 5,
"output": "#FF8C00"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"borderStyle": "solid",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,3 @@
SELECT DISTINCT sorter
FROM package_history
ORDER BY sorter ASC;

View File

@ -0,0 +1,19 @@
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.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

View File

@ -0,0 +1,6 @@
def set_priority_filters(self):
filters = self.props.value
payload = {}
payload["data"] = filters
system.perspective.sendMessage("set-priority-filters", payload = payload,
scope = "page")

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -1,77 +0,0 @@
SELECT
CASE
WHEN c.sActual_Dest_ID LIKE 'S03%' THEN 'S03'
ELSE 'S03'
END AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS end_time,
COALESCE(c.sActual_Dest_ID, 'N/A') AS Lane,
CONCAT(COALESCE(c.Success_pct, 0), '%') AS success_perc,
CONCAT(COALESCE(c.Unknown_pct, 0), '%') AS unknown_perc,
CONCAT(COALESCE(c.Unexpected_Container_pct, 0), '%') AS unexpected_container_perc,
CONCAT(COALESCE(c.Tracking_Error_pct, 0), '%') AS tracking_error_perc,
CONCAT(COALESCE(c.Gap_Error_pct, 0), '%') AS gap_error_perc,
CONCAT(COALESCE(c.Destination_Full_pct, 0), '%') AS destination_full_perc,
CONCAT(COALESCE(c.Destination_Non_Operational_pct, 0), '%') AS destination_non_operational_perc,
CONCAT(COALESCE(c.Invalid_Destination_pct, 0), '%') AS invalid_destination_perc,
CONCAT(COALESCE(c.Scanner_Error_pct, 0), '%') AS scan_error_perc,
CONCAT(COALESCE(c.Destination_Disabled_pct, 0), '%') AS destination_disabled_perc,
CONCAT(COALESCE(c.Throughput_Limit_pct, 0), '%') AS throughput_limit_perc,
CONCAT(COALESCE(c.Failed_To_Divert_pct, 0), '%') AS failed_to_divert_perc,
CONCAT(COALESCE(c.No_Destination_Received_pct, 0), '%') AS no_destination_received_perc,
CONCAT(COALESCE(c.Lost_Container_pct, 0), '%') AS lost_container_perc,
CONCAT(COALESCE(c.Dimension_Error_pct, 0), '%') AS dimension_error_perc,
CONCAT(COALESCE(c.Weight_Error_pct, 0), '%') AS weight_error_perc,
CONCAT(COALESCE(c.Container_Utilization_pct, 0), '%') AS container_utilization_perc,
CONCAT(COALESCE(c.Unable_To_Divert_pct, 0), '%') AS unable_to_divert_perc,
CONCAT(COALESCE(c.Destination_Not_Attempted_pct, 0), '%') AS destination_not_attempted_perc,
COALESCE(c.total, 0) AS total
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
sActual_Dest_ID,
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS Success_count,
SUM(CASE WHEN adiSort_Code_0 = 1 THEN 1 ELSE 0 END) AS Unknown_count,
SUM(CASE WHEN adiSort_Code_0 = 2 THEN 1 ELSE 0 END) AS Unexpected_Container_count,
SUM(CASE WHEN adiSort_Code_0 = 3 THEN 1 ELSE 0 END) AS Tracking_Error_count,
SUM(CASE WHEN adiSort_Code_0 = 4 THEN 1 ELSE 0 END) AS Gap_Error_count,
SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) AS Destination_Full_count,
SUM(CASE WHEN adiSort_Code_0 = 6 THEN 1 ELSE 0 END) AS Destination_Non_Operational_count,
SUM(CASE WHEN adiSort_Code_0 = 7 THEN 1 ELSE 0 END) AS Invalid_Destination_count,
SUM(CASE WHEN adiSort_Code_0 IN (8, 9, 10) THEN 1 ELSE 0 END) AS Scanner_Error_count,
SUM(CASE WHEN adiSort_Code_0 = 12 THEN 1 ELSE 0 END) AS Destination_Disabled_count,
SUM(CASE WHEN adiSort_Code_0 = 13 THEN 1 ELSE 0 END) AS Throughput_Limit_count,
SUM(CASE WHEN adiSort_Code_0 = 14 THEN 1 ELSE 0 END) AS Failed_To_Divert_count,
SUM(CASE WHEN adiSort_Code_0 = 16 THEN 1 ELSE 0 END) AS No_Destination_Received_count,
SUM(CASE WHEN adiSort_Code_0 = 17 THEN 1 ELSE 0 END) AS Lost_Container_count,
SUM(CASE WHEN adiSort_Code_0 = 18 THEN 1 ELSE 0 END) AS Dimension_Error_count,
SUM(CASE WHEN adiSort_Code_0 = 19 THEN 1 ELSE 0 END) AS Weight_Error_count,
SUM(CASE WHEN adiSort_Code_0 = 20 THEN 1 ELSE 0 END) AS Container_Utilization_count,
SUM(CASE WHEN adiSort_Code_0 = 21 THEN 1 ELSE 0 END) AS Unable_To_Divert_count,
SUM(CASE WHEN adiSort_Code_0 = 22 THEN 1 ELSE 0 END) AS Destination_Not_Attempted_count,
COUNT(*) AS total,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Success_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 1 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Unknown_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 2 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Unexpected_Container_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 3 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Tracking_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 4 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Gap_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Full_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 6 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Non_Operational_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 7 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Invalid_Destination_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 IN (8, 9, 10) THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Scanner_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 12 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Disabled_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 13 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Throughput_Limit_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 14 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Failed_To_Divert_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 16 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS No_Destination_Received_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 17 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Lost_Container_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 18 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Dimension_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 19 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Weight_Error_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 20 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Container_Utilization_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 21 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Unable_To_Divert_pct,
CASE WHEN COUNT(*) = 0 THEN 0 ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 22 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2) END AS Destination_Not_Attempted_pct
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
GROUP BY sActual_Dest_ID
) AS c ON 1=1;

View File

@ -1,200 +0,0 @@
{
"custom": {
"state": {
"$": [
"ds",
192,
1766054596663
],
"$columns": [
{
"data": [
"MCM01",
"MCM01"
],
"name": "Location",
"type": "String"
},
{
"data": [
"High",
"Medium"
],
"name": "Priority",
"type": "String"
},
{
"data": [
2,
1
],
"name": "Count",
"type": "Integer"
}
]
},
"status": ""
},
"params": {
"value": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"type": "tag"
},
"onChange": {
"enabled": null,
"script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\tif not queryData:\n\t self.custom.status \u003d \"\"\n\t\n\t# Define priority order from highest to lowest\n\tpriority_order \u003d [\"Critical\", \"High\", \"Medium\", \"Low\", \"Diagnostic\"]\n\texisting_priorities \u003d set()\n\tmyPriority \u003d \"\"\n\t\n\t# Populate the set\n\tfor row in range(queryData.rowCount):\n\t mcm_val \u003d queryData.getValueAt(row, 0)\n\t severity \u003d queryData.getValueAt(row, 1).capitalize()\n\t count \u003d queryData.getValueAt(row, 2)\n\t\n\t if mcm_val \u003d\u003d MCM and count \u003e 0:\n\t existing_priorities.add(severity)\n\t\n\t# Find the highest one that exists\n\tfor priority in priority_order:\n\t if priority in existing_priorities:\n\t myPriority \u003d priority\n\t break\n\t\n\tself.custom.status \u003d myPriority"
},
"persistent": true
},
"custom.status": {
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.navigate(self.view.params.value.tagProps[0])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Label"
},
"position": {
"grow": 1
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.status"
},
"transforms": [
{
"fallback": "State-Styles/Background-Fill/State5",
"inputType": "scalar",
"mappings": [
{
"input": "High",
"output": "State-Styles/Background-Fill/State1"
},
{
"input": "Medium",
"output": "State-Styles/Background-Fill/State2"
},
{
"input": "Low",
"output": "State-Styles/Background-Fill/State3"
},
{
"input": "Diagnostic",
"output": "State-Styles/Background-Fill/State4"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.status"
},
"transforms": [
{
"fallback": "HEALTHY",
"inputType": "scalar",
"mappings": [
{
"input": "Diagnostic",
"output": "DIAGNOSTIC"
},
{
"input": "Low",
"output": "HALF WORKFLOW"
},
{
"input": "Medium",
"output": "CONTROLLED STOP"
},
{
"input": "High",
"output": "UNCONTROLLED STOP"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"borderColor": "#555555",
"borderStyle": "none",
"cursor": "pointer",
"fontSize": 12,
"marginBottom": 8,
"marginTop": 8,
"textAlign": "center"
},
"textStyle": {
"fontSize": 12,
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,97 @@
{
"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"
}
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,17 @@
{
"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"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,732 @@
{
"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

@ -0,0 +1,46 @@
WITH SORTERS AS (
SELECT
DATE_FORMAT(MIN(s04_timestamp), "%Y-%m-%d %H:00") AS start_timestamp,
CONCAT("H",
CAST(
TIMESTAMPDIFF(
HOUR,
DATE_FORMAT(MIN(s04_timestamp), "%Y-%m-%d %H:00:00"),
DATE_FORMAT(LEAST(CURRENT_TIMESTAMP(), :endDate), "%Y-%m-%d %H:00:00")
) AS CHAR
)
) AS hour,
COUNT(*) AS total,
SUM(sort_code="Success") AS success,
SUM(sort_code IN ("Dest Invalid", "Dest None", "Underutilized")) AS awcs,
SUM(sort_code IN ("Dest Disabled", "Dest Full", "Dim Error", "Unexpected", "Weight Err")) AS operational,
SUM(sort_code IN ("Dest Fault", "Div Fail", "Gap Err", "Lost", "Rate High", "Track Err", "Unknown", "Unsafe")) AS machine,
SUM(sort_code IN ("No Read", "No Code", "Multi Label")) AS scanner
FROM package_history
WHERE s04_timestamp BETWEEN :startDate AND :endDate
AND sorter=:sorter
GROUP BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:00")
)
SELECT
start_timestamp AS time,
hour,
/* Counts: */
success AS success_count,
awcs AS awcs_issues_count,
operational AS operational_issues_count,
machine AS machine_issues_count,
scanner AS scanner_issues_count,
/* PPH: */
success AS success_pph,
awcs AS awcs_issues_pph,
operational AS operational_issues_pph,
machine AS machine_issues_pph,
scanner AS scanner_issues_pph,
/* Percents: */
ROUND(success/total, 4) AS success_percent,
ROUND(awcs/total, 4) AS awcs_issues_percent,
ROUND(operational/total, 4) AS operational_issues_percent,
ROUND(machine/total, 4) AS machine_issues_percent,
ROUND(scanner/total, 4) AS scanner_issues_percent
FROM SORTERS
ORDER BY start_timestamp;

View File

@ -0,0 +1,393 @@
{
"custom": {},
"params": {
"enableTooltip": true,
"label": null,
"tagPath": "",
"tagPathControl": "",
"view": ""
},
"propConfig": {
"params.enableTooltip": {
"paramDirection": "input",
"persistent": true
},
"params.label": {
"paramDirection": "input",
"persistent": true
},
"params.tagPath": {
"paramDirection": "input",
"persistent": true
},
"params.tagPathControl": {
"paramDirection": "input",
"persistent": true
},
"params.view": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 40,
"width": 135
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openWindow()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Status"
},
"position": {
"height": "100%",
"width": "100%"
},
"propConfig": {
"props.style.backgroundColor": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}.jsonValues"
},
"transforms": [
{
"expression": "try(\r\n\tif(jsonGet({value}, \"Estop_Active\") \u0026\u0026 {[default]Gateway/ToggleTag},\r\n\t\t\"#F00\",\t\t// Estop\r\n\t\tif(jsonGet({value}, \"bStarted\"),\r\n\t\t\t\"#0F0\",\t// Running\r\n\t\t\t\"#AAA\"\t// Stopped\r\n\t\t)\r\n\t),\r\n\t\"#808080\" // Unknown\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"borderColor": "#000",
"borderStyle": "solid",
"borderWidth": 1
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openWindow()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Text"
},
"position": {
"height": "calc(100% - 10px)",
"width": "calc(100% - 10px)",
"x": 5,
"y": 5
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/Parameters.LabelFull"
},
"transforms": [
{
"expression": "coalesce({view.params.label}, {value}, \"Unknown\")",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"backgroundColor": "#FFF",
"borderColor": "#000",
"borderStyle": "solid",
"borderWidth": 1,
"fontSize": "12px",
"fontWeight": "bold",
"overflow": "hidden",
"paddingLeft": "5px",
"textOverflow": "ellipsis",
"textTransform": "uppercase",
"user-select": "none",
"whiteSpace": "nowrap"
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openWindow()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "TooltipOverlay"
},
"position": {
"height": "100%",
"width": "100%"
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"path": "view.params.enableTooltip"
},
"type": "property"
}
},
"props.status.tooltip": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/Graphics"
},
"transforms": [
{
"expression": "if(isGood({value}),\r\n\tjsonGet({value}, \"tooltip\"),\r\n\t\"Tooltip not configured\"\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"status": {}
},
"type": "dex.display.tooltipoverlay"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPath \u003d self.view.params.tagPathControl\n\tif tagPath \u003c\u003e \"\":\n\t\ttags \u003d [tagPath + \"/SetStart\"]\n\t\tvalues \u003d [1]\n\t\tsystem.tag.writeAsync(tags, values)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Start"
},
"position": {
"height": 25,
"width": 25,
"x": "calc(100% - 60px)",
"y": "calc(50% - 12.5px)"
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPathControl": "{view.params.tagPathControl}"
},
"tagPath": "{tagPathControl}/SetStart"
},
"transforms": [
{
"expression": "isGood({value})",
"type": "expression"
}
],
"type": "tag"
}
},
"props.textStyle.color": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPathControl": "{view.params.tagPathControl}"
},
"tagPath": "{tagPathControl}/Alarms/bStarted"
},
"transforms": [
{
"expression": "coalesce({value}, false)",
"type": "expression"
},
{
"fallback": "#888888",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#32CD32"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"classes": "Buttons/Grey"
},
"text": "►",
"textStyle": {
"fontFamily": "Arial",
"fontSize": "14px"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPath \u003d self.view.params.tagPathControl\n\tif tagPath \u003c\u003e \"\":\n\t\ttags \u003d [tagPath + \"/SetStop\"]\n\t\tvalues \u003d [1]\n\t\tsystem.tag.writeAsync(tags, values)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Stop"
},
"position": {
"height": 25,
"width": 25,
"x": "calc(100% - 32.5px)",
"y": "calc(50% - 12.5px)"
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPathControl": "{view.params.tagPathControl}"
},
"tagPath": "{tagPathControl}/SetStop"
},
"transforms": [
{
"expression": "isGood({value})",
"type": "expression"
}
],
"type": "tag"
}
},
"props.textStyle.color": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPathControl": "{view.params.tagPathControl}"
},
"tagPath": "{tagPathControl}/Alarms/bStarted"
},
"transforms": [
{
"expression": "coalesce({value}, true)",
"type": "expression"
},
{
"fallback": "#888888",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"classes": "Buttons/Grey"
},
"text": "■",
"textStyle": {
"fontFamily": "monospace",
"fontSize": "14px"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"props": {
"style": {
"cursor": "pointer"
}
},
"scripts": {
"customMethods": [
{
"name": "openWindow",
"params": [],
"script": "\tview \u003d self.view.params.view\n\tif view in [\"\", None]:\n\t\tview \u003d \"Windows/Graphics/\"+self.getChild(\"Text\").props.text.replace(\" \", \"_\")\n\t# Open window:\n\twindow \u003d \"Windows/GraphicsWrapper\"\n\tparams \u003d {\"view\": view}\n\tsystem.perspective.navigate(\"/\")\n\tsystem.perspective.navigate(view\u003dwindow, params\u003dparams)"
}
],
"messageHandlers": []
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,17 @@
{
"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

@ -0,0 +1,327 @@
{
"custom": {},
"params": {
"meta": {
"name": "S1-CH1"
},
"props": {
"config": {
"alwaysShowAll": true,
"isClickable": false,
"isRightOfSorter": false,
"mirror": false
},
"status": {
"tagPath": "[default]MCP03/S01/S01_CH01"
}
}
},
"propConfig": {
"params.meta": {
"paramDirection": "input",
"persistent": true
},
"params.meta.name": {
"paramDirection": "input",
"persistent": true
},
"params.props": {
"paramDirection": "input",
"persistent": true
},
"params.props.config.alwaysShowAll": {
"paramDirection": "input",
"persistent": true
},
"params.props.config.isRightOfSorter": {
"paramDirection": "input",
"persistent": true
},
"params.props.config.mirror": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 349,
"width": 500
}
},
"root": {
"children": [
{
"meta": {
"name": "ChuteLabel"
},
"position": {
"height": 30,
"width": 100,
"x": 198,
"y": 298.8
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.props.status.tagPath"
},
"transforms": [
{
"code": "\treturn utils.prettyName(value.split(\"/\")[-1])",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"fontSize": "20px",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Chute"
},
"position": {
"height": 20,
"width": 60,
"x": 220,
"y": 195
},
"propConfig": {
"props.params": {
"binding": {
"config": {
"struct": {
"alwaysShowAll": true,
"isClickable": false,
"isRightOfSorter": "{view.params.props.config.isRightOfSorter}",
"mirror": "{view.params.props.config.mirror}",
"tagPath": "{view.params.props.status.tagPath}"
},
"waitOnAll": true
},
"type": "expr-struct"
}
}
},
"props": {
"path": "Templates/Areas/FlexChute",
"style": {
"transform": "scale(3) rotate(90deg)"
}
},
"type": "ia.display.view"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPath \u003d self.view.params.props.status.tagPath\n\ttags \u003d [tagPath + \"/CH/SetEnable\"]\n\tvalues \u003d [1]\n\tsystem.tag.writeAsync(tags, values)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Enable"
},
"position": {
"height": 40,
"width": 120,
"x": 120,
"y": 20.3
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.props.status.tagPath}"
},
"tagPath": "{tagPath}/CH/SetEnable"
},
"enabled": false,
"transforms": [
{
"expression": "isGood({value})",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.classes": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.props.status.tagPath}"
},
"tagPath": "{tagPath}/CH/SetEnable"
},
"transforms": [
{
"fallback": "Buttons/Grey",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Buttons/Green"
}
],
"outputType": "scalar",
"type": "map"
},
{
"expression": "if(isGood({value}),\r\n\t{value},\r\n\t\"Buttons/Grey\"\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"style": {},
"text": "Enable"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPath \u003d self.view.params.props.status.tagPath\n\ttags \u003d [tagPath + \"/CH/SetEnable\"]\n\tvalues \u003d [0]\n\tsystem.tag.writeAsync(tags, values)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Disable"
},
"position": {
"height": 40,
"width": 120,
"x": 260,
"y": 20.3
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.props.status.tagPath}"
},
"tagPath": "{tagPath}/CH/SetEnable"
},
"enabled": false,
"transforms": [
{
"expression": "isGood({value})",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.classes": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.props.status.tagPath}"
},
"tagPath": "{tagPath}/CH/SetEnable"
},
"transforms": [
{
"fallback": "Buttons/Grey",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "Buttons/Red"
}
],
"outputType": "scalar",
"type": "map"
},
{
"expression": "if(isGood({value}),\r\n\t{value},\r\n\t\"Buttons/Grey\"\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"style": {},
"text": "Disable"
},
"type": "ia.input.button"
},
{
"meta": {
"name": "ChuteLabel_0"
},
"position": {
"height": 35,
"width": 260,
"x": 120,
"y": 63
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.props.status.tagPath}"
},
"tagPath": "{tagPath}/CH/StatusText"
},
"type": "tag"
}
}
},
"props": {
"style": {
"fontSize": "20px",
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"style": {
"background-color": "#CFCFCF"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,33 @@
{
"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)"
}
}
}
}
]
}

View File

@ -0,0 +1,275 @@
{
"custom": {
"plc": "value",
"searchId": "value",
"state": 0,
"string": "Idle"
},
"params": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.plc": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"expression": "split({value}, \"/\")[0]",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 1,
"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": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
},
{
"input": 4,
"output": 4
},
{
"input": 5,
"output": 5
},
{
"input": 6,
"output": 6
},
{
"input": 7,
"output": 7
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "Idle"
},
{
"input": 1,
"output": "Actuated"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 30,
"width": 30
}
},
"root": {
"children": [
{
"meta": {
"name": "EPC"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_epc"
},
"type": "property"
}
},
"props.elements[2].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#00FF00",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"fill": {
"paint": "#FFFF00"
},
"height": "20",
"name": "rect",
"type": "rect",
"width": "20",
"x": "0",
"y": "0"
},
{
"d": "M 0,0 H 20 V 20 H 0 Z",
"fill": {
"paint": "transparent"
},
"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-EPC\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
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_epc"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

File diff suppressed because it is too large Load Diff

View File

@ -1,322 +0,0 @@
{
"custom": {
"beacon": false,
"flashingColor": "#808080",
"solidColor": "#FF8C00",
"state": "Offline"
},
"params": {
"demoColor": false,
"tagProps": [
"System/MCM02/Beacon/NCS1_1_BCN1_A",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.beacon": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Beacon"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.demoColor})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.flashingColor": {
"binding": {
"config": {
"path": "view.custom.beacon"
},
"transforms": [
{
"code": "\t\n\tif value \u003d\u003d 0:\n\t\treturn \"#808080\" # Normal OFF\n\t\n\treturn self.custom.solidColor # Normal ON\n",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"custom.solidColor": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"transforms": [
{
"expression": "coalesce({value}, \"S\")\r\n",
"type": "expression"
},
{
"code": "\treturn value[-1]",
"type": "script"
},
{
"fallback": "#808080",
"inputType": "scalar",
"mappings": [
{
"input": "R",
"output": "#FF0000"
},
{
"input": "G",
"output": "#47FF47"
},
{
"input": "B",
"output": "#0000FF"
},
{
"input": "A",
"output": "#FF8C00"
},
{
"input": "H",
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "expr"
},
"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},-1)",
"type": "expression"
},
{
"fallback": "Offline",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "OFF"
},
{
"input": 1,
"output": "SOLID"
},
{
"input": 2,
"output": "FLASHING"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.demoColor": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 20
}
},
"root": {
"children": [
{
"meta": {
"name": "BCN"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.flashingColor"
},
"type": "property"
}
},
"props.elements[1].text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"code": "\treturn value[-1]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"fill": {},
"height": "47.417244",
"id": "beaconSquare",
"name": "beaconSquare",
"stroke": {
"paint": "#000000",
"width": "2.36887"
},
"type": "rect",
"width": "47.337795",
"x": "1.450278",
"y": "1.3708278"
},
{
"fill": {
"paint": "#000"
},
"fontSize": "29.5834px",
"id": "beaconLabel",
"name": "beaconLabel",
"stroke": {
"width": "1.64352"
},
"style": {
"classes": "",
"fontSize": "30px",
"textAnchor": "middle"
},
"type": "text",
"x": 26.11241,
"y": 35.09856
}
],
"viewBox": "0 0 50 50"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\t#create tags lists for the device\n\tsystem.perspective.closeDock(\"Docked-East-Conv\")\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":\"\"} )"
},
"preventDefault": true,
"scope": "G",
"stopPropagation": true,
"type": "script"
},
"onMouseEnter": {
"config": {
"draggable": false,
"id": "LZ5nPg42{view.params.tagProps[0]}",
"modal": false,
"overlayDismiss": false,
"position": {
"relativeLocation": "top-right"
},
"positionType": "relative",
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewParams": {
"text": "{/root.meta.tooltip.text}"
},
"viewPath": "autStand/Custom_Views/Tooltip",
"viewportBound": false
},
"scope": "C",
"type": "popup"
},
"onMouseLeave": {
"config": {
"draggable": true,
"id": "LZ5nPg42{view.params.tagProps[0]}",
"modal": false,
"overlayDismiss": false,
"resizable": true,
"showCloseIcon": true,
"type": "close",
"viewPath": "autStand/Custom_Views/Tooltip",
"viewportBound": false
},
"scope": "C",
"type": "popup"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.state} !\u003d \"Offline\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_beacons"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer",
"overflow": "visible",
"userSelect": "None"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,12 @@
{
"base": {
"style": {
"color": "#8E8E8E",
"fontSize": "12px",
"fontWeight": "300",
"lineHeight": "16px",
"marginRight": "10px",
"textTransform": "uppercase"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -1,495 +0,0 @@
{
"custom": {},
"params": {
"Status": "",
"tagProps": [
"MCM02",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"params.Status": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 212,
"width": 336
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "400px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.MCM"
},
"type": "property"
}
}
},
"props": {
"style": {
"textIndent": "10px"
},
"textStyle": {
"textIndent": "10px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "JAM",
"tooltip": {
"enabled": true,
"text": "Jams"
}
},
"position": {
"basis": "24px",
"shrink": 0
},
"props": {
"path": "autStand/Equipment/JAM",
"style": {
"marginRight": "5px"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "10px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.totalJams"
},
"type": "property"
}
}
},
"props": {
"style": {
"marginRight": "20px",
"overflow": "visible",
"textAlign": "end"
},
"textStyle": {
"textAlign": "end"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "60px"
},
"props": {
"style": {
"backgroundColor": "#555555"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"fontFamily": "Roboto",
"fontSize": 12,
"marginLeft": 10
},
"text": "AREA",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "195px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.area_display"
},
"type": "property"
}
}
},
"props": {
"style": {
"fontSize": 12,
"marginLeft": 50
},
"textStyle": {
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5,
"borderLeftColor": "#555555",
"borderLeftStyle": "none",
"borderLeftWidth": 0.5,
"borderRightColor": "#555555",
"borderRightStyle": "none",
"borderRightWidth": 0.5,
"borderTopColor": "#555555",
"borderTopStyle": "solid",
"borderTopWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"fontFamily": "Roboto",
"fontSize": 12,
"marginLeft": 10
},
"text": "STATUS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "200px"
},
"propConfig": {
"props.params.value.tagProps[0]": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"params": {
"value": {
"tagProps": [
null,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"path": "autStand/Equipment/Controller-Views/CommandControlStatus"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "80px"
},
"props": {
"justify": "space-around",
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "25px"
},
"propConfig": {
"props.color": {
"binding": {
"config": {
"path": "/root.custom.counts"
},
"enabled": false,
"type": "property"
}
}
},
"props": {
"color": "#FFF9F9",
"path": "material/notifications_active",
"style": {
"classes": "",
"marginLeft": 10
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "100px"
},
"props": {
"style": {
"fontFamily": "Roboto",
"fontSize": 12,
"marginLeft": 10
},
"text": "ACTIVE ALARMS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_3"
},
"position": {
"basis": "80px"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.value.tagProps[0]": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"params": {
"classes": "Text-Styles/Ariel-Bold-White-12pt",
"value": {
"tagProps": [
null,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"path": "autStand/Equipment/Controller-Views/CommandControlAlarms"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "FlexContainer_2"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"marginBottom": 5,
"marginLeft": 10,
"marginRight": 10
}
},
"type": "ia.container.flex"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\n\tpage \u003d self.view.params.tagProps[0]\n\t\n\tsystem.perspective.navigate(\"/\"+ page)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.MCM": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"type": "property"
}
},
"custom.area_display": {
"binding": {
"config": {
"expression": "jsonGet({this.custom.plc_dict}, \"Area\")"
},
"type": "expr"
}
},
"custom.plc_dict": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"transforms": [
{
"expression": "jsonGet({value}, {view.params.tagProps[0]})",
"type": "expression"
}
],
"type": "tag"
}
},
"custom.totalJams": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsTable"
},
"transforms": [
{
"code": "\t# value is a dataset returned from your SQL query\n\tfrom java.util import HashSet\n\t\n\tunique_devices \u003d HashSet()\n\t\n\t# iterate rows\n\tfor rowIndex in range(value.getRowCount()):\n\t device \u003d value.getValueAt(rowIndex, \"Description\")\n\t tag \u003d value.getValueAt(rowIndex, \"Tag\")\n\t location \u003d value.getValueAt(rowIndex, \"Location\")\n\t\n\t # match for TPE devices that are jammed and match MCM area\n\t if (\n\t device\n\t and tag\n\t and \"TPE\" in str(device)\n\t and \"Jammed\" in str(tag)\n\t and str(location) \u003d\u003d str(self.custom.MCM)\n\t ):\n\t unique_devices.add(device)\n\t\n\t# return total unique jammed device count\n\treturn unique_devices.size()",
"type": "script"
}
],
"type": "tag"
}
},
"meta.visible": {
"binding": {
"config": {
"expression": "if({session.custom.covert} \u003d False \u0026\u0026 {this.custom.status} \u003d 5, False, True)"
},
"type": "expr"
}
}
},
"props": {
"direction": "column",
"style": {
"animationFillMode": "both",
"borderBottomLeftRadius": 10,
"borderBottomRightRadius": 10,
"borderColor": "#555555",
"borderStyle": "solid",
"borderTopLeftRadius": 10,
"borderTopRightRadius": 10,
"borderWidth": 1,
"box-shadow": "5px 5px 5px grey",
"classes": "Background-Styles/Controller",
"cursor": "pointer"
}
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View File

@ -0,0 +1,51 @@
def handleTagHighlight(view, currentValue):
tag_priority = currentValue.value
if tag_priority == None:
return
parts = str(tag_priority).split("||")
tag = parts[0]
splitedTag = tag.split("/")
deviceName = splitedTag[-1]
Docked_East_Map = {
"VFD" : "Docked-East-VFD",
"MCM" : "Docked-East-MCM"
}
Docked_East_View = Docked_East_Map["VFD"]
if "PE" in deviceName:
tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1"
if "MCM" in deviceName:
Docked_East_View = Docked_East_Map["MCM"]
components = view.rootContainer.getChildren()
priority = parts[1]
foundMatch = False
# clear all highlights and apply new one when found
for child in components:
params = child.props.get("params", {})
tagProps = params.get("tagProps", {})
tagsList = list(tagProps)
if len(tagsList) == 0:
continue
child.props.style.classes = ""
tagPath = tagsList[0]
if tag == tagPath:
child.props.style["classes"] = "Highlight/Pulse-" + priority
system.perspective.openDock(Docked_East_View, params={'tagProps': tagProps})
foundMatch = True
return foundMatch

View File

@ -0,0 +1,908 @@
{
"custom": {},
"params": {
"alwaysShowAll": false,
"isClickable": true,
"isRightOfSorter": false,
"mirror": false,
"tagPath": "[default]MCP20/SO01/So01_CH01"
},
"propConfig": {
"params.alwaysShowAll": {
"paramDirection": "input",
"persistent": true
},
"params.isClickable": {
"paramDirection": "input",
"persistent": true
},
"params.isRightOfSorter": {
"paramDirection": "input",
"persistent": true
},
"params.mirror": {
"paramDirection": "input",
"persistent": true
},
"params.tagPath": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 60
},
"loading": {
"mode": "blocking"
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openPopup()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Conveyor"
},
"position": {
"height": 20,
"width": 38,
"x": 22
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/CH/IsChuteMode"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "coalesce({value}, true)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"enableHighlight": false,
"isClickable": false,
"showLabel": false,
"type": "bar"
},
"status": {
"color": "#FFF"
}
},
"type": "dex.display.conveyor"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openPopup()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Gaylord"
},
"position": {
"height": 16,
"width": 16,
"x": 22,
"y": 2
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"expression": "try( tag({view.params.tagPath}+\"/CH/IsCartMode\")\r\n\t||tag({view.params.tagPath}+\"/CH/IsGLLMode\"),\r\n\ttrue\r\n)"
},
"type": "expr"
}
}
},
"props": {
"config": {
"enableHighlight": false,
"isClickable": false
}
},
"type": "dex.display.gaylord"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openPopup()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Chute"
},
"position": {
"height": 20,
"rotate": {
"anchor": "0 0"
},
"width": 23
},
"propConfig": {
"props.config.isClickable": {
"binding": {
"config": {
"expression": "!{view.params.isClickable}"
},
"type": "expr"
}
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/CH/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"showLabel": false
}
},
"type": "dex.display.conveyor"
},
{
"meta": {
"name": "LS1"
},
"position": {
"height": 6,
"width": 6,
"x": 19,
"y": 14
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/LS1/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR Presence)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"showLabel": false
}
},
"type": "dex.display.limitswitch"
},
{
"meta": {
"name": "BCN1_GRN"
},
"position": {
"height": 5,
"rotate": {
"angle": "-90deg"
},
"width": 5,
"x": 5,
"y": 15
},
"propConfig": {
"position.x": {
"binding": {
"config": {
"expression": "if({../BCN1_AMB.meta.visible}, 10, 5)"
},
"type": "expr"
},
"persistent": true
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/GRN/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(-1, 1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"type": "dex.display.beacon"
},
{
"meta": {
"name": "BCN1_AMB",
"visible": false
},
"position": {
"height": 5,
"rotate": {
"angle": "-90deg"
},
"width": 5,
"x": 5,
"y": 15
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/AMB/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "isGood({value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/AMB/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(-1, 1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"type": "dex.display.beacon"
},
{
"meta": {
"name": "BCN1_BLU"
},
"position": {
"height": 5,
"rotate": {
"angle": "-90deg"
},
"width": 5,
"y": 15
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/BLU/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(-1, 1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"type": "dex.display.beacon"
},
{
"meta": {
"name": "GS1_ENABLE"
},
"position": {
"height": 6,
"width": 6,
"x": 38,
"y": 14
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/GS1/Enable/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"type": "dex.display.pushbutton"
},
{
"meta": {
"name": "PE3"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%"
},
"width": 8,
"x": 3,
"y": 2
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE3/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GL 100% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE4"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%",
"angle": "-45deg"
},
"width": 8,
"x": 5,
"y": 10
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE4/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GL Presence)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE2"
},
"position": {
"height": 6,
"width": 28,
"x": 13,
"y": 7
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE2/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR 50% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE1B"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%"
},
"width": 20,
"x": 15
},
"propConfig": {
"position.rotate.angle": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": "-45deg",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "45deg"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"position.y": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": 14,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": 0
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE1B/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR 100% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE1A"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%"
},
"width": 20,
"x": 15
},
"propConfig": {
"position.rotate.angle": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": "45deg",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "-45deg"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"position.y": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": 14
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE1A/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR 100% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "RS1_RESTART"
},
"position": {
"height": 6,
"width": 6,
"x": 44,
"y": 14
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/RS1/Restart/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"type": "dex.display.pushbutton"
},
{
"meta": {
"name": "FIO1"
},
"position": {
"height": 5,
"width": 10,
"x": 50,
"y": 15
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/FIO1/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"type": "dex.display.eip"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(1, -1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"overflow": "hidden"
}
},
"scripts": {
"customMethods": [
{
"name": "openPopup",
"params": [],
"script": "\tif self.view.params.isClickable:\n\t\tid \u003d \"FlexChute|\" + self.view.params.tagPath\n\t\ttitle \u003d utils.prettyName(self.view.params.tagPath.split(\"/\")[-1])\n\t\tparams \u003d { \n\t\t\t\"deviceType\": \"chutedestination\",\n\t\t\t\"props\": { \n\t\t\t\t\"config\": {\n\t\t\t\t\t\"alwaysShowAll\": self.view.params.alwaysShowAll,\n\t\t\t\t\t\"isClickable\": self.view.params.isClickable,\n\t\t\t\t\t\"isRightOfSorter\": self.view.params.isRightOfSorter,\n\t\t\t\t\t\"mirror\": self.view.params.mirror\n\t\t\t\t},\n\t\t\t\t\"status\": {\n\t\t\t\t\t\"tagPath\": self.view.params.tagPath\n\t\t\t\t}\n\t\t \t},\n\t\t \t\"tabs\": [\"Controls\", \"Alarm History\", \"Devices\"]\t\t\n\t\t}\n\t\tsystem.perspective.openPopup(id, \"Popups/DeviceWrapper\", params, title, resizable \u003d True)"
}
],
"extensionFunctions": null,
"messageHandlers": []
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

View File

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

View File

@ -0,0 +1,32 @@
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

@ -0,0 +1,656 @@
{
"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

@ -0,0 +1,447 @@
{
"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

@ -0,0 +1,773 @@
{
"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

@ -0,0 +1,63 @@
################################################################
################################################################
## Version: 1.0 / Author: Dillon Uzar
##
## DESC: For use in WCS Sorting Lane Lookup & Recording
## WARN: Modifying code may cause system to function incorrectly
################################################################
################################################################
import time
#######################################################
#######################################################
#######################################################
#### Constants
#######################################################
# Logger:
LOG = system.util.logger("PE BreakCount Handler")
# For inserting data into database:
CONFIRM_INSERT_QUERY = "INSERT IGNORE INTO pe_history (lane_id,count) VALUES (?,?)"
#######################################################
#######################################################
#######################################################
#### Parsing Utils
#######################################################
def logTime(title, trackID, seconds):
millisec = round(seconds * 1000, 1)
if millisec > 4:
LOG.info("%s[ID=%s] took longer than expected (%sms to process)" % (title, trackID, millisec))
#######################################################
#######################################################
#######################################################
#### PLC Event Handling
#######################################################
def processBreak(laneID, count):
# This function handles confirm events, and logs the event in SQL
# Ensure ID is valid
if count > 0:
start_time = time.time()
# Log confirm event in SQL:
# Insert into Package History:
system.db.runPrepUpdate(CONFIRM_INSERT_QUERY, [laneID, count])
logTime("PE_BREAK[DB_INSERT]", laneID, time.time() - start_time)
def processBreakAsync(laneID, count):
# This function handles confirm events, and logs the event in SQL
# Ensure ID is valid
if count > 0:
def processConfirmInner():
start_time = time.time()
# Log confirm event in SQL:
# Insert into Package History:
system.db.runPrepUpdate(CONFIRM_INSERT_QUERY, [laneID, count])
logTime("PE_BREAK[DB_INSERT]", laneID, time.time() - start_time)
system.util.invokeAsynchronous(processConfirmInner)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
{
"base": {
"style": {
"borderBottomColor": "var(--neutral-30)",
"borderBottomStyle": "solid",
"borderBottomWidth": "1px"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,19 @@
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

@ -0,0 +1,141 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "Image"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.source": {
"binding": {
"config": {
"expression": "\"http://127.0.0.1:5500/VFD.svg?var\" + toMillis(now(1000))"
},
"type": "expr"
}
}
},
"props": {
"fit": {
"mode": "fill"
}
},
"type": "ia.display.image"
},
{
"meta": {
"name": "UL1_3_JR_PB1"
},
"position": {
"height": 0.1648,
"width": 0.0964,
"x": 0.0719,
"y": 0.1736
},
"props": {
"params": {
"forceFaultStatus": null,
"tagProps": [
"System/MCM01/Station/JR/UL1_3_JR_PB1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "Symbol-Views/Equipment-Views/JR_Button"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL1_3_JR_PB2"
},
"position": {
"height": 0.1648,
"width": 0.0964,
"x": 0.0719,
"y": 0.6255
},
"props": {
"params": {
"forceFaultStatus": null,
"tagProps": [
"System/MCM01/Station/JR/UL1_3_JR_PB2",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "Symbol-Views/Equipment-Views/JR_Button"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL1_3_VFD1"
},
"position": {
"height": 0.2333,
"width": 0.1224,
"x": 0.427,
"y": 0.367
},
"props": {
"params": {
"directionLeft": false,
"forceFaultStatus": null,
"forceRunningStatus": null,
"tagProps": [
"/System/MCM01/Conveyor/VFD/UL1_3_VFD1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "Symbol-Views/Equipment-Views/Status"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#FFFFFF"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1,84 +0,0 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 498,
"width": 599
}
},
"root": {
"children": [
{
"meta": {
"name": "Runout"
},
"position": {
"height": 408,
"width": 563,
"x": -62,
"y": -9
},
"props": {
"path": "Windows/Graphics/Templates/Runout",
"style": {
"classes": "painted-events"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "NavButton_HSS_Sorter"
},
"position": {
"height": 40,
"width": 95,
"x": 278.5,
"y": 67
},
"props": {
"params": {
"enableTooltip": true,
"label": null,
"tagPath": "[default]HSSSorterStatus",
"view": ""
},
"path": "Templates/Buttons/NavButton",
"style": {
"transform": "scale(2)"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "NavButton_OXD_Sorter"
},
"position": {
"height": 40,
"width": 97,
"x": 78.5,
"y": 247
},
"props": {
"params": {
"enableTooltip": true,
"label": null,
"tagPath": "[default]OXDSorterStatus",
"view": ""
},
"path": "Templates/Buttons/NavButton",
"style": {
"transform": "scale(2)"
}
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,907 @@
{
"custom": {},
"params": {
"alwaysShowAll": false,
"isClickable": true,
"isRightOfSorter": false,
"mirror": false,
"tagPath": "[default]MCP20/SO01/So01_CH01"
},
"propConfig": {
"params.alwaysShowAll": {
"paramDirection": "input",
"persistent": true
},
"params.isClickable": {
"paramDirection": "input",
"persistent": true
},
"params.isRightOfSorter": {
"paramDirection": "input",
"persistent": true
},
"params.mirror": {
"paramDirection": "input",
"persistent": true
},
"params.tagPath": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 60
},
"loading": {
"mode": "blocking"
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openPopup()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Conveyor"
},
"position": {
"height": 20,
"width": 38,
"x": 22
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/CH/IsChuteMode"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "coalesce({value}, true)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"enableHighlight": false,
"isClickable": false,
"showLabel": false,
"type": "bar"
},
"status": {
"color": "#FFF"
}
},
"type": "dex.display.conveyor"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openPopup()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Gaylord"
},
"position": {
"height": 16,
"width": 16,
"x": 22,
"y": 2
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"expression": "try( tag({view.params.tagPath}+\"/CH/IsCartMode\")\r\n\t||tag({view.params.tagPath}+\"/CH/IsGLLMode\"),\r\n\ttrue\r\n)"
},
"type": "expr"
}
}
},
"props": {
"config": {
"enableHighlight": false,
"isClickable": false
}
},
"type": "dex.display.gaylord"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.parent.openPopup()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Chute"
},
"position": {
"height": 20,
"rotate": {
"anchor": "0 0"
},
"width": 23
},
"propConfig": {
"props.config.isClickable": {
"binding": {
"config": {
"expression": "!{view.params.isClickable}"
},
"type": "expr"
}
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/CH/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"showLabel": false
}
},
"type": "dex.display.conveyor"
},
{
"meta": {
"name": "LS1"
},
"position": {
"height": 6,
"width": 6,
"x": 19,
"y": 14
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/LS1/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR Presence)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"showLabel": false
}
},
"type": "dex.display.limitswitch"
},
{
"meta": {
"name": "BCN1_GRN"
},
"position": {
"height": 5,
"rotate": {
"angle": "-90deg"
},
"width": 5,
"x": 10,
"y": 15
},
"propConfig": {
"position.x": {
"binding": {
"config": {
"expression": "if({../BCN1_AMB.meta.visible}, 10, 5)"
},
"type": "expr"
},
"persistent": true
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/GRN/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(-1, 1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"type": "dex.display.beacon"
},
{
"meta": {
"name": "BCN1_AMB"
},
"position": {
"height": 5,
"rotate": {
"angle": "-90deg"
},
"width": 5,
"x": 5,
"y": 15
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/AMB/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "isGood({value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/AMB/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(-1, 1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"type": "dex.display.beacon"
},
{
"meta": {
"name": "BCN1_BLU"
},
"position": {
"height": 5,
"rotate": {
"angle": "-90deg"
},
"width": 5,
"y": 15
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/BCN1/BLU/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
},
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(-1, 1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"type": "dex.display.beacon"
},
{
"meta": {
"name": "GS1_ENABLE"
},
"position": {
"height": 6,
"width": 6,
"x": 38,
"y": 14
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/GS1/Enable/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"type": "dex.display.pushbutton"
},
{
"meta": {
"name": "PE3"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%"
},
"width": 8,
"x": 3,
"y": 2
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE3/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GL 100% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE4"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%",
"angle": "-45deg"
},
"width": 8,
"x": 5,
"y": 10
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE4/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GL Presence)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE2"
},
"position": {
"height": 6,
"width": 28,
"x": 13,
"y": 7
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE2/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR 50% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE1B"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%"
},
"width": 20,
"x": 15
},
"propConfig": {
"position.rotate.angle": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": "-45deg",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "45deg"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"position.y": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": 14,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": 0
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE1B/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR 100% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "PE1A"
},
"position": {
"height": 6,
"rotate": {
"anchor": "0 50%"
},
"width": 20,
"x": 15
},
"propConfig": {
"position.rotate.angle": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": "45deg",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "-45deg"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"position.y": {
"binding": {
"config": {
"path": "view.params.isRightOfSorter"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": 14
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/PE1A/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "jsonSet({value}, \"tooltip\", replace(jsonGet({value}, \"tooltip\"), \"\u003cbr\u003e\", \" (GR 100% Full)\u003cbr\u003e\"))",
"type": "expression"
},
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"props": {
"config": {
"type": "diffuse"
}
},
"type": "dex.display.photoeye"
},
{
"meta": {
"name": "RS1_RESTART"
},
"position": {
"height": 6,
"width": 6,
"x": 44,
"y": 14
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/RS1/Restart/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"type": "dex.display.pushbutton"
},
{
"meta": {
"name": "FIO1"
},
"position": {
"height": 5,
"width": 10,
"x": 50,
"y": 15
},
"propConfig": {
"props.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"tagPath": "{view.params.tagPath}"
},
"tagPath": "{tagPath}/FIO1/Graphics"
},
"overlayOptOut": true,
"transforms": [
{
"expression": "if({view.params.alwaysShowAll},\r\n\tjsonSet({value}, \"showAlways\", {view.params.alwaysShowAll}),\r\n\t{value}\r\n)",
"type": "expression"
}
],
"type": "tag"
}
}
},
"type": "dex.display.eip"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"props.style.transform": {
"binding": {
"config": {
"path": "view.params.mirror"
},
"transforms": [
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "scale(1, -1)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"overflow": "hidden"
}
},
"scripts": {
"customMethods": [
{
"name": "openPopup",
"params": [],
"script": "\tif self.view.params.isClickable:\n\t\tid \u003d \"FlexChute|\" + self.view.params.tagPath\n\t\ttitle \u003d utils.prettyName(self.view.params.tagPath.split(\"/\")[-1])\n\t\tparams \u003d { \n\t\t\t\"deviceType\": \"chutedestination\",\n\t\t\t\"props\": { \n\t\t\t\t\"config\": {\n\t\t\t\t\t\"alwaysShowAll\": self.view.params.alwaysShowAll,\n\t\t\t\t\t\"isClickable\": self.view.params.isClickable,\n\t\t\t\t\t\"isRightOfSorter\": self.view.params.isRightOfSorter,\n\t\t\t\t\t\"mirror\": self.view.params.mirror\n\t\t\t\t},\n\t\t\t\t\"status\": {\n\t\t\t\t\t\"tagPath\": self.view.params.tagPath\n\t\t\t\t}\n\t\t \t},\n\t\t \t\"tabs\": [\"Controls\", \"Alarm History\", \"Devices\"]\t\t\n\t\t}\n\t\tsystem.perspective.openPopup(id, \"Popups/DeviceWrapper\", params, title, resizable \u003d True)"
}
],
"extensionFunctions": null,
"messageHandlers": []
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,510 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"params": {
"con_lines": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"con_lines_visible": [
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"in": false,
"out": false
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_TO_HUB"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3012_4"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.0229
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3012_2"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.0229,
"y": 0.1667
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL1038_4"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.0229,
"y": 0.3333
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL1034_4"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.0229,
"y": 0.6667
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL1038_2"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.0229,
"y": 0.8333
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3020_4"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.375
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3016_2"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.5
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3016_4"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.625
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3020_2"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.75
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL1034_2"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.0229,
"y": 0.5
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3024_2"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.25
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "FL3024_4"
},
"position": {
"height": 0.1667,
"width": 0.125,
"x": 0.125,
"y": -0.0009
},
"props": {
"path": "Windows/Tabs/Enternet Windows/Components/APF"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "VFD1_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.0069,
"y": 0.5394
},
"props": {
"text": "FL1034_2_VFD1 11.200.1.80",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD2_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.0068,
"y": 0.7315
},
"props": {
"text": "FL1034_4_EX1 11.200.1.81",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD3_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.0068,
"y": 0.8981
},
"props": {
"text": "FL1038_2_VFD1 11.200.1.82",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD4_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.0068,
"y": 0.3986
},
"props": {
"text": "FL1038_4_EX1 11.200.1.83",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD5_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.0068,
"y": 0.2324
},
"props": {
"text": "FL3012_2_VFD1 11.200.1.84",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD6_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.0068,
"y": 0.0653
},
"props": {
"text": "FL3012_4_EX1 11.200.1.85",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD7_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.5062,
"y": 0.167
},
"props": {
"text": "FL3016_2_VFD1 11.200.1.86",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD8_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.6312,
"y": 0.167
},
"props": {
"text": "FL3016_4_EX1 11.200.1.87",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD9_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.75,
"y": 0.167
},
"props": {
"text": "FL3020_2_VFD1 11.200.1.88",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD10_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.3879,
"y": 0.167
},
"props": {
"text": "FL3020_4_EX1 11.200.1.89",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD11_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.316,
"y": 0.167
},
"props": {
"text": "FL3024_2_VFD1 11.200.1.90",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "VFD12_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.2077,
"y": 0.167
},
"props": {
"text": "FL3024_4_EX1 11.200.1.91",
"textStyle": {
"fontSize": "1vmin",
"key": "value"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "FL3016_2_DPM1"
},
"position": {
"height": 0.0694,
"width": 0.101,
"x": 0.4491,
"y": 0.6407
},
"props": {
"text": "FL3016_2_DPM1 11.200.1.6",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,17 @@
{
"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,97 +0,0 @@
SELECT
CASE
WHEN COALESCE(c.sLocation_ID, '') LIKE 'S03%' THEN 'S03'
ELSE 'S03'
END AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS end_time,
COALESCE(NULLIF(c.sLocation_ID, ''), 'N/A') AS sLocation_ID,
COALESCE(c.Success, 0) AS success_count,
COALESCE(c.Unknown, 0) AS unknown_count,
COALESCE(c.Unexpected_Container, 0) AS unexpected_container_count,
COALESCE(c.Tracking_Error, 0) AS tracking_error_count,
COALESCE(c.Gap_Error, 0) AS gap_error_count,
COALESCE(c.Destination_Full, 0) AS destination_full_count,
COALESCE(c.Destination_Non_Operational, 0) AS destination_non_operational_count,
COALESCE(c.Invalid_Destination, 0) AS invalid_destination_count,
COALESCE(c.Scanner_Error, 0) AS scan_error_count,
COALESCE(c.Destination_Disabled, 0) AS destination_disabled_count,
COALESCE(c.Throughput_Limit, 0) AS throughput_limit_count,
COALESCE(c.Failed_To_Divert, 0) AS failed_to_divert_count,
COALESCE(c.No_Destination_Received, 0) AS no_destination_received_count,
COALESCE(c.Lost_Container, 0) AS lost_container_count,
COALESCE(c.Dimension_Error, 0) AS dimension_error_count,
COALESCE(c.Weight_Error, 0) AS weight_error_count,
COALESCE(c.Container_Utilization, 0) AS container_utilization_count,
COALESCE(c.Unable_To_Divert, 0) AS unable_to_divert_count,
COALESCE(c.Destination_Not_Attempted, 0) AS destination_not_attempted_count,
COALESCE(c.total, 0) AS total
FROM
(SELECT 1) AS p
LEFT JOIN (
SELECT
sLocation_ID,
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS Success,
SUM(CASE WHEN adiSort_Code_0 = 1 THEN 1 ELSE 0 END) AS Unknown,
SUM(CASE WHEN adiSort_Code_0 = 2 THEN 1 ELSE 0 END) AS Unexpected_Container,
SUM(CASE WHEN adiSort_Code_0 = 3 THEN 1 ELSE 0 END) AS Tracking_Error,
SUM(CASE WHEN adiSort_Code_0 = 4 THEN 1 ELSE 0 END) AS Gap_Error,
SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) AS Destination_Full,
SUM(CASE WHEN adiSort_Code_0 = 6 THEN 1 ELSE 0 END) AS Destination_Non_Operational,
SUM(CASE WHEN adiSort_Code_0 = 7 THEN 1 ELSE 0 END) AS Invalid_Destination,
SUM(CASE WHEN adiSort_Code_0 IN (8, 9, 10) THEN 1 ELSE 0 END) AS Scanner_Error,
SUM(CASE WHEN adiSort_Code_0 = 12 THEN 1 ELSE 0 END) AS Destination_Disabled,
SUM(CASE WHEN adiSort_Code_0 = 13 THEN 1 ELSE 0 END) AS Throughput_Limit,
SUM(CASE WHEN adiSort_Code_0 = 14 THEN 1 ELSE 0 END) AS Failed_To_Divert,
SUM(CASE WHEN adiSort_Code_0 = 16 THEN 1 ELSE 0 END) AS No_Destination_Received,
SUM(CASE WHEN adiSort_Code_0 = 17 THEN 1 ELSE 0 END) AS Lost_Container,
SUM(CASE WHEN adiSort_Code_0 = 18 THEN 1 ELSE 0 END) AS Dimension_Error,
SUM(CASE WHEN adiSort_Code_0 = 19 THEN 1 ELSE 0 END) AS Weight_Error,
SUM(CASE WHEN adiSort_Code_0 = 20 THEN 1 ELSE 0 END) AS Container_Utilization,
SUM(CASE WHEN adiSort_Code_0 = 21 THEN 1 ELSE 0 END) AS Unable_To_Divert,
SUM(CASE WHEN adiSort_Code_0 = 22 THEN 1 ELSE 0 END) AS Destination_Not_Attempted,
COUNT(*) AS total
FROM
item_data
WHERE
t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID IS NOT NULL
AND sLocation_ID != ''
GROUP BY
sLocation_ID
) AS c ON 1=1
WHERE c.sLocation_ID IS NOT NULL
UNION ALL
SELECT
'S03' AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS end_time,
'N/A' AS sLocation_ID,
0 AS success_count,
0 AS unknown_count,
0 AS unexpected_container_count,
0 AS tracking_error_count,
0 AS gap_error_count,
0 AS destination_full_count,
0 AS destination_non_operational_count,
0 AS invalid_destination_count,
0 AS scan_error_count,
0 AS destination_disabled_count,
0 AS throughput_limit_count,
0 AS failed_to_divert_count,
0 AS no_destination_received_count,
0 AS lost_container_count,
0 AS dimension_error_count,
0 AS weight_error_count,
0 AS container_utilization_count,
0 AS unable_to_divert_count,
0 AS destination_not_attempted_count,
0 AS total
WHERE NOT EXISTS (
SELECT 1 FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID IS NOT NULL
AND sLocation_ID != ''
);

View File

@ -0,0 +1,160 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 400,
"width": 1600
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 40,
"width": "100%"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "try(\r\n\tproperty(\"../TabContainer.props.tabs[\"+{../TabContainer.props.currentTabIndex}+\"]\"),\r\n\t\"No Configs\"\r\n)"
},
"type": "expr"
}
}
},
"props": {
"style": {
"backgroundColor": "#1A4A5E",
"borderBottomColor": "#000000",
"borderBottomStyle": "solid",
"borderBottomWidth": "2px",
"color": "#fff",
"fontFamily": "Helvetica",
"fontSize": 20,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.sendMessage(\"export-data\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"height": 30,
"width": 100,
"x": "calc(100% - 105px)",
"y": 5
},
"props": {
"style": {
"classes": "Buttons/Grey"
},
"text": "Export"
},
"type": "ia.input.button"
},
{
"meta": {
"name": "TabContainer"
},
"position": {
"height": "calc(100% - 40px)",
"width": "100%",
"y": 40
},
"propConfig": {
"props.tabs": {
"binding": {
"config": {
"struct": {
"auth": "{session.props.auth.user.roles}",
"tabs": "{[default]Gateway/ConfigTabs}"
},
"waitOnAll": true
},
"transforms": [
{
"code": "\troles \u003d [\"Administrator\", \"Developer\", \"Supervisor\"]\n\tauth \u003d value.auth\n\ttabs \u003d value.tabs\n\tisNotAuth \u003d (auth \u003d\u003d None or len(auth) \u003d\u003d 0 or len([i for i in auth if i in roles]) \u003d\u003d 0)\n\treturn [v[\"title\"] for v in utils.datasetToJSON(tabs) if v[\"isVisible\"] and not (v[\"isSupervisor\"] and isNotAuth)]",
"type": "script"
}
],
"type": "expr-struct"
}
}
},
"props": {
"menuStyle": {
"backgroundColor": "#225E77"
},
"tabSize": {
"width": 140
},
"tabStyle": {
"active": {
"backgroundColor": "#2D7D9F",
"color": "#FFF",
"fontWeight": "bold"
},
"inactive": {
"backgroundColor": "#389CC7",
"color": "#FFF"
}
}
},
"type": "ia.container.tab"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"height": "calc(100% - 75px)",
"width": "100%",
"y": 75
},
"propConfig": {
"props.path": {
"binding": {
"config": {
"expression": " \"Windows/Configs/\"\r\n+replace(\r\n\tproperty(\"../TabContainer.props.tabs[\"+{../TabContainer.props.currentTabIndex}+\"]\"),\r\n\t\" \",\r\n\t\"\"\r\n)"
},
"type": "expr"
},
"persistent": true
}
},
"props": {
"path": "Windows/Configs/Shifts"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"props": {
"style": {
"min-width": "1000px"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,59 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 820
}
},
"root": {
"children": [
{
"meta": {
"name": "OXD_Inbound"
},
"position": {
"height": 800,
"width": 636,
"x": 10,
"y": 10
},
"props": {
"path": "Windows/Graphics/Templates/OXD_Inbound",
"style": {
"classes": "painted-events"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "NavButton_OXD_Singulator"
},
"position": {
"height": 40,
"width": 128,
"x": 630,
"y": 79
},
"props": {
"params": {
"enableTooltip": true,
"label": null,
"tagPath": "[default]OXDSingulatorStatus",
"view": ""
},
"path": "Templates/Buttons/NavButton",
"style": {
"transform": "scale(1.5)"
}
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,19 @@
WITH INDUCTS AS (
SELECT
DATE_FORMAT(MIN(timestamp), "%Y-%m-%d %H:%i:00") AS time,
SUM(count) AS total
FROM pe_history
WHERE timestamp BETWEEN :startDate AND :endDate
AND lane_id = :induct
GROUP BY DATE_FORMAT(timestamp, "%Y-%m-%d %H:%i:00")
ORDER BY DATE_FORMAT(timestamp, "%Y-%m-%d %H:%i:00")
)
SELECT
time,
/* Counts: */
total AS total_count,
/* PPH: */
ROUND(total*60) AS total_pph,
/* Percents: */
ROUND(total/total, 4) AS total_percent
FROM INDUCTS;

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

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