alot new changes. major: statistics page. showing data from 1000 tags. updated db tables scripts. added labels on the conveyors and chutes. fixed chute pe not showing colors correclty. fixed device mapping function not displaying LRPE status correctly. New queries for the statistics page
@ -0,0 +1,626 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 101 B |
@ -0,0 +1,8 @@
|
||||
SELECT DISTINCT destination_act AS lane
|
||||
FROM package_history
|
||||
WHERE destination_act IS NOT NULL
|
||||
UNION
|
||||
SELECT DISTINCT lane_id AS lane
|
||||
FROM pe_history
|
||||
WHERE lane_id LIKE "CH%" OR lane_id LIKE "RS%1CH"
|
||||
ORDER BY lane ASC;
|
||||
@ -0,0 +1,14 @@
|
||||
-- Hourly Induct Graph Query (Rate)
|
||||
-- Shows every hour in detail for graphing
|
||||
|
||||
SELECT
|
||||
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,
|
||||
COUNT(*) AS Total
|
||||
FROM alltable
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
GROUP BY DATE(t_stamp), HOUR(t_stamp)
|
||||
ORDER BY DATE(t_stamp) ASC, HOUR(t_stamp) ASC;
|
||||
|
||||
@ -0,0 +1,290 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"meta": {
|
||||
"name": "VFD"
|
||||
},
|
||||
"props": {
|
||||
"config": {
|
||||
"enableHighlight": true,
|
||||
"isClickable": false
|
||||
},
|
||||
"status": {
|
||||
"color": {
|
||||
"left": "#B3B3B3",
|
||||
"right": "#D3D3D3"
|
||||
},
|
||||
"showAlways": true,
|
||||
"tagPath": "[default]MCP03/RO02/RO02_03/VFD",
|
||||
"tooltip": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"params.meta": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.meta.name": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.props": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 105,
|
||||
"width": 500
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "VFD"
|
||||
},
|
||||
"position": {
|
||||
"height": 64,
|
||||
"width": 64,
|
||||
"x": 67.5,
|
||||
"y": 2.5
|
||||
},
|
||||
"propConfig": {
|
||||
"props.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Graphics"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "try(\r\n\tjsonSet({value}, \"showAlways\", true),\r\n\t{view.params.props.status}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"config": {
|
||||
"enableHighlight": false,
|
||||
"isClickable": false
|
||||
}
|
||||
},
|
||||
"type": "dex.display.vfd"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_15"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 75,
|
||||
"x": 195,
|
||||
"y": 40
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Status:"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "lbStatus"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": "calc(100% - 300px)",
|
||||
"x": 280,
|
||||
"y": 40
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Graphics"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn utils.extractStatus(value)",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"overflow": "hidden",
|
||||
"textAlign": "center",
|
||||
"textOverview": "ellipsis",
|
||||
"whiteSpace": "nowrap"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_1"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 75,
|
||||
"x": 195,
|
||||
"y": 5
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Name: "
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "lbName"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": "calc(100% - 300px)",
|
||||
"x": 280,
|
||||
"y": 5
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Parameters.LabelFull"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value}, \u0027\u0027)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"overflow": "hidden",
|
||||
"textAlign": "center",
|
||||
"textOverview": "ellipsis",
|
||||
"whiteSpace": "nowrap"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_12"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 75,
|
||||
"x": 195,
|
||||
"y": 75
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Panel:"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "lbStatus_0"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": "calc(100% - 300px)",
|
||||
"x": 280,
|
||||
"y": 75
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Parameters.OPC_Server"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value}, \"Unknown\")",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"overflow": "hidden",
|
||||
"textAlign": "center",
|
||||
"textOverview": "ellipsis",
|
||||
"whiteSpace": "nowrap"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"background-color": "#CFCFCF"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,603 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
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)
|
||||
@ -0,0 +1,58 @@
|
||||
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;
|
||||
|
||||
|
After Width: | Height: | Size: 296 B |
@ -0,0 +1,44 @@
|
||||
SELECT
|
||||
roundtime AS `Round Time`,
|
||||
sInduction_Name AS `Induction Name`,
|
||||
COALESCE(total_single_carrier, 0) AS `Total Single Carrier`,
|
||||
COALESCE(total_double_carrier, 0) AS `Total Double Carrier`,
|
||||
COALESCE(total_single_carrier, 0) +
|
||||
COALESCE(total_double_carrier, 0) AS `Total`
|
||||
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,
|
||||
sInduction_Name,
|
||||
SUM(diTotal_Single_Carrier) AS total_single_carrier,
|
||||
SUM(diTotal_Double_Carrier) AS total_double_carrier
|
||||
FROM induction_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND (sInduction_Name = :inductionname OR :inductionname IS NULL OR :inductionname = '')
|
||||
GROUP BY roundtime, sInduction_Name
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
FROM_UNIXTIME(
|
||||
FLOOR(UNIX_TIMESTAMP(t_stamp) /
|
||||
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
|
||||
) *
|
||||
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
|
||||
) AS roundtime,
|
||||
'S02' AS sInduction_Name,
|
||||
0 AS total_single_carrier,
|
||||
COUNT(*) AS total_double_carrier
|
||||
FROM item_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND adiSort_Code_0 NOT IN (11, 15)
|
||||
AND sLocation_ID LIKE 'S02%'
|
||||
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S02')
|
||||
GROUP BY roundtime
|
||||
ORDER BY roundtime ASC
|
||||
) basa;
|
||||
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,209 @@
|
||||
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;
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
WITH SORTERS AS (
|
||||
SELECT
|
||||
DATE_FORMAT(MIN(s04_timestamp), "%Y-%m-%d %H:%i:00") AS time,
|
||||
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:%i:00")
|
||||
ORDER BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
|
||||
)
|
||||
SELECT
|
||||
time,
|
||||
/* Counts: */
|
||||
total AS total_count,
|
||||
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: */
|
||||
ROUND(total*60) AS total_pph,
|
||||
ROUND(success*60) AS success_pph,
|
||||
ROUND(awcs*60) AS awcs_issues_pph,
|
||||
ROUND(operational*60) AS operational_issues_pph,
|
||||
ROUND(machine*60) AS machine_issues_pph,
|
||||
ROUND(scanner*60) 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;
|
||||
@ -0,0 +1,24 @@
|
||||
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;
|
||||
@ -0,0 +1,58 @@
|
||||
SELECT
|
||||
CASE
|
||||
WHEN c.sActual_Dest_ID LIKE 'S02%' THEN 'S02'
|
||||
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,
|
||||
COALESCE(c.Success_rate, 0) AS success_rate,
|
||||
COALESCE(c.Unknown_rate, 0) AS unknown_rate,
|
||||
COALESCE(c.Unexpected_Container_rate, 0) AS unexpected_container_rate,
|
||||
COALESCE(c.Tracking_Error_rate, 0) AS tracking_error_rate,
|
||||
COALESCE(c.Gap_Error_rate, 0) AS gap_error_rate,
|
||||
COALESCE(c.Destination_Full_rate, 0) AS destination_full_rate,
|
||||
COALESCE(c.Destination_Non_Operational_rate, 0) AS destination_non_operational_rate,
|
||||
COALESCE(c.Invalid_Destination_rate, 0) AS invalid_destination_rate,
|
||||
COALESCE(c.Scanner_Error_rate, 0) AS scan_error_rate,
|
||||
COALESCE(c.Destination_Disabled_rate, 0) AS destination_disabled_rate,
|
||||
COALESCE(c.Throughput_Limit_rate, 0) AS throughput_limit_rate,
|
||||
COALESCE(c.Failed_To_Divert_rate, 0) AS failed_to_divert_rate,
|
||||
COALESCE(c.No_Destination_Received_rate, 0) AS no_destination_received_rate,
|
||||
COALESCE(c.Lost_Container_rate, 0) AS lost_container_rate,
|
||||
COALESCE(c.Dimension_Error_rate, 0) AS dimension_error_rate,
|
||||
COALESCE(c.Weight_Error_rate, 0) AS weight_error_rate,
|
||||
COALESCE(c.Container_Utilization_rate, 0) AS container_utilization_rate,
|
||||
COALESCE(c.Unable_To_Divert_rate, 0) AS unable_to_divert_rate,
|
||||
COALESCE(c.Destination_Not_Attempted_rate, 0) AS destination_not_attempted_rate,
|
||||
COALESCE(c.total, 0) AS total
|
||||
FROM (SELECT 1) AS p
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sActual_Dest_ID,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(COUNT(*) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS total,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Success_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 1 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Unknown_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 2 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Unexpected_Container_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 3 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Tracking_Error_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 4 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Gap_Error_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Destination_Full_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 6 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Destination_Non_Operational_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 7 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Invalid_Destination_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 IN (8, 9, 10) THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Scanner_Error_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 12 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Destination_Disabled_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 13 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Throughput_Limit_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 14 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Failed_To_Divert_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 16 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS No_Destination_Received_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 17 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Lost_Container_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 18 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Dimension_Error_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 19 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Weight_Error_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 20 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Container_Utilization_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 21 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Unable_To_Divert_rate,
|
||||
CASE WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 22 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2) END AS Destination_Not_Attempted_rate
|
||||
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;
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
SELECT DISTINCT destination_act AS lane
|
||||
FROM package_history
|
||||
WHERE destination_act IS NOT NULL
|
||||
ORDER BY lane ASC;
|
||||
|
After Width: | Height: | Size: 375 B |
|
After Width: | Height: | Size: 2.1 KiB |
@ -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("GL BreakCount Handler")
|
||||
|
||||
# For inserting data into database:
|
||||
CONFIRM_INSERT_QUERY = "INSERT IGNORE INTO gl_history (gaylord_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(gaylordID, 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, [gaylordID, count])
|
||||
logTime("GL_BREAK[DB_INSERT]", gaylordID, time.time() - start_time)
|
||||
|
||||
def processBreakAsync(gaylordID, 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, [gaylordID, count])
|
||||
logTime("GL_BREAK[DB_INSERT]", gaylordID, time.time() - start_time)
|
||||
|
||||
system.util.invokeAsynchronous(processConfirmInner)
|
||||
|
||||
|
After Width: | Height: | Size: 7.8 KiB |
@ -0,0 +1,26 @@
|
||||
WITH SORTERS AS (
|
||||
SELECT
|
||||
MIN(timestamp) AS start_timestamp,
|
||||
MAX(timestamp) AS end_timestamp,
|
||||
3600/TIMESTAMPDIFF(SECOND, :startDate, :endDate) AS pph_multiplier,
|
||||
"SYSTEM" AS sorter,
|
||||
SUM(IF(lane_id LIKE "UL%", count, 0)) AS inducted,
|
||||
SUM(IF(lane_id LIKE "CH%", count, 0)) AS sorted
|
||||
FROM pe_history
|
||||
WHERE timestamp BETWEEN :startDate AND :endDate
|
||||
GROUP BY "SYSTEM" /* Makes it so no row is returned if no rows are processed */
|
||||
)
|
||||
SELECT
|
||||
start_timestamp,
|
||||
end_timestamp,
|
||||
sorter,
|
||||
/* Counts: */
|
||||
inducted AS inducted_count,
|
||||
sorted AS sorted_count,
|
||||
/* PPH: */
|
||||
ROUND(inducted*pph_multiplier) AS inducted_pph,
|
||||
ROUND(sorted*pph_multiplier) AS sorted_pph,
|
||||
/* Percents: */
|
||||
ROUND(inducted/inducted, 4) AS inducted_percent,
|
||||
ROUND(sorted/sorted, 4) AS sorted_percent
|
||||
FROM SORTERS;
|
||||
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
@ -0,0 +1,322 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
################################################################
|
||||
################################################################
|
||||
## Version: 1.0 / Author: Dillon Uzar
|
||||
##
|
||||
## DESC: For use in FMS in recording Flow Management data
|
||||
## WARN: Modifying code may cause system to function incorrectly
|
||||
################################################################
|
||||
################################################################
|
||||
|
||||
import json
|
||||
import system
|
||||
import time
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### Constants
|
||||
#######################################################
|
||||
|
||||
# Logger:
|
||||
LOG = system.util.logger("FMS Handler")
|
||||
|
||||
# For inserting data into database:
|
||||
INSERT_QUERY = "INSERT INTO fms_history (conveyor, segment, data) VALUES (?,?,?)"
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### Parsing Utils
|
||||
#######################################################
|
||||
|
||||
def extractNibble(val, nibble):
|
||||
if val is not None:
|
||||
return (val >> (nibble*4)) & 0x0F
|
||||
|
||||
def logTime(title, conv, seg, data, start_time):
|
||||
millisec = round((time.time() - start_time) * 1000, 1)
|
||||
LOG.info("%s[CONV=%s][SEG=%s][DATA=%s] took %sms to process" % (title, conv, seg, data, millisec))
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### Tag Event Handling
|
||||
#######################################################
|
||||
|
||||
def logSegment(conveyor, segment, data):
|
||||
# Log event in SQL:
|
||||
# Insert into FMS History:
|
||||
start_time = time.time()
|
||||
INSERT_QUERY = "INSERT INTO fms_history (conveyor, segment, data) VALUES (?,?,?)"
|
||||
system.db.runPrepUpdate(INSERT_QUERY, [conveyor, segment, data])
|
||||
#logTime("FMS[DB_INSERT]", conveyor, segment, data, start_time)
|
||||
|
||||
def dintOnChange(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
|
||||
# Don't execute on startup, or if new value is bad quality:
|
||||
if currentValue.quality.isGood():
|
||||
# Only consider it a change if the value is different:
|
||||
if currentValue.value <> previousValue.value:
|
||||
id = int(tagPath.split("/")[-1].replace("DINT", ""))
|
||||
conveyor = tag['parameters']['LabelFull']
|
||||
# ID=0 is unique where the first nibble is the average of all segments, the 7 other segments are normal segments:
|
||||
if id == 0:
|
||||
# Ignore first nibble, which is the average of all segments:
|
||||
for i in range(1, 8):
|
||||
# Check if segment changed:
|
||||
curVal = extractNibble(currentValue.value, i)
|
||||
prevVal = extractNibble(previousValue.value, i)
|
||||
if curVal <> prevVal:
|
||||
segment = i - 1
|
||||
logSegment(conveyor, segment, curVal)
|
||||
else:
|
||||
for i in range(0, 8):
|
||||
# Check if segment changed:
|
||||
curVal = extractNibble(currentValue.value, i)
|
||||
prevVal = extractNibble(previousValue.value, i)
|
||||
if curVal <> prevVal:
|
||||
segment = i + (id-1)*8 + 7
|
||||
logSegment(conveyor, segment, curVal)
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### Graphics Tag Scripts
|
||||
#######################################################
|
||||
|
||||
"""
|
||||
radial-gradient(circle at 30%,
|
||||
#f5bff5 calc((var(--conv-width) - 4px)/2*0.25),
|
||||
#000 calc((var(--conv-width) - 4px)/2*0.25),
|
||||
#000 calc((var(--conv-width) - 4px)/2*0.25 + 1px),
|
||||
transparent calc((var(--conv-width) - 4px)/2*0.25 + 1px)),
|
||||
radial-gradient(circle at 50%, #d900d9 calc((var(--conv-width) - 4px)/2*1), #000 calc((var(--conv-width) - 4px)/2*1), #000 calc((var(--conv-width) - 4px)/2*1 + 1px), transparent calc((var(--conv-width) - 4px)/2*0.25 + 1px)), radial-gradient(circle at 70%, #ec7fec 7px, #000 7px, #000 8px, transparent 8px), radial-gradient(circle at 90%, #e23fe2 10px, #000 10px, #000 11px, transparent 11px), #00D900
|
||||
"""
|
||||
|
||||
|
||||
def genSegmentsTable(obj):
|
||||
segments = []
|
||||
if obj is not None and obj["Count"] is not None:
|
||||
for i in range(1, obj["Count"]+1):
|
||||
dint = "DINT"+str(int(i/8))
|
||||
if obj[dint] is not None:
|
||||
percent = extractNibble(obj[dint], i % 8) / 15.0
|
||||
segments.append([i, percent])
|
||||
return system.dataset.toDataSet(["segment", "fill"], segments)
|
||||
|
||||
def genSegmentColor(data):
|
||||
perc = (data/15.0)
|
||||
c1 = 255 - (255 - 217)*perc
|
||||
c2 = 255 - (255 - 0)*perc
|
||||
return "rgb(%s, %s, %s)" % (c1, c2, c1)
|
||||
|
||||
def genSegmentsPattern(obj):
|
||||
if obj["Count"] is not None and obj["Count"] > 0:
|
||||
percUnit = 100 / float(obj["Count"])
|
||||
gradients = []
|
||||
for i in range(1, obj["Count"]+1):
|
||||
dint = "DINT"+str(int(i/8))
|
||||
if obj[dint] is not None:
|
||||
data = extractNibble(obj[dint], i % 8)
|
||||
color = genSegmentColor(data)
|
||||
circlePos = ((obj["Count"]-i))*percUnit + percUnit/2.0
|
||||
perc = (data/15.0*0.5+0.5) if data > 0 else 0.0 # Make circle size between 50%-100%
|
||||
if perc > 0.0:
|
||||
output = "radial-gradient(circle at %s%%" % (circlePos)
|
||||
output += ", %s calc((var(--conv-width) - 8px)/2*%s)" % (color, perc)
|
||||
output += ", #000 calc((var(--conv-width) - 8px)/2*%s)" % (perc)
|
||||
output += ", #000 calc((var(--conv-width) - 8px)/2*%s + 1px)" % (perc)
|
||||
output += ", transparent calc((var(--conv-width) - 8px)/2*%s + 1px)" % (perc)
|
||||
output += ")"
|
||||
gradients.append(output)
|
||||
if len(gradients) > 0:
|
||||
return ", ".join(gradients)+","
|
||||
return ""
|
||||
|
||||
def genSegmentsTooltip(obj):
|
||||
if obj["Count"] is not None and obj["Count"] > 0:
|
||||
data = extractNibble(obj["DINT0"], 0)
|
||||
output = "<br><br>SegmentAVG: %s%%" % (int(round(100 * data / 15.0)))
|
||||
for i in range(1, obj["Count"]+1):
|
||||
dint = "DINT"+str(int(i/8))
|
||||
if obj[dint] is not None:
|
||||
data = extractNibble(obj[dint], i % 8)
|
||||
output += "<br>Segment%s: %s%%" % (i, int(round(100 * data / 15.0)))
|
||||
return output
|
||||
return ""
|
||||
|
||||
def genSegmentHeatmap(obj):
|
||||
segments = []
|
||||
if obj["Count"] is not None and obj["Count"] > 0:
|
||||
for i in range(1, obj["Count"]+1):
|
||||
dint = "DINT"+str(int(i/8))
|
||||
if obj[dint] is not None:
|
||||
data = extractNibble(obj[dint], i % 8)
|
||||
color = 255 * data / 15
|
||||
segments.append("rgb(255, %s, %s)" % (color, color))
|
||||
return json.dumps(segments)
|
||||
@ -0,0 +1,36 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(245,245,245,1) 0%, rgba(235,235,235,1) 70%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"textTransform": "uppercase"
|
||||
}
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pseudo": "hover",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(0deg, rgba(245,245,245,1) 0%, rgba(235,235,235,1) 70%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pseudo": "disabled",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(208,208,208,1) 0%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#555555",
|
||||
"cursor": "not-allowed"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 102 KiB |
@ -0,0 +1,7 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"color": "#FF0000"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 24,
|
||||
"width": 24
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "troubleshoot_white_24dp"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"height": "24",
|
||||
"name": "rect",
|
||||
"type": "rect",
|
||||
"width": "24"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M22,20.59l-4.69-4.69C18.37,14.55,19,12.85,19,11c0-4.42-3.58-8-8-8c-4.08,0-7.44,3.05-7.93,7h2.02C5.57,7.17,8.03,5,11,5 c3.31,0,6,2.69,6,6s-2.69,6-6,6c-2.42,0-4.5-1.44-5.45-3.5H3.4C4.45,16.69,7.46,19,11,19c1.85,0,3.55-0.63,4.9-1.69L20.59,22 L22,20.59z",
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"name": "polygon",
|
||||
"points": "8.43,9.69 9.65,15 11.29,15 12.55,11.22 13.5,13.5 15.5,13.5 15.5,12 14.5,12 13.25,9 11.71,9 10.59,12.37 9.35,7 7.7,7 6.45,11 1,11 1,12.5 7.55,12.5",
|
||||
"type": "polygon"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"fill": {
|
||||
"paint": "#FFFFFF"
|
||||
},
|
||||
"viewBox": "0 0 24 24"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent"
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,10 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"paddingBottom": "5px",
|
||||
"paddingLeft": "5px",
|
||||
"paddingRight": "5px",
|
||||
"paddingTop": "5px"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,290 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"meta": {
|
||||
"name": "VFD"
|
||||
},
|
||||
"props": {
|
||||
"config": {
|
||||
"enableHighlight": true,
|
||||
"isClickable": false
|
||||
},
|
||||
"status": {
|
||||
"color": {
|
||||
"left": "#B3B3B3",
|
||||
"right": "#D3D3D3"
|
||||
},
|
||||
"showAlways": true,
|
||||
"tagPath": "[default]MCP03/RO02/RO02_03/VFD",
|
||||
"tooltip": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"params.meta": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.meta.name": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.props": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 105,
|
||||
"width": 500
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "VFD"
|
||||
},
|
||||
"position": {
|
||||
"height": 64,
|
||||
"width": 64,
|
||||
"x": 67.5,
|
||||
"y": 17.5
|
||||
},
|
||||
"propConfig": {
|
||||
"props.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Graphics"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "try(\r\n\tjsonSet({value}, \"showAlways\", true),\r\n\t{view.params.props.status}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"config": {
|
||||
"enableHighlight": false,
|
||||
"isClickable": false
|
||||
}
|
||||
},
|
||||
"type": "dex.display.vfd"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_15"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 75,
|
||||
"x": 195,
|
||||
"y": 40
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Status:"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "lbStatus"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": "calc(100% - 300px)",
|
||||
"x": 280,
|
||||
"y": 40
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Graphics"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn utils.extractStatus(value)",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"overflow": "hidden",
|
||||
"textAlign": "center",
|
||||
"textOverview": "ellipsis",
|
||||
"whiteSpace": "nowrap"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_1"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 75,
|
||||
"x": 195,
|
||||
"y": 5
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Name: "
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "lbName"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": "calc(100% - 300px)",
|
||||
"x": 280,
|
||||
"y": 5
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Parameters.LabelFull"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value}, \u0027\u0027)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"overflow": "hidden",
|
||||
"textAlign": "center",
|
||||
"textOverview": "ellipsis",
|
||||
"whiteSpace": "nowrap"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_12"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 75,
|
||||
"x": 195,
|
||||
"y": 75
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontSize": "20px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Panel:"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "lbStatus_0"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": "calc(100% - 300px)",
|
||||
"x": 280,
|
||||
"y": 75
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.props.status.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Parameters.OPC_Server"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value}, \"Unknown\")",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"overflow": "hidden",
|
||||
"textAlign": "center",
|
||||
"textOverview": "ellipsis",
|
||||
"whiteSpace": "nowrap"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"background-color": "#CFCFCF"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
WITH SCANNERS 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(scanner_status NOT IN ("No Read", "No Code", "Multi Label")) AS good_read,
|
||||
SUM(scanner_status = "No Read") AS no_read,
|
||||
SUM(scanner_status = "No Code") AS no_code,
|
||||
SUM(scanner_status = "Multi Label") AS multi_label
|
||||
FROM package_history
|
||||
WHERE s04_timestamp BETWEEN :startDate AND :endDate
|
||||
AND scanner=:scanner
|
||||
GROUP BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:00")
|
||||
)
|
||||
SELECT
|
||||
start_timestamp,
|
||||
hour,
|
||||
/* Counts: */
|
||||
total AS total_count,
|
||||
good_read AS good_read_count,
|
||||
no_read AS no_read_count,
|
||||
no_code AS no_code_count,
|
||||
multi_label AS multi_label_count,
|
||||
/* PPH: */
|
||||
total AS total_pph,
|
||||
good_read AS good_read_pph,
|
||||
no_read AS no_read_pph,
|
||||
no_code AS no_code_pph,
|
||||
multi_label AS multi_label_pph,
|
||||
/* Percents: */
|
||||
ROUND(total/total, 4) AS total_percent,
|
||||
ROUND(good_read/total, 4) AS good_read_percent,
|
||||
ROUND(no_read/total, 4) AS no_read_percent,
|
||||
ROUND(no_code/total, 4) AS no_code_percent,
|
||||
ROUND(multi_label/total, 4) AS multi_label_percent
|
||||
FROM SCANNERS;
|
||||
@ -0,0 +1,84 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(245,245,245,1) 0%, rgba(235,235,235,1) 70%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"textTransform": "uppercase"
|
||||
}
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pseudo": "hover",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(0deg, rgba(245,245,245,1) 0%, rgba(235,235,235,1) 70%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pseudo": "disabled",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(208,208,208,1) 0%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#555555",
|
||||
"cursor": "not-allowed"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundColor": "#B42222B3",
|
||||
"borderColor": "#000000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "0.5px",
|
||||
"color": "#FFFFFF",
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"lineHeight": "20px",
|
||||
"textAlign": "center"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
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 != ''
|
||||
);
|
||||
@ -0,0 +1,23 @@
|
||||
WITH GAYLORDS AS (
|
||||
SELECT
|
||||
MIN(timestamp) AS start_timestamp,
|
||||
MAX(timestamp) AS end_timestamp,
|
||||
3600/TIMESTAMPDIFF(SECOND, :startDate, :endDate) AS pph_multiplier,
|
||||
gaylord_id AS gaylord,
|
||||
SUM(count) AS total
|
||||
FROM gl_history
|
||||
WHERE timestamp BETWEEN :startDate AND :endDate
|
||||
GROUP BY gaylord_id
|
||||
ORDER BY gaylord_id
|
||||
)
|
||||
SELECT
|
||||
start_timestamp,
|
||||
end_timestamp,
|
||||
gaylord,
|
||||
/* Counts: */
|
||||
total AS total_count,
|
||||
/* PPH: */
|
||||
ROUND(total*pph_multiplier) AS total_pph,
|
||||
/* Percents: */
|
||||
ROUND(total/total, 4) AS total_percent
|
||||
FROM GAYLORDS;
|
||||
@ -0,0 +1,415 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"alwaysShowAll": false,
|
||||
"chuteNum": "",
|
||||
"isClickable": true,
|
||||
"mirror": false,
|
||||
"tagPath": "MCP05/PS01/PS01_28CH"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.alwaysShowAll": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.chuteNum": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.isClickable": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.mirror": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 92,
|
||||
"width": 94
|
||||
},
|
||||
"loading": {
|
||||
"mode": "blocking"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tself.parent.openPopup()"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Conveyor"
|
||||
},
|
||||
"position": {
|
||||
"height": 48,
|
||||
"rotate": {
|
||||
"anchor": "0 0",
|
||||
"angle": 90
|
||||
},
|
||||
"width": 89,
|
||||
"x": 69,
|
||||
"y": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.config.isClickable": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!{view.params.isClickable}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.config.showLabel": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Conv/Parameters.LabelFull"
|
||||
},
|
||||
"overlayOptOut": true,
|
||||
"type": "tag"
|
||||
}
|
||||
},
|
||||
"props.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Conv/Graphics"
|
||||
},
|
||||
"overlayOptOut": true,
|
||||
"type": "tag"
|
||||
}
|
||||
},
|
||||
"props.style.transform": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.mirror"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "scale(1, -1) translateY(-100%)"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"config": {
|
||||
"type": "chute"
|
||||
}
|
||||
},
|
||||
"type": "dex.display.conveyor"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "BCN1_BLU"
|
||||
},
|
||||
"position": {
|
||||
"height": 16,
|
||||
"width": 16,
|
||||
"y": 3
|
||||
},
|
||||
"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": "parent.props.style.transform"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "dex.display.beacon"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "BCN1_AMB"
|
||||
},
|
||||
"position": {
|
||||
"height": 16,
|
||||
"width": 16,
|
||||
"y": 18
|
||||
},
|
||||
"propConfig": {
|
||||
"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": "parent.props.style.transform"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "dex.display.beacon"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "BCN1_GRN"
|
||||
},
|
||||
"position": {
|
||||
"height": 16,
|
||||
"width": 16,
|
||||
"y": 33
|
||||
},
|
||||
"propConfig": {
|
||||
"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": "parent.props.style.transform"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "dex.display.beacon"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Half_PE"
|
||||
},
|
||||
"position": {
|
||||
"height": 10,
|
||||
"rotate": {
|
||||
"angle": 180
|
||||
},
|
||||
"width": 62,
|
||||
"x": 17,
|
||||
"y": 74
|
||||
},
|
||||
"propConfig": {
|
||||
"props.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Half_PE/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.photoeye"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Jam_PE"
|
||||
},
|
||||
"position": {
|
||||
"height": 10,
|
||||
"rotate": {
|
||||
"angle": 180
|
||||
},
|
||||
"width": 62,
|
||||
"x": 17,
|
||||
"y": 6
|
||||
},
|
||||
"propConfig": {
|
||||
"props.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Jam_PE/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.photoeye"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Full_PE"
|
||||
},
|
||||
"position": {
|
||||
"height": 10,
|
||||
"rotate": {
|
||||
"angle": 180
|
||||
},
|
||||
"width": 62,
|
||||
"x": 17,
|
||||
"y": 36
|
||||
},
|
||||
"propConfig": {
|
||||
"props.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Full_PE/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.photoeye"
|
||||
}
|
||||
],
|
||||
"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 \"DivChute|\" + 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\": \"divchute\",\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#\"rotate\": self.view.params.rotate,\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"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
WITH SORTERS AS (
|
||||
SELECT
|
||||
DATE_FORMAT(MIN(s04_timestamp), "%Y-%m-%d %H:%i:00") AS time,
|
||||
COUNT(*) AS total,
|
||||
/* PPH Data */
|
||||
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,
|
||||
/* Problem Solve Data */
|
||||
SUM(sort_code="No Read") AS no_read,
|
||||
SUM(sort_code="No Code") AS no_code,
|
||||
SUM(sort_code="Multi Label") AS multi_label,
|
||||
/* Sorter Error Data */
|
||||
SUM(sort_code="Gap Err") AS gap_err,
|
||||
SUM(sort_code="Div Fail") AS div_fail,
|
||||
SUM(sort_code="Dest None") AS dest_none,
|
||||
SUM(sort_code="Lost") AS lost
|
||||
FROM package_history
|
||||
WHERE s04_timestamp BETWEEN :startDate AND :endDate
|
||||
AND sorter = :sorter
|
||||
GROUP BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
|
||||
ORDER BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
|
||||
), DATA AS (
|
||||
SELECT
|
||||
total,
|
||||
/* PPH: */
|
||||
ROUND((SUM((total - machine - scanner)*60) OVER w)/(:movAvgMin+1)) AS total_pph,
|
||||
/* Problem Solve Percents: */
|
||||
no_read+no_code+multi_label AS scanner,
|
||||
/* Sorter Error Percents: */
|
||||
gap_err+div_fail+dest_none+lost AS sorter
|
||||
FROM SORTERS
|
||||
WINDOW w AS (ORDER BY STR_TO_DATE(time, "%Y-%m-%d %H:%i:00") RANGE BETWEEN INTERVAL :movAvgMin MINUTE PRECEDING AND CURRENT ROW)
|
||||
)
|
||||
SELECT
|
||||
MAX(total_pph) AS total_pph,
|
||||
/* Problem Solve Percents: */
|
||||
ROUND(SUM(scanner)/SUM(total), 4) AS scanner,
|
||||
/* Sorter Error Percents: */
|
||||
ROUND(SUM(sorter)/SUM(total), 4) AS sorter
|
||||
FROM DATA;
|
||||
@ -0,0 +1,20 @@
|
||||
SELECT
|
||||
COALESCE(c.sActual_Dest_ID, 'N/A') AS Lane,
|
||||
COALESCE(c.Total_count, 0) AS Total_count,
|
||||
CONCAT(COALESCE(c.DestFull_perc, 0), '%') AS DestFull_perc
|
||||
FROM (SELECT 1) AS p
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sActual_Dest_ID,
|
||||
COUNT(*) AS Total_count,
|
||||
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 DestFull_perc
|
||||
FROM item_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND (sActual_Dest_ID LIKE CONCAT(:lane, '%') OR :lane IS NULL OR :lane = '')
|
||||
GROUP BY sActual_Dest_ID
|
||||
) AS c ON 1=1
|
||||
ORDER BY c.sActual_Dest_ID;
|
||||
|
||||
|
After Width: | Height: | Size: 51 KiB |
@ -0,0 +1,97 @@
|
||||
/*+ MAX_EXECUTION_TIME(8000) */
|
||||
|
||||
-- Simple historical alarms query: get all alarms in time period
|
||||
-- Filter by priority, location, and time range - that's it
|
||||
|
||||
SELECT
|
||||
a.id AS ID,
|
||||
a.eventtime AS StartTimestamp,
|
||||
(SELECT MIN(clr.eventtime)
|
||||
FROM alarm_events clr USE INDEX (idx_alarm_events_eventid)
|
||||
WHERE clr.eventid = a.eventid
|
||||
AND clr.eventtype IN (1, 2)
|
||||
AND clr.id > a.id
|
||||
) AS EndTimestamp,
|
||||
TIME_FORMAT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, a.eventtime,
|
||||
COALESCE(
|
||||
(SELECT MIN(clr.eventtime)
|
||||
FROM alarm_events clr USE INDEX (idx_alarm_events_eventid)
|
||||
WHERE clr.eventid = a.eventid
|
||||
AND clr.eventtype IN (1, 2)
|
||||
AND clr.id > a.id
|
||||
),
|
||||
NOW()
|
||||
)
|
||||
)), '%H:%i:%s') AS Duration,
|
||||
CONCAT(REPLACE(a.displaypath, '_', '-'), ' ', SUBSTRING_INDEX(a.source, ':/alm:', -1)) AS Description,
|
||||
|
||||
CASE a.priority
|
||||
WHEN 0 THEN 'Diagnostic'
|
||||
WHEN 1 THEN 'Low'
|
||||
WHEN 2 THEN 'Medium'
|
||||
WHEN 3 THEN 'High'
|
||||
WHEN 4 THEN 'Critical'
|
||||
ELSE 'Unknown'
|
||||
END AS Priority,
|
||||
|
||||
IFNULL(tag.strValue, '') AS Tag,
|
||||
|
||||
-- Use myLocation property directly (99.96% coverage) - MUCH faster than parsing tags!
|
||||
IFNULL(loc.strValue, '') AS Location,
|
||||
|
||||
CASE
|
||||
WHEN a.priority = 3 THEN 'Alarms-Styles/High'
|
||||
WHEN a.priority = 2 THEN 'Alarms-Styles/Medium'
|
||||
WHEN a.priority = 1 THEN 'Alarms-Styles/Low'
|
||||
WHEN a.priority = 0 THEN 'Alarms-Styles/Diagnostic'
|
||||
ELSE 'Alarms-Styles/NoAlarm'
|
||||
END AS Style
|
||||
|
||||
FROM alarm_events a FORCE INDEX (idx_alarm_events_type_time_id)
|
||||
LEFT JOIN alarm_event_data tag FORCE INDEX (idx_alarm_event_data_lookup)
|
||||
ON tag.id = a.id AND tag.propname = 'myTag'
|
||||
LEFT JOIN alarm_event_data loc FORCE INDEX (idx_alarm_event_data_lookup)
|
||||
ON loc.id = a.id AND loc.propname = 'myLocation'
|
||||
|
||||
WHERE
|
||||
a.eventtype = 0
|
||||
AND a.displaypath NOT LIKE '%System Startup%'
|
||||
AND a.source NOT LIKE '%System Startup%'
|
||||
AND a.displaypath NOT LIKE '%System Shutdown%'
|
||||
AND a.source NOT LIKE '%System Shutdown%'
|
||||
AND a.eventtime >= :starttime
|
||||
AND a.eventtime < :endtime
|
||||
-- Exclude active alarms: only show alarms that have been cleared
|
||||
-- Check if a later clear/ack event exists for this eventid
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM alarm_events clr USE INDEX (idx_alarm_events_eventid)
|
||||
WHERE clr.eventid = a.eventid
|
||||
AND clr.eventtype IN (1, 2)
|
||||
AND clr.id > a.id
|
||||
LIMIT 1
|
||||
)
|
||||
|
||||
-- Priority filter: Only evaluate priority conditions when parameter is provided
|
||||
AND (
|
||||
:priority IS NULL OR :priority = '' OR :priority = 0
|
||||
OR (
|
||||
:priority IS NOT NULL AND :priority != '' AND :priority != 0 AND (
|
||||
(:priority = 3 AND a.priority = 3)
|
||||
OR (:priority = 2 AND a.priority BETWEEN 2 AND 3)
|
||||
OR (:priority = 1 AND a.priority BETWEEN 1 AND 3)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
-- LOCATION FILTER
|
||||
AND (
|
||||
(:location = 'all'
|
||||
AND (loc.strValue LIKE '%MCM01%' OR loc.strValue LIKE '%MCM02%')
|
||||
)
|
||||
OR (:location <> 'all'
|
||||
AND loc.strValue LIKE CONCAT('%', :location, '%')
|
||||
)
|
||||
)
|
||||
|
||||
ORDER BY a.eventtime DESC;
|
||||
@ -0,0 +1,15 @@
|
||||
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,
|
||||
'S03' AS sInduction_Name,
|
||||
COALESCE(sorter_total.total, 0) AS total
|
||||
FROM (SELECT 1) AS p
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
COUNT(*) AS total
|
||||
FROM item_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND adiSort_Code_0 NOT IN (11, 15)
|
||||
AND sLocation_ID LIKE 'S03%'
|
||||
) AS sorter_total ON 1=1;
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,130 @@
|
||||
################################################################
|
||||
################################################################
|
||||
## Version: 1.0 / Author: Dillon Uzar
|
||||
##
|
||||
## DESC: For use in WCS Sorting Lane Lookup & Recording
|
||||
## WARN: Modifying code may cause system to function incorrectly
|
||||
################################################################
|
||||
################################################################
|
||||
|
||||
from __future__ import with_statement
|
||||
import csv
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
import system
|
||||
import time
|
||||
from os import path
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### Constants
|
||||
#######################################################
|
||||
|
||||
# Logger:
|
||||
LOG = system.util.logger("WCS Sorting Handler")
|
||||
|
||||
# Defaults for function arguments:
|
||||
PROGRAM_PATH = ""
|
||||
CARTON_PATH = "WCS_Package"
|
||||
DEFAULT_DEVICE = "MCP20"
|
||||
DEFAULT_OPC_SERVER = "Ignition OPC UA Server"
|
||||
|
||||
# Configuration variables:
|
||||
MAX_CARTONS = 100 # Max possible carton IDs
|
||||
MAX_BARCODE_SIZE = 82 # Max possible size of full barcode
|
||||
|
||||
# For extracting PLC info:
|
||||
PACKAGE_DATA = [
|
||||
#["Induct_ID", "induct"], # The induct the package was inducted from
|
||||
#["Scanner_ID", "scanner"], # The scanner the package was scanned from
|
||||
#["Sorter_ID", "sorter"], # The sorter the package was sorted from
|
||||
["BCR_Img_ID", "bcr_imgid"], # Barcode reader, sequence ID
|
||||
["BCR_Seq_ID", "bcr_seqid"], # Barcode reader, image ID
|
||||
["Length", "pkg_length"], # Package length in units of 1/10". Only populated if available, use 0 if not
|
||||
["Width", "pkg_width"], # Package width in units of 1/10". Only populated if available, use 0 if not
|
||||
["Height", "pkg_height"], # Package height in units of 1/10". Only populated if available, use 0 if not
|
||||
["Carriers", "carriers"], # Num of carriers (trays/shoes) on sorter that the package is occupying. Only populated if available, use 0 if not
|
||||
["Gap_Leading", "gap_leading"], # Leading edge gap distance in units of 1/10". Only populated if available, use 0 if not. If value exceeds INT size, cap it to the max INT value
|
||||
["Gap_Trailing", "gap_trailing"], # Trailing edge gap distance in units of 1/10". Only populated if available, use 0 if not. If value exceeds INT size, cap it to the max INT value
|
||||
["S01_Barcode", "s01_barcode"], # The barcode sent in the S01 message
|
||||
["S02_Req_Dest_ID", "s02_req_dest"], # The requested destination ID sent in the S02 message
|
||||
["S02_Alt_Dest_ID", "s02_alt_dest"], # The alternate destination ID sent in the S02 message
|
||||
["S04_PLC_ID", "s04_plc_id"], # Internal PLC number used to track packages and cross reference to the Host ID
|
||||
["S04_Host_ID", "s04_host_id"], # The PLC record number sent in the S04 message, (1 - 9999)
|
||||
["S04_Req_Dest_ID", "s04_req_dest"], # The requested destination ID sent in the S04 message
|
||||
["S04_Act_Dest_ID", "s04_act_dest"], # The actual destination ID sent in the S04 message
|
||||
["S04_Sort_Code", "s04_sort_code"], # The reason code sent in the S04 message
|
||||
["Req_Dest_Reason", "req_dest_reason"], # See Destination Reason Bit-Map sheet
|
||||
["Alt_Dest_Reason", "alt_dest_reason"] # See Destination Reason Bit-Map sheet
|
||||
]
|
||||
TIMESTAMP_DATA = [
|
||||
["S01_Timestamp_H", "s01_timestamp"], # The timestamp sent in the S01 message, Upper 32-bits, UTS in microseconds
|
||||
["S01_Timestamp_L", "s01_timestamp"], # The timestamp sent in the S01 message, Lower 32-bits, UTS in microseconds
|
||||
["S02_Timestamp_H", "s02_timestamp"], # The timestamp sent in the S02 message, Upper 32-bits, UTS in microseconds
|
||||
["S02_Timestamp_L", "s02_timestamp"], # The timestamp sent in the S02 message, Lower 32-bits, UTS in microseconds
|
||||
["S04_Timestamp_H", "s04_timestamp"], # The timestamp sent in the S04 message, Upper 32-bits, UTS in microseconds
|
||||
["S04_Timestamp_L", "s04_timestamp"] # The timestamp sent in the S04 message, Lower 32-bits, UTS in microseconds
|
||||
]
|
||||
# Generate array of paths to read:
|
||||
PACKAGE_PATHS = [v[0] for v in PACKAGE_DATA]
|
||||
TIMESTAMP_PATHS = [v[0] for v in TIMESTAMP_DATA]
|
||||
DATA_PATHS = PACKAGE_PATHS + TIMESTAMP_PATHS
|
||||
|
||||
# For inserting data into database:
|
||||
PACKAGE_COLS = [v[1] for v in PACKAGE_DATA]
|
||||
PACKAGE_VALS = ["?"]*len(PACKAGE_COLS)
|
||||
TIMESTAMP_COLS = [TIMESTAMP_DATA[i][1] for i in range(len(TIMESTAMP_DATA)) if TIMESTAMP_DATA[i][1] in (v[1] for v in TIMESTAMP_DATA[:i])]
|
||||
TIMESTAMP_VALS = ["FROM_UNIXTIME(((?&(POWER(2, 32)-1))*POWER(2, 32)+(?&(POWER(2, 32)-1)))/1000000)"]*len(TIMESTAMP_COLS)
|
||||
UNIQUE_COLS = ["trackid", "induct", "scanner", "sorter"] + PACKAGE_COLS + TIMESTAMP_COLS
|
||||
UNIQUE_VALS = ["?"]*4 + PACKAGE_VALS + TIMESTAMP_VALS
|
||||
CONFIRM_INSERT_QUERY = "INSERT IGNORE INTO package_history (" + ",".join(UNIQUE_COLS) + ") VALUES (" + ",".join(UNIQUE_VALS) + ")"
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### Parsing Utils
|
||||
#######################################################
|
||||
|
||||
def isNoRead(field):
|
||||
return field.replace("?","") == ""
|
||||
|
||||
def isMultiRead(field):
|
||||
return field.replace("#","") == ""
|
||||
|
||||
def isBadRead(field):
|
||||
return (field == None or isNoRead(field) or isMultiRead(field))
|
||||
|
||||
def logTime(title, trackID, seconds):
|
||||
millisec = round(seconds * 1000, 1)
|
||||
LOG.info("%s[ID=%s] took %sms to process" % (title, trackID, millisec))
|
||||
|
||||
#######################################################
|
||||
#######################################################
|
||||
#######################################################
|
||||
#### PLC Event Handling
|
||||
#######################################################
|
||||
|
||||
def processConfirmAsync(trackID, induct, scanner, sorter, program=PROGRAM_PATH, carton=CARTON_PATH, device=DEFAULT_DEVICE, opcServer=DEFAULT_OPC_SERVER):
|
||||
# This function handles confirm events, and logs the event in SQL
|
||||
# Ensure ID is valid
|
||||
if trackID > 0 and trackID < MAX_CARTONS:
|
||||
def processConfirmInner():
|
||||
start_time = time.time()
|
||||
# Setup carton location:
|
||||
devicePrefix = "[" + device + "]" + program
|
||||
cartonPrefix = devicePrefix + carton + "[" + str(trackID) + "]"
|
||||
# Read all carton data directly:
|
||||
tags = [cartonPrefix + "." + path for path in DATA_PATHS]
|
||||
values = [trackID, induct, scanner, sorter] + [value.value for value in system.opc.readValues(opcServer, tags)]
|
||||
logTime("Confirm[PLC_READ]", trackID, time.time() - start_time)
|
||||
start_time = time.time()
|
||||
# Log confirm event in SQL:
|
||||
# Insert into Package History:
|
||||
system.db.runPrepUpdate(CONFIRM_INSERT_QUERY, values)
|
||||
logTime("Confirm[DB_INSERT]", trackID, time.time() - start_time)
|
||||
|
||||
system.util.invokeAsynchronous(processConfirmInner)
|
||||
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
@ -0,0 +1,24 @@
|
||||
WITH LANES AS (
|
||||
SELECT
|
||||
MIN(timestamp) AS start_timestamp,
|
||||
MAX(timestamp) AS end_timestamp,
|
||||
3600/TIMESTAMPDIFF(SECOND, :startDate, :endDate) AS pph_multiplier,
|
||||
lane_id AS induct,
|
||||
SUM(count) AS total
|
||||
FROM pe_history FORCE INDEX (timestamp)
|
||||
WHERE timestamp BETWEEN :startDate AND :endDate
|
||||
AND (lane_id LIKE "UL%" OR lane_id LIKE "PRS%" OR lane_id LIKE "RE%")
|
||||
GROUP BY lane_id
|
||||
ORDER BY lane_id
|
||||
)
|
||||
SELECT
|
||||
start_timestamp,
|
||||
end_timestamp,
|
||||
induct,
|
||||
/* Counts: */
|
||||
total AS total_count,
|
||||
/* PPH: */
|
||||
ROUND(total*pph_multiplier) AS total_pph,
|
||||
/* Percents: */
|
||||
ROUND(total/total, 4) AS total_percent
|
||||
FROM LANES;
|
||||
@ -0,0 +1,575 @@
|
||||
{
|
||||
"custom": {
|
||||
"color": "#C2C2C2",
|
||||
"priority": "No Active Alarms",
|
||||
"state": "Closed"
|
||||
},
|
||||
"params": {
|
||||
"demoColor": -1,
|
||||
"tagProps": [
|
||||
"System/MCM02/Scanner/S03",
|
||||
"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},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "No Active Alarms"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Medium"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Low"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "Unknown",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "Closed"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Actuated"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Communication Faulted"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Conveyor Running In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "Disconnected"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "Enabled Not Running"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "Encoder Fault"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "Energy Management"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "ESTOP Was Actuated"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "EStopped"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "EStopped Locally"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "Extended Faulted"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "Full"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "Gaylord Start Pressed"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "Jam Fault"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "Jammed"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "Loading Allowed"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "Loading Not Allowed"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "Low Air Pressure Fault Was Present"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 22,
|
||||
"output": "Conveyor Stopped In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 23,
|
||||
"output": "Motor Faulted"
|
||||
},
|
||||
{
|
||||
"input": 24,
|
||||
"output": "Motor Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 25,
|
||||
"output": "Normal"
|
||||
},
|
||||
{
|
||||
"input": 26,
|
||||
"output": "Off Inactive"
|
||||
},
|
||||
{
|
||||
"input": 27,
|
||||
"output": "Open"
|
||||
},
|
||||
{
|
||||
"input": 28,
|
||||
"output": "PLC Ready To Run"
|
||||
},
|
||||
{
|
||||
"input": 29,
|
||||
"output": "Package Release Pressed"
|
||||
},
|
||||
{
|
||||
"input": 30,
|
||||
"output": "Power Branch Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 31,
|
||||
"output": "Pressed"
|
||||
},
|
||||
{
|
||||
"input": 32,
|
||||
"output": "Ready To Receive"
|
||||
},
|
||||
{
|
||||
"input": 33,
|
||||
"output": "Running"
|
||||
},
|
||||
{
|
||||
"input": 34,
|
||||
"output": "Started"
|
||||
},
|
||||
{
|
||||
"input": 35,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 36,
|
||||
"output": "System Started"
|
||||
},
|
||||
{
|
||||
"input": 37,
|
||||
"output": "Unknown"
|
||||
},
|
||||
{
|
||||
"input": 38,
|
||||
"output": "VFD Fault"
|
||||
},
|
||||
{
|
||||
"input": 39,
|
||||
"output": "Conveyor Running In Power Saving Mode"
|
||||
},
|
||||
{
|
||||
"input": 40,
|
||||
"output": "Conveyor Jogging In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 41,
|
||||
"output": "VFD Reset Required"
|
||||
},
|
||||
{
|
||||
"input": 42,
|
||||
"output": "Jam Reset Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 43,
|
||||
"output": "Start Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 44,
|
||||
"output": "Stop Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 45,
|
||||
"output": "No Container"
|
||||
},
|
||||
{
|
||||
"input": 46,
|
||||
"output": "Ready To Be Enabled"
|
||||
},
|
||||
{
|
||||
"input": 47,
|
||||
"output": "Half Full"
|
||||
},
|
||||
{
|
||||
"input": 48,
|
||||
"output": "Enabled"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.demoColor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 47,
|
||||
"width": 68
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "scanner"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[3].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.color"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs3",
|
||||
"name": "defs3",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"d": "M 12.414439,21.622269 A 10,10 0 0 1 3.6989343,16.637386 10,10 0 0 1 3.7050549,6.5970154 10,10 0 0 1 12.426631,1.6227621",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "circle2",
|
||||
"name": "circle2",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "m 12.613908,2.4818261 c 6.942674,2.0834521 13.885347,6.0484566 20.828021,9.0726849 -6.945981,3.064219 -13.756047,6.450542 -20.837943,9.220277 l 0.0095,1.573493 C 20.634274,19.516759 28.443167,15.021636 36.358007,11.377844 28.442954,7.8932966 21.08348,3.5675692 12.628474,0.8929519 Z",
|
||||
"fill": {
|
||||
"opacity": "1",
|
||||
"paint": "#000000"
|
||||
},
|
||||
"id": "path1",
|
||||
"name": "path1",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "0.4"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 12.389032,20.647726 C 6.9023213,20.490828 3.0753636,16.369847 3.0567874,11.653611 3.038211,6.9373755 6.5424269,3.1052388 12.194672,2.492415 m 0.189184,18.176827 -0.200534,-18.1942153 3.376452,1.1997941 4.395729,1.769738 13.626819,6.0452262 -15.195971,6.684943 z",
|
||||
"fill": {
|
||||
"opacity": "1"
|
||||
},
|
||||
"id": "path3",
|
||||
"name": "path3",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "0"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 38 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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": "High",
|
||||
"output": "Alarms-Styles/High"
|
||||
},
|
||||
{
|
||||
"input": "Medium",
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": "Low",
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": "Diagnostic",
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\n {view.custom.state} !\u003d \"Closed\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"aspectRatio": "68:47",
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer",
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
SELECT
|
||||
COALESCE(c.sActual_Dest_ID, 'N/A') AS Lane,
|
||||
COALESCE(c.Total_rate, 0) AS Total_rate,
|
||||
COALESCE(c.DestFull_rate, 0) AS DestFull_rate
|
||||
FROM (SELECT 1) AS p
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sActual_Dest_ID,
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COUNT(*) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS Total_rate,
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) * 3600.0 / TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS DestFull_rate
|
||||
FROM item_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND (sActual_Dest_ID LIKE CONCAT(:lane, '%') OR :lane IS NULL OR :lane = '')
|
||||
GROUP BY sActual_Dest_ID
|
||||
) AS c ON 1=1
|
||||
ORDER BY c.sActual_Dest_ID;
|
||||
@ -0,0 +1,60 @@
|
||||
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,
|
||||
'S03aa' AS sScanner_Name,
|
||||
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COALESCE(sorter_total.total_bad_reads, 0) * 3600.0
|
||||
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS total_bad_reads,
|
||||
|
||||
0 AS total_comm_faults,
|
||||
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COALESCE(sorter_total.total_good_reads, 0) * 3600.0
|
||||
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS total_good_reads,
|
||||
|
||||
0 AS total_multi_items,
|
||||
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COALESCE(sorter_total.total_multi_reads, 0) * 3600.0
|
||||
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS total_multi_reads,
|
||||
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COALESCE(sorter_total.total_no_data, 0) * 3600.0
|
||||
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS total_no_data,
|
||||
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COALESCE(sorter_total.total_no_reads, 0) * 3600.0
|
||||
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS total_no_reads,
|
||||
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
|
||||
ELSE ROUND(COALESCE(sorter_total.total, 0) * 3600.0
|
||||
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
|
||||
END AS total
|
||||
|
||||
FROM (SELECT 1) AS p
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) AS total_bad_reads,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS total_good_reads,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) AS total_multi_reads,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) AS total_no_data,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) AS total_no_reads,
|
||||
COUNT(*) AS total
|
||||
FROM item_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND adiSort_Code_0 NOT IN (11, 15)
|
||||
AND sLocation_ID LIKE 'S03%'
|
||||
) AS sorter_total ON 1 = 1;
|
||||
|
After Width: | Height: | Size: 84 B |
@ -0,0 +1,395 @@
|
||||
{
|
||||
"custom": {
|
||||
"hasControls": null,
|
||||
"isRunning": false
|
||||
},
|
||||
"params": {
|
||||
"label": "System",
|
||||
"tagPath": "[default]SystemStatus",
|
||||
"tagPaths": [],
|
||||
"view": "Windows/Graphics/Overview"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.hasControls": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "// Force refresh:\r\nif(now(1000)\u003dnow(1000),\r\n\t{view.params.tagPaths},\r\n\t{view.params.tagPaths}\r\n)"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\ttags \u003d [tagPath + \"/SetStart.Quality\" for tagPath in value] + [tagPath + \"/SetStop.Quality\" for tagPath in value]\n\tqualities \u003d [v.getQuality() for v in system.tag.readBlocking(tags)]\n\tqualities \u003d [v \u003d\u003d v.Good for v in qualities]\n\treturn any(qualities) and len(qualities) \u003e 0",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.isRunning": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/bStarted"
|
||||
},
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.label": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPaths": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPaths[0]": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPaths[1]": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPaths[2]": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPaths[3]": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.view": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 40,
|
||||
"width": 125
|
||||
}
|
||||
},
|
||||
"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": "if({view.params.label} \u003d None || {view.params.label} \u003d \"\",\r\n\t{value},\r\n\t{view.params.label}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#FFF",
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 1,
|
||||
"fontFamily": "var(--font-NotoSans)",
|
||||
"fontSize": "12px",
|
||||
"fontWeight": "bold",
|
||||
"paddingLeft": "5px",
|
||||
"textTransform": "uppercase",
|
||||
"user-select": "none"
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"props.status.tooltip": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "{tagPath}/Graphics"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "//\"System\u003cbr\u003eStatus: \"+if({view.custom.hasControls}, if({view.custom.isRunning}, \"Running\", \"Stopped\"), \"Unknown\")\r\njsonGet({value}, \"tooltip\")",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"status": {}
|
||||
},
|
||||
"type": "dex.display.tooltipoverlay"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\ttagPaths \u003d self.view.params.tagPaths\n\tif len(tagPaths) \u003e 0:\n\t\ttags \u003d [tagPath + \"/SetStart\" for tagPath in tagPaths]\n\t\tvalues \u003d [1]*len(tagPaths)\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": {
|
||||
"path": "view.custom.hasControls"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.textStyle.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.isRunning"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(isGood({value}), {value}, \"\")",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "#888888",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "#32CD32"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "►",
|
||||
"textStyle": {
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": "14px"
|
||||
}
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\ttagPaths \u003d self.view.params.tagPaths\n\tif len(tagPaths) \u003e 0:\n\t\ttags \u003d [tagPath + \"/SetStop\" for tagPath in tagPaths]\n\t\tvalues \u003d [1]*len(tagPaths)\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": {
|
||||
"path": "view.custom.hasControls"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.textStyle.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.isRunning"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(isGood({value}), {value}, \"\")",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "#888888",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": false,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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)"
|
||||
}
|
||||
],
|
||||
"extensionFunctions": null,
|
||||
"messageHandlers": []
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
SELECT
|
||||
roundtime AS `Round Time`,
|
||||
sActual_Dest_ID AS `Lane`,
|
||||
COALESCE(Success_rate, 0) AS `Success Rate`,
|
||||
COALESCE(Unknown_rate, 0) AS `Unknown Rate`,
|
||||
COALESCE(Unexpected_Container_rate, 0) AS `Unexpected Container Rate`,
|
||||
COALESCE(Tracking_Error_rate, 0) AS `Tracking Error Rate`,
|
||||
COALESCE(Gap_Error_rate, 0) AS `Gap Error Rate`,
|
||||
COALESCE(Destination_Full_rate, 0) AS `Destination Full Rate`,
|
||||
COALESCE(Destination_Non_Operational_rate, 0) AS `Destination Non Operational Rate`,
|
||||
COALESCE(Invalid_Destination_rate, 0) AS `Invalid Destination Rate`,
|
||||
COALESCE(Scanner_Error_rate, 0) AS `Scanner Error Rate`,
|
||||
COALESCE(Destination_Disabled_rate, 0) AS `Destination Disabled Rate`,
|
||||
COALESCE(Throughput_Limit_rate, 0) AS `Throughput Limit Rate`,
|
||||
COALESCE(Failed_To_Divert_rate, 0) AS `Failed To Divert Rate`,
|
||||
COALESCE(No_Destination_Received_rate, 0) AS `No Destination Received Rate`,
|
||||
COALESCE(Lost_Container_rate, 0) AS `Lost Container Rate`,
|
||||
COALESCE(Dimension_Error_rate, 0) AS `Dimension Error Rate`,
|
||||
COALESCE(Weight_Error_rate, 0) AS `Weight Error Rate`,
|
||||
COALESCE(Container_Utilization_rate, 0) AS `Container Utilization Rate`,
|
||||
COALESCE(Unable_To_Divert_rate, 0) AS `Unable To Divert Rate`,
|
||||
COALESCE(Destination_Not_Attempted_rate, 0) AS `Destination Not Attempted Rate`
|
||||
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,
|
||||
sActual_Dest_ID,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Success_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 1 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Unknown_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 2 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Unexpected_Container_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 3 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Tracking_Error_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 4 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Gap_Error_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Destination_Full_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 6 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Destination_Non_Operational_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 7 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Invalid_Destination_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 IN (8, 9, 10) THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Scanner_Error_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 12 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Destination_Disabled_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 13 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Throughput_Limit_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 14 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Failed_To_Divert_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 16 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS No_Destination_Received_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 17 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Lost_Container_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 18 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Dimension_Error_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 19 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Weight_Error_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 20 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Container_Utilization_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 21 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Unable_To_Divert_rate,
|
||||
CASE WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0 ELSE ROUND(SUM(CASE WHEN adiSort_Code_0 = 22 THEN 1 ELSE 0 END) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2) END AS Destination_Not_Attempted_rate
|
||||
FROM item_data
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
AND adiSort_Code_0 NOT IN (11, 15)
|
||||
AND (COALESCE(:Lane, '') = '' OR sActual_Dest_ID = :Lane)
|
||||
GROUP BY roundtime, sActual_Dest_ID
|
||||
ORDER BY roundtime ASC
|
||||
) basa;
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": "10px",
|
||||
"textAlign": "center"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,685 @@
|
||||
{
|
||||
"custom": {
|
||||
"title": ""
|
||||
},
|
||||
"params": {},
|
||||
"permissions": {
|
||||
"securityLevels": [],
|
||||
"type": "AllOf"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.title": {
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 400,
|
||||
"width": 1600
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Table"
|
||||
},
|
||||
"position": {
|
||||
"height": "100%",
|
||||
"width": "100%"
|
||||
},
|
||||
"props": {
|
||||
"cells": {
|
||||
"style": {
|
||||
"borderBottomColor": "#D5D5D5",
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": "1px",
|
||||
"borderRightColor": "#D5D5D5",
|
||||
"borderRightStyle": "solid",
|
||||
"borderRightWidth": "1px",
|
||||
"color": "#000",
|
||||
"fontFamily": "Helvetica",
|
||||
"fontSize": "14px"
|
||||
}
|
||||
},
|
||||
"columns": [
|
||||
{
|
||||
"align": "center",
|
||||
"boolean": "checkbox",
|
||||
"dateFormat": "MM/DD/YYYY",
|
||||
"editable": false,
|
||||
"field": "eventtime",
|
||||
"footer": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"title": ""
|
||||
},
|
||||
"header": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"title": ""
|
||||
},
|
||||
"justify": "auto",
|
||||
"number": "value",
|
||||
"numberFormat": "0,0.##",
|
||||
"progressBar": {
|
||||
"bar": {
|
||||
"color": "#62A3F6",
|
||||
"linecap": "round",
|
||||
"width": 5
|
||||
},
|
||||
"max": 100,
|
||||
"track": {
|
||||
"color": "#DADADA",
|
||||
"linecap": "round",
|
||||
"width": 2
|
||||
},
|
||||
"value": {
|
||||
"color": "#7D7D7D",
|
||||
"show": true
|
||||
}
|
||||
},
|
||||
"render": "auto",
|
||||
"resizable": true,
|
||||
"sort": "none",
|
||||
"sortable": true,
|
||||
"strictWidth": false,
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"toggleSwitch": {
|
||||
"color": {
|
||||
"selected": "#2196F3",
|
||||
"unselected": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
"viewParams": {},
|
||||
"viewPath": "",
|
||||
"visible": true,
|
||||
"width": ""
|
||||
}
|
||||
],
|
||||
"pager": {
|
||||
"bottom": false
|
||||
},
|
||||
"rows": {
|
||||
"highlight": {
|
||||
"enabled": false
|
||||
},
|
||||
"striped": {
|
||||
"enabled": false
|
||||
},
|
||||
"style": {
|
||||
"classes": "table/highlight"
|
||||
}
|
||||
},
|
||||
"style": {
|
||||
"fontFamily": "Helvetica",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.table"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "Table"
|
||||
},
|
||||
"position": {
|
||||
"height": "calc(100% - 40px)",
|
||||
"width": "calc(100% - 250px)",
|
||||
"x": 250,
|
||||
"y": 40
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"border-left": "2px solid #000",
|
||||
"min-width": "450px"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "LabelHeader"
|
||||
},
|
||||
"position": {
|
||||
"height": 40,
|
||||
"width": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": " \"Custom Reports\"\r\n+if(len({view.custom.title})\u003e0, \" - \" + {view.custom.title}, \"\")"
|
||||
},
|
||||
"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": "\t# Grab Data:\n\ttable \u003d self.parent.getChild(\"Table\").getChild(\"Table\")\n\tdata \u003d utils.downloadCSV(table, self.view.custom.title)"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button_Export"
|
||||
},
|
||||
"position": {
|
||||
"height": 30,
|
||||
"width": 100,
|
||||
"x": "calc(100% - 105px)",
|
||||
"y": 5
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "Export"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\treportTree \u003d self.getSibling(\"ReportTree\")\n\treportTree.meta.visible \u003d not reportTree.meta.visible"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button_Mode"
|
||||
},
|
||||
"position": {
|
||||
"height": 32,
|
||||
"width": 85,
|
||||
"x": 4,
|
||||
"y": 4
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({../ReportTree.meta.visible},\r\n\t\"Files\",\r\n\t\"Reports\"\r\n)"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"enabled": false,
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "Files"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "PABE2XXI",
|
||||
"modal": true,
|
||||
"overlayDismiss": true,
|
||||
"resizable": false,
|
||||
"showCloseIcon": true,
|
||||
"title": "Upload Custom Report",
|
||||
"type": "open",
|
||||
"viewPath": "Popups/CustomReports/ConfigUpload"
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button_UploadConfig",
|
||||
"visible": false
|
||||
},
|
||||
"position": {
|
||||
"height": 32,
|
||||
"width": 85,
|
||||
"x": 93,
|
||||
"y": 4
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{../ReportTree.meta.visible}\r\n\u0026\u0026 ({session.props.device.type} \u003d \"designer\" || isAuthorized(\r\n\tfalse,\r\n\t\u0027Authenticated/Roles/Administrator\u0027,\r\n\t\u0027Authenticated/Roles/Developer\u0027\r\n))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "Upload"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\t# Get filenames:\n\ttree \u003d self.getSibling(\u0027ReportTree\u0027)\n\tfilenames \u003d [sel.value for sel in tree.props.selectionData]\n\t\n\terr \u003d reports.downloadConfigs(filenames)\n\n\t# Check if err:\n\tif err is not None:\n\t\tsystem.gui.messageBox(err, \"Error\")"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button_DownloadConfig",
|
||||
"visible": false
|
||||
},
|
||||
"position": {
|
||||
"height": 32,
|
||||
"width": 95,
|
||||
"x": 182,
|
||||
"y": 4
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{../ReportTree.meta.visible}\r\n\u0026\u0026 ({session.props.device.type} \u003d \"designer\" || isAuthorized(\r\n\tfalse,\r\n\t\u0027Authenticated/Roles/Administrator\u0027,\r\n\t\u0027Authenticated/Roles/Developer\u0027\r\n))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "../ReportTree.props.selection"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn len(value)\u003e0",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "Download"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "5QyUoYBU",
|
||||
"modal": true,
|
||||
"overlayDismiss": true,
|
||||
"resizable": false,
|
||||
"showCloseIcon": true,
|
||||
"title": "Delete Confirmation",
|
||||
"type": "open",
|
||||
"viewParams": {
|
||||
"filenames": "{/root/ReportTree.props.selectionData}"
|
||||
},
|
||||
"viewPath": "Popups/CustomReports/DeleteConfirmation"
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button_DeleteConfig",
|
||||
"visible": false
|
||||
},
|
||||
"position": {
|
||||
"height": 32,
|
||||
"width": 85,
|
||||
"x": 281,
|
||||
"y": 4
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{../ReportTree.meta.visible}\r\n\u0026\u0026 ({session.props.device.type} \u003d \"designer\" || isAuthorized(\r\n\tfalse,\r\n\t\u0027Authenticated/Roles/Administrator\u0027,\r\n\t\u0027Authenticated/Roles/Developer\u0027\r\n))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "../ReportTree.props.selection"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn len(value)\u003e0",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "Delete"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "FileTree",
|
||||
"visible": false
|
||||
},
|
||||
"position": {
|
||||
"height": "calc(100% - 97px)",
|
||||
"width": 250,
|
||||
"y": 65
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!{../ReportTree.meta.visible}"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"appearance": {
|
||||
"defaultNodeIcons": {
|
||||
"collapsed": {
|
||||
"color": "#5F707E",
|
||||
"path": "material/folder"
|
||||
},
|
||||
"empty": {
|
||||
"color": "#869DB1",
|
||||
"path": "material/stop"
|
||||
},
|
||||
"expanded": {
|
||||
"color": "#5F707E",
|
||||
"path": "material/folder_open"
|
||||
}
|
||||
},
|
||||
"expandIcons": {
|
||||
"collapsed": {
|
||||
"color": "#869DB1",
|
||||
"path": "material/arrow_right"
|
||||
},
|
||||
"empty": {
|
||||
"color": "#869DB1"
|
||||
},
|
||||
"expanded": {
|
||||
"color": "#869DB1",
|
||||
"path": "material/arrow_drop_down"
|
||||
}
|
||||
},
|
||||
"selectedStyle": {
|
||||
"backgroundColor": "#BBE0F6",
|
||||
"color": "#000",
|
||||
"cursor": "pointer"
|
||||
},
|
||||
"unselectedStyle": {
|
||||
"classes": "Tree/hoverUnselected",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "ia.display.tree"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.print(self.getSibling(\"FileTree\").props.selection)"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button_DownloadFiles",
|
||||
"visible": false
|
||||
},
|
||||
"position": {
|
||||
"height": 32,
|
||||
"y": "calc(100% - 32px)"
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "../FileTree.meta.visible"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"position.width": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "../FileTree.position.width"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "../FileTree.props.selection"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn len(value)\u003e0",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Buttons/Grey"
|
||||
},
|
||||
"text": "Download Selected"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"dom": {
|
||||
"onDoubleClick": {
|
||||
"config": {
|
||||
"script": "\tdata \u003d self.props.selectionData\n\tif len(data) \u003d\u003d 1:\n\t\tconfig \u003d data[0].value\n\t\tresults \u003d reports.readTable(config)\n\t\t# Return data table:\n\t\tif \u0027err\u0027 in results:\n\t\t\tsystem.gui.messageBox(results[\u0027err\u0027], \"Error\")\n\t\telse:\n\t\t\ttable \u003d self.getSibling(\"Table\").getChild(\"Table\")\n\t\t\ttable.props.data \u003d results[\u0027data\u0027]\n\t\t\ttable.props.columns \u003d results[\u0027columns\u0027]\n\t\t\tself.view.custom.title \u003d \".\".join(config.split(\".\")[:-1])"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
},
|
||||
"system": {
|
||||
"onStartup": {
|
||||
"config": {
|
||||
"script": "\tself.refreshList()"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "ReportTree"
|
||||
},
|
||||
"position": {
|
||||
"height": "calc(100% - 65px)",
|
||||
"width": 250,
|
||||
"y": 65
|
||||
},
|
||||
"props": {
|
||||
"appearance": {
|
||||
"defaultNodeIcons": {
|
||||
"collapsed": {
|
||||
"color": "#5F707E",
|
||||
"path": "material/folder"
|
||||
},
|
||||
"empty": {
|
||||
"color": "#869DB1",
|
||||
"path": "material/stop"
|
||||
},
|
||||
"expanded": {
|
||||
"color": "#5F707E",
|
||||
"path": "material/folder_open"
|
||||
}
|
||||
},
|
||||
"expandIcons": {
|
||||
"collapsed": {
|
||||
"color": "#869DB1",
|
||||
"path": "material/arrow_right"
|
||||
},
|
||||
"empty": {
|
||||
"color": "#869DB1"
|
||||
},
|
||||
"expanded": {
|
||||
"color": "#869DB1",
|
||||
"path": "material/arrow_drop_down"
|
||||
}
|
||||
},
|
||||
"selectedStyle": {
|
||||
"backgroundColor": "#BBE0F6",
|
||||
"color": "#000",
|
||||
"cursor": "pointer",
|
||||
"user-select": "none"
|
||||
},
|
||||
"unselectedStyle": {
|
||||
"classes": "Tree/hoverUnselected",
|
||||
"cursor": "pointer",
|
||||
"user-select": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"customMethods": [
|
||||
{
|
||||
"name": "refreshList",
|
||||
"params": [],
|
||||
"script": "\ticons \u003d {\n\t\t\"csv\": {\n\t\t\t\"path\": \"material/table_chart\",\n\t\t\t\"color\": \"#869DB1\"\n\t\t},\n\t\t\"sql\": {\n\t\t\t\"path\": \"material/storage\",\n\t\t\t\"color\": \"#869DB1\"\n\t\t}\n\t}\n\t\n\tconfigs \u003d []\n\troles \u003d self.session.props.auth.user.roles\n\tfor config in reports.getConfigs(roles\u003droles):\n\t\tparts \u003d config.split(\".\")\n\t\tconfigs.append({\n\t\t\t\"label\": \".\".join(parts[:-1]),\n\t\t\t\"expanded\": False,\n\t\t\t\"icon\": icons.get(parts[-1], \"\"),\n\t\t\t\"data\": config,\n\t\t\t\"items\": []\n\t\t})\n\t\n\tself.props.items \u003d configs"
|
||||
}
|
||||
],
|
||||
"messageHandlers": [
|
||||
{
|
||||
"messageType": "custom-reports-refreshlist",
|
||||
"pageScope": true,
|
||||
"script": "\tself.refreshList()",
|
||||
"sessionScope": false,
|
||||
"viewScope": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "ia.display.tree"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "LabelTree"
|
||||
},
|
||||
"position": {
|
||||
"height": 25,
|
||||
"width": 250,
|
||||
"y": 40
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({../ReportTree.meta.visible},\r\n\t\"On-Demand Reports\",\r\n\t\"Pre-Run Reports\"\r\n)"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#808080",
|
||||
"borderBottomColor": "#000",
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": 2,
|
||||
"color": "#FFF",
|
||||
"fontSize": "16px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "center",
|
||||
"user-select": "none"
|
||||
},
|
||||
"text": "On-Demand Reports"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"min-width": "1000px"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
SELECT
|
||||
roundtime AS `Round Time`,
|
||||
sScanner_Name AS `Scanner Name`,
|
||||
COALESCE(total_bad_reads, 0) AS `Total Bad Reads`,
|
||||
COALESCE(total_comm_faults, 0) AS `Total Comm Faults`,
|
||||
COALESCE(total_good_reads, 0) AS `Total Good Reads`,
|
||||
COALESCE(total_multi_items, 0) AS `Total Multi Items`,
|
||||
COALESCE(total_multi_reads, 0) AS `Total Multi Reads`,
|
||||
COALESCE(total_no_data, 0) AS `Total No Data`,
|
||||
COALESCE(total_no_reads, 0) AS `Total No Reads`,
|
||||
COALESCE(total_bad_reads, 0) +
|
||||
COALESCE(total_comm_faults, 0) +
|
||||
COALESCE(total_good_reads, 0) +
|
||||
COALESCE(total_multi_items, 0) +
|
||||
COALESCE(total_multi_reads, 0) +
|
||||
COALESCE(total_no_data, 0) +
|
||||
COALESCE(total_no_reads, 0) AS `Total`
|
||||
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,
|
||||
sScanner_Name,
|
||||
SUM(diScanner_bad_reads) AS total_bad_reads,
|
||||
SUM(diScanner_comm_fault) AS total_comm_faults,
|
||||
SUM(diScanner_good_reads) AS total_good_reads,
|
||||
SUM(diScanner_multi_items) AS total_multi_items,
|
||||
SUM(diScanner_multi_reads) AS total_multi_reads,
|
||||
SUM(diScanner_no_data) AS total_no_data,
|
||||
SUM(diScanner_no_reads) 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 roundtime, sScanner_Name
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
FROM_UNIXTIME(
|
||||
FLOOR(UNIX_TIMESTAMP(t_stamp) /
|
||||
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
|
||||
) *
|
||||
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
|
||||
) AS roundtime,
|
||||
'S03aa' AS sScanner_Name,
|
||||
SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) AS total_bad_reads,
|
||||
0 AS total_comm_faults,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS total_good_reads,
|
||||
0 AS total_multi_items,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) AS total_multi_reads,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) AS total_no_data,
|
||||
SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 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 roundtime
|
||||
ORDER BY roundtime ASC
|
||||
) basa;
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundColor": "#007EFCB3",
|
||||
"borderColor": "#000000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "0.5px",
|
||||
"color": "#000000",
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"lineHeight": "20px",
|
||||
"textAlign": "center"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,600 @@
|
||||
{
|
||||
"custom": {
|
||||
"color": "#000000",
|
||||
"priority": "No Active Alarms",
|
||||
"state": "Offline"
|
||||
},
|
||||
"params": {
|
||||
"demoColor": -1,
|
||||
"tagProps": [
|
||||
"System/MCM01/DPM/PS3_1_DPM1",
|
||||
"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}, -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.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Priority"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "No Active Alarms"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Medium"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Low"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},-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"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.demoColor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 47,
|
||||
"width": 68
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "DPM"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.color}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "M 0 40 L 0 0 L 61 40 Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#4c4c4c",
|
||||
"width": 4
|
||||
},
|
||||
"transform": "rotate(-180,30.5,20)",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 0 40 L 0 0 L 61 40 Z",
|
||||
"fill": {
|
||||
"paint": "#4C4C4C"
|
||||
},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 4
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"viewBox": "-0.5 -0.5 62 41"
|
||||
},
|
||||
"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": "{/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,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": "High",
|
||||
"output": "Alarms-Styles/High"
|
||||
},
|
||||
{
|
||||
"input": "Medium",
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": "Low",
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": "Diagnostic",
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\n {view.custom.state} !\u003d \"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_dpm_mcm"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"aspectRatio": "68:47",
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"classes": "Disconnects/Device-Connected",
|
||||
"cursor": "pointer",
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,18 @@
|
||||
{
|
||||
"base": {
|
||||
"animation": {
|
||||
"duration": "2.5s",
|
||||
"keyframes": {
|
||||
"0%": {
|
||||
"boxShadow": "0 0 12px 5px rgba(88, 158, 249, 0.8)"
|
||||
},
|
||||
"50%": {
|
||||
"boxShadow": "0 0 20px 8px rgba(88, 158, 249, 1)"
|
||||
},
|
||||
"100%": {
|
||||
"boxShadow": "0 0 5px 2px rgba(88, 158, 249, 0.3)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 73 KiB |
@ -0,0 +1,28 @@
|
||||
-- Hourly Scanner Graph Query (Rate per hour)
|
||||
-- Shows every hour in detail for graphing as rates (items per hour)
|
||||
|
||||
SELECT
|
||||
CONCAT('H', TIMESTAMPDIFF(HOUR,
|
||||
DATE_FORMAT(Startstamp, "%Y-%m-%d %H:00:00"),
|
||||
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
|
||||
)) AS Hour,
|
||||
ROUND(COALESCE(Total, 0) * 3600 / GREATEST(TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 1), 2) AS Total,
|
||||
ROUND(COALESCE(GoodRead, 0) * 3600 / GREATEST(TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 1), 2) AS GoodRead,
|
||||
ROUND(COALESCE(NoRead, 0) * 3600 / GREATEST(TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 1), 2) AS NoRead,
|
||||
ROUND(COALESCE(MultiRead, 0) * 3600 / GREATEST(TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 1), 2) AS MultiRead,
|
||||
ROUND(COALESCE(NoCode, 0) * 3600 / GREATEST(TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 1), 2) AS NoCode
|
||||
FROM (
|
||||
SELECT
|
||||
MIN(t_stamp) AS Startstamp,
|
||||
MAX(t_stamp) AS Endtstamp,
|
||||
COUNT(*) AS Total,
|
||||
SUM(DivertStatus NOT IN (8, 9, 10)) AS GoodRead,
|
||||
SUM(DivertStatus = 8) AS NoRead,
|
||||
SUM(DivertStatus = 10) AS MultiRead,
|
||||
SUM(DivertStatus = 9) AS NoCode
|
||||
FROM alltable
|
||||
WHERE t_stamp BETWEEN :starttime AND :endtime
|
||||
GROUP BY DATE(t_stamp), HOUR(t_stamp)
|
||||
) counts
|
||||
ORDER BY Startstamp ASC;
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(255,0,0,1) 0%, rgba(245,0,0,1) 70%, rgba(208,0,0,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"textTransform": "uppercase"
|
||||
}
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pseudo": "hover",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(0deg, rgba(255,0,0,1) 0%, rgba(245,0,0,1) 70%, rgba(208,0,0,1) 100%);",
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pseudo": "disabled",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(208,0,0,1) 0%, rgba(208,0,0,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#555555",
|
||||
"cursor": "not-allowed"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
{
|
||||
"base": {
|
||||
"animation": {
|
||||
"duration": "1s",
|
||||
"keyframes": {
|
||||
"0%": {
|
||||
"backgroundColor": "#007EFCB3"
|
||||
},
|
||||
"100%": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,867 @@
|
||||
{
|
||||
"custom": {
|
||||
"FilteredViews": [
|
||||
{
|
||||
"Path": "autStand/Equipment/Button",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/Camera",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Chute",
|
||||
"Path": "autStand/Equipment/Conveyor",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/Conveyor",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Conveyor",
|
||||
"Path": "autStand/Equipment/Conveyor_Left90",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Conveyor",
|
||||
"Path": "autStand/Equipment/Conveyor_Right90",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/DPM",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/EPC",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/Encoder",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/MCM",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Photoeye",
|
||||
"Path": "autStand/Equipment/Photoeye_Tracking",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Long Range Photoeye",
|
||||
"Path": "autStand/Equipment/Photoeye_Long",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Proximity Switch",
|
||||
"Path": "autStand/Equipment/ProxSensor",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Start/Stop Button",
|
||||
"Path": "autStand/Equipment/SS_Button",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/IO_Block",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/Solenoid",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/VFD",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Beacon_G",
|
||||
"Path": "autStand/Equipment/Beacon",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Beacon_A",
|
||||
"Path": "autStand/Equipment/Beacon",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Beacon_R",
|
||||
"Path": "autStand/Equipment/Beacon",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Beacon_B",
|
||||
"Path": "autStand/Equipment/Beacon",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Beacon_H",
|
||||
"Path": "autStand/Equipment/Beacon",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/Scanner",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"Path": "autStand/Equipment/DPM",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"events": {
|
||||
"system": {
|
||||
"onStartup": {
|
||||
"config": {
|
||||
"script": "\tproject_info \u003d system.perspective.getProjectInfo()\n\tviews \u003d project_info.get(\u0027views\u0027,[])\n\tfilter_criterion \u003d \"Symbol-Views\"\n\tfilter_criterion2 \u003d \"Symbol-Library-Views\"\n\tfilter_criterion3 \u003d \"Controller-Views\"\n\tfilter_criterion4 \u003d \"Device-Views\"\n\tfiltered_views \u003d [\n\t\tview for view in views \n\t\t\t\n\t\tif filter_criterion in view.get(\u0027path\u0027,\u0027\u0027) \n\t\tand not filter_criterion2 in view.get(\u0027path\u0027,\u0027\u0027) \n\t\tand not filter_criterion3 in view.get(\u0027path\u0027,\u0027\u0027)\n\t\tand not filter_criterion4 in view.get(\u0027path\u0027,\u0027\u0027)\n\t\t]\n\tjson_structure \u003d []\n\tfor view in filtered_views:\n\t\t\n\t\tif \u0027Test\u0027 not in view[\u0027path\u0027]:\n\t\t\tinstance \u003d {\n\t\t\t\t\"instanceStyle\": {\n\t\t\t\t\t\"classes\": \"\"\n\t\t\t\t},\n\t\t\t\t\"instancePosition\": {},\n\t\t\t\t\"Path\": view.get(\u0027path\u0027,\u0027\u0027),\n\t\t\t\t\"forceRunning\":3,\n\t\t\t\t\"forceFault\": None,\n\t\t\t\t\"has_state\":True\n\t\t\t}\n\t\t\tjson_structure.append(instance)\n\t\t\n\tjson_result \u003d system.util.jsonEncode(json_structure)\n\tself.params.Dataset \u003d filtered_views\n\tself.params.FilteredViews \u003d json_structure\n\tself.session.custom.alarm_filter.show_running \u003d True\n\tself.session.custom.alarm_filter.show_safety \u003d True\n\tself.session.custom.alarm_filter.show_diagnostic \u003d True\n\tself.session.custom.alarm_filter.show_gateways \u003d True\n\tself.session.custom.alarm_filter.show_low_alarm \u003d True\n\t"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"Dataset": [],
|
||||
"FilteredViews": []
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.FilteredViews": {
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 309,
|
||||
"width": 378
|
||||
},
|
||||
"theme": "dark"
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Table"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.data[11].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state5"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[11].Color.style.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired}\u003d true, \u0027#000000\u0027,\u0027#FFFFFF\u0027) "
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.data[12].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state4"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[13].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state3"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[14].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state2"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[15].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state1"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[1].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state0"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[3].Color.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state5"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.data[3].Color.style.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired}\u003d true, \u0027#000000\u0027,\u0027#FFFFFF\u0027) "
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"cells": {
|
||||
"style": {
|
||||
"paddingLeft": 5
|
||||
}
|
||||
},
|
||||
"columns": [
|
||||
{
|
||||
"align": "center",
|
||||
"boolean": "checkbox",
|
||||
"dateFormat": "MM/DD/YYYY",
|
||||
"editable": false,
|
||||
"field": "Color",
|
||||
"filter": {
|
||||
"boolean": {
|
||||
"condition": ""
|
||||
},
|
||||
"date": {
|
||||
"condition": "",
|
||||
"value": ""
|
||||
},
|
||||
"enabled": false,
|
||||
"number": {
|
||||
"condition": "",
|
||||
"value": ""
|
||||
},
|
||||
"string": {
|
||||
"condition": "",
|
||||
"value": ""
|
||||
},
|
||||
"visible": "on-hover"
|
||||
},
|
||||
"footer": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"title": ""
|
||||
},
|
||||
"header": {
|
||||
"align": "center",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"title": ""
|
||||
},
|
||||
"justify": "auto",
|
||||
"nullFormat": {
|
||||
"includeNullStrings": false,
|
||||
"nullFormatValue": "",
|
||||
"strict": false
|
||||
},
|
||||
"number": "value",
|
||||
"numberFormat": "0,0.##",
|
||||
"progressBar": {
|
||||
"bar": {
|
||||
"color": "",
|
||||
"style": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
"max": 100,
|
||||
"min": 0,
|
||||
"track": {
|
||||
"color": "",
|
||||
"style": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"enabled": true,
|
||||
"format": "0,0.##",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"render": "auto",
|
||||
"resizable": true,
|
||||
"sort": "none",
|
||||
"sortable": false,
|
||||
"strictWidth": true,
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"toggleSwitch": {
|
||||
"color": {
|
||||
"selected": "",
|
||||
"unselected": ""
|
||||
}
|
||||
},
|
||||
"viewParams": {},
|
||||
"viewPath": "",
|
||||
"visible": true,
|
||||
"width": 85
|
||||
},
|
||||
{
|
||||
"align": "center",
|
||||
"boolean": "checkbox",
|
||||
"dateFormat": "MM/DD/YYYY",
|
||||
"editable": false,
|
||||
"field": "Description",
|
||||
"filter": {
|
||||
"boolean": {
|
||||
"condition": ""
|
||||
},
|
||||
"date": {
|
||||
"condition": "",
|
||||
"value": ""
|
||||
},
|
||||
"enabled": false,
|
||||
"number": {
|
||||
"condition": "",
|
||||
"value": ""
|
||||
},
|
||||
"string": {
|
||||
"condition": "",
|
||||
"value": ""
|
||||
},
|
||||
"visible": "on-hover"
|
||||
},
|
||||
"footer": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"title": ""
|
||||
},
|
||||
"header": {
|
||||
"align": "center",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"title": ""
|
||||
},
|
||||
"justify": "auto",
|
||||
"nullFormat": {
|
||||
"includeNullStrings": false,
|
||||
"nullFormatValue": "",
|
||||
"strict": false
|
||||
},
|
||||
"number": "value",
|
||||
"numberFormat": "0,0.##",
|
||||
"progressBar": {
|
||||
"bar": {
|
||||
"color": "",
|
||||
"style": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
"max": 100,
|
||||
"min": 0,
|
||||
"track": {
|
||||
"color": "",
|
||||
"style": {
|
||||
"classes": ""
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"enabled": true,
|
||||
"format": "0,0.##",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"render": "auto",
|
||||
"resizable": true,
|
||||
"sort": "none",
|
||||
"sortable": false,
|
||||
"strictWidth": false,
|
||||
"style": {
|
||||
"borderLeftStyle": "solid",
|
||||
"borderLeftWidth": 1,
|
||||
"borderRightStyle": "solid",
|
||||
"borderRightWidth": 1,
|
||||
"classes": ""
|
||||
},
|
||||
"toggleSwitch": {
|
||||
"color": {
|
||||
"selected": "",
|
||||
"unselected": ""
|
||||
}
|
||||
},
|
||||
"viewParams": {},
|
||||
"viewPath": "",
|
||||
"visible": true,
|
||||
"width": 100
|
||||
}
|
||||
],
|
||||
"data": [
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "",
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": 1,
|
||||
"borderLeftStyle": "hidden",
|
||||
"borderRightStyle": "hidden",
|
||||
"classes": "",
|
||||
"font-weight": "bold"
|
||||
},
|
||||
"value": "State"
|
||||
},
|
||||
"Description": {
|
||||
"align": "center",
|
||||
"editable": false,
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "",
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": 1,
|
||||
"borderLeftStyle": "hidden",
|
||||
"classes": "some-class",
|
||||
"font-weight": "bold"
|
||||
},
|
||||
"value": "Description"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": "",
|
||||
"color": "#000000"
|
||||
},
|
||||
"value": "Stopped"
|
||||
},
|
||||
"Description": "MHE is Stopped/Disabled\n"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#c9fcc0",
|
||||
"classes": "",
|
||||
"color": "#000000"
|
||||
},
|
||||
"value": "Enabled"
|
||||
},
|
||||
"Description": "MHE is Enabled (Not Running)"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"value": "Running"
|
||||
},
|
||||
"Description": "MHE is Running"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#00ffd0",
|
||||
"classes": "",
|
||||
"color": "#000000"
|
||||
},
|
||||
"value": "Power Saving"
|
||||
},
|
||||
"Description": "MHE is in Power Saving Mode"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#ff8c00",
|
||||
"classes": "",
|
||||
"color": "#000000"
|
||||
},
|
||||
"value": "Jammed"
|
||||
},
|
||||
"Description": "MHE is Jammed"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#0008ff",
|
||||
"classes": "",
|
||||
"color": "#FFFFFF"
|
||||
},
|
||||
"value": "Full"
|
||||
},
|
||||
"Description": "MHE is Full"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#946446",
|
||||
"classes": "",
|
||||
"color": "#FFFFFF"
|
||||
},
|
||||
"value": "Maint Mode"
|
||||
},
|
||||
"Description": "MHE is in Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#B45C5C",
|
||||
"classes": "",
|
||||
"color": "#FFFFFF"
|
||||
},
|
||||
"value": "Maint Running Mode"
|
||||
},
|
||||
"Description": "MHE Running in Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "#ff0000",
|
||||
"classes": "",
|
||||
"color": "#FFFFFF"
|
||||
},
|
||||
"value": "Estop / Faulted\n"
|
||||
},
|
||||
"Description": "MHE is Estopped / Faulted\n"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "",
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": 1,
|
||||
"borderLeftStyle": "hidden",
|
||||
"borderRightStyle": "hidden",
|
||||
"borderTopStyle": "solid",
|
||||
"borderTopWidth": 1,
|
||||
"classes": "",
|
||||
"font-weight": "bold"
|
||||
},
|
||||
"value": "Priority"
|
||||
},
|
||||
"Description": {
|
||||
"align": "center",
|
||||
"editable": false,
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"backgroundColor": "",
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": 1,
|
||||
"borderLeftStyle": "hidden",
|
||||
"borderTopStyle": "solid",
|
||||
"borderTopWidth": 1,
|
||||
"classes": "",
|
||||
"font-weight": "bold"
|
||||
},
|
||||
"value": "Description"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"value": "Healthy"
|
||||
},
|
||||
"Description": "Healthy, no active alarms"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": "",
|
||||
"color": "#000000"
|
||||
},
|
||||
"value": "Diagnostic"
|
||||
},
|
||||
"Description": "Diagnostic Information"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"borderLeftColor": "white",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": "",
|
||||
"color": "#000000"
|
||||
},
|
||||
"value": "Low"
|
||||
},
|
||||
"Description": "Running at reduced capacity",
|
||||
"Status": "Low"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": ""
|
||||
},
|
||||
"value": "Medium"
|
||||
},
|
||||
"Description": "Controlled Stop"
|
||||
},
|
||||
{
|
||||
"Color": {
|
||||
"align": "center",
|
||||
"justify": "left",
|
||||
"style": {
|
||||
"classes": "some-class"
|
||||
},
|
||||
"value": "High"
|
||||
},
|
||||
"Description": "Uncontrolled Stop"
|
||||
}
|
||||
],
|
||||
"dragOrderable": false,
|
||||
"enableHeader": false,
|
||||
"headerStyle": {
|
||||
"backgroundColor": "#2B2B2B",
|
||||
"color": "#FFFFFF",
|
||||
"textIndent": "0px"
|
||||
},
|
||||
"pager": {
|
||||
"bottom": false
|
||||
},
|
||||
"rows": {
|
||||
"highlight": {
|
||||
"color": "#FFFFFF",
|
||||
"enabled": false
|
||||
},
|
||||
"style": {
|
||||
"classes": "Background-Styles/Controller"
|
||||
}
|
||||
},
|
||||
"selection": {
|
||||
"enableRowSelection": false,
|
||||
"style": {
|
||||
"fontWeight": "bold"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "ia.display.table"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "EmbeddedView"
|
||||
},
|
||||
"position": {
|
||||
"basis": "320px"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.params.FilteredViews": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.FilteredViews"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"path": "autStand/PopUp-Views/Legend_Popup/Legend-table"
|
||||
},
|
||||
"type": "ia.display.view"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_6"
|
||||
},
|
||||
"position": {
|
||||
"basis": "800px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer"
|
||||
},
|
||||
"position": {
|
||||
"tabIndex": 1
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"overflow": "visible"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "TabContainer"
|
||||
},
|
||||
"position": {
|
||||
"basis": "1377px"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.currentTabIndex": {
|
||||
"onChange": {
|
||||
"enabled": null,
|
||||
"script": "\tif currentValue.value \u003d\u003d 2:\n\t\tsystem.perspective.closePopup(\"TZyBcXB7\")\n\t\tsystem.perspective.openPopup(\n\t\t id\u003d\"DOO\", \n\t\t view\u003d\"autStand/PopUp-Views/Legend_Popup/Legend-DOO\", \n\t\t title\u003d\"Description of Operations - Amazon BNA8\",\n\t\t modal\u003dTrue,\n\t\t draggable\u003dFalse,\n\t\t resizable\u003dFalse,\n\t\t showCloseIcon\u003dTrue,\n\t\t)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"currentTabIndex": 1,
|
||||
"menuStyle": {
|
||||
"fontWeight": "bold"
|
||||
},
|
||||
"style": {
|
||||
"classes": "Background-Styles/Controller"
|
||||
},
|
||||
"tabs": [
|
||||
"Color",
|
||||
"Icons",
|
||||
"DOO"
|
||||
]
|
||||
},
|
||||
"type": "ia.container.tab"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"system": {
|
||||
"onStartup": {
|
||||
"config": {
|
||||
"script": "\tself.getChild(\"TabContainer\").props.currentTabIndex \u003d 0"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"backgroundColor": "#3B3B3B",
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,229 @@
|
||||
SELECT
|
||||
COALESCE(data.roundtime, 'N/A') AS StartTimestamp,
|
||||
COALESCE(CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(data.roundtime, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))), 'N/A') AS Hour,
|
||||
COALESCE(data.sScanner_Name, 'N/A') AS sScanner_Name,
|
||||
COALESCE(data.BadReads, '0%') AS BadReads,
|
||||
COALESCE(data.CommFaults, '0%') AS CommFaults,
|
||||
COALESCE(data.GoodReads, '0%') AS GoodReads,
|
||||
COALESCE(data.MultiItems, '0%') AS MultiItems,
|
||||
COALESCE(data.MultiReads, '0%') AS MultiReads,
|
||||
COALESCE(data.NoData, '0%') AS NoData,
|
||||
COALESCE(data.NoReads, '0%') AS NoReads,
|
||||
COALESCE(data.Total, 0) AS Total
|
||||
FROM (SELECT 1) AS p
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
|
||||
sScanner_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 BadReads,
|
||||
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 CommFaults,
|
||||
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 GoodReads,
|
||||
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 MultiItems,
|
||||
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 MultiReads,
|
||||
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 NoData,
|
||||
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 NoReads,
|
||||
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) AS Total
|
||||
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 roundtime,
|
||||
'S03aa' AS sScanner_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 BadReads,
|
||||
'0%' AS CommFaults,
|
||||
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 GoodReads,
|
||||
'0%' AS MultiItems,
|
||||
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 MultiReads,
|
||||
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 NoData,
|
||||
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 NoReads,
|
||||
COUNT(*) AS Total
|
||||
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)
|
||||
) AS data ON 1=1
|
||||
ORDER BY data.roundtime ASC;
|
||||
@ -0,0 +1,112 @@
|
||||
import re
|
||||
import system
|
||||
|
||||
reDefault = re.compile(r'\[[^[]+\]')
|
||||
|
||||
def _extractParameter(params, parameter, path):
|
||||
val = params[parameter].value
|
||||
if hasattr(val, "bindType"):
|
||||
return system.tag.readBlocking([path+"/Parameters."+parameter])[0].value
|
||||
else:
|
||||
return val
|
||||
|
||||
def _isGroupedUDT(obj):
|
||||
for tag in obj["tags"]:
|
||||
if tag["name"] in ["Graphics", "StatusText"]:
|
||||
return False
|
||||
return True
|
||||
|
||||
def getSiblingDevices(tagPath, filterType=None, filterTagPath=True):
|
||||
devices = []
|
||||
|
||||
def extractStatusText(obj, path):
|
||||
# Scan for status text tag:
|
||||
for tag in obj["tags"]:
|
||||
if tag["name"] == "StatusText":
|
||||
return "[ignition]" + reDefault.sub("", path) + "/StatusText"
|
||||
# Couldn't find it, so return None:
|
||||
return None
|
||||
|
||||
def scan(obj, parentPath):
|
||||
if isinstance(obj, list):
|
||||
for tag in obj:
|
||||
scan(tag, parentPath)
|
||||
else:
|
||||
path = parentPath + "/" + obj["name"]
|
||||
if str(obj["tagType"]) == "Folder" or (str(obj["tagType"]) == "UdtInstance" and (tagPath <> path or not filterTagPath) and _isGroupedUDT(obj)):
|
||||
for tag in obj["tags"]:
|
||||
scan(tag, path)
|
||||
elif str(obj["tagType"]) == "UdtInstance" and (tagPath <> path or not filterTagPath):
|
||||
params = obj["parameters"]
|
||||
# Make sure this is a renderable device:
|
||||
if "DeviceType" in params:
|
||||
deviceType = _extractParameter(params, "DeviceType", path)
|
||||
if filterType == None or deviceType in filterType:
|
||||
labelFull = _extractParameter(params, "LabelFull", path)
|
||||
devices.append({
|
||||
"deviceType": deviceType,
|
||||
"tagPath": path,
|
||||
"device": labelFull,#"[ignition]" + reDefault.sub("", path) + "/Parameters.LabelFull",
|
||||
"status": extractStatusText(obj, path)
|
||||
})
|
||||
|
||||
# Scan devices:
|
||||
if tagPath not in [None, ""]:
|
||||
tagPath = reDefault.sub("", tagPath) # Remove [default] from tagpath
|
||||
parentPath = "/".join(tagPath.split("/")[:-1])
|
||||
config = system.tag.getConfiguration(parentPath, True)
|
||||
#system.perspective.print(parentPath)
|
||||
#system.perspective.print(config)
|
||||
if len(config) > 0 and "tags" in config[0]:
|
||||
scan(config[0]["tags"], parentPath)
|
||||
devices.sort(key=lambda x: x["device"])
|
||||
|
||||
return devices
|
||||
|
||||
def _isTagOPC(path):
|
||||
try:
|
||||
return system.tag.readBlocking([path+".ValueSource"])[0].value == "opc"
|
||||
except:
|
||||
return False
|
||||
|
||||
def _isTagEnabled(path):
|
||||
try:
|
||||
return system.tag.readBlocking([path+".Enabled"])[0].value
|
||||
except:
|
||||
return False
|
||||
|
||||
def getOPCTags(tagPath):
|
||||
tags = []
|
||||
|
||||
def scan(obj, parentPath, relPath=""):
|
||||
if isinstance(obj, list):
|
||||
for tag in obj:
|
||||
scan(tag, parentPath, relPath)
|
||||
elif "name" in obj:
|
||||
path = parentPath + "/" + obj["name"]
|
||||
if "tags" in obj:
|
||||
# Scan deeper:
|
||||
relPath = relPath + obj["name"] + "/"
|
||||
for tag in obj["tags"]:
|
||||
scan(tag, path, relPath)
|
||||
else:
|
||||
if _isTagEnabled(path) and _isTagOPC(path):#and obj["name"] not in ["Graphics"]:
|
||||
# Found an OPC tag:
|
||||
tags.append({
|
||||
"tagName": relPath + obj["name"],
|
||||
"tagType": "opc",
|
||||
"tagPath": "[ignition]" + path + ".OpcItemPath",
|
||||
"tagValue": "[ignition]" + path,
|
||||
"tagTooltip": "[ignition]" + path + ".Tooltip",
|
||||
"tagDocumentation": "[ignition]" + path + ".Documentation"
|
||||
})
|
||||
|
||||
# Scan devices:
|
||||
if tagPath not in [None, ""]:
|
||||
tagPath = reDefault.sub("", tagPath) # Remove [default] from tagpath
|
||||
config = system.tag.getConfiguration(tagPath, True)
|
||||
if len(config) > 0 and "tags" in config[0]:
|
||||
scan(config[0]["tags"], tagPath)
|
||||
tags.sort(key=lambda x: x["tagName"])
|
||||
|
||||
return tags
|
||||
@ -0,0 +1,34 @@
|
||||
WITH SCANNERS AS (
|
||||
SELECT
|
||||
DATE_FORMAT(MIN(s04_timestamp), "%Y-%m-%d %H:%i:00") AS time,
|
||||
COUNT(*) AS total,
|
||||
SUM(scanner_status NOT IN ("No Read", "No Code", "Multi Label")) AS good_read,
|
||||
SUM(scanner_status = "No Read") AS no_read,
|
||||
SUM(scanner_status = "No Code") AS no_code,
|
||||
SUM(scanner_status = "Multi Label") AS multi_label
|
||||
FROM package_history
|
||||
WHERE s04_timestamp BETWEEN :startDate AND :endDate
|
||||
AND scanner = :scanner
|
||||
GROUP BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
|
||||
ORDER BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
|
||||
)
|
||||
SELECT
|
||||
time,
|
||||
/* Counts: */
|
||||
total AS total_count,
|
||||
good_read AS good_read_count,
|
||||
no_read AS no_read_count,
|
||||
no_code AS no_code_count,
|
||||
multi_label AS multi_label_count,
|
||||
/* PPH: */
|
||||
ROUND(total*60) AS total_pph,
|
||||
ROUND(good_read*60) AS good_read_pph,
|
||||
ROUND(no_read*60) AS no_read_pph,
|
||||
ROUND(no_code*60) AS no_code_pph,
|
||||
ROUND(multi_label*60) AS multi_label_pph,
|
||||
/* Percents: */
|
||||
ROUND(good_read/total, 4) AS good_read_percent,
|
||||
ROUND(no_read/total, 4) AS no_read_percent,
|
||||
ROUND(no_code/total, 4) AS no_code_percent,
|
||||
ROUND(multi_label/total, 4) AS multi_label_percent
|
||||
FROM SCANNERS;
|
||||
@ -0,0 +1,73 @@
|
||||
WITH LANES_SUCCESS AS (
|
||||
SELECT
|
||||
MIN(s04_timestamp) AS start_timestamp,
|
||||
MAX(s04_timestamp) AS end_timestamp,
|
||||
sorter,
|
||||
destination_act AS lane,
|
||||
COUNT(*) AS total
|
||||
FROM package_history a
|
||||
WHERE s04_timestamp BETWEEN :startDate AND :endDate
|
||||
GROUP BY sorter, s04_act_dest
|
||||
), LANES_FAIL_REQ AS (
|
||||
SELECT
|
||||
MIN(s04_timestamp) AS start_timestamp,
|
||||
MAX(s04_timestamp) AS end_timestamp,
|
||||
sorter,
|
||||
CONCAT(sorter, LPAD(s02_req_dest, 2, '0')) AS lane,
|
||||
SUM(req_dest_reason=5) AS dest_full,
|
||||
SUM(req_dest_reason=6) AS dest_fault,
|
||||
SUM(req_dest_reason=12) AS dest_disabled
|
||||
FROM package_history
|
||||
WHERE s04_timestamp BETWEEN :startDate AND :endDate
|
||||
AND s04_act_dest != s02_req_dest
|
||||
GROUP BY sorter, s02_req_dest
|
||||
), LANES_FAIL_ALT AS (
|
||||
SELECT
|
||||
MIN(s04_timestamp) AS start_timestamp,
|
||||
MAX(s04_timestamp) AS end_timestamp,
|
||||
sorter,
|
||||
CONCAT(sorter, LPAD(s02_alt_dest, 2, '0')) AS lane,
|
||||
SUM(alt_dest_reason=5) AS dest_full,
|
||||
SUM(alt_dest_reason=6) AS dest_fault,
|
||||
SUM(alt_dest_reason=12) AS dest_disabled
|
||||
FROM package_history
|
||||
WHERE s04_timestamp BETWEEN :startDate AND :endDate
|
||||
AND s04_act_dest != s02_alt_dest
|
||||
GROUP BY sorter, s02_alt_dest
|
||||
), LANES AS (
|
||||
SELECT
|
||||
LEAST(s.start_timestamp, IFNULL(r.start_timestamp, s.start_timestamp), IFNULL(r.start_timestamp, a.start_timestamp)) AS start_timestamp,
|
||||
GREATEST(s.end_timestamp, IFNULL(r.end_timestamp, s.end_timestamp), IFNULL(r.end_timestamp, a.end_timestamp)) AS end_timestamp,
|
||||
3600/TIMESTAMPDIFF(SECOND, :startDate, :endDate) AS pph_multiplier,
|
||||
s.sorter,
|
||||
s.lane,
|
||||
s.total,
|
||||
IFNULL(r.dest_full, 0)+IFNULL(a.dest_full, 0) AS dest_full,
|
||||
IFNULL(r.dest_fault, 0)+IFNULL(a.dest_fault, 0) AS dest_fault,
|
||||
IFNULL(r.dest_disabled, 0)+IFNULL(a.dest_disabled, 0) AS dest_disabled
|
||||
FROM LANES_SUCCESS s
|
||||
LEFT JOIN LANES_FAIL_REQ r ON s.sorter=r.sorter AND s.lane=r.lane
|
||||
LEFT JOIN LANES_FAIL_ALT a ON s.sorter=a.sorter AND s.lane=a.lane
|
||||
)
|
||||
SELECT
|
||||
start_timestamp,
|
||||
end_timestamp,
|
||||
sorter,
|
||||
lane,
|
||||
/* Counts: */
|
||||
total AS total_count,
|
||||
dest_full AS dest_full_count,
|
||||
dest_fault AS dest_fault_count,
|
||||
dest_disabled AS dest_disabled_count,
|
||||
/* PPH: */
|
||||
ROUND(total*pph_multiplier) AS total_pph,
|
||||
ROUND(dest_full*pph_multiplier) AS dest_full_pph,
|
||||
ROUND(dest_fault*pph_multiplier) AS dest_fault_pph,
|
||||
ROUND(dest_disabled*pph_multiplier) AS dest_disabled_pph,
|
||||
/* Percents: */
|
||||
ROUND(total/total, 4) AS total_percent,
|
||||
ROUND(dest_full/total, 4) AS dest_full_percent,
|
||||
ROUND(dest_fault/total, 4) AS dest_fault_percent,
|
||||
ROUND(dest_disabled/total, 4) AS dest_disabled_percent
|
||||
FROM LANES
|
||||
ORDER BY sorter, lane;
|
||||
@ -0,0 +1,15 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundColor": "#008000",
|
||||
"borderColor": "#000000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "0.5px",
|
||||
"color": "#FFFFFF",
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": "14px",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "center"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
-- Enabled vs Disabled Pie Chart WITH time range support
|
||||
|
||||
WITH filtered AS (
|
||||
SELECT
|
||||
Name,
|
||||
Disabled,
|
||||
t_stamp,
|
||||
ROW_NUMBER() OVER (PARTITION BY Name ORDER BY t_stamp DESC) AS rn
|
||||
FROM lane_data
|
||||
WHERE t_stamp BETWEEN :startTime AND :endTime
|
||||
),
|
||||
|
||||
latest_records AS (
|
||||
SELECT *
|
||||
FROM filtered
|
||||
WHERE rn = 1
|
||||
),
|
||||
|
||||
totals AS (
|
||||
SELECT
|
||||
GREATEST(COUNT(*), 22) AS total_lanes,
|
||||
SUM(CASE WHEN Disabled = 1 THEN 1 ELSE 0 END) AS disabled_count
|
||||
FROM latest_records
|
||||
)
|
||||
|
||||
SELECT
|
||||
'Enabled' AS `Status`,
|
||||
ROUND((total_lanes - COALESCE(disabled_count, 0)) * 100.0 / total_lanes, 1) AS `Percentage (%)`
|
||||
FROM totals
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
'Disabled' AS `Status`,
|
||||
ROUND(COALESCE(disabled_count, 0) * 100.0 / total_lanes, 1) AS `Percentage (%)`
|
||||
FROM totals;
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,7 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"color": "#808080"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,637 @@
|
||||
{
|
||||
"custom": {
|
||||
"color": "#C2C2C2",
|
||||
"isHighlited": false,
|
||||
"overlayColor": "#ffffff",
|
||||
"priority": "No Active Alarms",
|
||||
"state": "Offline"
|
||||
},
|
||||
"params": {
|
||||
"highlight": "",
|
||||
"tagProps": [
|
||||
"System/MCM01/Conveyor/Ul15_1",
|
||||
"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": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#C2C2C2"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FFA500"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#0008FF"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#FFF700"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#87CEEB"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#90EE90"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#964B00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFFFF"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#8B0000"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#8B8000"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#006400"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "#FFFFC5"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "#00008B"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "#FF7276"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "#556B2F"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "#B43434"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "#4682B4"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "#FFD700"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.isHighlited": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.params.highlight} !\u003d \"\""
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.overlayColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.highlight"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#ffffff",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": "Diagnostic",
|
||||
"output": "rgb(88, 158, 249)"
|
||||
},
|
||||
{
|
||||
"input": "Low",
|
||||
"output": "rgb(255, 255, 0)"
|
||||
},
|
||||
{
|
||||
"input": "Medium",
|
||||
"output": "rgb(247, 160, 96)"
|
||||
},
|
||||
{
|
||||
"input": "High",
|
||||
"output": "rgb(245, 95, 89)"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"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": "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"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.highlight": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 69,
|
||||
"width": 49
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor45"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.opacity": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.isHighlited}, 1, 0)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.overlayColor"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].style.animation": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.custom.isHighlited}, \"2.5s linear infinite both conveyor\", \"\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.color"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "m -0.86795047,19.664401 0.24823006,-8.9351 C 1.4141638,5.1674347 4.2395046,2.4376861 9.9814841,-0.49166894 L 15.036661,7.9157199 C 11.035373,9.451617 10.840679,10.658485 9.8085725,14.305329 l -0.1172109,5.383077 z",
|
||||
"fill": {},
|
||||
"id": "path9",
|
||||
"name": "path9",
|
||||
"style": {
|
||||
"opacity": 1,
|
||||
"transition": "opacity 2.5s linear"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "m 0.3823775,18.9146 0.185181,-7.76481 C 2.0848475,6.3164005 5.1481255,3.3505165 9.4316745,0.80483942 L 13.3462,7.7400105 C 10.361215,9.0747405 9.1170805,11.08825 8.3471235,14.25744 l -0.08744,4.67802 z",
|
||||
"fill": {
|
||||
"opacity": 1
|
||||
},
|
||||
"id": "path26615",
|
||||
"name": "path26615",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"opacity": "1",
|
||||
"paint": "#000000",
|
||||
"width": "0.45"
|
||||
},
|
||||
"style": {
|
||||
"opacity": "1"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"overflow": "visible"
|
||||
},
|
||||
"viewBox": "0 0 14 19"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\t#create devices and tags lists for the conveyor\n\tprops \u003d self.view.params.tagProps[0]\n\tautStand.devices.build_device_mapping(props)\n\tdevice_table_dataset \u003d autStand.devices.build_device_table(self)\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props, section \u003d \"conveyor\")\n\tsystem.perspective.openDock(\u0027Docked-East-Conv\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps, \"devices\": device_table_dataset, \"tags\":tags_table_dataset})"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer",
|
||||
"overflow": "visible"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,212 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"down": true,
|
||||
"left": true,
|
||||
"right": true,
|
||||
"up": true
|
||||
},
|
||||
"propConfig": {
|
||||
"params.down": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.left": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.right": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.up": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 300,
|
||||
"width": 300
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Left"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"rotate": {
|
||||
"angle": 0
|
||||
},
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.left"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "M0,54 H54",
|
||||
"fill": {},
|
||||
"name": "cableLine",
|
||||
"stroke": {
|
||||
"paint": "#4c4c4c",
|
||||
"width": 3
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
},
|
||||
"viewBox": "4 4 100 100"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Right"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"rotate": {
|
||||
"angle": 0
|
||||
},
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.right"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "M54,54 H104",
|
||||
"fill": {},
|
||||
"name": "line_right",
|
||||
"stroke": {
|
||||
"paint": "#4c4c4c",
|
||||
"width": 3
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
},
|
||||
"viewBox": "4 4 100 100"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Up"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"rotate": {
|
||||
"angle": 0
|
||||
},
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.up"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "M54,0 V54",
|
||||
"fill": {},
|
||||
"name": "line_up",
|
||||
"stroke": {
|
||||
"paint": "#4c4c4c",
|
||||
"width": 3
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
},
|
||||
"viewBox": "4 4 100 100"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Down"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"rotate": {
|
||||
"angle": 0
|
||||
},
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.down"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "M54,54 V104",
|
||||
"fill": {},
|
||||
"name": "line_down",
|
||||
"stroke": {
|
||||
"paint": "#4c4c4c",
|
||||
"width": 3
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
},
|
||||
"viewBox": "4 4 100 100"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent"
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||