more changes : this project is made for the ignition version 8.1.9 per amazon requests. styles files are also required to make it work

This commit is contained in:
Salijoghli 2025-11-07 20:52:46 +04:00
commit a68ebe4ece
1528 changed files with 430225 additions and 0 deletions

View File

@ -0,0 +1,941 @@
{
"custom": {
"largeView": false
},
"params": {
"params": {}
},
"propConfig": {
"custom.largeView": {
"binding": {
"config": {
"expression": "{page.props.dimensions.viewport.width} \u003e 800"
},
"type": "expr"
},
"persistent": true
},
"params.params": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 58
}
},
"root": {
"children": [
{
"children": [
{
"events": {
"dom": {
"onDoubleClick": {
"config": {
"page": "/Monitron"
},
"scope": "C",
"type": "nav"
}
}
},
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"props": {
"color": "#FFFFFF",
"path": "material/vibration",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "41px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[IEC_SCADA_TAG_PROVIDER]Monitron/monitron_data"
},
"transforms": [
{
"code": "\treturn value.getRowCount()",
"type": "script"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "80px",
"display": false
},
"type": "ia.container.flex"
},
{
"children": [
{
"events": {
"dom": {
"onDoubleClick": {
"config": {
"page": "/Oil"
},
"scope": "C",
"type": "nav"
}
}
},
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"props": {
"color": "#FFFFFF",
"path": "material/opacity",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "41px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[IEC_SCADA_TAG_PROVIDER]Oil/oil_condition_monitoring"
},
"transforms": [
{
"code": "\treturn value.getRowCount()",
"type": "script"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "80px",
"display": false
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Image"
},
"position": {
"basis": "120px"
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.largeView"
},
"type": "property"
}
}
},
"props": {
"fit": {
"height": 30,
"mode": "fill"
},
"source": "/system/images/Builtin/amazon_rme_logo.png"
},
"type": "ia.display.image"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer Start"
},
"position": {
"basis": "16px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"id": "Docked-West",
"type": "toggle"
},
"scope": "C",
"type": "dock"
}
}
},
"meta": {
"name": "Menu Dock"
},
"position": {
"basis": "24px",
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "!{view.custom.largeView}"
},
"type": "expr"
}
}
},
"props": {
"color": "#FFFFFF",
"path": "material/menu",
"style": {
"classes": "Header/Icon",
"marginRight": "10px"
}
},
"type": "ia.display.icon"
},
{
"children": [
{
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "150px",
"grow": 1
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "300px",
"grow": 1
},
"propConfig": {
"custom.path": {
"binding": {
"config": {
"expression": "{page.props.primaryView}"
},
"transforms": [
{
"code": "\tview \u003d str(value).split(\"/\")[-1]\n\tif not \"MCM\" in view:\n\t\treturn \"\"\n\treturn view\n\t",
"type": "script"
}
],
"type": "expr"
}
},
"position.display": {
"binding": {
"config": {
"expression": "{page.props.dimensions.viewport.width} \u003e 800"
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "this.custom.path"
},
"type": "property"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontWeight": "bold",
"textAlign": "center"
},
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "150px",
"grow": 1
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Area"
},
"position": {
"basis": "200px",
"grow": 1
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Icon_1",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "30px",
"shrink": 0
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "{[System]Gateway/Database/MariaDB/Available}"
},
"transforms": [
{
"fallback": "Database Connection Status: LOST",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Database Connection Status: GOOD"
},
{
"input": false,
"output": "Database Connection Status: LOST"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "expr"
}
},
"props.color": {
"binding": {
"config": {
"expression": "{[System]Gateway/Database/MariaDB/Available}"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#47FF47"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "expr"
},
"onChange": {
"enabled": null,
"script": " db_tag_path \u003d \"[System]Gateway/Database/MariaDB/Available\"\n\t\n if not (system.tag.readBlocking([db_tag_path])[0].value):\n \tsystem.perspective.openPopup(\"errorPopup\",\u0027autStand/PopUp-Views/DatabaseError\u0027, title\u003d\"Database Error\")\n\t"
},
"persistent": true
}
},
"props": {
"color": "#47FF47",
"path": "material/table_chart",
"style": {
"classes": "Header/Icon"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_3"
},
"position": {
"basis": "10px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"custom": {
"buttonid": "HeaderLegendIcon"
},
"events": {
"dom": {
"onClick": {
"config": {
"draggable": false,
"id": "TZyBcXB7",
"modal": true,
"overlayDismiss": true,
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewPath": "autStand/PopUp-Views/Legend_Popup/Legend-popup-view",
"viewportBound": true
},
"scope": "C",
"type": "popup"
}
}
},
"meta": {
"name": "Icon",
"tooltip": {
"delay": 250,
"enabled": true,
"sustain": 1000,
"text": "Legend"
}
},
"position": {
"basis": "35px",
"shrink": 0
},
"props": {
"color": "#FFFFFF",
"path": "material/legend_toggle",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"children": [
{
"meta": {
"hasDelegate": true,
"name": "Spacer End"
},
"position": {
"basis": "10px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.navigate(page \u003d \"/Alarms\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"propConfig": {
"props.color": {
"binding": {
"config": {
"path": "../Label.props.text"
},
"transforms": [
{
"code": "\t\n\treturn \"red\" if value \u003e 0 else \"#fff\"",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/notifications_active",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "41px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
},
"transforms": [
{
"code": "\ttotal \u003d sum(\n\t row[\"Count\"]\n\t for row in value\n\t if \"Count\" in row\n\t and row[\"Count\"] is not None\n\t and row.get(\"Priority\") in (\"Medium\", \"High\")\n\t)\n\treturn total",
"type": "script"
}
],
"type": "query"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "75px",
"shrink": 0
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "{./Label.props.text} + \" - Medium \u0026 High Alarms\""
},
"type": "expr"
}
}
},
"props": {
"justify": "flex-end",
"style": {
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"custom": {
"covert": true,
"heartbeat_received": false,
"wbsckt_running": true
},
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tdevice_list \u003d tags.tag_utilities.get_devices(self.session.custom.fc)\n\ttags.tag_utilities.reset_disconnect_tags(self.session.custom.fc, device_list)\n\tAWS.wbsckt_abort.close_websckt()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Icon_2",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "30px",
"shrink": 0
},
"propConfig": {
"custom.heartbeat_received": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_heartbeat_interval"
},
"enabled": false,
"transforms": [
{
"expression": "if(secondsBetween(todate({value}),todate(now())) \u003e 70, False, True)",
"type": "expression"
}
],
"type": "tag"
}
},
"custom.wbsckt_running": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_running"
},
"enabled": false,
"transforms": [
{
"expression": "if({value} \u003d True \u0026\u0026 ({this.custom.heartbeat_received} \u003d True) , True, False)",
"type": "expression"
}
],
"type": "tag"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"path": "this.custom.wbsckt_running"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "websocket running"
},
{
"input": false,
"output": "websocket disconnected"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.color": {
"binding": {
"config": {
"path": "this.custom.wbsckt_running"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "#FF4747"
},
{
"input": true,
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/location_city",
"style": {
"cursor": "pointer"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.basis": {
"binding": {
"config": {
"expression": "len({this.props.text}) * 11 + \"px\""
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{session.custom.fc}"
},
"tagPath": "[{0}_SCADA_TAG_PROVIDER]Configuration/FC"
},
"type": "tag"
}
}
},
"props": {
"icon": "material/building",
"style": {
"borderWidth": "0.25px",
"color": "#FFFFFF",
"textAlign": "",
"textIndent": 10
},
"textStyle": {
"lineBreak": "auto"
}
},
"type": "ia.display.label"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End"
},
"position": {
"basis": "20px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tif self.session.props.auth.authenticated:\n\t\tsystem.perspective.logout()\n\telse:\n\t\tsystem.perspective.login()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "User"
},
"position": {
"basis": "30px",
"shrink": 0
},
"props": {
"path": "material/person",
"style": {
"classes": "Header/Icon",
"color": "#FFFFFF"
}
},
"type": "ia.display.icon"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tif self.session.props.auth.authenticated:\n\t\tsystem.perspective.logout()\n\telse:\n\t\tsystem.perspective.login()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"hasDelegate": true,
"name": "Sign In"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "session.props.auth.user.userName"
},
"transforms": [
{
"code": "\tif value is None or len(str(value)) \u003d\u003d 0 or str(value).lower() \u003d\u003d \"null\":\n\t return \"Sign In\"\n\telse:\n\t return str(value).split(\"@\")[0]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Header/Icon",
"color": "#FFFFFF",
"cursor": "pointer",
"marginLeft": "4px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_0"
},
"position": {
"basis": "20px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.closeSession()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Exit",
"tooltip": {
"enabled": true,
"location": "bottom-left",
"style": {
"fontFamily": "Arial",
"fontSize": 12
},
"tail": false,
"text": "Exit Application"
}
},
"position": {
"basis": "30px",
"shrink": 0
},
"props": {
"path": "material/exit_to_app",
"style": {
"classes": "Header/Icon",
"color": "#FFFFFF",
"cursor": "pointer"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_1"
},
"position": {
"basis": "16px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"justify": "flex-end",
"style": {
"background": "rgb(43,43,43)"
}
},
"type": "ia.container.flex"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -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,
concat(round(COUNT(*)/COUNT(*) * 100,2),'%') AS Inducted,
concat(round(SUM(alltable.ACTUAL_DEST <> 'S03999')/COUNT(*) * 100,2),'%') AS Sorted,
concat(round(SUM((alltable.ACTUAL_DEST = 'S03999') AND (alltable.DivertStatus = 7 OR alltable.DivertStatus = 8 OR alltable.DivertStatus = 9 OR alltable.DivertStatus = 10 OR alltable.DivertStatus = 12 OR alltable.DivertStatus = 16))/COUNT(*) * 100,2),'%') AS AwcsRecirc,
concat(round(SUM((alltable.ACTUAL_DEST = 'S03999') AND (alltable.DivertStatus = 2 OR alltable.DivertStatus = 5 OR alltable.DivertStatus = 18 OR alltable.DivertStatus = 19 or alltable.DivertStatus = 20))/COUNT(*) * 100,2),'%') AS OperationalRecirc,
concat(round(SUM((alltable.ACTUAL_DEST = 'S03999') AND (alltable.DivertStatus = 1 OR alltable.DivertStatus = 3 OR alltable.DivertStatus = 4 OR alltable.DivertStatus = 6 OR alltable.DivertStatus = 13 OR alltable.DivertStatus = 14 OR alltable.DivertStatus = 17 OR alltable.DivertStatus = 21))/COUNT(*) * 100,2),'%') AS MachineRecirc
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -0,0 +1,4 @@
SELECT DISTINCT destination_act AS lane
FROM package_history
WHERE destination_act IS NOT NULL
ORDER BY lane ASC;

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,63 @@
################################################################
################################################################
## Version: 1.0 / Author: Dillon Uzar
##
## DESC: For use in WCS Sorting Lane Lookup & Recording
## WARN: Modifying code may cause system to function incorrectly
################################################################
################################################################
import time
#######################################################
#######################################################
#######################################################
#### Constants
#######################################################
# Logger:
LOG = system.util.logger("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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -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;

View File

@ -0,0 +1,12 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(round(COUNT(*)/COUNT(*) * 100,2),'%') AS Total,
concat(round(SUM(SUBSTRING(alltable.ScanLabel,1,1) <> '?' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '9' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '0')/COUNT(*) * 100,2),'%') AS GoodRead,
concat(round(SUM(SUBSTRING(alltable.ScanLabel,1,1) = '?')/COUNT(*) * 100,2),'%') AS NoRead,
concat(round(SUM(SUBSTRING(alltable.ScanLabel,1,1) = '9')/COUNT(*) * 100,2),'%') AS MultiRead,
concat(round(SUM(SUBSTRING(alltable.ScanLabel,1,1) = '0')/COUNT(*) * 100,2),'%') AS NoCode
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

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

View File

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

View File

@ -0,0 +1,10 @@
{
"base": {
"style": {
"paddingBottom": "5px",
"paddingLeft": "5px",
"paddingRight": "5px",
"paddingTop": "5px"
}
}
}

File diff suppressed because one or more lines are too long

View File

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

View File

@ -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;

View File

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

View File

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

View File

@ -0,0 +1,883 @@
{
"custom": {},
"params": {
"Tab_ID": 6,
"Table": "Statistics"
},
"propConfig": {
"params.Tab_ID": {
"binding": {
"config": {
"path": "/root/Statistics.props.currentTabIndex"
},
"type": "property"
},
"paramDirection": "output",
"persistent": true
},
"params.Table": {
"binding": {
"config": {
"path": "/root/Statistics.meta.name"
},
"type": "property"
},
"paramDirection": "output",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 930,
"width": 1920
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Sorter_Statistics"
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Shipping Sorter Statistics",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Sorter_Summary"
},
"position": {
"tabIndex": 1
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Shipping Sorter Statistics Com",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Scan_Performance"
},
"position": {
"tabIndex": 2
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Scanner Performance",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Full_Recirc_Jackpot"
},
"position": {
"tabIndex": 3
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Lane Full Recirc Jackpot",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Total_Scans"
},
"position": {
"tabIndex": 4
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Total Scans",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Top_Jams"
},
"position": {
"tabIndex": 5
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Top Jams",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Divert_VS_Full"
},
"position": {
"tabIndex": 6
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Lane Divert vs Full"
},
"type": "ia.reporting.report-viewer"
}
],
"custom": {
"endDate": {
"$": [
"ts",
192,
1759323667144
],
"$ts": 1759241850000
},
"startDate": {
"$": [
"ts",
192,
1759323667144
],
"$ts": 1759213050000
}
},
"meta": {
"name": "Statistics"
},
"position": {
"height": 0.96,
"width": 1,
"y": 0.04
},
"propConfig": {
"props.tabs": {
"persistent": true
}
},
"props": {
"currentTabIndex": 6,
"menuStyle": {
"backgroundColor": "#FFFFFFBD",
"fontSize": "1.0vmin",
"overflowWrap": "break-word",
"textAlign": "left"
},
"style": {
"fontFamily": "Arial",
"width": "100%"
},
"tabSize": {
"width": 160
},
"tabStyle": {
"active": {
"flexBasis": 0,
"flexGrow": 1,
"fontSize": "1.0vmin"
},
"disabled": {
"fontSize": "1.0vmin"
},
"inactive": {
"flexBasis": 0,
"flexGrow": 1,
"fontSize": "1.0vmin"
}
},
"tabs": [
"Sorter Statistics",
"Sorter Summary",
"Scan Performance",
"Full/Recirc/Jackpot",
"Total Scans",
"Top Jams",
"Divert vs Full"
]
},
"type": "ia.container.tab"
},
{
"children": [
{
"meta": {
"name": "LPeriod"
},
"position": {
"basis": "60px",
"grow": 1
},
"props": {
"style": {
"color": "#FFFFFF"
},
"text": "Period:"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Period"
},
"position": {
"basis": "140px",
"grow": 1
},
"props": {
"dropdownOptionStyle": {
"fontSize": "1.5vmin",
"overflow": "hidden",
"width": "auto"
},
"options": [
{
"label": "Past 30 Min",
"value": "Past 30 Min"
},
{
"label": "Past Hour",
"value": "Past Hour"
},
{
"label": "Past 2 Hour",
"value": "Past 2 Hour"
},
{
"label": "Past 4 Hour",
"value": "Past 4 Hour"
},
{
"label": "Past 8 Hour",
"value": "Past 8 Hour"
},
{
"label": "Current Day",
"value": "Current Day"
},
{
"label": "Morning",
"value": "Morning"
},
{
"label": "Daylight",
"value": "Daylight"
},
{
"label": "Twilight",
"value": "Twilight"
},
{
"label": "Night",
"value": "Night"
},
{
"label": "Wrap Down",
"value": "Wrap Down"
},
{
"label": "Current Sort",
"value": "Current Sort"
},
{
"label": "Custom",
"value": "Custom"
}
],
"style": {
"fontSize": "1.5vmin"
},
"value": "Past 8 Hour"
},
"type": "ia.input.dropdown"
},
{
"meta": {
"name": "Spare_0"
},
"position": {
"basis": "18.1px",
"grow": 1
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Start Date"
},
"position": {
"basis": "85px",
"grow": 1
},
"props": {
"style": {
"color": "#FFFFFF"
},
"text": "Start Date:"
},
"type": "ia.display.label"
},
{
"custom": {
"Selected": {
"$": [
"ts",
192,
1689168205405
],
"$ts": 1688473380000
}
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t\n\tself.custom.Selected \u003d self.props.value"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "StartTime"
},
"position": {
"basis": "190px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "{../Period.props.value} \u003d \"Custom\""
},
"type": "expr"
}
},
"props.maxDate": {
"binding": {
"config": {
"expression": "now()"
},
"type": "expr"
}
},
"props.startDate": {
"binding": {
"config": {
"path": "../Period.props.value"
},
"transforms": [
{
"fallback": "todate(now())",
"inputType": "expression",
"mappings": [
{
"input": "\"Past 30 Min\"",
"output": "todate(dateFormat(dateArithmetic(now(),-30, \"Minute\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-1, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past 2 Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-2, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past 4 Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-4, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past 8 Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-8, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Current Day\"",
"output": "todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 00:00:00\"))"
},
{
"input": "\"Morning\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\",\r dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 2:30:00\"),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\")))"
},
{
"input": "\"Daylight\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 7:30:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 7:30:00\")))"
},
{
"input": "\"Twilight\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Hours\"), \"HH:mm:ss\")\u003c\"13:00:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 13:00:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 13:00:00\")))"
},
{
"input": "\"Night\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 18:30:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 18:30:00\")))"
},
{
"input": "\"Wrap Down\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 23:30:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 23:30:00\")))"
},
{
"input": "\"Current Sort\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\", todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\")), \r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"13:00:00\",todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 7:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\",todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 13:00:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\",todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 18:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\", todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 23:30:00\")),\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")))))))"
},
{
"input": "\"Custom\"",
"output": "{this.props.value}"
}
],
"outputType": "expression",
"type": "map"
}
],
"type": "property"
},
"onChange": {
"enabled": null,
"script": "\t\n\tif self.getSibling(\"Period\").props.value !\u003d \"Custom\":\n\t\tself.props.value \u003d self.props.startDate"
}
},
"props.value": {
"onChange": {
"enabled": null,
"script": "\t\n\tif system.date.secondsBetween(self.props.value,self.getSibling(\"EndTime\").props.value) \u003e 604800 or system.date.secondsBetween(self.props.value,self.getSibling(\"EndTime\").props.value) \u003c 0:\n\t if system.date.secondsBetween(system.date.addSeconds(self.props.value,604800),system.date.now()) \u003c 0: \n\t self.getSibling(\"EndTime\").props.value \u003d system.date.now()\n\t else:\n\t self.getSibling(\"EndTime\").props.value \u003d system.date.addSeconds(self.props.value,604800)"
}
}
},
"props": {
"dismissOnSelect": false,
"formattedValue": "Oct 1, 2025 11:01 AM",
"formattedValues": {
"date": "Mar 26, 2021",
"datetime": "Mar 26, 2021 12:00 AM",
"time": "12:00 AM"
},
"inputProps": {
"style": {
"fontSize": "1.5vmin"
}
},
"style": {
"fontSize": "1.5vmin"
},
"value": {
"$": [
"ts",
192,
1759330916924
],
"$ts": 1759302116000
}
},
"type": "ia.input.date-time-input"
},
{
"meta": {
"name": "Spare"
},
"position": {
"basis": "18.1px",
"grow": 1
},
"type": "ia.display.label"
},
{
"meta": {
"name": "End Date"
},
"position": {
"basis": "81px",
"grow": 1
},
"props": {
"style": {
"color": "#FFFFFF"
},
"text": "End Date:"
},
"type": "ia.display.label"
},
{
"custom": {
"Selected": "value"
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t\n\tself.custom.Selected \u003d self.props.value"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "EndTime"
},
"position": {
"basis": "190px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "{../Period.props.value} \u003d \"Custom\""
},
"type": "expr"
}
},
"props.endDate": {
"binding": {
"config": {
"path": "../Period.props.value"
},
"transforms": [
{
"fallback": "{this.props.value}",
"inputType": "scalar",
"mappings": [
{
"input": "Past 30 Min",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past 2 Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past 4 Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past 8 Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Current Day",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Morning",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 7:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 7:30:00\"))))"
},
{
"input": "Daylight",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 13:00:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"13:00:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 13:00:00\"))))"
},
{
"input": "Twilight",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"13:00:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 18:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 18:30:00\"))))"
},
{
"input": "Night",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 23:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 23:30:00\"))))"
},
{
"input": "Wrap Down",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\",\r todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\"))))"
},
{
"input": "Current Sort",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
}
],
"outputType": "expression",
"type": "map"
}
],
"type": "property"
},
"onChange": {
"enabled": null,
"script": "\t\n\tif self.getSibling(\"Period\").props.value !\u003d \"Custom\":\n\t\tself.props.value \u003d self.props.endDate"
}
},
"props.maxDate": {
"binding": {
"config": {
"expression": "if(dateDiff({../StartTime.props.value},now(),\"day\") \u003c 7, now(),dateArithmetic({../StartTime.props.value}, 7, \"days\"))"
},
"type": "expr"
}
},
"props.minDate": {
"binding": {
"config": {
"expression": "{../StartTime.props.value}"
},
"type": "expr"
}
}
},
"props": {
"dismissOnSelect": false,
"formattedValue": "Oct 1, 2025 7:01 PM",
"formattedValues": {
"date": "Mar 29, 2021",
"datetime": "Mar 29, 2021 1:37 PM",
"time": "1:37 PM"
},
"inputProps": {
"style": {
"fontSize": "1.5vmin"
}
},
"style": {
"fontSize": "1.5vmin"
},
"value": {
"$": [
"ts",
192,
1759330916952
],
"$ts": 1759330916000
}
},
"type": "ia.input.date-time-input"
}
],
"meta": {
"name": "Period_not_Global_0"
},
"position": {
"height": 0.0269,
"width": 0.483,
"x": 0.0025,
"y": 0.0059
},
"propConfig": {
"custom.EndDate": {
"binding": {
"config": {
"path": "./EndTime.props.value"
},
"type": "property"
}
},
"custom.StartDate": {
"binding": {
"config": {
"path": "./StartTime.props.value"
},
"type": "property"
}
}
},
"props": {
"style": {
"fontFamily": "Arial",
"fontSize": "1.5vmin"
},
"text": "Highest Sorted PPH at 5 min Interval: 0 pph"
},
"type": "ia.container.flex"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t#Passing start and end dates to the reports, this is to avoid re-renders\n\tstartDate \u003d self.getSibling(\"Period_not_Global_0\").custom.StartDate\n\tendDate \u003d self.getSibling(\"Period_not_Global_0\").custom.EndDate\n\t\n\tself.getSibling(\"Statistics\").custom.startDate \u003d startDate\n\tself.getSibling(\"Statistics\").custom.endDate \u003d endDate\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button",
"tooltip": {
"enabled": true,
"text": "Clicking this button generates new report with updated times"
}
},
"position": {
"height": 0.0312,
"width": 0.0667,
"x": 0.4958,
"y": 0.0043
},
"props": {
"primary": false,
"text": "Generate New Report",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.input.button"
}
],
"events": {
"system": {
"onStartup": {
"config": {
"script": "\t#Saving start and end dates on startup of view\n\tstartDate \u003d self.getChild(\"Period_not_Global_0\").custom.StartDate\n\tendDate \u003d self.getChild(\"Period_not_Global_0\").custom.EndDate\n\t\n\tself.getChild(\"Statistics\").custom.startDate \u003d startDate\n\tself.getChild(\"Statistics\").custom.endDate \u003d endDate"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"position": {
"x": 0,
"y": 0
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#1A4A5E",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -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;

File diff suppressed because one or more lines are too long

View File

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

View File

@ -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;

View File

@ -0,0 +1,7 @@
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 Total_count
FROM alltable
WHERE alltable.t_stamp BETWEEN :starttime AND :endtime
GROUP BY date(alltable.t_stamp), hour(alltable.t_stamp)

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,964 @@
{
"custom": {},
"params": {
"tagProps": [
"System/MCM01/IO_BLOCK/DPM/PS3_5_DPM1",
"System/MCM01/IO_BLOCK/SIO/PS3_3_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_4_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_5_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_6_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_7_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_8_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_9AL_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_9B_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_10_SIO1",
"System/MCM01/IO_BLOCK/SIO/PS3_11_SIO1",
"System/MCM01/IO_BLOCK/FIO/PDP01_FIOM_1"
]
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.params.DPMNotFaulted": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[0]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[1]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[10]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[11]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[1]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[2]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[2]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[3]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[3]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[4]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[4]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[5]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[5]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[6]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[6]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[7]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[7]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[8]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[8]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[9]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[9]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[10]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
}
},
"props": {
"params": {
"con_lines": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"tagProps": [
"System/MCM01/IO_BLOCK/DPM/PS3_5_DPM1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_TO_HUB",
"style": {
"userSelect": "none"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_3_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0256,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.54",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_3_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_4_SIO1 "
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0715,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.55",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_4_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_5_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1148,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.56",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_5_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_6_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.155,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.57",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_6_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_7_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1957,
"y": 0.0047
},
"props": {
"params": {
"IP": "11.200.1.58",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_7_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_8_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2368,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.59",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_8_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_9AL_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2766,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.60",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_9AL_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_9B_SIO1"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "-607% 50%"
},
"width": 0.0349,
"x": 0.3167,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.61",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_9B_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "DPM_label"
},
"position": {
"height": 0.0694,
"width": 0.101,
"x": 0.7498,
"y": 0.6527
},
"props": {
"text": "PS3_5_DPM1",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "PS3_10_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3578,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.62",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_10_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "PS3_11_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3979,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.63",
"tagProps": [
"System/MCM01/IO_BLOCK/SIO/PS3_11_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"children": [
{
"meta": {
"name": "Communication_Faulted_Text"
},
"position": {
"height": 0.4836,
"width": 0.8826,
"x": 0.0701,
"y": -0.0785
},
"props": {
"style": {
"borderColor": "#1A1A1A",
"overflow": "hidden",
"whiteSpace": "normal",
"wordBreak": "break-all"
},
"text": "Communication Faulted",
"textStyle": {
"fontFamily": "inherit",
"fontSize": "1.5vmin",
"textAlign": "start"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Communication_Not_Faulted_Text"
},
"position": {
"height": 0.6066,
"width": 0.9032,
"x": 0.0698,
"y": 0.247
},
"props": {
"style": {
"borderColor": "#1A1A1A",
"overflow": "hidden",
"whiteSpace": "normal",
"wordBreak": "break-all"
},
"text": "Communication Not Faulted",
"textStyle": {
"fontFamily": "inherit",
"fontSize": "1.5vmin",
"textAlign": "start"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "CoordinateContainer_0"
},
"position": {
"height": 0.0242,
"width": 0.0508,
"x": 0.0122,
"y": 0.176
},
"props": {
"style": {
"backgroundColor": "#FF0000"
}
},
"type": "ia.container.coord"
},
{
"meta": {
"name": "CoordinateContainer_1"
},
"position": {
"height": 0.0242,
"width": 0.0508,
"x": 0.0122,
"y": 0.5164
},
"props": {
"style": {
"backgroundColor": "#00FF00"
}
},
"type": "ia.container.coord"
}
],
"meta": {
"name": "CoordinateContainer"
},
"position": {
"height": 0.1365,
"width": 0.9083,
"x": 0.0083,
"y": 0.7752
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
},
{
"meta": {
"name": "DPM_label_0"
},
"position": {
"height": 0.0694,
"width": 0.101,
"x": 0.7498,
"y": 0.7085
},
"props": {
"text": "11.200.1.3",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "PDP01_FIOM1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.437,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.64",
"tagProps": [
"System/MCM01/IO_BLOCK/FIO/PDP01_FIOM_1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"position": {
"x": 0.6348,
"y": -0.1546
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

File diff suppressed because one or more lines are too long

View File

@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

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

View File

@ -0,0 +1,52 @@
Select
SorterName,inducted_count,sorted_count,destinv_count,destfull_count,unexpected_count,destfault_count,destfault_count,divfail_count,gaperr_count,
lost_count, trackerr_count, unknownn_count, unsafe_count,destdis_count, destnone_count, Startstamp,Endtstamp,
inducted_count/inducted_count as inducted_perc,
sorted_count/inducted_count as sorted_perc,
destinv_count/inducted_count as destinv_perc,
destfull_count/inducted_count as destfull_perc,
unexpected_count/inducted_count as unexpected_perc,
destfault_count/inducted_count as destfault_perc,
divfail_count/inducted_count as divfail_perc,
gaperr_count/inducted_count as gaperr_perc,
lost_count/inducted_count as lost_perc,
trackerr_count/inducted_count as trackerr_perc,
unknownn_count/inducted_count as unknown_perc,
unsafe_count/inducted_count as unsafe_perc,
destdis_count/inducted_count as destdis_perc,
destnone_count/inducted_count as destnone_perc,
inducted_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as inducted_rate,
sorted_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as sorted_rate,
destinv_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as destinv_rate,
destfull_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as destfull_rate,
unexpected_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as unexpected_rate,
destfault_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as destfault_rate,
divfail_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as divfail_rate,
gaperr_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as gaperr_rate,
lost_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as lost_rate,
trackerr_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as trackerr_rate,
unknownn_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as unknown_rate,
unsafe_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as unsafe_rate,
destdis_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as destdis_rate,
destnone_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as destnone_rate
FROM
(SELECT
'S03' as SorterName,
COUNT(*) AS inducted_count,
SUM(alltable.ACTUAL_DEST <> 'S03999') AS sorted_count,
SUM(alltable.DivertStatus = 7) AS destinv_count,
SUM(alltable.DivertStatus = 5) AS destfull_count,
SUM(alltable.DivertStatus = 2) AS unexpected_count,
SUM(alltable.DivertStatus = 6) AS destfault_count,
SUM(alltable.DivertStatus = 14) AS divfail_count,
SUM(alltable.DivertStatus = 4) AS gaperr_count,
SUM(alltable.DivertStatus = 17) AS lost_count,
SUM(alltable.DivertStatus = 3) AS trackerr_count,
SUM(alltable.DivertStatus = 1) AS unknownn_count,
SUM(alltable.DivertStatus = 21) AS unsafe_count,
SUM(alltable.DivertStatus = 12) AS destdis_count,
SUM(alltable.DivertStatus = 16) AS destnone_count,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)) basa

View File

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

View File

@ -0,0 +1,9 @@
{
"base": {
"style": {
"fontFamily": "Arial",
"fontSize": "10px",
"textAlign": "center"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

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

View File

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

View File

@ -0,0 +1,16 @@
{
"base": {
"style": {
"backgroundColor": "#007EFCB3",
"borderColor": "#000000",
"borderStyle": "solid",
"borderWidth": "0.5px",
"color": "#000000",
"fontFamily": "Arial",
"fontSize": "14px",
"fontWeight": "bold",
"lineHeight": "20px",
"textAlign": "center"
}
}
}

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
-- GetActiveAlarmsByLocationAndPriority: Count active alarms grouped by location and priority
-- Uses: idx_alarm_events_eventid, idx_alarm_event_data_lookup
-- Expected performance: <1 second
-- Active alarm = latest event per eventid is eventtype=0 (Ignition alarm pattern)
SELECT
-- Use myLocation property directly (99.96% coverage) - MUCH faster than parsing tags!
IFNULL(loc.strValue, '') AS Location,
CASE ae.priority
WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low'
WHEN 2 THEN 'Medium'
WHEN 3 THEN 'High'
WHEN 4 THEN 'Critical'
ELSE 'Unknown'
END AS Priority,
COUNT(*) AS Count
FROM alarm_events ae
INNER JOIN (
-- Find latest event per eventid where latest event is type 0 (active)
SELECT lat.eventid, lat.latest_id
FROM (
SELECT eventid, MAX(id) as latest_id
FROM alarm_events
WHERE eventid IS NOT NULL
GROUP BY eventid
) lat
INNER JOIN alarm_events latest_event ON latest_event.id = lat.latest_id
WHERE latest_event.eventtype = 0
AND latest_event.displaypath NOT LIKE '%System Startup%'
AND latest_event.source NOT LIKE '%System Startup%'
AND latest_event.displaypath NOT LIKE '%System Shutdown%'
AND latest_event.source NOT LIKE '%System Shutdown%'
) active ON ae.id = active.latest_id
LEFT JOIN alarm_event_data loc FORCE INDEX (idx_alarm_event_data_lookup)
ON loc.id = ae.id AND loc.propname = 'myLocation'
GROUP BY Location, ae.priority
ORDER BY Location, Priority;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -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;

View File

@ -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;

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

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

View File

@ -0,0 +1,7 @@
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,
'100%' AS Total_count
FROM alltable
WHERE alltable.t_stamp BETWEEN :starttime AND :endtime
GROUP BY date(alltable.t_stamp), hour(alltable.t_stamp)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,407 @@
{
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 1,
"High": 4,
"Low": 0,
"Medium": 0,
"Total": 5
},
"totalAlarms": {
"$": [
"ds",
192,
1762441246756
],
"$columns": [
{
"data": [
"MCM01",
"MCM01"
],
"name": "Location",
"type": "String"
},
{
"data": [
"Diagnostic",
"High"
],
"name": "Priority",
"type": "String"
},
{
"data": [
1,
4
],
"name": "Count",
"type": "Long"
}
]
}
},
"params": {
"value": {
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"custom.counts": {
"persistent": true
},
"custom.totalAlarms": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},
"onChange": {
"enabled": null,
"script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\t# Initialize counts\n\tcounts \u003d {\n\t \"Critical\": 0,\n\t \"High\": 0,\n\t \"Medium\": 0,\n\t \"Low\": 0,\n\t \"Diagnostic\": 0,\n\t \"Total\": 0\n\t}\n\t\n\t# Loop through dataset and aggregate\n\tfor row in range(queryData.rowCount):\n\t mcm_val \u003d queryData.getValueAt(row, 0)\n\t severity \u003d queryData.getValueAt(row, 1)\n\t count \u003d queryData.getValueAt(row, 2)\n\t\n\t if mcm_val \u003d\u003d MCM:\n\t key \u003d severity.capitalize()\n\t if key in counts:\n\t counts[key] +\u003d count\n\t counts[\"Total\"] +\u003d count\n\t \n\tself.custom.counts \u003d counts"
},
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
},
"params.value.tagProps": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.print(currentValue.value[0])"
}
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "High"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Med"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Low"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Diag"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Total"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "25px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.High"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Medium"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Low"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Diagnostic"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Total"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "25px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"custom.has_role": {
"binding": {
"config": {
"expression": "{session.custom.fc}"
},
"transforms": [
{
"code": "\trme_role \u003d value +\"-rme-all\"\n\troles \u003d (self.session.props.auth.user.roles)\n\tif (rme_role.lower() in roles \n\tor rme_role.upper() in roles):\n\t\treturn True\n\telse:\n\t\treturn False",
"type": "script"
}
],
"type": "expr"
}
},
"custom.status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
},
"transforms": [
{
"expression": "if(isNull({value}), 0, {value})",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 4,
"output": 1
},
{
"input": 3,
"output": 2
},
{
"input": 2,
"output": 3
},
{
"input": 1,
"output": 4
},
{
"input": 0,
"output": 5
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
}
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

View File

@ -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 <> 'S03999') AS Sorted,
SUM(alltable.ACTUAL_DEST = 'S03999' AND (alltable.DivertStatus = 7 OR alltable.DivertStatus = 8 OR alltable.DivertStatus = 9 OR alltable.DivertStatus = 10 OR alltable.DivertStatus = 12 OR alltable.DivertStatus = 16)) AS AwcsRecirc,
SUM(alltable.ACTUAL_DEST = 'S03999' AND (alltable.DivertStatus = 2 OR alltable.DivertStatus = 5 OR alltable.DivertStatus = 18 OR alltable.DivertStatus = 19 or alltable.DivertStatus = 20)) AS OperationalRecirc,
SUM(alltable.ACTUAL_DEST = 'S03999' AND (alltable.DivertStatus = 1 OR alltable.DivertStatus = 3 OR alltable.DivertStatus = 4 OR alltable.DivertStatus = 6 OR alltable.DivertStatus = 13 OR alltable.DivertStatus = 14 OR alltable.DivertStatus = 17 OR alltable.DivertStatus = 21)) AS MachineRecirc
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,64 @@
WITH ALARM_TIMELAPSES AS (
/* Group related active & clear events into a single row */
SELECT
id, /* Unique to each row in alarm_events, used to look up metadata in alarm_event_data */
source, /* Unique alarm path in Ignition */
eventtime AS starttime,
displaypath, /* Get description */
/* Get the last time this event was active within the given time range*/
CAST(LEAST(COALESCE((
/* Search for the clear event (if exists) for the outer query's active event */
SELECT MIN(eventtime)
FROM alarm_events e2
WHERE e2.eventid = e.eventid /* eventid is unique per alarm instance */
AND e2.eventtime >= e.eventtime
AND e2.eventtype = 1 /* Look only for the clear event */
ORDER BY eventtime ASC
), NOW()), :endDate) AS DATETIME) AS endtime, /* Clamp to end of time range if clear event is after end time */
priority
FROM alarm_events e
/* The range for both start/end allows for index optimizations */
WHERE eventtime BETWEEN :startDate AND :endDate
/* Filter shifts */
{shifts}
/* Filter alarm types */
AND displaypath IN ({alarms})
/* Filter out active events */
AND eventtype = 0
), HITLIST AS (
/* Group the same type of alarms together to get hit counts and total durations */
SELECT
MAX(id) AS id, /* Use latest id to get the latest metadata */
MIN(starttime) AS firsttime, /* Get the earliest it's been active in the given time range */
MAX(endtime) AS lasttime, /* Get the latest it's been active in the given time range */
MIN(displaypath) AS displaypath, /* Get one of the displaypaths associated with source */
MAX(priority) AS priority,
COUNT(*) AS count,
SUM(TIME_TO_SEC(TIMEDIFF(endtime, starttime))) AS duration
FROM ALARM_TIMELAPSES
GROUP BY source
ORDER BY count DESC
LIMIT 2000
)
/* Finally, merge metadata into hitlist */
SELECT
/*e.firsttime, e.lasttime,*/
/* Translate duration to a string */
CAST(SEC_TO_TIME(FLOOR(e.duration)) AS CHAR) AS duration,
/* Retrieve instance count and total duration */
e.count,
dtag.strvalue AS plctag,
ddevice.strvalue AS device,
displaypath AS description
FROM HITLIST e
/* Lookup Device */
JOIN alarm_event_data dtag ON e.id = dtag.id AND dtag.propname = "PLCTag"
/* Lookup Device */
JOIN alarm_event_data ddevice ON e.id = ddevice.id AND ddevice.propname = "Device"
/* Lookup Class */
JOIN alarm_event_data dclass ON e.id = dclass.id AND dclass.propname = "Class"
/* Lookup DeviceType */
JOIN alarm_event_data dtype ON e.id = dtype.id AND dtype.propname = "DeviceType"
WHERE dclass.strvalue IN ("Error", "Warning")
AND ddevice.strvalue NOT IN ("Ignition")
AND SUBSTRING_INDEX(dtype.strvalue, "_", 1) IN ({devices});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
SELECT
concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') AS StartTimestamp,
concat('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"), DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) AS Hour,
concat(CAST(COUNT(*) AS CHAR), ' pph') AS Total_count
FROM alltable
WHERE alltable.t_stamp BETWEEN :starttime AND :endtime
GROUP BY date(alltable.t_stamp), hour(alltable.t_stamp)

View File

@ -0,0 +1,189 @@
{
"pages": {
"/Home": {
"viewPath": "autStand/Overview/Home",
"title": ""
},
"/Status": {
"viewPath": "autStand/Windows/Status",
"title": ""
},
"/Help": {
"viewPath": "autStand/Windows/Help",
"title": ""
},
"/Command": {
"viewPath": "autStand/Windows/CommandControl",
"title": ""
},
"/MCM01": {
"viewPath": "autStand/Detailed_Views/MCM01-FLUID INBOUND",
"title": ""
},
"/Statistics": {
"viewPath": "autStand/Windows/Statistics",
"title": ""
},
"/MCM02": {
"viewPath": "autStand/Detailed_Views/MCM02-NON CON SORTER",
"title": ""
},
"/Alarms": {
"viewPath": "autStand/Alarms/RealTime",
"title": ""
},
"/Reports": {
"viewPath": "autStand/Windows/Reports",
"title": ""
},
"/": {
"viewPath": "autStand/Overview/BNA8",
"title": "",
"docks": {
"left": [
{
"viewPath": "autStand/Docked_Views/Docked-West",
"id": "Docked-West",
"viewParams": {},
"size": 70,
"resizable": false,
"iconUrl": "",
"modal": false,
"show": "auto",
"anchor": "fixed",
"content": "auto",
"autoBreakpoint": 805,
"handle": "autoHide"
}
],
"top": [
{
"viewPath": "autStand/Docked_Views/Header",
"id": "",
"viewParams": {},
"size": 50,
"resizable": false,
"iconUrl": "",
"modal": false,
"show": "visible",
"anchor": "fixed",
"content": "auto",
"autoBreakpoint": 480,
"handle": "hide"
}
],
"bottom": [
{
"viewPath": "autStand/Docked_Views/Footer",
"id": "",
"viewParams": {},
"size": 165,
"resizable": false,
"iconUrl": "material/notifications_active",
"modal": false,
"show": "onDemand",
"anchor": "fixed",
"content": "cover",
"autoBreakpoint": 480,
"handle": "show"
}
]
}
}
},
"sharedDocks": {
"cornerPriority": "top-bottom",
"left": [
{
"viewPath": "autStand/Docked_Views/Docked-West",
"id": "",
"viewParams": {},
"size": 70,
"resizable": false,
"iconUrl": "",
"modal": false,
"show": "auto",
"anchor": "fixed",
"content": "auto",
"autoBreakpoint": 805,
"handle": "autoHide"
}
],
"right": [
{
"viewPath": "autStand/Docked_Views/Controller-Equipment/Information-Docked-East-Conv",
"id": "Docked-East-Conv",
"viewParams": {},
"size": 600,
"resizable": false,
"iconUrl": "",
"modal": true,
"show": "onDemand",
"anchor": "fixed",
"content": "cover",
"autoBreakpoint": 480,
"handle": "hide"
},
{
"viewPath": "autStand/Docked_Views/Controller-Equipment/Information-Docked-East-Device",
"id": "Docked-East-Device",
"viewParams": {},
"size": 600,
"resizable": false,
"iconUrl": "",
"modal": true,
"show": "onDemand",
"anchor": "fixed",
"content": "cover",
"autoBreakpoint": 480,
"handle": "hide"
},
{
"viewPath": "autStand/Docked_Views/Controller-Equipment/Information-Docked-East-VFD",
"id": "Docked-East-VFD",
"viewParams": {},
"size": 600,
"resizable": false,
"iconUrl": "",
"modal": true,
"show": "onDemand",
"anchor": "fixed",
"content": "cover",
"autoBreakpoint": 480,
"handle": "hide"
}
],
"top": [
{
"viewPath": "autStand/Docked_Views/Header",
"id": "",
"viewParams": {},
"size": 50,
"resizable": false,
"iconUrl": "",
"modal": false,
"show": "visible",
"anchor": "fixed",
"content": "auto",
"autoBreakpoint": 480,
"handle": "hide"
}
],
"bottom": [
{
"viewPath": "autStand/Docked_Views/Footer",
"id": "",
"viewParams": {},
"size": 165,
"resizable": false,
"iconUrl": "material/notifications_active",
"modal": false,
"show": "onDemand",
"anchor": "fixed",
"content": "cover",
"autoBreakpoint": 480,
"handle": "show"
}
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

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