Pushing to the main branch. merged code

This commit is contained in:
nodo kakabadze 2025-08-28 14:03:49 +04:00
parent bca0789845
commit f246ca0e7e
206 changed files with 77329 additions and 2390 deletions

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,264 @@
{
"custom": {
"state": 0,
"string": "Clear"
},
"params": {
"tagProps": [
3,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 1,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
},
"transforms": [
{
"expression": "coalesce({value},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Clear",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Clear"
},
{
"input": 2,
"output": "Blocked"
},
{
"input": 3,
"output": "Disabled"
},
{
"input": 4,
"output": "Jammed"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 42,
"width": 98
}
},
"root": {
"children": [
{
"meta": {
"name": "Photoeye"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#00FF00",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#00FF00"
},
{
"input": 2,
"output": "#000000"
},
{
"input": 3,
"output": "#800080"
},
{
"input": 4,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[2].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#00FF00",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#00FF00"
},
{
"input": 2,
"output": "#000000"
},
{
"input": 3,
"output": "#800080"
},
{
"input": 4,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"d": "m 28.763932,20 -20,10 V 10 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "2"
},
"type": "path"
},
{
"stroke": {
"paint": "#000000",
"width": "2"
},
"stroke-dasharray": "4,4",
"type": "line",
"x1": "30",
"x2": "60",
"y1": "20",
"y2": "20"
},
{
"fill": {},
"height": "20",
"stroke": {
"paint": "#000000",
"width": "2"
},
"type": "rect",
"width": "6",
"x": "60",
"y": "10"
}
],
"preserveAspectRatio": "none",
"style": {
"boxShadow": "value"
},
"viewBox": "0 0 80 40"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-Photoeye\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\n\talarm \u003d []\n\tmessage \u003d None\n\n\tsleep(0.5)\n\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_photoeyes"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 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,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: 88 KiB

File diff suppressed because it is too large Load Diff

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,209 @@
{
"custom": {
"state": 0,
"string": "Unknown"
},
"params": {
"tagProps": [
"/system/mcm01/test",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 0,
"output": 0
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "OK"
},
{
"input": 2,
"output": "Faulted"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 40
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"style": {
"paddingBottom": 1,
"paddingLeft": 1,
"paddingRight": 1,
"paddingTop": 1
},
"text": "SIO",
"textStyle": {
"fontSize": "20px",
"textAlign": "center",
"textTransform": "uppercase"
}
},
"type": "ia.display.label"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_fio_safety"
},
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#808080",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#00FF00"
},
{
"input": 2,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"borderStyle": "solid",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

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)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,99 @@
import os, json, sys
global_project_page_ids = {}
def get_project_config():
"""
Scan each view.json under Detailed_Views (no recursion),
go one level deeper (coordinateContainer), extract tagProps[0]
from children, and store as {source_id: view_folder_name}.
"""
global global_project_page_ids
global_project_page_ids.clear()
try:
project_name = system.util.getProjectName()
base_path = (
os.getcwd().replace("\\", "/")
+ "/data/projects/"
+ project_name
+ "/com.inductiveautomation.perspective/Views/autStand/Detailed_Views"
)
if not os.path.exists(base_path):
system.perspective.print("Path not found: " + base_path)
return {}
for view_folder in os.listdir(base_path):
json_file = os.path.join(base_path, view_folder, "view.json")
if not os.path.isfile(json_file):
continue
with open(json_file, "r") as fh:
view_json = json.load(fh)
# go one level deeper: root -> children[0] (coordinateContainer) -> its children
root_children = (view_json.get("root") or {}).get("children") or []
if not root_children:
continue
# assume first child is the coordinateContainer
container = root_children[0]
children = container.get("children") or []
# now loop through these children to get tagProps
for child in children:
props = child.get("props") or {}
params = props.get("params") or {}
tag_props = params.get("tagProps")
if isinstance(tag_props, list) and len(tag_props) > 0:
source_id = str(tag_props[0])
global_project_page_ids[source_id] = view_folder
system.perspective.print("Found: {} -> {}".format(source_id, view_folder))
except:
whid = system.tag.readBlocking("Configuration/FC")[0].value
logger = system.util.getLogger("%s-get_project_config" % whid)
exc_type, exc_obj, tb = sys.exc_info()
logger.error("Error at line %s: %s" % (tb.tb_lineno, exc_obj))
return global_project_page_ids
def navigate_to_url(self, source_id, page_id):
url_to_navigate = "autStand/Detailed_Views/%s" % (page_id)
system.perspective.navigate(view=url_to_navigate, params={"highlightTagPath": source_id + "||Diagnostic"})
def source_id_lookup(self, source_id):
"""
Finds page_id from global_project_page_ids by source_id or by hierarchy,
then navigates.
"""
if not source_id:
return
page_id = global_project_page_ids.get(source_id)
found = False
if page_id:
found = True
navigate_to_url(self, source_id, page_id)
else:
# Walk hierarchy upwards until we find a match
items = source_id.split("/")
while len(items) > 1:
items.pop()
source_id = "/".join(items)
page_id = global_project_page_ids.get(source_id)
if page_id:
found = True
navigate_to_url(self, source_id, page_id)
break
if not found:
open_pop_up("No page id found")

View File

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

File diff suppressed because one or more lines are too long

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1,434 @@
{
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 3,
"High": 5,
"Low": 0,
"Medium": 2,
"Total": 10
},
"totalAlarms": {
"$": [
"ds",
192,
1755617373648
],
"$columns": [
{
"data": [
"MCM01",
"MCM01",
"MCM01",
"MCM02",
"MCM03",
"MCM04",
"MCM04",
"MCM05",
"MCM06",
"MCM07",
"MCM07"
],
"name": "Location",
"type": "String"
},
{
"data": [
"Diagnostic",
"High",
"Medium",
"Diagnostic",
"Diagnostic",
"Diagnostic",
"High",
"Diagnostic",
"Diagnostic",
"Diagnostic",
"High"
],
"name": "Priority",
"type": "String"
},
{
"data": [
3,
5,
2,
2,
1,
2,
5,
1,
1,
2,
3
],
"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": "Alarms-autStand/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"
}
}

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)

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)

View File

@ -0,0 +1,625 @@
{
"custom": {
"PLCs": "{ \"MCM01 Fluid Inbound\": [ \"MCM01\" ], \"MCM02 Non Con Sorter\": [ \"MCM02\" ] }",
"activityLogger": {
"alt_pageid": "command_control",
"start_time": {
"$": [
"ts",
192,
1755611847075
],
"$ts": 1755611847075
}
},
"devices": {
"MCM01": {
"area": "Fluid Inbound",
"name": "MCM01",
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"MCM02": {
"area": "Non Con Sorter",
"name": "MCM02",
"tagProps": [
"MCM02",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
}
},
"events": {
"system": {
"onShutdown": {
"config": {
"script": "\tactivityLog.logger.callLogger(self, \u0027page\u0027)\n\tactivityLog.productMetrics.callLogger(self, \u0027page\u0027)"
},
"scope": "G",
"type": "script"
},
"onStartup": {
"config": {
"script": "\tself.custom.activityLogger.start_time \u003d system.date.now()"
},
"scope": "G",
"type": "script"
}
}
},
"params": {
"page_name": "Command and Control"
},
"propConfig": {
"custom.PLCs": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/DetailedViews"
},
"type": "tag"
},
"persistent": true
},
"custom.activityLogger": {
"persistent": true
},
"custom.activityLogger.pageid": {
"binding": {
"config": {
"expression": "{page.props.path}"
},
"transforms": [
{
"code": "\tif value \u003d\u003d\u0027/\u0027 or value \u003d\u003d \u0027\u0027 or value \u003d\u003d None:\n\t\treturn self.custom.activityLogger.alt_pageid.lower()\n\telse:\n\t\treturn value[1:].lower()",
"type": "script"
}
],
"type": "expr"
}
},
"custom.devices": {
"binding": {
"config": {
"path": "view.custom.PLCs"
},
"transforms": [
{
"code": "\tdevices \u003d system.util.jsonDecode(value)\n\tPLCs \u003d {}\n\tfc \u003d self.session.custom.fc\n\tconfig \u003d system.tag.readBlocking(\u0027[\u0027 + fc + \u0027_SCADA_TAG_PROVIDER]\u0027 + \u0027/Configuration/PLC\u0027)[0].value\n\t\n\tif devices:\n\t\tfor k, v in devices.items():\n\t\t\tdevice_list \u003d v\n\t\t\tfor i in device_list:\n\t\t\t\tdecode \u003d system.util.jsonDecode(config)\n\t\t\t\tif decode:\n\t\t\t\t\tarea \u003d decode[i][\"Area\"]\n\t\t\t\t\tsub_area \u003d decode[i][\"SubArea\"]\n\t\t\t\t\tarea_label \u003d str(area) + \"/\" + str(sub_area) if sub_area else str(area)\n\t\t\t\telse:\n\t\t\t\t\tarea \u003d \"\"\n\t\t\t\t\tarea_label \u003d \"\"\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tPLCs[i] \u003d {\u0027name\u0027:i,\u0027area\u0027:area_label,\u0027tagProps\u0027:[\n\t\t\t\t\t\t\t\t i,\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\",\n\t\t\t\t\t\t\t\t \"value\"\n\t\t\t\t\t\t\t\t ]}\n\t\n\treturn PLCs",
"type": "script"
}
],
"type": "property"
},
"persistent": true
},
"params.page_name": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "Table"
},
"position": {
"grow": 1
},
"propConfig": {
"props.data": {
"binding": {
"config": {
"path": "view.custom.devices"
},
"transforms": [
{
"code": "\tresults \u003d []\n\tfor row, val in value.items():\n\t\tresults.append({\"plc\": val[\"name\"], \"area\": val[\"area\"],\"status\": {\"tagProps\":val[\"tagProps\"]},\"alarms\": {\"tagProps\":val[\"tagProps\"]},\"actions\": {\"tagProps\":val[\"tagProps\"]}})\n\t\n\tresults.sort(key\u003dlambda item: item[\u0027plc\u0027])\n\treturn results",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"cells": {
"style": {
"borderColor": "#4A4A4A",
"borderStyle": "solid",
"borderWidth": 1,
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 16,
"paddingRight": 16
}
},
"columns": [
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "plc",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"borderColor": "#4A4A4A",
"borderStyle": "solid",
"borderWidth": 1,
"classes": "",
"color": "#4A4A4A",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 11,
"paddingRight": 11
},
"title": "PLC"
},
"justify": "auto",
"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": false,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 50
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "area",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"borderColor": "#4A4A4A",
"borderStyle": "solid",
"borderWidth": 1,
"classes": "",
"color": "#4A4A4A",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 11,
"paddingRight": 11
},
"title": "Area"
},
"justify": "auto",
"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": false,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 50
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "status",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"borderColor": "#4A4A4A",
"borderStyle": "solid",
"borderWidth": 1,
"classes": "",
"color": "#4A4A4A",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 11,
"paddingRight": 11
},
"title": "Status"
},
"justify": "auto",
"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": false,
"sort": "none",
"sortable": false,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "autStand/Equipment/Controller-Views/CommandControlStatus",
"visible": true,
"width": 75
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "alarms",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"borderColor": "#4A4A4A",
"borderStyle": "solid",
"borderWidth": 1,
"classes": "",
"color": "#4A4A4A",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 11,
"paddingRight": 11
},
"title": "Active Alarms"
},
"justify": "auto",
"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": false,
"sort": "none",
"sortable": false,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "autStand/Equipment/Controller-Views/CommandControlAlarms",
"visible": true,
"width": "auto"
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "actions",
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"borderColor": "#4A4A4A",
"borderStyle": "solid",
"borderWidth": 1,
"classes": "",
"color": "#4A4A4A",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 11,
"paddingRight": 11
},
"title": "Controls"
},
"justify": "auto",
"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": "view",
"resizable": false,
"sort": "none",
"sortable": false,
"strictWidth": false,
"style": {
"classes": "",
"textAlign": "center"
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "autStand/Equipment/Controller-Views/CommandControlActions",
"visible": true,
"width": "auto"
}
],
"dragOrderable": false,
"pager": {
"activeOption": 50,
"initialOption": 50
},
"rows": {
"height": 44,
"highlight": {
"color": "#EEEEEE"
},
"striped": {
"enabled": false
},
"style": {
"backgroundColor": "#FFFFFF",
"borderColor": "#4A4A4A",
"borderStyle": "none",
"borderWidth": 1,
"classes": "Fonts/BodyText14",
"color": "#4A4A4A"
}
},
"selection": {
"enableRowSelection": false
},
"style": {
"borderStyle": "none",
"margin": 5,
"overflow": "hidden",
"overflowX": "hidden",
"overflowY": "hidden"
},
"virtualized": false
},
"type": "ia.display.table"
}
],
"custom": {
"Devices": [],
"count": "value",
"delay": 4000
},
"events": {
"system": {
"onShutdown": [
{
"config": {
"script": "\tself.session.custom.command_auth.enabled \u003d False"
},
"scope": "G",
"type": "script"
},
{
"config": {
"script": "\twhid \u003d self.session.custom.fc\n\tsession_id \u003d self.session.props.id\n\tpage_id \u003d self.view.params.page_name\n\tCommands.analytics.send_page_details(whid, session_id, page_id)"
},
"scope": "G",
"type": "script"
}
]
}
},
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,249 @@
{
"custom": {
"state": 0,
"string": "Idle"
},
"params": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 1,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
},
{
"input": 4,
"output": 4
},
{
"input": 5,
"output": 5
},
{
"input": 6,
"output": 6
},
{
"input": 7,
"output": 7
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "Idle"
},
{
"input": 1,
"output": "Actuated"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 30,
"width": 30
}
},
"root": {
"children": [
{
"meta": {
"name": "EPC"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_epc"
},
"type": "property"
}
},
"props.elements[2].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#00FF00",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"fill": {
"paint": "#FFFF00"
},
"height": "20",
"name": "rect",
"type": "rect",
"width": "20",
"x": "0",
"y": "0"
},
{
"d": "M 0,0 H 20 V 20 H 0 Z",
"fill": {
"paint": "transparent"
},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "1.5"
},
"type": "path"
},
{
"d": "m 17,10.5 a 7,7 0 0 1 -7,7 7,7 0 0 1 -7,-7 7,7 0 0 1 7,-7 7,7 0 0 1 7,7 z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "1"
},
"type": "path"
}
],
"viewBox": "0 0 20 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-EPC\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_epc"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

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

View File

@ -0,0 +1,203 @@
{
"custom": {
"state": 0,
"string": "Unknown"
},
"params": {
"tagProps": [
"/system/mcm01/test",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 0,
"output": 0
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "OK"
},
{
"input": 2,
"output": "Faulted"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 40
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"text": "FIO",
"textStyle": {
"fontSize": "20px",
"textAlign": "center",
"textTransform": "uppercase"
}
},
"type": "ia.display.label"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_fio_safety"
},
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#808080",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#00FF00"
},
{
"input": 2,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"borderStyle": "solid",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,321 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 294,
"width": 500
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "77px"
},
"props": {
"style": {
"backgroundColor": "#555555",
"color": "#FFFFFF",
"fontWeight": "bold",
"textIndent": "15px"
},
"text": "Search"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"props": {
"color": "#FFFFFF",
"path": "material/search"
},
"type": "ia.display.icon"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "45px"
},
"props": {
"style": {
"backgroundColor": "#555555"
}
},
"type": "ia.container.flex"
},
{
"events": {
"component": {
"onRowDoubleClick": {
"config": {
"script": "\trow \u003d event.value\n\tsource_id \u003d row.get(\"SourceId\") \n\tautStand.config.project_config.source_id_lookup(self, source_id)\n\tsystem.perspective.closePopup(id \u003d \"Search\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Table"
},
"position": {
"basis": "294px"
},
"props": {
"cells": {
"style": {
"textIndent": "15px"
}
},
"columns": [
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "SourceId",
"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": "",
"style": {
"classes": ""
}
},
"max": 100,
"min": 0,
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"render": "auto",
"resizable": false,
"sort": "none",
"sortable": false,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": 200
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "Page",
"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": "left",
"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": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": ""
}
],
"data": {
"$": [
"ds",
192,
1756214343007
],
"$columns": [
{
"data": [
"System/MCM01/Station/SSPB/UL6_1_SS1",
"/system/mcm01/test"
],
"name": "SourceId",
"type": "String"
},
{
"data": [
"MCM01-FLUID INBOUND",
"MCM02-NC SORTER"
],
"name": "Page",
"type": "String"
}
]
},
"filter": {
"enabled": true,
"style": {
"backgroundColor": "#2B2B2B",
"color": "#FFFFFF"
}
},
"headerStyle": {
"backgroundColor": "#2B2B2B",
"color": "#FFFFFF",
"textIndent": "15px"
},
"pager": {
"style": {
"backgroundColor": "#2B2B2B",
"color": "#FFFFFF",
"fontWeight": "bold"
}
},
"rows": {
"highlight": {
"color": "#FFFFFF"
},
"style": {
"classes": "Background-Styles/Controller"
}
},
"virtualized": false
},
"type": "ia.display.table"
}
],
"events": {
"system": {
"onStartup": {
"config": {
"script": "\t\n\tids \u003d autStand.config.project_config.get_project_config()\n\t\n\t# Ensure its actually a dictionary\n\tif not isinstance(ids, dict):\n\t system.perspective.print(\"Error: global_project_page_ids is not a dictionary\")\n\telse:\n\t data \u003d []\n\t for k, v in ids.items():\n\t data.append([str(k), str(v)])\n\t\n\t header \u003d [\"SourceId\", \"Page\"]\n\t dataset \u003d system.dataset.toDataSet(header, data)\n\t self.getChild(\"Table\").props.data \u003d dataset"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

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

View File

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

View File

@ -0,0 +1,9 @@
SELECT
date(alltable.t_stamp) as Day,
COUNT(*) AS Total,
SUM(alltable.DivertStatus = 5)/COUNT(*)*100 As Full,
SUM(alltable.ACTUAL_DEST = 'S0168')/COUNT(*)*100 AS Jackpot,
SUM(alltable.ACTUAL_DEST = 'S0199')/COUNT(*)*100 AS Recirc
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY day(alltable.t_stamp)

View File

@ -0,0 +1,135 @@
WITH DesiredLanes AS (
SELECT lane_number
FROM (
SELECT 101 + n AS lane_number
FROM (
SELECT a.N + b.N * 10 AS n
FROM (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION
SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) a,
(SELECT 0 AS N UNION SELECT 1 UNION SELECT 2) b
) numbers
WHERE n <= 29 -- 101 to 130
) lanes
WHERE lane_number NOT IN (102, 104, 106) -- exclude these
),
AlarmData AS (
SELECT DISTINCT
ae.id AS record_id,
ae.eventid AS event_uuid,
ae.source,
ae.eventtime AS active_time,
(SELECT MIN(eventtime)
FROM alarm_events ae2
WHERE ae2.eventid = ae.eventid
AND ae2.eventtype = 1
AND ae2.eventtime >= ae.eventtime
) AS clear_time
FROM alarm_events ae
WHERE
ae.eventtime BETWEEN :startDate AND :endDate
AND ae.eventtype = 0
AND (ae.source LIKE '%Chute%' OR ae.source LIKE '%ChuteStatus%')
),
LaneMapping AS (
SELECT
id AS record_id,
strvalue AS tag_value,
CASE
WHEN strvalue LIKE '%Chute[%' THEN
CAST(SUBSTRING(strvalue, LOCATE('Chute[', strvalue) + 6,
LOCATE(']', strvalue, LOCATE('Chute[', strvalue)) - LOCATE('Chute[', strvalue) - 6) AS UNSIGNED)
WHEN strvalue LIKE '%Chute[_%' THEN
CAST(SUBSTRING(strvalue, LOCATE('Chute_', strvalue) + 6) AS UNSIGNED)
WHEN strvalue LIKE '%Chute%' THEN
CAST(REGEXP_SUBSTR(strvalue, '[0-9]+') AS UNSIGNED)
ELSE NULL
END AS plc_index,
CASE
WHEN strvalue LIKE '%Chute[%' THEN
CASE
WHEN CAST(SUBSTRING(strvalue, LOCATE('Chute[', strvalue) + 6,
LOCATE(']', strvalue, LOCATE('Chute[', strvalue)) - LOCATE('Chute[', strvalue) - 6) AS UNSIGNED) BETWEEN 1 AND 30
THEN 101 + (CAST(SUBSTRING(strvalue, LOCATE('Chute[', strvalue) + 6,
LOCATE(']', strvalue, LOCATE('Chute[', strvalue)) - LOCATE('Chute[', strvalue) - 6) AS UNSIGNED) - 1)
WHEN CAST(SUBSTRING(strvalue, LOCATE('Chute[', strvalue) + 6,
LOCATE(']', strvalue, LOCATE('Chute[', strvalue)) - LOCATE('Chute[', strvalue) - 6) AS UNSIGNED) BETWEEN 31 AND 60
THEN 201 + (CAST(SUBSTRING(strvalue, LOCATE('Chute[', strvalue) + 6,
LOCATE(']', strvalue, LOCATE('Chute[', strvalue)) - LOCATE('Chute[', strvalue) - 6) AS UNSIGNED) - 31)
ELSE NULL
END
WHEN strvalue LIKE '%Chute[_%' THEN
CASE
WHEN CAST(SUBSTRING(strvalue, LOCATE('Chute_', strvalue) + 6) AS UNSIGNED) BETWEEN 1 AND 30
THEN 101 + (CAST(SUBSTRING(strvalue, LOCATE('Chute_', strvalue) + 6) AS UNSIGNED) - 1)
WHEN CAST(SUBSTRING(strvalue, LOCATE('Chute_', strvalue) + 6) AS UNSIGNED) BETWEEN 31 AND 60
THEN 201 + (CAST(SUBSTRING(strvalue, LOCATE('Chute_', strvalue) + 6) AS UNSIGNED) - 31)
ELSE NULL
END
WHEN strvalue LIKE '%Chute%' THEN
CASE
WHEN CAST(REGEXP_SUBSTR(strvalue, '[0-9]+') AS UNSIGNED) BETWEEN 1 AND 30
THEN 101 + (CAST(REGEXP_SUBSTR(strvalue, '[0-9]+') AS UNSIGNED) - 1)
WHEN CAST(REGEXP_SUBSTR(strvalue, '[0-9]+') AS UNSIGNED) BETWEEN 31 AND 60
THEN 201 + (CAST(REGEXP_SUBSTR(strvalue, '[0-9]+') AS UNSIGNED) - 31)
ELSE NULL
END
ELSE NULL
END AS lane_number
FROM alarm_event_data
WHERE propname = 'Tag' AND strvalue LIKE '%Chute%'
),
JamEvents AS (
SELECT DISTINCT
lm.lane_number,
ad.event_uuid,
ad.active_time,
ad.clear_time
FROM LaneMapping lm
INNER JOIN AlarmData ad ON lm.record_id = ad.record_id
INNER JOIN alarm_event_data aed ON ad.record_id = aed.id
WHERE aed.propname = 'Jam' AND aed.strvalue = '1'
),
FullEvents AS (
SELECT DISTINCT
lm.lane_number,
ad.event_uuid,
ad.active_time,
ad.clear_time
FROM LaneMapping lm
INNER JOIN AlarmData ad ON lm.record_id = ad.record_id
INNER JOIN alarm_event_data aed ON ad.record_id = aed.id
WHERE aed.propname = 'Full' AND aed.strvalue = '1'
),
Aggregated AS (
SELECT
CONCAT('S03_', dl.lane_number, 'CH') AS lane,
COALESCE(j.jam_count, 0) AS jam_count,
COALESCE(f.full_count, 0) AS full_count,
COALESCE(j.jam_duration_seconds, 0) AS jam_duration_seconds,
COALESCE(f.full_duration_seconds, 0) AS full_duration_seconds
FROM DesiredLanes dl
LEFT JOIN (
SELECT
lane_number,
COUNT(DISTINCT event_uuid) AS jam_count,
SUM(TIMESTAMPDIFF(SECOND, active_time, COALESCE(clear_time, NOW()))) AS jam_duration_seconds
FROM JamEvents
GROUP BY lane_number
) j ON dl.lane_number = j.lane_number
LEFT JOIN (
SELECT
lane_number,
COUNT(DISTINCT event_uuid) AS full_count,
SUM(TIMESTAMPDIFF(SECOND, active_time, COALESCE(clear_time, NOW()))) AS full_duration_seconds
FROM FullEvents
GROUP BY lane_number
) f ON dl.lane_number = f.lane_number
)
SELECT
lane AS Lane,
jam_count AS JamCount,
full_count AS FullCount,
COALESCE(SEC_TO_TIME(jam_duration_seconds), '00:00:00') AS JamDuration,
COALESCE(SEC_TO_TIME(full_duration_seconds), '00:00:00') AS FullDuration
FROM Aggregated
ORDER BY lane;

View File

@ -0,0 +1,17 @@
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,
concat(cast(SUM(alltable.ACTUAL_DEST <> 'S03999') as char),' pph') AS Diverted,
concat(cast(SUM(alltable.DivertStatus = 14) as char),' pph') AS DivertFail,
concat(cast(SUM(alltable.DivertStatus = 5) as char),' pph') AS DestinationFull,
concat(cast(SUM(alltable.DivertStatus = 6) as char),' pph') AS DestinationJam,
concat(cast(SUM(alltable.DivertStatus = 12) as char),' pph') AS DestinationDisabled,
concat(cast(SUM(alltable.DivertStatus = 6) as char),' pph') as DestinationFault,
concat(cast(SUM(alltable.DivertStatus = 17) as char),' pph') as Lost,
concat(cast(SUM(alltable.DivertStatus = 21) as char),' pph') as Unsafe,
concat(cast(SUM(alltable.DivertStatus = 18) as char),' pph') as DimError,
concat(cast(SUM(alltable.DivertStatus = 4) as char),' pph') as GapError,
concat(cast(SUM(alltable.DivertStatus = 1) as char),' pph') as Unknown
FROM alltable
Where (alltable.DEST_REQ = :lane AND alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

@ -0,0 +1,684 @@
{
"custom": {},
"params": {
"LD": false,
"LR": false,
"LRD": false,
"LRU": false,
"LU": false,
"On": false,
"RD": false,
"RLD": false,
"RLU": false,
"RU": false
},
"propConfig": {
"params.LD": {
"paramDirection": "input",
"persistent": true
},
"params.LR": {
"paramDirection": "input",
"persistent": true
},
"params.LRD": {
"paramDirection": "input",
"persistent": true
},
"params.LRU": {
"paramDirection": "input",
"persistent": true
},
"params.LU": {
"paramDirection": "input",
"persistent": true
},
"params.On": {
"paramDirection": "input",
"persistent": true
},
"params.RD": {
"paramDirection": "input",
"persistent": true
},
"params.RLD": {
"paramDirection": "input",
"persistent": true
},
"params.RLU": {
"paramDirection": "input",
"persistent": true
},
"params.RU": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 540,
"width": 640
}
},
"root": {
"children": [
{
"meta": {
"name": "CommLines"
},
"position": {
"basis": "300px",
"grow": 1
},
"propConfig": {
"props.elements[0].elements[0].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[0].visibility": {
"binding": {
"config": {
"path": "view.params.LU"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[1].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[1].visibility": {
"binding": {
"config": {
"path": "view.params.RD"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[2].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[2].visibility": {
"binding": {
"config": {
"path": "view.params.LR"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[3].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[3].visibility": {
"binding": {
"config": {
"path": "view.params.RU"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[4].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[4].visibility": {
"binding": {
"config": {
"path": "view.params.RD"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[5].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[5].visibility": {
"binding": {
"config": {
"path": "view.params.RLU"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[6].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[6].visibility": {
"binding": {
"config": {
"path": "view.params.RLD"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[7].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[7].visibility": {
"binding": {
"config": {
"path": "view.params.LRU"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[8].stroke.paint": {
"binding": {
"config": {
"path": "view.params.On"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#00FF00"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[0].elements[8].visibility": {
"binding": {
"config": {
"path": "view.params.LRD"
},
"transforms": [
{
"fallback": "hidden",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "hidden"
},
{
"input": true,
"output": "visible"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"elements": [
{
"d": "M 0.01474311,101.46884 H 289.94649 L 289.94649,0",
"fill": {
"paint": "transparent"
},
"id": "LU",
"name": "LU",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "M 0.01474311,101.46884 H 289.94649 l -0.018,978.53286",
"fill": {
"paint": "transparent"
},
"id": "RD",
"name": "RD",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "M 0.01474311,101.46884 1919.9985,101.46829",
"fill": {
"paint": "transparent"
},
"id": "LR",
"name": "LR",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "m 1920.0085,101.47076 -310.7599,0.13258 V -0.00390625",
"fill": {
"paint": "transparent"
},
"id": "RU",
"name": "RU",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "m 1919.9974,101.46523 -310.7488,0.13811 V 1080",
"fill": {
"paint": "transparent"
},
"id": "RD",
"name": "RD",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "M 1919.9872,101.49029 289.94291,101.54297 289.94291,0",
"fill": {
"paint": "transparent"
},
"id": "RLU",
"name": "RLU",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "m 1920.0178,101.46885 -1629.98505,-1e-4 -0.092,978.52045",
"fill": {
"paint": "transparent"
},
"id": "RLD",
"name": "RLD",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "m 0.28125,101.53444 1608.95705,0.0609 0.01,-101.59604783662",
"fill": {
"paint": "transparent"
},
"id": "path8",
"name": "path8",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
},
{
"d": "m 0.2890625,101.47273 1608.9570375,0.0664 -10e-4,978.38257",
"fill": {
"paint": "transparent"
},
"id": "LRD",
"name": "LRD",
"stroke": {
"dasharray": "none",
"width": "3.77953"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"preserveAspectRatio": "none",
"viewBox": "0 0 1920 1080"
},
"type": "ia.shapes.svg"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,92 @@
def create_home_page(self):
self.session.custom.covert = True
fc = self.session.custom.fc
tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (fc)
data_to_read = system.tag.readBlocking([tag_provider+"Configuration/PLC"])
data = system.util.jsonDecode(data_to_read[0].value)
try: devices_list = sorted(data.keys())
except: devices_list = []
if len(devices_list)>0:
instances = []
dashboard_devices = {}
for i in devices_list:
area = data[i]['Area']
if len(data[i]['Area'])>0:
dashboard_devices.update({i:area})
else:
dashboard_devices.update({i:'unknown'})
instances.append({
"instanceStyle": {
"classes": "",
"margin": "5px"
},
"instancePosition": {},
"tagProps": [
i,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
],"Counts":{"Diag":0, "High":0, "Low":0, "Medium":0},
"area":data[i]['Area'],
"subarea":data[i]['SubArea']
})
self.custom.Devices = sorted(dashboard_devices.items(), key=lambda x:x[1], reverse = False)
self.getChild("FlexRepeater").props.instances = sorted(instances, reverse = False)
def get_counters(alarm_counters, controller):
counters = alarm_counters.get(controller,{"High":0, "Medium":0, "Low":0, "Diagnostic":0})
return counters
def get_device_values(tag_provider, devices_list):
tag_paths_to_read = []
read_values = []
for device in devices_list:
tag_path = "%s%s/ALARMST" % (tag_provider, str(device[0]))
tag_paths_to_read.append(tag_path)
values = system.tag.readBlocking(tag_paths_to_read)
for i,j in enumerate(values):
value = values[i].value
if value == None:
read_values.append(0)
else:
read_values.append(value)
return read_values
def update_home_status(self):
orderBy = self.session.custom.alarm_filter.orderby
fc = self.session.custom.fc
tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (fc)
alarm_counters = system.tag.readBlocking([tag_provider + "System/device_count"])[0].value
counters_decoded = system.util.jsonDecode(alarm_counters)
if not counters_decoded:
counters_decoded = {}
devices_list = self.custom.Devices
values = get_device_values(tag_provider, devices_list)
devices_only = []
for device in devices_list:
devices_only.append(str(device[0]))
if orderBy == True:
zipped_list = zip(values, devices_only)
else:
zipped_list = sorted(zip(values, devices_only), reverse = True)
devices_sorted = [y for x, y in (zipped_list)]
for i,j in enumerate(devices_sorted):
counters = get_counters(counters_decoded, j)
self.getChild("FlexRepeater").props.instances[i].tagProps[0] = j
self.getChild("FlexRepeater").props.instances[i].Counts.Diag = counters.get("Diagnostic")
self.getChild("FlexRepeater").props.instances[i].Counts.Low = counters.get("Low")
self.getChild("FlexRepeater").props.instances[i].Counts.Medium = counters.get("Medium")
self.getChild("FlexRepeater").props.instances[i].Counts.High = counters.get("High")

View File

@ -0,0 +1,35 @@
Select
roundtime,Total_count,GoodRead_count,NoRead_count,MultiRead_count,NoCode_count,
Total_count/Total_count as Total_perc,
GoodRead_count/Total_count as GoodRead_perc,
NoRead_count/Total_count as NoRead_perc,
MultiRead_count/Total_count as MultiLabelRead_perc,
NoCode_count/Total_count as NoCode_perc,
Total_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as Total_rate,
GoodRead_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as GoodRead_rate,
NoRead_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as NoRead_rate,
MultiRead_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as MultiLabelRead_rate,
NoCode_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as NoCode_rate
FROM
(Select
alltable.t_stamp AS t_stamp,
COUNT(*) AS Total_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) <> '?' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '9' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '0') AS GoodRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '?') AS NoRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '9') AS MultiRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '0') AS NoCode_count,
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60) roundtime
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime) and ('S03aa' = :Scanner)
Group BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60)
Order By alltable.t_stamp ASC
) okey

View File

@ -0,0 +1,15 @@
SELECT alltable.t_stamp,
'S03' AS SorterName,
alltable.ParcelID,
'S03aa' AS ScannerName,
'0' AS IMGID,
alltable.ScanLabel,
alltable.ScanStatus,
alltable.Length,
alltable.AssignmentScanHist,
alltable.DivertStatus,
alltable.DEST_REQ,
alltable.ACTUAL_DEST,
alltable.SortCode
FROM alltable
WHERE alltable.t_stamp BETWEEN :starttime AND :endtime

View File

@ -0,0 +1,60 @@
Select
roundtime,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, assigned_count,
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,
assigned_count/inducted_count as assigned_perc,
inducted_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as inducted_rate,
sorted_count*3600/TIMESTAMPDIFF(second,:starttime, :endtime) as sorted_rate,
destinv_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destinv_rate,
destfull_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destfull_rate,
unexpected_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unexpected_rate,
destfault_count*3600/TIMESTAMPDIFF(second,:starttime, :endtime) as destfault_rate,
divfail_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as divfail_rate,
gaperr_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as gaperr_rate,
lost_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as lost_rate,
trackerr_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as trackerr_rate,
unknownn_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unknown_rate,
unsafe_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unsafe_rate,
destdis_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destdis_rate,
destnone_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destnone_rate,
assigned_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as assigned_rate
FROM
(SELECT
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,
SUM(alltable.DEST_REQ ) AS assigned_count,
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60) roundtime
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime) AND ('S03' = :Sorter)
Group BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60)
Order By alltable.t_stamp ASC
) okey

View File

@ -0,0 +1,64 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 207,
"width": 182
}
},
"root": {
"children": [
{
"meta": {
"name": "Right45"
},
"position": {
"height": 0.8696,
"width": 1
},
"props": {
"elements": [
{
"id": "defs1",
"name": "defs1",
"type": "defs"
},
{
"elements": [
{
"d": "m 0.61872656,19.047242 0.185181,-7.76481 C 2.3211966,6.4490419 5.3844746,3.4831579 9.6680236,0.93748089 L 13.582549,7.8726519 c -2.984985,1.33473 -4.2291194,3.3482401 -4.9990764,6.5174301 l -0.08744,4.67802 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path26615",
"name": "path26615",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.25"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"viewBox": "0 0 14 19"
},
"type": "ia.shapes.svg"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,481 @@
{
"custom": {},
"params": {
"tagProps": [
"TAG0",
"TAG1",
"TAG2",
"TAG3",
"TAG4",
"TAG5",
"TAG6",
"TAG7",
"TAG8",
"TAG9",
"TAG10",
"TAG11"
]
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"params": {
"con_lines": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"in": false,
"out": false,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_TO_HUB"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0256,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.50",
"tagProps": [
"UL14_1_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0715,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.51",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_3_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1148,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.52",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.155,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.35",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1957,
"y": 0.0047
},
"props": {
"params": {
"IP": "11.200.1.36",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2368,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.37",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2766,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.38",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_3_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "-607% 50%"
},
"width": 0.0349,
"x": 0.3167,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.39",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3979,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.41",
"tagProps": [
"/system/someting_SIO",
"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_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.4386,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.30",
"tagProps": [
"/system/someting_SIO",
"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_2_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "465% -311%"
},
"width": 0.0349,
"x": 0.4782,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.31",
"tagProps": [
"/system/someting_SIO",
"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": "UL15_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3578,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.40",
"tagProps": [
"/system/someting_SIO",
"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"
}
}

View File

@ -0,0 +1,849 @@
{
"pages": {
"/": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"title": "",
"viewPath": "Windows/GraphicsWrapper"
},
"/alarms/active": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"title": "",
"viewPath": "Windows/AlarmWrapper"
},
"/alarms/history": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"viewPath": "Windows/AlarmWrapper"
},
"/alarms/hitlist": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"title": "",
"viewPath": "Windows/AlarmWrapper"
},
"/autStand": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "auto",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 50,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Overview/BNA8"
},
"/autStand/Alarms": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "auto",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 50,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Alarms/RealTime"
},
"/autStand/Command": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Windows/CommandControl"
},
"/autStand/MCM01": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Detailed_Views/MCM01-FLUID INBOUND"
},
"/autStand/MCM02": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "show",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Detailed_Views/MCM02-NC SORTER"
},
"/autStand/Statistics": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "show",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"viewPath": "autStand/Windows/Statistics"
},
"/autStand/Status": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "show",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Windows/Status"
},
"/autStand/home": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "",
"id": "autStand",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Footer"
}
],
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Docked-West"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "auto",
"handle": "hide",
"iconUrl": "",
"id": "header-autStand",
"modal": false,
"resizable": false,
"show": "visible",
"size": 50,
"viewParams": {},
"viewPath": "autStand/Docked_Views/Header"
}
]
},
"title": "",
"viewPath": "autStand/Overview/Home"
},
"/cameras": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"title": "",
"viewPath": "Windows/JamCameras"
},
"/commission": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"title": "",
"viewPath": "Windows/Commissioning"
},
"/config": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"viewPath": "Windows/ConfigWrapper"
},
"/custom-reports": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"viewPath": "Windows/CustomReports"
},
"/help": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"viewPath": "Windows/Help"
},
"/statistics": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"viewPath": "Windows/Statistics"
},
"/status": {
"docks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "footer",
"modal": false,
"resizable": false,
"show": "visible",
"size": 100,
"viewParams": {},
"viewPath": "Windows/Docked/Footer"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "push",
"handle": "autoHide",
"iconUrl": "",
"id": "header",
"modal": false,
"resizable": false,
"show": "visible",
"size": 60,
"viewParams": {},
"viewPath": "Windows/Docked/Header"
}
]
},
"title": "",
"viewPath": "Windows/StatusWrapper"
}
},
"sharedDocks": {}
}

View File

@ -0,0 +1,63 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 30,
"width": 160
}
},
"root": {
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPath \u003d \"[BNA8_SCADA_TAG_PROVIDER]System/Global_Started\"\n\tsystem.tag.write(tagPath, True)\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"basis": "80%",
"grow": 1
},
"props": {
"image": {
"icon": {
"path": "material/not_started"
}
},
"style": {
"backgroundColor": "#00B900",
"borderStyle": "groove",
"borderWidth": 3,
"cursor": "pointer"
},
"text": "Global Start",
"textStyle": {
"color": "#000000",
"fontFamily": "inherit",
"fontSize": "1vmin",
"fontWeight": "bold"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"props": {
"alignContent": "flex-start",
"justify": "center"
},
"type": "ia.container.flex"
}
}

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,
COUNT(*) AS Total,
SUM(SUBSTRING(alltable.ScanLabel,1,1) <> '?' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '9' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '0') AS GoodRead,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '?') AS NoRead,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '9') AS MultiRead,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '0') AS NoCode
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

@ -0,0 +1,7 @@
SELECT
alltable.ACTUAL_DEST as Lane,
concat(round(COUNT(*)/COUNT(*) * 100,2),'%') AS Total_count,
concat(round(SUM(alltable.DivertStatus = 5)/COUNT(*) * 100,2),'%') AS DestFull_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY (alltable.ACTUAL_DEST)

View File

@ -0,0 +1,804 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 1080,
"width": 70
}
},
"root": {
"children": [
{
"children": [
{
"custom": {
"show": true
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tmap_selected \u003d self.session.custom.alarm_filter.show_map\n\tself.custom.show \u003d False\n\tif not map_selected:\n\t\tsystem.perspective.navigate(\"/autStand/home\")\n\telse:\n\t\tsystem.perspective.navigate(\"/autStand\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Home",
"tooltip": {
"enabled": true,
"text": "Home"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/home"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Home",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tif self.page.props.path \u003d\u003d \"/autStand\":\n\t\tsystem.perspective.navigate(\"/autStand/home\")\n\t\n\telif self.page.props.path \u003d\u003d \"/autStand/home\":\n\t\tsystem.perspective.navigate(\"/autStand\")\n\t\n\telif self.props.selected \u003d\u003d True and self.page.props.path \u003d\u003d \"/\":\n\t\tsystem.perspective.navigate(\"/autStand\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "ToggleSwitch",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "60px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_map"
},
"transforms": [
{
"expression": "if({value}, \"Toggle for home card view\", \"Toggle for home detailed view\")",
"type": "expression"
}
],
"type": "property"
}
},
"position.display": {
"binding": {
"config": {
"path": "/root.custom.show_home_selector"
},
"type": "property"
}
},
"props.selected": {
"binding": {
"config": {
"bidirectional": true,
"path": "session.custom.alarm_filter.show_map"
},
"type": "property"
}
}
},
"props": {
"color": {
"background-color": "",
"selected": "#FFFFFF",
"unselected": "#FFFFFF"
},
"label": {
"position": "left",
"style": {
"classes": "",
"fontSize": "10px"
},
"text": "Map View"
},
"style": {
"borderBottomLeftRadius": "5px",
"borderBottomRightRadius": "5px",
"borderColor": "#AAAAAA",
"borderStyle": "solid",
"borderTopLeftRadius": "5px",
"borderTopRightRadius": "5px",
"borderWidth": "0.5px",
"classes": "Buttons/Button-Menu",
"margin": "1px"
}
},
"type": "ia.input.toggle-switch"
}
],
"events": {
"dom": {
"onMouseEnter": {
"config": {
"script": "\tself.parent.custom.show_home_selector \u003d True"
},
"scope": "G",
"type": "script"
},
"onMouseLeave": {
"config": {
"script": "\tself.parent.custom.show_home_selector \u003d False"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "FlexContainer"
},
"propConfig": {
"position.basis": {
"binding": {
"config": {
"expression": "if({parent.custom.show_home_selector} \u003d True, \"130px\", \"70px\")"
},
"type": "expr"
}
}
},
"props": {
"direction": "column",
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"custom": {
"show": true
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup(\"DevicePopUP\")\n\tsystem.perspective.closePopup(\"StatusPopUP\")\n\tself.custom.show \u003d False\n\tsystem.perspective.navigate(\"/autStand/Alarms\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Alarms",
"tooltip": {
"enabled": true,
"text": "Alarms"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/access_alarm"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Alarms",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\n\tsystem.perspective.openPopup(id \u003d \"Search\", view \u003d \"autStand/PopUp-Views/Search\",\n\t\t\t\t\t\t\t\t\t\t\t\tshowCloseIcon \u003d False, modal \u003d True,\n\t\t\t\t\t\t\t\t\t\t\t\tviewportBound \u003d True,\n\t\t\t\t\t\t\t\t\t\t\t\tdraggable \u003d False,\n\t\t\t\t\t\t\t\t\t\t\t\toverlayDismiss \u003d True\n\t\t\t\t\t\t\t\t\t\t\t\t)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "search",
"tooltip": {
"enabled": true,
"text": "Search"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/search"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Search",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.session.custom.searchId \u003d \"\"\n\tself.session.custom.deviceSearchId \u003d \"\"\n\tsystem.perspective.closePopup(id \u003d \"Search\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Search off",
"tooltip": {
"enabled": true,
"text": "Search Off"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/search_off"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Search Off",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"custom": {
"show": false
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"draggable": false,
"modal": true,
"overlayDismiss": true,
"position": {
"relativeLocation": "top-right"
},
"positionType": "relative",
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewParams": {
"viewFocus": "{session.custom.view_in_focus}"
},
"viewPath": "autStand/PopUp-Views/Detail-View-Filter",
"viewportBound": true
},
"scope": "C",
"type": "popup"
}
}
},
"meta": {
"name": "Filter",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"custom.filters_active": {
"binding": {
"config": {
"expression": "if(\r\n !{session.custom.alarm_filter.show_dpm_mcm} ||\r\n !{session.custom.alarm_filter.show_beacons} ||\r\n !{session.custom.alarm_filter.show_VFD} ||\r\n !{session.custom.alarm_filter.show_buttons} ||\r\n !{session.custom.alarm_filter.show_photoeyes} ||\r\n !{session.custom.alarm_filter.show_encoders} ||\r\n !{session.custom.alarm_filter.show_epc} ||\r\n !{session.custom.alarm_filter.show_px} ||\r\n !{session.custom.alarm_filter.show_camera_jams} ||\r\n !{session.custom.alarm_filter.show_fio_safety},\r\n True,\r\n False\r\n)\r\n"
},
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.custom.filters_active}, \"Status Filters are active\",\r\n\"Select Status Filters\")"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.custom.filters_active},\r\n\"#FF8C00\",\r\n\"#FFFFFF\")\r\n"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/filter_alt",
"style": {
"classes": ""
}
},
"position": "top",
"width": 32
},
"style": {
"classes": "Buttons/Button-Menu, filter-button",
"margin": 1
},
"text": "Filter",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"page": "/autStand/Command"
},
"scope": "C",
"type": "nav"
}
}
},
"meta": {
"name": "Control",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"custom.has_role": {
"binding": {
"config": {
"expression": "{session.custom.fc}"
},
"transforms": [
{
"code": "#\trme_role \u003d value +\"-rme-all\"\n\trme_role \u003d \"eurme-ignition-developers\"\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"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.custom.has_role}\u003d False, \r\n\"You do not have the required role to access this page\",\r\n\"Access controls page\")\r\n"
},
"type": "expr"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/gamepad"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Control",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"custom": {
"show": false
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.navigate(\"/autStand/Statistics\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Statistic",
"tooltip": {
"enabled": true,
"text": "Notifications"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "if(isNull({session.custom.download_url}), False, True)"
},
"enabled": false,
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FCFFFC",
"path": "material/leaderboard"
},
"position": "top",
"width": 32
},
"style": {
"classes": "Buttons/Button-Menu",
"color": "#FFFFFF",
"margin": 1
},
"text": "Statistic",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"custom": {
"show": false
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.navigate(\"/autStand/Status\")\n\tself.session.custom.show_dpm_view \u003d False\n\tself.session.custom.show_dpm_device_view \u003d False"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Status",
"tooltip": {
"enabled": true,
"text": "Notifications"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": ""
},
"enabled": false,
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFD",
"path": "material/done"
},
"position": "top",
"width": 32
},
"style": {
"classes": "Buttons/Button-Menu",
"color": "#FFFFFF",
"margin": 1
},
"text": "Status",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"custom": {
"show": false
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup(\"DevicePopUP\")\n\tsystem.perspective.closePopup(\"StatusPopUP\")\n\tself.custom.show \u003d False\n\tsystem.perspective.navigate(\"/Help\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Help",
"tooltip": {
"enabled": true,
"text": "Navigate to the help wiki"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/help_outline"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Help",
"textStyle": {
"classes": "Text-Styles/Docked-Buttons"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"page": "/"
},
"scope": "C",
"type": "nav"
}
}
},
"meta": {
"name": "Back",
"tooltip": {
"enabled": true,
"text": "Back to DEX"
}
},
"position": {
"basis": "70px"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"color": "#FFFFFF",
"path": "material/keyboard_return"
},
"position": "top",
"width": 32
},
"style": {
"margin": 1
},
"text": "Back",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.input.button"
}
],
"custom": {
"show_home_selector": true
},
"meta": {
"name": "root"
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "session.props.theme"
},
"transforms": [
{
"code": "\tif \u0027dark\u0027 in value:\n\t\treturn \u0027Buttons/Button-Menu\u0027\n\telse:\n\t\treturn \u0027Buttons/Button-Menu\u0027",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"direction": "column",
"style": {}
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,33 @@
Select
day,
SorterName,ScannerName,Total_count,
GoodRead_count,NoRead_count,MultiLabelRead_count,NoCode_count,Startstamp,Endtstamp,
1 as Total_perc,
GoodRead_count/Total_count as GoodRead_perc,
NoRead_count/Total_count * 100 as NoRead_perc,
MultiLabelRead_count/Total_count * 100 as MultiLabelRead_perc,
NoCode_count/Total_count * 100 as NoCode_perc,
Total_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as Total_rate,
GoodRead_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as GoodRead_rate,
NoRead_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as NoRead_rate,
MultiLabelRead_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as MultiLabelRead_rate,
NoCode_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as NoCode_rate
FROM
(SELECT
date(alltable.t_stamp) as day,
'S01' as SorterName,
'S01aa' as ScannerName,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp,
COUNT(*) AS Total_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) <> '?' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '9' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '0') AS GoodRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '?') AS NoRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '9') AS MultiLabelRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '0') AS NoCode_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY day(alltable.t_stamp)) basa

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
def set_priority_filters(self):
filters = self.props.value
payload = {}
payload["data"] = filters
system.perspective.sendMessage("set-priority-filters", payload = payload,
scope = "page")
def set_time_from_filters(self):
"This filter sets the time from for history"
time = self.props.value
payload = {}
payload["data"] = time
system.perspective.sendMessage("set-from-filters", payload = payload,
scope = "page")
def set_time_to_filters(self):
"This filter sets the time to for history"
time = self.props.value
payload = {}
payload["data"] = time
system.perspective.sendMessage("set-to-filters", payload = payload,
scope = "page")

View File

@ -0,0 +1,91 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 165,
"width": 400
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "32px"
},
"props": {
"text": "An error occurred while connecting to the database."
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Network or database connection failed. Check your settings or contact IT support."
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"grow": 1
},
"props": {
"alignItems": "flex-start",
"direction": "column",
"justify": "space-around",
"style": {
"paddingLeft": 5,
"paddingRight": 5
}
},
"type": "ia.container.flex"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup(\"\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"props": {
"primary": false,
"style": {
"marginTop": 3
},
"text": "Dismiss"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"props": {
"alignContent": "flex-start",
"direction": "column",
"justify": "space-around"
},
"type": "ia.container.flex"
}
}

View File

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

View File

@ -0,0 +1,6 @@
Select
DATE_FORMAT(date(alltable.t_stamp),'%m/%d/%Y') as Day,
COUNT(*) AS Scans
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY day(alltable.t_stamp)

View File

@ -0,0 +1,17 @@
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,
SUM(alltable.ACTUAL_DEST <> 'S03999') AS Diverted,
SUM(alltable.DivertStatus = 14) AS DivertFail,
SUM(alltable.DivertStatus = 5) AS DestinationFull,
SUM(alltable.DivertStatus = 6) AS DestinationJam,
SUM(alltable.DivertStatus = 12) AS DestinationDisabled,
SUM(alltable.DivertStatus = 6) as DestinationFault,
SUM(alltable.DivertStatus = 17) as Lost,
SUM(alltable.DivertStatus = 21) as Unsafe,
SUM(alltable.DivertStatus = 18) as DimError,
SUM(alltable.DivertStatus = 4) as GapError,
SUM(alltable.DivertStatus = 1) as Unknown
FROM alltable
Where (alltable.DEST_REQ = :lane AND alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

@ -0,0 +1,14 @@
SELECT
alltable.DEST_REQ as Lane,
SUM(alltable.ACTUAL_DEST <> 'S0199') AS Diverted,
SUM(alltable.DivertStatus = 5) AS Full
FROM alltable
Where (alltable.DEST_REQ <> 'S0199' and alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY alltable.DEST_REQ
Union
Select
'S0199' as Lane,
COUNT(*) AS Diverted,
0 as Full
From alltable
Where (alltable.ACTUAL_DEST = 'S0199' and alltable.t_stamp BETWEEN :starttime AND :endtime)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,9 @@
SELECT
alltable.ACTUAL_DEST as Lane,
COUNT(*) AS Total_count,
SUM(alltable.DivertStatus = 5) AS DestFull_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY date(alltable.t_stamp),(alltable.ACTUAL_DEST)

View File

@ -0,0 +1,73 @@
Select
SorterName,Lane,Startstamp,Endtstamp,
Total_count, DivertFail_count,Diverted_count,
DestFull_count,DestJam_count,DestDis_count,
DestFault_count,Lost_count,Unsafe_count,Dim_count,GapErr_count,Unknown_count,
Total_count/Total_count as total_perc,
DivertFail_count/Total_count as DivertFail_perc,
Diverted_count/Total_count as Diverted_perc,
DestFull_count/Total_count as destfull_perc,
DestJam_count/Total_count as destjam_perc,
DestDis_count/Total_count as destdisabled_perc,
DestFault_count/Total_count as destfault_perc,
Lost_count/Total_count as lost_perc,
Unsafe_count/Total_count as unsafe_perc,
Dim_count/Total_count as dim_perc,
GapErr_count/Total_count as gaperr_perc,
Unknown_count/Total_count as unknown_perc,
Total_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as total_rate,
DivertFail_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as DivertFail_rate,
Diverted_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as Diverted_rate,
DestFull_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destfull_rate,
DestJam_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destjam_rate,
DestDis_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destdisabled_rate,
DestFault_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destfault_rate,
Lost_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as lost_rate,
Unsafe_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unsafe_rate,
Dim_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as dim_rate,
GapErr_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as gaperr_rate,
Unknown_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unknown_rate
FROM
(Select
'S03' AS SorterName,
alltable.DEST_REQ as Lane,
COUNT(*) AS Total_count,
SUM(alltable.ACTUAL_DEST <> 'S03999') AS Diverted_count,
SUM(alltable.DivertStatus = 14) AS DivertFail_count,
SUM(alltable.DivertStatus = 5) AS DestFull_count,
SUM(alltable.DivertStatus = 6) AS DestJam_count,
SUM(alltable.DivertStatus = 12) AS DestDis_count,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp,
SUM(alltable.DivertStatus = 6) as DestFault_count,
SUM(alltable.DivertStatus = 17) as Lost_count,
SUM(alltable.DivertStatus = 21) as Unsafe_count,
SUM(alltable.DivertStatus = 18) as Dim_count,
SUM(alltable.DivertStatus = 4) as GapErr_count,
SUM(alltable.DivertStatus = 1) as Unknown_count
FROM alltable
Where (alltable.DEST_REQ <> 'S03999' AND alltable.t_stamp BETWEEN :starttime AND :endtime)
Group BY alltable.DEST_REQ
Union
Select
'S03' AS SorterName,
alltable.ACTUAL_DEST as Lane,
COUNT(*) AS Total_count,
COUNT(*) AS Diverted_count,
0 AS DivertFail_count,
0 AS DestFull_count,
0 AS DestJam_count,
0 AS DestDis_count,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp,
0 as DestFault_count,
0 as Lost_count,
0 as Unsafe_count,
0 as Dim_count,
0 as GapErr_count,
0 as Unknown_count
FROM alltable
Where (alltable.ACTUAL_DEST = 'S03999' AND alltable.t_stamp BETWEEN :starttime AND :endtime)) basa

View File

@ -0,0 +1,418 @@
{
"custom": {
"dpm1-dpm2": false,
"dpm2-mcm": false,
"mcm-dpm1": false
},
"params": {
"tagProps": [
"DPM0_TAG",
"DPM1_TAG",
"DPM2_TAG"
]
},
"propConfig": {
"custom.dpm1-dpm2": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.tagProps[1]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{1}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},1)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": true
},
{
"input": 1,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm2-mcm": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"2": "{view.params.tagProps[2]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{2}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},1)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": true
},
{
"input": 1,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.mcm-dpm1": {
"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},1)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": true
},
{
"input": 1,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 894,
"width": 1920
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MCM02"
},
"position": {
"height": 0.5,
"width": 0.5,
"x": 0.5,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": false,
"OutUp": true
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/EN4TR"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "NCS1_1_DPM2"
},
"position": {
"height": 0.5,
"width": 0.5,
"x": 0.5
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": true,
"DownLeft": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": true,
"OutRight": false,
"OutUp": false,
"view": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM02/NCS1_1_DPM2"
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "NCS1_1_DPM1"
},
"position": {
"height": 0.5,
"width": 0.5
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": true,
"Down3": false,
"DownLeft": false,
"DownRight": false,
"InDown": true,
"InLeft": false,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM02/NCS1_1_DPM1"
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "DPM1_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.5572,
"y": 0.1
},
"props": {
"text": "NCS1_1_DPM2 11.200.1.3",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM2_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.036,
"y": 0.1
},
"props": {
"text": "NCS1_1_DPM1 11.200.1.2",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "comms"
},
"position": {
"height": 0.5,
"width": 0.5,
"y": 0.5
},
"propConfig": {
"props.params.On": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
}
},
"props": {
"params": {
"LD": false,
"LR": false,
"LRD": false,
"LRU": false,
"LU": false,
"RD": false,
"RLD": false,
"RLU": true,
"RU": false
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/CommLines"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"position": {
"x": 120,
"y": -723
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#ffffff"
}
},
"type": "ia.container.coord"
}
}

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,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(cast(COUNT(*) as char),' pph') AS Total,
concat(cast(SUM(SUBSTRING(alltable.ScanLabel,1,1) <> '?' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '9' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '0') as char),' pph') AS GoodRead,
concat(cast(SUM(SUBSTRING(alltable.ScanLabel,1,1) = '?') as char),' pph') AS NoRead,
concat(cast(SUM(SUBSTRING(alltable.ScanLabel,1,1) = '9') as char),' pph') AS MultiRead,
concat(cast(SUM(SUBSTRING(alltable.ScanLabel,1,1) = '0') as char),' pph') AS NoCode
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

View File

@ -0,0 +1,221 @@
{
"custom": {
"state": 1,
"string": "Device Disconnected"
},
"params": {
"tagProps": [
"value"
]
},
"propConfig": {
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "OK"
},
{
"input": 1,
"output": "Device Disconnected"
},
{
"input": 2,
"output": "Faulted"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 26,
"width": 26
}
},
"root": {
"children": [
{
"meta": {
"name": "VFD"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#C2C2C2",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "url(#splitGreenGrey)"
},
{
"input": 1,
"output": "#C2C2C2"
},
{
"input": 2,
"output": "url(#splitRedGrey)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"elements": [
{
"elements": [
{
"offset": "0%",
"stop-color": "#C2C2C2",
"type": "stop"
},
{
"offset": "49.5%",
"stop-color": "#C2C2C2",
"type": "stop"
},
{
"offset": "50.5%",
"stop-color": "#00FF00",
"type": "stop"
},
{
"offset": "100%",
"stop-color": "#00FF00",
"type": "stop"
}
],
"gradientUnits": "userSpaceOnUse",
"id": "splitGreenGrey",
"type": "linearGradient",
"x1": "0",
"x2": "24",
"y1": "0",
"y2": "24"
},
{
"elements": [
{
"offset": "0%",
"stop-color": "#C2C2C2",
"type": "stop"
},
{
"offset": "49.5%",
"stop-color": "#C2C2C2",
"type": "stop"
},
{
"offset": "50.5%",
"stop-color": "#FF0000",
"type": "stop"
},
{
"offset": "100%",
"stop-color": "#FF0000",
"type": "stop"
}
],
"gradientUnits": "userSpaceOnUse",
"id": "splitRedGrey",
"type": "linearGradient",
"x1": "0",
"x2": "24",
"y1": "0",
"y2": "24"
}
],
"type": "defs"
},
{
"cx": "12",
"cy": "12",
"fill": {},
"rx": "10",
"ry": "10",
"stroke": {
"paint": "#000000",
"width": "2"
},
"type": "ellipse"
},
{
"d": "M 6,18 L 18,6",
"fill": {},
"stroke": {
"linecap": "round",
"paint": "#000000",
"width": "2"
},
"type": "path"
}
],
"viewBox": "0 0 24 24"
},
"type": "ia.shapes.svg"
}
],
"meta": {
"name": "VFD",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_VFD"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because one or more lines are too long

View File

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

View File

@ -0,0 +1,88 @@
{
"custom": {
"currentView": "autStand/Custom_Views/Enternet-Windows/DPMS/MCM01-DPM"
},
"params": {},
"propConfig": {
"custom.currentView": {
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 894,
"width": 1920
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MCM01_PLC"
},
"position": {
"height": 0.5649,
"width": 0.063,
"x": 0.1963,
"y": 0.151
},
"props": {
"params": {
"MCM": "MCM01",
"view": "autStand/Custom_Views/Enternet-Windows/DPMS/MCM01-DPM"
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/PLC"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MCM02_PLC"
},
"position": {
"height": 0.5649,
"width": 0.063,
"x": 0.7651,
"y": 0.1549
},
"props": {
"params": {
"MCM": "MCM02",
"view": "autStand/Custom_Views/Enternet-Windows/DPMS/MCM02-DPM"
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/PLC"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,418 @@
{
"custom": {
"dpm1-dpm2": false,
"dpm2-mcm": false,
"mcm-dpm1": false
},
"params": {
"tagProps": [
"DPM0_TAG",
"DPM1_TAG",
"DPM2_TAG"
]
},
"propConfig": {
"custom.dpm1-dpm2": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.tagProps[1]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{1}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},1)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": true
},
{
"input": 1,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm2-mcm": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"2": "{view.params.tagProps[2]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{2}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},1)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": true
},
{
"input": 1,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.mcm-dpm1": {
"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},1)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": true
},
{
"input": 1,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 894,
"width": 1920
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MCM01"
},
"position": {
"height": 0.5,
"width": 0.5,
"x": 0.5,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": false,
"OutUp": true
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/EN4TR"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS3_5_DPM1"
},
"position": {
"height": 0.5,
"width": 0.5,
"x": 0.5
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": true,
"DownLeft": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": true,
"OutRight": false,
"OutUp": false,
"view": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM01/PS3_5_DPM1"
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS3_1_DPM1"
},
"position": {
"height": 0.5,
"width": 0.5
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": true,
"Down3": false,
"DownLeft": false,
"DownRight": false,
"InDown": true,
"InLeft": false,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM01/PS3_1_DPM1"
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "DPM1_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.552,
"y": 0.1
},
"props": {
"text": "PS3_5_DPM1 11.200.1.3",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM2_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.036,
"y": 0.1
},
"props": {
"text": "PS3_1_DPM1 11.200.1.2",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "comms"
},
"position": {
"height": 0.5,
"width": 0.5,
"y": 0.5
},
"propConfig": {
"props.params.On": {
"binding": {
"config": {
"path": "view.custom.dpm2-mcm"
},
"type": "property"
}
}
},
"props": {
"params": {
"LD": false,
"LR": false,
"LRD": false,
"LRU": false,
"LU": false,
"RD": false,
"RLD": false,
"RLU": true,
"RU": false
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/CommLines"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"position": {
"x": 120,
"y": -723
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#ffffff"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,207 @@
{
"custom": {
"state": 0,
"string": "Inactive"
},
"params": {
"tagProps": [
"/system/mcm01/test",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"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},0)",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 0,
"output": 0
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Actuated"
},
{
"input": 2,
"output": "Faulted"
},
{
"input": 0,
"output": "Inactive"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 22,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"text": "SOL",
"textStyle": {
"fontSize": 10,
"textAlign": "center",
"textTransform": "uppercase"
}
},
"type": "ia.display.label"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_solenoids"
},
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#808080",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#00FF00"
},
{
"input": 2,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"borderStyle": "solid",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,267 @@
{
"custom": {
"disconnected": 0,
"priority": 0,
"priority_string": "No active alarms",
"state": 0,
"state_string": "Normal"
},
"params": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.disconnected": {
"binding": {
"config": {
"path": "view.custom.state"
},
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n0, \"No active alarms\",\r\n\"Unknown\")"
},
"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},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"Communication Faulted\",\r\n0, \"Normal\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 47,
"width": 68
}
},
"root": {
"children": [
{
"meta": {
"name": "ControlCabinet"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_dpm_mcm"
},
"type": "property"
}
},
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \u0027#808080\u0027,\r\n if(\r\n {view.custom.state} \u003d 1,\r\n \u0027#FF0000\u0027,\r\n if(\r\n {view.custom.state} \u003d 0,\r\n \u0027#00D900\u0027,\r\n \u0027#fff700\u0027\r\n )\r\n )\r\n)\r\n"
},
"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": "\tsystem.perspective.openDock(\u0027Docked-East-DS\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string} + \", State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
}
},
"props": {
"aspectRatio": "68:47",
"mode": "percent",
"style": {
"classes": "Disconnects/Device-Connected",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,63 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 30,
"width": 160
}
},
"root": {
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttagPath \u003d \"[BNA8_SCADA_TAG_PROVIDER]System/Global_Stopped\"\n\tsystem.tag.write(tagPath, True)\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"basis": "80%",
"grow": 1
},
"props": {
"image": {
"icon": {
"path": "material/stop_circle"
}
},
"style": {
"backgroundColor": "#F11632",
"borderStyle": "groove",
"borderWidth": 3,
"cursor": "pointer"
},
"text": "Global Stop",
"textStyle": {
"color": "#000000",
"fontFamily": "inherit",
"fontSize": "1vmin",
"fontWeight": "bold"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"props": {
"alignContent": "flex-start",
"justify": "center"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,431 @@
{
"custom": {
"disconnected": true,
"priority": 5,
"priority_string": "No active alarms",
"state": 0,
"state_string": "Stopped"
},
"params": {
"tagProps": [
"System/MCM01/Station/SSPB/UL6_1_SS1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "!isGood({value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 5,
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": 5
},
{
"input": 1,
"output": 3
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 3
},
{
"input": 4,
"output": 5
},
{
"input": 5,
"output": 5
},
{
"input": 6,
"output": 5
},
{
"input": 7,
"output": 3
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.priority},\r\n3, \"Medium\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 1,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
},
{
"input": 4,
"output": 4
},
{
"input": 5,
"output": 5
},
{
"input": 6,
"output": 6
},
{
"input": 7,
"output": 7
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n0, \"Stopped\",\r\n1, \"Started\",\r\n2, \"Stopped\",\r\n3, \"Stopped\",\r\n4, \"Disabled\",\r\n5, \"Started\",\r\n6, \"Started\",\r\n7, \"Stopped\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 25,
"width": 50
}
},
"root": {
"children": [
{
"meta": {
"name": "SS_button"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \"#808080\",\r\n switch(\r\n toInt({view.custom.state}),\r\n 0, 1, 2, 3, 4, 5, 6 ,7,\r\n \"#AAAAAA\", \"#AAAAAA\", \"#AAAAAA\", \"#AAAAAA\", \"#AAAAAA\",\r\n \"#AAAAAA\", \"#AAAAAA\", \"#AAAAAA\", \r\n \"#FFFF00\"\r\n )\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#00CC00",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#007400"
},
{
"input": 1,
"output": "#00FF00"
},
{
"input": 2,
"output": "#00FF00"
},
{
"input": 3,
"output": "#00FF00"
},
{
"input": 4,
"output": "#007400"
},
{
"input": 5,
"output": "#00FF00"
},
{
"input": 6,
"output": "#00FF00"
},
{
"input": 7,
"output": "#00FF00"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
},
"props.elements[2].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#940003",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "#940003"
},
{
"input": 1,
"output": "#940003"
},
{
"input": 2,
"output": "#940003"
},
{
"input": 3,
"output": "#D90000"
},
{
"input": 4,
"output": "#940003"
},
{
"input": 5,
"output": "#940003"
},
{
"input": 6,
"output": "#940003"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"elements": [
{
"d": "M 0,0 H 40 V 20 H 0 Z",
"fill": {},
"id": "outer-rect",
"name": "outer-rect",
"stroke": {
"paint": "#000000",
"width": "1.5"
},
"type": "path"
},
{
"d": "m 17,10.5 c 0,3.865993 -3.134007,7 -7,7 -3.8659932,0 -7,-3.134007 -7,-7 0,-3.8659932 3.1340068,-7 7,-7 3.865993,0 7,3.1340068 7,7 z",
"fill": {},
"id": "inner-circle",
"name": "inner-circle",
"stroke": {
"paint": "#000000",
"width": "1"
},
"type": "path"
},
{
"d": "m 36.642136,10.376001 c 0,3.865993 -3.134007,7 -7,7 -3.865993,0 -7,-3.134007 -7,-7 0,-3.8659928 3.134007,-6.9999998 7,-6.9999998 3.865993,0 7,3.134007 7,6.9999998 z",
"fill": {},
"id": "inner-circle-8",
"name": "inner-circle-8",
"stroke": {
"paint": "#000000",
"width": "1"
},
"type": "path"
}
],
"viewBox": "0 0 40 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-SS-BTN\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string} + \", State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_buttons"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,48 @@
{
"custom": {
"key": "value",
"key_1": "value",
"string": "value"
},
"params": {
"key": "value"
},
"propConfig": {
"custom.key": {
"persistent": true
},
"custom.key_1": {
"persistent": true
},
"custom.string": {
"persistent": true
},
"params.key": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 8,
"width": 240
}
},
"root": {
"meta": {
"name": "root"
},
"position": {
"x": 0,
"y": 0
},
"props": {
"style": {
"backgroundColor": "white",
"borderStyle": "solid",
"borderWidth": "1px"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

View File

@ -0,0 +1,481 @@
{
"custom": {},
"params": {
"tagProps": [
"TAG0",
"TAG1",
"TAG2",
"TAG3",
"TAG4",
"TAG5",
"TAG6",
"TAG7",
"TAG8",
"TAG9",
"TAG10",
"TAG11"
]
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"params": {
"con_lines": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"in": false,
"out": false,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_TO_HUB"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0256,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.32",
"tagProps": [
"UL14_1_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0715,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.33",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_3_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1148,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.34",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.155,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.35",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1957,
"y": 0.0047
},
"props": {
"params": {
"IP": "11.200.1.36",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2368,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.37",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2766,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.38",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_3_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "-607% 50%"
},
"width": 0.0349,
"x": 0.3167,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.39",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3979,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.41",
"tagProps": [
"/system/someting_SIO",
"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_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.4386,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.30",
"tagProps": [
"/system/someting_SIO",
"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_2_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "465% -311%"
},
"width": 0.0349,
"x": 0.4782,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.31",
"tagProps": [
"/system/someting_SIO",
"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": "NCS1_1_DPM1",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "UL15_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3578,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.40",
"tagProps": [
"/system/someting_SIO",
"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"
}
}

View File

@ -0,0 +1,241 @@
{
"custom": {
"disconnected": 0,
"priority": 0,
"priority_string": "No active alarms",
"state": 0,
"state_string": "Normal"
},
"params": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.disconnected": {
"binding": {
"config": {
"path": "view.custom.state"
},
"type": "property"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n0, \"No active alarms\",\r\n\"Unknown\")"
},
"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},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"Communication Faulted\",\r\n0, \"Normal\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 30,
"width": 41
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"text": "MCM",
"textStyle": {
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-DS\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string} + \", State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_dpm_mcm"
},
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.disconnected},\r\n \u0027#808080\u0027,\r\n if(\r\n {view.custom.state} \u003d 1,\r\n \u0027#FF0000\u0027,\r\n if(\r\n {view.custom.state} \u003d 0,\r\n \u0027#00D900\u0027,\r\n \u0027#fff700\u0027\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
}
}
},
"props": {
"mode": "percent",
"style": {
"borderStyle": "solid",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,226 @@
{
"custom": {
"state": 0,
"string": "Unknown"
},
"params": {
"tagProps": [
"system/mcm01/buttons/jr/ul15_1_jr1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Start"
},
{
"input": 2,
"output": "Start Pressed"
},
{
"input": 3,
"output": "Start Illuminated"
},
{
"input": 4,
"output": "Start Pressed / Illuminated"
},
{
"input": 5,
"output": "Stop"
},
{
"input": 6,
"output": "Stop Pressed"
},
{
"input": 7,
"output": "Stop Illuminated"
},
{
"input": 8,
"output": "Stop Pressed / Illuminated"
},
{
"input": 9,
"output": "Restart"
},
{
"input": 10,
"output": "Restart Pressed"
},
{
"input": 11,
"output": "Restart Illuminated"
},
{
"input": 12,
"output": "Restart Pressed / Illuminated"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 25,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "JR_Button"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d 0, \"#a9a9a9\", // disconnected gray (DarkGray)\r\n if(\r\n {view.custom.state} % 2 \u003d 1, \"#ffffff\", // white\r\n \"#000000\" // black\r\n )\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"expression": "if({view.custom.state} \u003d 0, \"#a9a9a9\", // disconnected gray\r\n if({view.custom.state} \u003d 1 || {view.custom.state} \u003d 2, \"#90ee90\", // light green\r\n if({view.custom.state} \u003d 3 || {view.custom.state} \u003d 4, \"#228B22\", // softer dark green\r\n if({view.custom.state} \u003d 5 || {view.custom.state} \u003d 6, \"#ffc0cb\", // pink\r\n if({view.custom.state} \u003d 7 || {view.custom.state} \u003d 8, \"#ff0000\", // red\r\n if({view.custom.state} \u003d 9 || {view.custom.state} \u003d 10, \"#808080\", // normal gray\r\n if({view.custom.state} \u003d 11 || {view.custom.state} \u003d 12, \"#ffffff\", \"\") // white\r\n )\r\n )\r\n )\r\n )\r\n )\r\n)\r\n"
},
"type": "expr"
}
}
},
"props": {
"elements": [
{
"d": "M 0,0 H 20 V 20 H 0 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "1.5"
},
"type": "path"
},
{
"d": "m 17,10.5 a 7,7 0 0 1 -7,7 7,7 0 0 1 -7,-7 7,7 0 0 1 7,-7 7,7 0 0 1 7,7 z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#000000",
"width": "1"
},
"type": "path"
}
],
"viewBox": "0 0 20 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_buttons"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,25 @@
Select
SorterName,Induct_count,Sorted_count,OperRecirc_count,MachineRecirc_count,AWCSRecirc_count,Startstamp,Endtstamp,
Induct_count/Induct_count as Induct_perc,
Sorted_count/Induct_count as Sorted_perc,
OperRecirc_count/Induct_count as OperRecirc_perc,
MachineRecirc_count/Induct_count as MachineRecirc_perc,
AWCSRecirc_count/Induct_count as AWCSRecirc_perc,
Induct_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as Induct_rate,
Sorted_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as Sorted_rate,
OperRecirc_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as OperRecirc_rate,
MachineRecirc_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as MachineRecirc_rate,
AWCSRecirc_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as AWCSRecirc_rate
FROM
(SELECT
'S03' as SorterName,
COUNT(*) AS Induct_count,
SUM(alltable.ACTUAL_DEST <> 'S03999') AS Sorted_count,
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 OperRecirc_count,
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_count,
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_count,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
Group BY 'S03') basa

View File

@ -0,0 +1,207 @@
{
"custom": {
"state": 0,
"string": "Inactive"
},
"params": {
"tagProps": [
"/system/mcm01/test",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"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},0)",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 1
},
{
"input": 0,
"output": 0
},
{
"input": 2,
"output": 2
},
{
"input": 3,
"output": 3
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.string": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "Unknown",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Actuated"
},
{
"input": 2,
"output": "Faulted"
},
{
"input": 0,
"output": "Inactive"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 30
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"text": "PX",
"textStyle": {
"fontSize": "20px",
"textAlign": "center",
"textTransform": "uppercase"
}
},
"type": "ia.display.label"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_px"
},
"type": "property"
}
},
"props.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": "#808080",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "#00FF00"
},
{
"input": 2,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"borderStyle": "solid",
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,993 @@
{
"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": "550px",
"grow": 1
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "300px",
"shrink": 0
},
"propConfig": {
"custom.area": {
"binding": {
"config": {
"expression": "if(isNull({this.custom.lookup_path}), \"\",\r\ntry(jsonGet({this.custom.plc_dict},\"Area\"),\"\"))"
},
"type": "expr"
}
},
"custom.lookup_path": {
"binding": {
"config": {
"expression": "try(if({this.custom.path}[1,0]\u003d\"DetailedView\", {this.custom.path}[2,0],\r\n\"\"), \"\")\r\n"
},
"type": "expr"
}
},
"custom.path": {
"binding": {
"config": {
"path": "page.props.path"
},
"transforms": [
{
"expression": "split({value},\"/\")",
"type": "expression"
}
],
"type": "property"
}
},
"custom.path_to_display": {
"binding": {
"config": {
"expression": "if(len({this.custom.lookup_path})\u003c1, \"\",\r\nif(len({this.custom.area}) \u003c1, {this.custom.lookup_path},\r\nif(len({this.custom.sub_area}) \u003e 0, concat({this.custom.lookup_path} + \" / \" + {this.custom.area} + \" / \" + {this.custom.sub_area}),\r\nconcat({this.custom.lookup_path} + \" / \" + {this.custom.area}))))"
},
"type": "expr"
}
},
"custom.plc_dict": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"transforms": [
{
"expression": "jsonGet({value},{this.custom.lookup_path})",
"type": "expression"
}
],
"type": "tag"
}
},
"custom.sub_area": {
"binding": {
"config": {
"expression": "if(isNull({this.custom.lookup_path}), \"\",\r\ntry(jsonGet({this.custom.plc_dict},\"SubArea\"), \"\"))"
},
"type": "expr"
}
},
"position.display": {
"binding": {
"config": {
"expression": "{view.params.size} \u003d \"large\""
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "this.custom.path_to_display"
},
"type": "property"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontWeight": "bold",
"textAlign": "center"
}
},
"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"
},
"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"
},
"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": "PopUp-Views/Legend_Popup/Legend-popup-view",
"viewportBound": true
},
"scope": "C",
"type": "popup"
},
{
"config": {
"script": "\tbuttonid \u003d self.custom.buttonid\n\tactivityLog.productMetrics.callLogger(self.view, \u0027click\u0027, buttonid)"
},
"scope": "G",
"type": "script"
}
]
}
},
"meta": {
"name": "Icon",
"tooltip": {
"delay": 250,
"enabled": true,
"sustain": 1000,
"text": "Legend"
}
},
"position": {
"basis": "35px"
},
"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 \"/Real-Time\")"
},
"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": "Alarms-autStand/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
},
"transforms": [
{
"code": "\ttotal \u003d sum(row[\"Count\"] for row in value if \"Count\" in row and row[\"Count\"] is not None)\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"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "{./Label.props.text} + \" active alarms in the system\""
},
"type": "expr"
}
}
},
"props": {
"justify": "flex-end",
"style": {
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"custom": {
"covert": 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"
},
"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"
},
"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"
},
"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": "direct",
"tagPath": "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": {
"basis": "50px",
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "{view.params.size} !\u003d \"small\""
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "session.props.auth.user.userName"
},
"transforms": [
{
"code": "\tif len(value) \u003d\u003d 0 or value \u003d\u003d \"null\":\n\t return \"Sign In\"\n\telse:\n\t return value.split(\"@\")[0]",
"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"
}
}

View File

@ -0,0 +1,17 @@
SELECT
okey.roundtime,
okey.Total_count,
okey.Total_count / okey.Total_count AS Total_perc,
okey.Total_count * 3600
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime) AS Total_rate
FROM (
SELECT
FROM_UNIXTIME(
CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60
) AS roundtime,
COUNT(*) AS Total_count
FROM alltable
WHERE (alltable.t_stamp BETWEEN :starttime AND :endtime) and ('Induct 1' = :Induct)
GROUP BY roundtime
) AS okey
ORDER BY okey.roundtime;

View File

@ -0,0 +1,557 @@
{
"custom": {
"covert_mode": null,
"disconnected": false,
"display_icon": null,
"error": false,
"isMatch": 0,
"priority": 0,
"priority_string": "No active alarms",
"running_status": 0,
"searchId": null,
"state": 5,
"state_string": "Unknown"
},
"params": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.covert_mode": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.disconnected": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}",
"plc": "{view.custom.plc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
},
"transforms": [
{
"expression": "if(isNull({value}), False, {value})",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.display_icon": {
"binding": {
"config": {
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
},
"type": "expr"
},
"persistent": true
},
"custom.error": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
"type": "expression"
}
],
"type": "property"
},
"persistent": true
},
"custom.isMatch": {
"binding": {
"config": {
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
},
"type": "expr"
},
"persistent": true
},
"custom.priority": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"fallback": 0,
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": 4
},
{
"input": 2,
"output": 3
},
{
"input": 3,
"output": 2
},
{
"input": 4,
"output": 1
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"persistent": true
},
"custom.priority_string": {
"binding": {
"config": {
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"custom.running_status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"custom.searchId": {
"binding": {
"config": {
"path": "session.custom.searchId"
},
"type": "property"
},
"persistent": true
},
"custom.state": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": null,
"inputType": "scalar",
"mappings": [
{
"input": 4,
"output": 1
},
{
"input": 3,
"output": 2
},
{
"input": 2,
"output": 3
},
{
"input": 1,
"output": 4
},
{
"input": 0,
"output": 5
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
},
"type": "expr"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 100,
"width": 100
}
},
"root": {
"children": [
{
"meta": {
"name": "Camera"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.state"
},
"enabled": false,
"transforms": [
{
"expression": "if({session.custom.colours}[\"state\"+{value}] \u003d null, \r\n{session.custom.colours}[\"Fallback\"],\r\n{session.custom.colours}[\"state\"+{value}])",
"type": "expression"
},
{
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": 101,
"output": "State-Styles/State101"
},
{
"input": 102,
"output": "State-Styles/State102"
},
{
"input": 103,
"output": "State-Styles/State103"
},
{
"input": 104,
"output": "State-Styles/State104"
},
{
"input": 105,
"output": "State-Styles/State105"
},
{
"input": 106,
"output": "State-Styles/State106"
},
{
"input": 201,
"output": "State-Styles/State201"
},
{
"input": 202,
"output": "State-Styles/State202"
},
{
"input": 203,
"output": "State-Styles/State203"
},
{
"input": 204,
"output": "State-Styles/State204"
},
{
"input": 205,
"output": "State-Styles/State205"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
}
},
"props": {
"elements": [
{
"id": "defs963",
"name": "defs963",
"type": "defs"
},
{
"elements": [
{
"d": "M 108.69378,77.205299 A 30.372795,30.372799 0 0 1 78.350262,107.57808 30.372795,30.372799 0 0 1 47.948245,77.263855 30.372795,30.372799 0 0 1 78.23315,46.832627 a 30.372795,30.372799 0 0 1 30.4604,30.255561",
"fill": {
"paint": "#00CC00"
},
"id": "path2823",
"name": "path2823",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"miterlimit": "4",
"paint": "#000000",
"width": "2.30899"
},
"style": {
"paintOrder": "markers fill stroke"
},
"type": "path"
},
{
"elements": [
{
"elements": [
{
"elements": [
{
"d": "m 308.1,277.95 c 0,35.7 -28.9,64.6 -64.6,64.6 -35.7,0 -64.6,-28.9 -64.6,-64.6 0,-35.7 28.9,-64.6 64.6,-64.6 35.7,0 64.6,28.9 64.6,64.6 z m 132.2,-161.9 c 25.8,0 46.7,20.9 46.7,46.7 v 122.4 103.8 c 0,27.5 -22.3,49.8 -49.8,49.8 H 49.8 C 22.3,438.75 0,416.45 0,388.95 v -103.9 -122.3 0 c 0,-25.8 20.9,-46.7 46.7,-46.7 h 93.4 l 4.4,-18.6 c 6.7,-28.8 32.4,-49.2 62,-49.2 h 74.1 c 29.6,0 55.3,20.4 62,49.2 l 4.3,18.6 z m -342.9,67.4 c 0,-12.9 -10.5,-23.4 -23.4,-23.4 -13,0 -23.5,10.5 -23.5,23.4 0,12.9 10.5,23.4 23.4,23.4 13,0.1 23.5,-10.4 23.5,-23.4 z m 261.3,94.5 c 0,-63.6 -51.6,-115.2 -115.2,-115.2 -63.6,0 -115.2,51.6 -115.2,115.2 0,63.6 51.6,115.2 115.2,115.2 63.6,0 115.2,-51.6 115.2,-115.2 z",
"id": "path954",
"name": "path954",
"type": "path"
}
],
"id": "g956",
"name": "g956",
"type": "group"
}
],
"id": "g958",
"name": "g958",
"transform": "matrix(0.10552692,0,0,0.1049851,58.573883,61.035557)",
"type": "group"
}
],
"id": "g2695",
"name": "g2695",
"transform": "matrix(0.78290367,0,0,0.78703031,12.345936,11.651649)",
"type": "group"
}
],
"id": "g3222",
"name": "g3222",
"transform": "matrix(0.45169465,0,0,0.44391375,-20.878644,-19.304276)",
"type": "group"
}
],
"fill": {
"paint": "#000000"
},
"style": {},
"viewBox": "0 0 29.22 29.22"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
},
"scope": "G",
"type": "script"
},
"onDoubleClick": {
"config": {
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
},
"enabled": false,
"scope": "G",
"type": "script"
},
"onMouseEnter": {
"config": {
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root",
"tooltip": {
"enabled": true,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.backgroundColor": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": 1,
"output": "Alarms-Styles/Diagnostic"
},
{
"input": 2,
"output": "Alarms-Styles/Low"
},
{
"input": 3,
"output": "Alarms-Styles/Medium"
},
{
"input": 4,
"output": "Alarms-Styles/High"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.style.color": {
"binding": {
"config": {
"path": "view.custom.state"
},
"transforms": [
{
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\u0027)\r\n\t)",
"type": "expression"
}
],
"type": "property"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
},
"type": "expr"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "session.custom.alarm_filter.show_camera_jams"
},
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.disconnected"
},
"transforms": [
{
"fallback": "Disconnects/Device-Connected",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Disconnects/Device-Disconnected"
},
{
"input": false,
"output": "Disconnects/Device-Connected"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"aspectRatio": "1:1",
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,30 @@
Select
SorterName,ScannerName,Total_count,
GoodRead_count,NoRead_count,MultiLabelRead_count,NoCode_count,Startstamp,Endtstamp,
1 as Total_perc,
GoodRead_count/Total_count as GoodRead_perc,
NoRead_count/Total_count as NoRead_perc,
MultiLabelRead_count/Total_count as MultiLabelRead_perc,
NoCode_count/Total_count as NoCode_perc,
Total_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as Total_rate,
GoodRead_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as GoodRead_rate,
NoRead_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as NoRead_rate,
MultiLabelRead_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as MultiLabelRead_rate,
NoCode_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as NoCode_rate
FROM
(SELECT
'S03' as SorterName,
'S03aa' as ScannerName,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp,
COUNT(*) AS Total_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) <> '?' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '9' AND
SUBSTRING(alltable.ScanLabel,1,1) <> '0') AS GoodRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '?') AS NoRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '9') AS MultiLabelRead_count,
SUM(SUBSTRING(alltable.ScanLabel,1,1) = '0') AS NoCode_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)) basa

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
SELECT
alltable.ACTUAL_DEST as Lane,
concat(cast(COUNT(*) as char),' pph') AS Total_count,
concat(cast(SUM(alltable.DivertStatus = 5) as char),' pph') AS DestFull_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY (alltable.ACTUAL_DEST)

View File

@ -0,0 +1,789 @@
{
"custom": {},
"params": {
"Status": "",
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"params.Status": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 212,
"width": 336
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "400px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"type": "property"
}
}
},
"props": {
"textStyle": {
"textIndent": "10px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "JAM",
"tooltip": {
"enabled": true,
"text": "Jams"
}
},
"position": {
"basis": "24px",
"shrink": 0
},
"props": {
"path": "autStand/Equipment/JAM",
"style": {
"marginRight": "5px"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "10px",
"grow": 1
},
"props": {
"style": {
"marginRight": "10px"
},
"text": 0,
"textStyle": {
"textAlign": "end"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "60px"
},
"props": {
"style": {
"backgroundColor": "#555555",
"key": "value"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"marginLeft": 10
},
"text": "AREA",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "195px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.area_display"
},
"type": "property"
}
}
},
"props": {
"style": {
"marginLeft": 50
},
"textStyle": {
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5,
"borderLeftColor": "#555555",
"borderLeftStyle": "none",
"borderLeftWidth": 0.5,
"borderRightColor": "#555555",
"borderRightStyle": "none",
"borderRightWidth": 0.5,
"borderTopColor": "#555555",
"borderTopStyle": "solid",
"borderTopWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"marginLeft": 10
},
"text": "STATUS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "200px"
},
"propConfig": {
"props.params.value.tagProps[0]": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"params": {
"key": "value",
"value": {
"tagProps": [
null,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"path": "autStand/Equipment/Controller-Views/CommandControlStatus"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "80px"
},
"props": {
"justify": "space-around",
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "25px"
},
"propConfig": {
"props.color": {
"binding": {
"config": {
"path": "/root.custom.counts"
},
"transforms": [
{
"code": "\tfor v in value.values():\n\t\tif v \u003e 0:\n\t\t\treturn \"red\"\n\treturn \"\"",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/notifications_active",
"style": {
"classes": "",
"marginLeft": 10
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "100px"
},
"props": {
"style": {
"marginLeft": 10
},
"text": "ACTIVE ALARMS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_3"
},
"position": {
"basis": "80px"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"text": "High",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Medium",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Low",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Diag",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"text": "Total",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "200px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"text": 5,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\thigh \u003d payload.get(\"High\",0)\n\tself.props.text \u003d high",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"text": 2,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tmedium \u003d payload.get(\"Medium\",0)\n\tself.props.text \u003d medium",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"text": 0,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tlow \u003d payload.get(\"Low\",0)\n\tself.props.text \u003d low",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"text": 3,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tdiag \u003d payload.get(\"Diagnostic\",0)\n\tself.props.text \u003d diag",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"text": 10,
"textStyle": {
"fontSize": 10,
"textAlign": "center"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-alarm-count",
"pageScope": false,
"script": "\tcritical \u003d payload.get(\"Critical\",0)\n\thigh \u003d payload.get(\"High\",0)\n\tmed \u003d payload.get(\"Medium\",0)\n\tlow \u003d payload.get(\"Low\",0)\n\tdiag \u003d payload.get(\"Diagnostic\",0)\n\t\n\ttotal \u003d critical + high + med + low + diag\n\tself.props.text \u003d total\n\t",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "200px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "334px"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_2"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"marginBottom": 5,
"marginLeft": 10,
"marginRight": 10
}
},
"type": "ia.container.flex"
}
],
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 3,
"High": 5,
"Low": 0,
"Medium": 2
}
},
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tDETAILED_VIEWS \u003d {\n\t\t\"MCM01\": \"/autStand/MCM01\",\n\t\t\"MCM02\": \"/autStand/MCM02\"\n\t}\n\tpage \u003d self.view.params.tagProps[0]\n\t\n\tsystem.perspective.navigate(DETAILED_VIEWS[page])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.Total": {
"binding": {
"config": {
"expression": "{this.custom.counts.Critical} + {this.custom.counts.Diagnostic} + {this.custom.counts.High} + {this.custom.counts.Low} + {this.custom.counts.Medium}"
},
"type": "expr"
}
},
"custom.area": {
"binding": {
"config": {
"expression": "jsonGet({this.custom.plc_dict}, \"Area\")"
},
"type": "expr"
}
},
"custom.area_display": {
"binding": {
"config": {
"expression": "if(len({this.custom.sub_area})\u003e0,\r\nconcat({this.custom.area} + \"/\" + {this.custom.sub_area}),\r\n{this.custom.area})"
},
"type": "expr"
}
},
"custom.counts": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.sendMessage(\"update-alarm-count\", self.custom.counts, \"view\")"
}
},
"custom.plc_dict": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"transforms": [
{
"expression": "jsonGet({value}, {view.params.tagProps[0]})",
"type": "expression"
}
],
"type": "tag"
}
},
"custom.provider": {
"binding": {
"config": {
"expression": "\"[\"+{session.custom.fc}+\"_SCADA_TAG_PROVIDER]\""
},
"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"
}
},
"custom.sub_area": {
"binding": {
"config": {
"expression": "jsonGet({this.custom.plc_dict}, \"SubArea\")"
},
"type": "expr"
}
},
"custom.table": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "Alarms-autStand/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},
"onChange": {
"enabled": null,
"script": "\ttry:\n\t\tMCM \u003d self.view.params.tagProps[0]\n\t\tdata \u003d currentValue.value\n\t\t\n\t\t# Convert dataset to PyDataSet\n\t\trows \u003d system.dataset.toPyDataSet(data)\n\t\t\n\t\t# Initialize counts dictionary with first-letter uppercase keys\n\t\tcounts \u003d {\n\t\t\t\"Low\": 0,\n\t\t\t\"Medium\": 0,\n\t\t\t\"High\": 0,\n\t\t\t\"Critical\": 0,\n\t\t\t\"Diagnostic\": 0\n\t\t}\n\t\t\n\t\t# Loop through rows and filter for current MCM\n\t\tfor row in rows:\n\t\t\tif row[\"Location\"] \u003d\u003d MCM:\n\n\t\t\t\tpriority \u003d row[\"Priority\"].capitalize()\n\t\t\t\tif priority in counts:\n\t\t\t\t\tcounts[priority] \u003d row[\"Count\"]\n\t\t\n\t\tself.custom.counts \u003d counts\n\t\n\texcept Exception as e:\n\t\tsystem.perspective.print(\"Error gaq dzma: \" + str(e))"
}
},
"meta.visible": {
"binding": {
"config": {
"expression": "if({session.custom.covert} \u003d False \u0026\u0026 {this.custom.status} \u003d 5, False, True)"
},
"type": "expr"
}
}
},
"props": {
"direction": "column",
"style": {
"animationFillMode": "both",
"borderBottomLeftRadius": 10,
"borderBottomRightRadius": 10,
"borderColor": "#555555",
"borderStyle": "solid",
"borderTopLeftRadius": 10,
"borderTopRightRadius": 10,
"borderWidth": 1,
"box-shadow": "5px 5px 5px grey",
"classes": "Background-Styles/Controller",
"cursor": "pointer"
}
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,6 @@
SELECT IFNULL(max(total_count*12),0) as max_pph FROM (
SELECT
Round(SUM(alltable.ACTUAL_DEST <> 'S0199' and alltable.ACTUAL_DEST <> 'S0168')) AS total_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY UNIX_TIMESTAMP(alltable.t_stamp) DIV 300) basa

View File

@ -0,0 +1,70 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 272,
"width": 215
}
},
"root": {
"children": [
{
"meta": {
"name": "left90"
},
"position": {
"height": 1.3652,
"width": 1,
"x": 0.0069,
"y": -0.1685
},
"props": {
"elements": [
{
"id": "defs1",
"name": "defs1",
"type": "defs"
},
{
"elements": [
{
"d": "M 16.890047,19.897888 C 4.1781605,20.036878 -0.11241603,13.922713 0.16340637,0.16060852 L 8.2822031,0.16091303 C 8.3924473,8.3148192 8.5268195,11.434975 16.856526,11.653146 Z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27089",
"name": "path27089",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.260407"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"viewBox": "0 0 17 20"
},
"type": "ia.shapes.svg"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent",
"style": {
"overflow": "hidden",
"overflowX": "hidden"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,17 @@
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_count,
concat(round(SUM(alltable.ACTUAL_DEST <> 'S03999')/COUNT(*) * 100,2),'%') AS Diverted,
concat(round(SUM(alltable.DivertStatus = 14)/COUNT(*) * 100,2),'%') AS DivertFail,
concat(round(SUM(alltable.DivertStatus = 5)/COUNT(*) * 100,2),'%') AS DestinationFull,
concat(round(SUM(alltable.DivertStatus = 6)/COUNT(*) * 100,2),'%') AS DestinationJam,
concat(round(SUM(alltable.DivertStatus = 12)/COUNT(*) * 100,2),'%') AS DestinationDisabled,
concat(round(SUM(alltable.DivertStatus = 6)/COUNT(*) * 100,2),'%') as DestinationFault,
concat(round(SUM(alltable.DivertStatus = 17)/COUNT(*) * 100,2),'%') as Lost,
concat(round(SUM(alltable.DivertStatus = 21)/COUNT(*) * 100,2),'%') as Unsafe,
concat(round(SUM(alltable.DivertStatus = 18)/COUNT(*) * 100,2),'%') as DimError,
concat(round(SUM(alltable.DivertStatus = 4)/COUNT(*) * 100,2),'%') as GapError,
concat(round(SUM(alltable.DivertStatus = 1)/COUNT(*) * 100,2),'%') as Unknown
FROM alltable
Where (alltable.DEST_REQ = :lane AND alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
Select
SorterName,InductName,Total_count,Startstamp,Endtstamp,
Total_count/Total_count as Total_perc,
Total_count*3600/TIMESTAMPDIFF(second, Startstamp, Endtstamp) as Total_rate
FROM
(SELECT
'S03' as SorterName,
'Induct 1' as InductName,
COUNT(*) AS Total_count,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
Group BY 'Induct 1' ) basa

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
Select
roundtime,
Induct_count,Sorted_count,OperRecirc_count,MachineRecirc_count,AWCSRecirc_count,
Induct_count/Induct_count as Induct_perc,
Sorted_count/Induct_count as Sorted_perc,
OperRecirc_count/Induct_count as OperRecirc_perc,
MachineRecirc_count/Induct_count as MachineRecirc_perc,
AWCSRecirc_count/Induct_count as AWCSRecirc_perc,
Induct_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as Induct_rate,
Sorted_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as Sorted_rate,
OperRecirc_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as OperRecirc_rate,
MachineRecirc_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as MachineRecirc_rate,
AWCSRecirc_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as AWCSRecirc_rate
FROM
(SELECT
COUNT(*) AS Induct_count,
SUM(alltable.ACTUAL_DEST <> 'S03999') AS Sorted_count,
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 OperRecirc_count,
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_count,
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_count,
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60) roundtime
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime) AND ('S03' = :Sorter)
Group BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60)
Order By alltable.t_stamp ASC
) okey

View File

@ -0,0 +1,481 @@
{
"custom": {},
"params": {
"tagProps": [
"TAG0",
"TAG1",
"TAG2",
"TAG3",
"TAG4",
"TAG5",
"TAG6",
"TAG7",
"TAG8",
"TAG9",
"TAG10",
"TAG11"
]
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"params": {
"con_lines": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"in": false,
"out": false,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_TO_HUB"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0256,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.32",
"tagProps": [
"UL14_1_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0715,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.33",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_3_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1148,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.34",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.155,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.35",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1957,
"y": 0.0047
},
"props": {
"params": {
"IP": "11.200.1.36",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2368,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.37",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2766,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.38",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_3_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "-607% 50%"
},
"width": 0.0349,
"x": 0.3167,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.39",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3979,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.41",
"tagProps": [
"/system/someting_SIO",
"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_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.4386,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.30",
"tagProps": [
"/system/someting_SIO",
"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_2_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "465% -311%"
},
"width": 0.0349,
"x": 0.4782,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.31",
"tagProps": [
"/system/someting_SIO",
"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_1_DPM1",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "UL15_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3578,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.40",
"tagProps": [
"/system/someting_SIO",
"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"
}
}

View File

@ -0,0 +1,64 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 271,
"width": 316
}
},
"root": {
"children": [
{
"meta": {
"name": "right90"
},
"position": {
"height": 0.9446,
"width": 0.9494
},
"props": {
"elements": [
{
"id": "defs1",
"name": "defs1",
"type": "defs"
},
{
"elements": [
{
"d": "m 0.48408946,0.63336539 c 5.03604004,0.02588 7.95928004,-0.266973 12.23377954,1.98944001 1.65503,0.9666 2.74197,2.07523 3.73794,3.20659 1.85537,2.84128 3.14745,5.8598596 3.05039,10.7798096 l -8.06562,0.031 c -0.0803,-1.92185 0.0446,-3.79913 -1.5474595,-5.77497 -2.38574,-2.6865496 -6.13811,-2.3322296 -9.40355004,-2.4430596 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27086",
"name": "path27086",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.25"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"type": "group"
}
],
"viewBox": "0 0 20 17"
},
"type": "ia.shapes.svg"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,448 @@
{
"custom": {},
"params": {
"tagProps": [
"TAG0",
"TAG1",
"TAG2",
"TAG3",
"TAG4",
"TAG5",
"TAG6",
"TAG7",
"TAG8",
"TAG9",
"TAG10",
"TAG11"
]
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"params": {
"con_lines": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"in": false,
"out": false,
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_TO_HUB"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0256,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.32",
"tagProps": [
"UL14_1_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0715,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.33",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_3_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1148,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.34",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.155,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.35",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL14_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1957,
"y": 0.0047
},
"props": {
"params": {
"IP": "11.200.1.36",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2368,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.37",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_2_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2766,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.38",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_3_SIO"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "-607% 50%"
},
"width": 0.0349,
"x": 0.3167,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.39",
"tagProps": [
"/system/someting_SIO",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "UL15_5_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3979,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.41",
"tagProps": [
"/system/someting_SIO",
"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_1_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.4386,
"y": 0.0056
},
"props": {
"params": {
"IP": "11.200.1.30",
"tagProps": [
"/system/someting_SIO",
"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": "NCS1_1_DPM2",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "UL15_4_SIO"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3578,
"y": 0.0064
},
"props": {
"params": {
"IP": "11.200.1.40",
"tagProps": [
"/system/someting_SIO",
"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"
}
}

View File

@ -0,0 +1,54 @@
Select
roundtime,
Total_count,DivertFail_count,Diverted_count, DestFull_count,DestJam_count,DestDis_count,
DestFault_count,Lost_count,Unsafe_count,Dim_count,GapErr_count,Unknown_count,
Total_count/Total_count as total_perc,
DivertFail_count/Total_count as DivertFail_perc,
Diverted_count/Total_count as Diverted_perc,
DestFull_count/Total_count as destfull_perc,
DestJam_count/Total_count as destjam_perc,
DestDis_count/Total_count as destdisabled_perc,
DestFault_count/Total_count as destfault_perc,
Lost_count/Total_count as lost_perc,
Unsafe_count/Total_count as unsafe_perc,
Dim_count/Total_count as dim_perc,
GapErr_count/Total_count as gaperr_perc,
Unknown_count/Total_count as unknown_perc,
Total_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as total_rate,
DivertFail_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as DivertFail_rate,
Diverted_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as Diverted_rate,
DestFull_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destfull_rate,
DestJam_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destjam_rate,
DestDis_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destdisabled_rate,
DestFault_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as destfault_rate,
Lost_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as lost_rate,
Unsafe_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unsafe_rate,
Dim_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as dim_rate,
GapErr_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as gaperr_rate,
Unknown_count*3600/TIMESTAMPDIFF(second, :starttime, :endtime) as unknown_rate
From
(Select
COUNT(*) AS Total_count,
SUM(alltable.ACTUAL_DEST <> 'S0199') AS Diverted_count,
SUM(alltable.DivertStatus = 14) AS DivertFail_count,
SUM(alltable.DivertStatus = 5) AS DestFull_count,
SUM(alltable.DivertStatus = 6) AS DestJam_count,
SUM(alltable.DivertStatus = 12) AS DestDis_count,
MIN(alltable.t_stamp) AS Startstamp,
Max(alltable.t_stamp) AS Endtstamp,
SUM(alltable.DivertStatus = 6) as DestFault_count,
SUM(alltable.DivertStatus = 17) as Lost_count,
SUM(alltable.DivertStatus = 21) as Unsafe_count,
SUM(alltable.DivertStatus = 18) as Dim_count,
SUM(alltable.DivertStatus = 4) as GapErr_count,
SUM(alltable.DivertStatus = 1) as Unknown_count,
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60) roundtime
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime) and (alltable.DEST_REQ = :Lane)
Group BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60)
Order By alltable.t_stamp ASC
) okey

View File

@ -8,9 +8,9 @@
],
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-08-19T14:27:40Z"
"actor": "external",
"timestamp": "2025-08-28T09:46:53Z"
},
"lastModificationSignature": "6a2a06901474f611b401f8623d33b74968b83e49db840672803aab7e3e65e59a"
"lastModificationSignature": "31605c3623a8ee17a7aaf7e3bdfd47eeaf0d9ef7612de0168eb8fa0dc59caaba"
}
}

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