modifications in the active alarms and counts. removed both queries and created timer script for them. this is made to optimise the high ram usage

This commit is contained in:
Salijoghli 2025-12-18 16:26:58 +04:00
parent f27e099edd
commit e131ff05bc
117 changed files with 168800 additions and 14335 deletions

View File

@ -1,44 +0,0 @@
SELECT
roundtime AS `Round Time`,
sInduction_Name AS `Induction Name`,
COALESCE(total_single_carrier, 0) AS `Total Single Carrier`,
COALESCE(total_double_carrier, 0) AS `Total Double Carrier`,
COALESCE(total_single_carrier, 0) +
COALESCE(total_double_carrier, 0) AS `Total`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
sInduction_Name,
SUM(diTotal_Single_Carrier) AS total_single_carrier,
SUM(diTotal_Double_Carrier) AS total_double_carrier
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sInduction_Name = :inductionname OR :inductionname IS NULL OR :inductionname = '')
GROUP BY roundtime, sInduction_Name
UNION ALL
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S02' AS sInduction_Name,
0 AS total_single_carrier,
COUNT(*) AS total_double_carrier
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S02%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S02')
GROUP BY roundtime
ORDER BY roundtime ASC
) basa;

View File

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

View File

@ -1,6 +1,6 @@
SELECT SELECT
CASE CASE
WHEN c.sActual_Dest_ID LIKE 'S02%' THEN 'S02' WHEN c.sActual_Dest_ID LIKE 'S03%' THEN 'S03'
ELSE 'S03' ELSE 'S03'
END AS Sorter, END AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time, DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,

View File

@ -4,25 +4,19 @@
"$": [ "$": [
"ds", "ds",
192, 192,
1762615945641 1766054596663
], ],
"$columns": [ "$columns": [
{ {
"data": [ "data": [
"MCM01", "MCM01",
"MCM01", "MCM01"
"MCM01",
"MCM02",
"MCM02"
], ],
"name": "Location", "name": "Location",
"type": "String" "type": "String"
}, },
{ {
"data": [ "data": [
"High",
"Low",
"Medium",
"High", "High",
"Medium" "Medium"
], ],
@ -31,14 +25,11 @@
}, },
{ {
"data": [ "data": [
23,
10,
2, 2,
9,
1 1
], ],
"name": "Count", "name": "Count",
"type": "Long" "type": "Integer"
} }
] ]
}, },
@ -64,13 +55,11 @@
"custom.state": { "custom.state": {
"binding": { "binding": {
"config": { "config": {
"polling": { "fallbackDelay": 2.5,
"enabled": true, "mode": "direct",
"rate": "1" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
}, },
"type": "query" "type": "tag"
}, },
"onChange": { "onChange": {
"enabled": null, "enabled": null,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,60 @@
SELECT
'S03' AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS end_time,
'S03aa' AS sScanner_Name,
CASE
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
ELSE ROUND(COALESCE(sorter_total.total_bad_reads, 0) * 3600.0
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
END AS total_bad_reads,
0 AS total_comm_faults,
CASE
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
ELSE ROUND(COALESCE(sorter_total.total_good_reads, 0) * 3600.0
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
END AS total_good_reads,
0 AS total_multi_items,
CASE
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
ELSE ROUND(COALESCE(sorter_total.total_multi_reads, 0) * 3600.0
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
END AS total_multi_reads,
CASE
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
ELSE ROUND(COALESCE(sorter_total.total_no_data, 0) * 3600.0
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
END AS total_no_data,
CASE
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
ELSE ROUND(COALESCE(sorter_total.total_no_reads, 0) * 3600.0
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
END AS total_no_reads,
CASE
WHEN TIMESTAMPDIFF(SECOND, :starttime, :endtime) = 0 THEN 0
ELSE ROUND(COALESCE(sorter_total.total, 0) * 3600.0
/ TIMESTAMPDIFF(SECOND, :starttime, :endtime), 2)
END AS total
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) AS total_bad_reads,
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS total_good_reads,
SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) AS total_multi_reads,
SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) AS total_no_data,
SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) AS total_no_reads,
COUNT(*) AS total
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
) AS sorter_total ON 1 = 1;

View File

@ -0,0 +1,63 @@
SELECT
roundtime AS `Round Time`,
sScanner_Name AS `Scanner Name`,
COALESCE(total_bad_reads, 0) AS `Total Bad Reads`,
COALESCE(total_comm_faults, 0) AS `Total Comm Faults`,
COALESCE(total_good_reads, 0) AS `Total Good Reads`,
COALESCE(total_multi_items, 0) AS `Total Multi Items`,
COALESCE(total_multi_reads, 0) AS `Total Multi Reads`,
COALESCE(total_no_data, 0) AS `Total No Data`,
COALESCE(total_no_reads, 0) AS `Total No Reads`,
COALESCE(total_bad_reads, 0) +
COALESCE(total_comm_faults, 0) +
COALESCE(total_good_reads, 0) +
COALESCE(total_multi_items, 0) +
COALESCE(total_multi_reads, 0) +
COALESCE(total_no_data, 0) +
COALESCE(total_no_reads, 0) AS `Total`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
sScanner_Name,
SUM(diScanner_bad_reads) AS total_bad_reads,
SUM(diScanner_comm_fault) AS total_comm_faults,
SUM(diScanner_good_reads) AS total_good_reads,
SUM(diScanner_multi_items) AS total_multi_items,
SUM(diScanner_multi_reads) AS total_multi_reads,
SUM(diScanner_no_data) AS total_no_data,
SUM(diScanner_no_reads) AS total_no_reads
FROM scanner_reads
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sScanner_Name = :scannername OR :scannername IS NULL OR :scannername = '')
GROUP BY roundtime, sScanner_Name
UNION ALL
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S03aa' AS sScanner_Name,
SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) AS total_bad_reads,
0 AS total_comm_faults,
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS total_good_reads,
0 AS total_multi_items,
SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) AS total_multi_reads,
SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) AS total_no_data,
SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) AS total_no_reads
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:scannername IS NULL OR :scannername = '' OR :scannername = 'S03aa')
GROUP BY roundtime
ORDER BY roundtime ASC
) basa;

View File

@ -0,0 +1,229 @@
SELECT
COALESCE(data.roundtime, 'N/A') AS StartTimestamp,
COALESCE(CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(data.roundtime, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))), 'N/A') AS Hour,
COALESCE(data.sScanner_Name, 'N/A') AS sScanner_Name,
COALESCE(data.BadReads, '0%') AS BadReads,
COALESCE(data.CommFaults, '0%') AS CommFaults,
COALESCE(data.GoodReads, '0%') AS GoodReads,
COALESCE(data.MultiItems, '0%') AS MultiItems,
COALESCE(data.MultiReads, '0%') AS MultiReads,
COALESCE(data.NoData, '0%') AS NoData,
COALESCE(data.NoReads, '0%') AS NoReads,
COALESCE(data.Total, 0) AS Total
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
sScanner_Name,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_bad_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS BadReads,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_comm_fault), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS CommFaults,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_good_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS GoodReads,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_multi_items), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS MultiItems,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_multi_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS MultiReads,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_no_data), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS NoData,
CONCAT(
CASE
WHEN (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diScanner_no_reads), 0) * 100.0) / (
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0)
), 2)
END, '%'
) AS NoReads,
COALESCE(SUM(diScanner_bad_reads), 0) +
COALESCE(SUM(diScanner_comm_fault), 0) +
COALESCE(SUM(diScanner_good_reads), 0) +
COALESCE(SUM(diScanner_multi_items), 0) +
COALESCE(SUM(diScanner_multi_reads), 0) +
COALESCE(SUM(diScanner_no_data), 0) +
COALESCE(SUM(diScanner_no_reads), 0) AS Total
FROM scanner_reads
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sScanner_Name = :scannername OR :scannername IS NULL OR :scannername = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sScanner_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
'S03aa' AS sScanner_Name,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS BadReads,
'0%' AS CommFaults,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS GoodReads,
'0%' AS MultiItems,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS MultiReads,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS NoData,
CONCAT(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END, '%'
) AS NoReads,
COUNT(*) AS Total
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:scannername IS NULL OR :scannername = '' OR :scannername = 'S03aa')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) AS data ON 1=1
ORDER BY data.roundtime ASC;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,59 @@
-- Hourly Sorter Details Rate Query (Table Display)
-- Shows every hour in detail with all sorter statistics as rates (items per hour)
-- Rate calculation matches SorterDetails_Rate.sql formula
SELECT
CONCAT(DATE(Startstamp), ' ', LPAD(HOUR(Startstamp), 2, '0'), ':00') AS Startstamp,
CONCAT('H', TIMESTAMPDIFF(HOUR,
DATE_FORMAT(Startstamp, "%Y-%m-%d %H:00:00"),
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
)) AS Hour,
CONCAT(ROUND(success_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS success_rate,
CONCAT(ROUND(unknown_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS unknown_rate,
CONCAT(ROUND(unexpected_container_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS unexpected_container_rate,
CONCAT(ROUND(tracking_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS tracking_error_rate,
CONCAT(ROUND(gap_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS gap_error_rate,
CONCAT(ROUND(destination_full_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_full_rate,
CONCAT(ROUND(destination_non_operational_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_non_operational_rate,
CONCAT(ROUND(invalid_destination_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS invalid_destination_rate,
CONCAT(ROUND(destination_disabled_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_disabled_rate,
CONCAT(ROUND(throughput_limit_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS throughput_limit_rate,
CONCAT(ROUND(failed_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS failed_to_divert_rate,
CONCAT(ROUND(no_destination_received_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS no_destination_received_rate,
CONCAT(ROUND(lost_container_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS lost_container_rate,
CONCAT(ROUND(dimension_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS dimension_error_rate,
CONCAT(ROUND(weight_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS weight_error_rate,
CONCAT(ROUND(container_utilization_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS container_utilization_rate,
CONCAT(ROUND(unable_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS unable_to_divert_rate,
CONCAT(ROUND(destination_not_attempted_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_not_attempted_rate,
CONCAT(ROUND(scan_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS scan_error_rate
FROM (
SELECT
DATE(t_stamp) AS date_part,
HOUR(t_stamp) AS hour_part,
MIN(t_stamp) AS Startstamp,
MAX(t_stamp) AS Endtstamp,
SUM(DivertStatus = 0) AS success_count,
SUM(DivertStatus = 1) AS unknown_count,
SUM(DivertStatus = 2) AS unexpected_container_count,
SUM(DivertStatus = 3) AS tracking_error_count,
SUM(DivertStatus = 4) AS gap_error_count,
SUM(DivertStatus = 5) AS destination_full_count,
SUM(DivertStatus = 6) AS destination_non_operational_count,
SUM(DivertStatus = 7) AS invalid_destination_count,
SUM(DivertStatus = 12) AS destination_disabled_count,
SUM(DivertStatus = 13) AS throughput_limit_count,
SUM(DivertStatus = 14) AS failed_to_divert_count,
SUM(DivertStatus = 16) AS no_destination_received_count,
SUM(DivertStatus = 17) AS lost_container_count,
SUM(DivertStatus = 18) AS dimension_error_count,
SUM(DivertStatus = 19) AS weight_error_count,
SUM(DivertStatus = 20) AS container_utilization_count,
SUM(DivertStatus = 21) AS unable_to_divert_count,
SUM(DivertStatus = 22) AS destination_not_attempted_count,
SUM(DivertStatus IN (8, 9, 10)) AS scan_error_count
FROM alltable
WHERE t_stamp BETWEEN :starttime AND :endtime
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) counts
ORDER BY Startstamp ASC;

View File

@ -541,36 +541,20 @@
"grow": 1 "grow": 1
}, },
"propConfig": { "propConfig": {
"custom.key": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
},
"type": "query"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
"polling": { "fallbackDelay": 2.5,
"enabled": true, "mode": "direct",
"rate": "3" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
}, },
"transforms": [ "transforms": [
{ {
"code": "\ttotal \u003d sum(\n\t row[\"Count\"]\n\t for row in value\n\t if \"Count\" in row\n\t and row[\"Count\"] is not None\n\t and row.get(\"Priority\") in (\"Medium\", \"High\")\n\t)\n\treturn total", "code": "\tds \u003d value\n\ttotal \u003d 0\n\t\t\n\tif ds is not None:\n\t\tfor i in range(ds.rowCount):\n\t\t\tpriority \u003d ds.getValueAt(i, \"Priority\")\n\t\t\tcount \u003d ds.getValueAt(i, \"Count\")\n\t\n\t\t\tif priority in (\"Medium\", \"High\") and count is not None:\n\t\t\t\ttotal +\u003d count\n\t\n\treturn total\n",
"type": "script" "type": "script"
} }
], ],
"type": "query" "type": "tag"
} }
} }
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -1,78 +0,0 @@
/*+ MAX_EXECUTION_TIME(8000) */
-- CORRECT APPROACH: Active alarm = latest event per eventid is eventtype=0
-- Ignition alarm lifecycle: 0=activated, 1=cleared, 2=acknowledged
-- If latest event is type 0, alarm is active
SELECT
ae.id AS ID,
ae.eventtime AS StartTimestamp,
TIME_FORMAT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, ae.eventtime, NOW())), '%H:%i:%s') AS Duration,
CONCAT(REPLACE(ae.displaypath, '_', '-'), ' ', SUBSTRING_INDEX(ae.source, ':/alm:', -1)) AS Description,
CASE ae.priority
WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low'
WHEN 2 THEN 'Medium'
WHEN 3 THEN 'High'
WHEN 4 THEN 'Critical'
ELSE 'Unknown'
END AS Priority,
IFNULL(tag.strValue, '') AS Tag,
IFNULL(loc.strValue, '') AS Location,
CASE
WHEN ae.priority = 3 THEN 'Alarms-Styles/High'
WHEN ae.priority = 2 THEN 'Alarms-Styles/Medium'
WHEN ae.priority = 1 THEN 'Alarms-Styles/Low'
WHEN ae.priority = 0 THEN 'Alarms-Styles/Diagnostic'
ELSE 'Alarms-Styles/NoAlarm'
END AS Style
FROM alarm_events ae
INNER JOIN (
-- Find latest event per eventid, then filter where it's type 0 (active)
SELECT lat.eventid, lat.latest_id
FROM (
SELECT eventid, MAX(id) as latest_id
FROM alarm_events
WHERE eventid IS NOT NULL
GROUP BY eventid
) lat
INNER JOIN alarm_events latest_event ON latest_event.id = lat.latest_id
WHERE latest_event.eventtype = 0
AND latest_event.displaypath NOT LIKE '%System Startup%'
AND latest_event.source NOT LIKE '%System Startup%'
AND latest_event.displaypath NOT LIKE '%System Shutdown%'
AND latest_event.source NOT LIKE '%System Shutdown%'
) active ON ae.id = active.latest_id
LEFT JOIN alarm_event_data tag FORCE INDEX (idx_alarm_event_data_lookup)
ON tag.id = ae.id AND tag.propname = 'myTag'
LEFT JOIN alarm_event_data loc FORCE INDEX (idx_alarm_event_data_lookup)
ON loc.id = ae.id AND loc.propname = 'myLocation'
WHERE
-- Priority filter: Only evaluate priority conditions when parameter is provided
(
:priority IS NULL OR :priority = '' OR :priority = 0
OR (
:priority IS NOT NULL AND :priority != '' AND :priority != 0 AND (
(:priority = 3 AND ae.priority = 3)
OR (:priority = 2 AND ae.priority BETWEEN 2 AND 3)
OR (:priority = 1 AND ae.priority BETWEEN 1 AND 3)
)
)
)
-- LOCATION FILTER
AND (
(:location = 'all'
AND (loc.strValue LIKE '%MCM01%' OR loc.strValue LIKE '%MCM02%')
)
OR (:location <> 'all'
AND loc.strValue LIKE CONCAT('%', :location, '%')
)
)
ORDER BY ae.eventtime DESC;

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,35 @@
SELECT
COALESCE(data.roundtime, 'N/A') AS StartTimestamp,
COALESCE(CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(data.roundtime, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))), 'N/A') AS Hour,
COALESCE(data.sInduction_Name, 'N/A') AS sInduction_Name,
COALESCE(data.SingleCarrier_count, 0) AS SingleCarrier_count,
COALESCE(data.DoubleCarrier_count, 0) AS DoubleCarrier_count,
COALESCE(data.SingleCarrier_count, 0) + COALESCE(data.DoubleCarrier_count, 0) AS Total_count
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
sInduction_Name,
SUM(diTotal_Single_Carrier) AS SingleCarrier_count,
SUM(diTotal_Double_Carrier) AS DoubleCarrier_count
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sInduction_Name = :inductionname OR :inductionname IS NULL OR :inductionname = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sInduction_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
'S03' AS sInduction_Name,
COUNT(*) AS SingleCarrier_count,
0 AS DoubleCarrier_count
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) AS data ON 1=1
ORDER BY data.roundtime ASC;

View File

@ -1,96 +0,0 @@
SELECT
jd.Name,
ROUND((jd.Jam_count / totals.Total_jams) * 100, 2) AS Jam_percentage
FROM
(
/* ---------------------------
TRUE JAM COUNTS PER DEVICE
--------------------------- */
SELECT
Name,
COUNT(*) AS Jam_count
FROM
(
/* AREA JAMS */
SELECT
Name,
t_stamp
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
UNION ALL
/* DEVICE JAMS — EDGE DETECT */
SELECT
Name,
t_stamp
FROM
(
SELECT
Name,
t_stamp,
Jam,
IF(@lastName = Name, @prevJam, 0) AS prevJam,
@prevJam := Jam,
@lastName := Name
FROM lane_data
JOIN (SELECT @prevJam := 0, @lastName := '') AS vars
WHERE t_stamp BETWEEN :starttime AND :endtime
ORDER BY Name, t_stamp
) AS x
WHERE Jam = 1 AND prevJam = 0
) AS all_jams
GROUP BY Name
) AS jd
CROSS JOIN
(
/* ---------------------------
TOTAL JAM COUNT FOR PERCENT
--------------------------- */
SELECT
SUM(Jam_count) AS Total_jams
FROM
(
/* repeat jam count block */
SELECT
Name,
COUNT(*) AS Jam_count
FROM
(
/* AREA JAMS */
SELECT
Name,
t_stamp
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
UNION ALL
/* DEVICE JAMS — EDGE DETECT */
SELECT
Name,
t_stamp
FROM
(
SELECT
Name,
t_stamp,
Jam,
IF(@lastName2 = Name, @prevJam2, 0) AS prevJam,
@prevJam2 := Jam,
@lastName2 := Name
FROM lane_data
JOIN (SELECT @prevJam2 := 0, @lastName2 := '') AS v2
WHERE t_stamp BETWEEN :starttime AND :endtime
ORDER BY Name, t_stamp
) AS x2
WHERE Jam = 1 AND prevJam = 0
) AS all_jams2
GROUP BY Name
) AS summed
) AS totals
ORDER BY Jam_percentage DESC;

View File

@ -0,0 +1,94 @@
{
"custom": {
"alarm_filter": {
"show_VFD": true,
"show_beacons": true,
"show_buttons": true,
"show_camera_jams": true,
"show_dpm_mcm": true,
"show_encoders": true,
"show_epc": true,
"show_fio_safety": true,
"show_labels": true,
"show_map": true,
"show_photoeyes": true,
"show_px": true,
"show_solenoids": true
},
"colours": {
"Fallback": "#00FF00",
"colour_impaired": false,
"state0": "#8C8C8C",
"state1": "#FF0000",
"state2": "#FF8000",
"state3": "#FFFF00",
"state4": "#007EFC",
"state5": "#00CC00",
"state6": "#CCCCFF"
},
"covert": true,
"dpm_view_path": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM02/NCS1_1_DPM1",
"fc": "BNA8",
"rotation": "0deg",
"show_dpm_device_view": true,
"show_dpm_view": true
},
"propConfig": {
"props.auth": {
"access": "PRIVATE",
"persistent": false
},
"props.device.accelerometer": {
"access": "SYSTEM",
"persistent": false
},
"props.device.identifier": {
"access": "SYSTEM",
"persistent": false
},
"props.device.timezone": {
"access": "SYSTEM",
"persistent": false
},
"props.device.type": {
"access": "SYSTEM",
"persistent": false
},
"props.device.userAgent": {
"access": "SYSTEM",
"persistent": false
},
"props.gateway": {
"access": "SYSTEM",
"persistent": false
},
"props.geolocation.data": {
"access": "SYSTEM",
"persistent": false
},
"props.geolocation.permissionGranted": {
"access": "SYSTEM",
"persistent": false
},
"props.host": {
"access": "SYSTEM",
"persistent": false
},
"props.id": {
"access": "SYSTEM",
"persistent": false
},
"props.lastActivity": {
"access": "SYSTEM",
"persistent": false
}
},
"props": {
"address": "[0:0:0:0:0:0:0:1]",
"device": {},
"geolocation": {},
"locale": "en-US",
"theme": "myTheme",
"timeZoneId": "Asia/Tbilisi"
}
}

View File

@ -1,54 +0,0 @@
/*+ MAX_EXECUTION_TIME(8000) */
-- GetActiveAlarmsByLocationAndPriority: Count active alarms grouped by location and priority
-- Uses: idx_alarm_events_eventid, idx_alarm_event_data_lookup
SELECT
IFNULL(loc.strValue, '') AS Location,
CASE ae.priority
WHEN 0 THEN 'Diagnostic'
WHEN 1 THEN 'Low'
WHEN 2 THEN 'Medium'
WHEN 3 THEN 'High'
WHEN 4 THEN 'Critical'
ELSE 'Unknown'
END AS Priority,
COUNT(*) AS Count
FROM alarm_events ae
INNER JOIN (
-- Find latest event per eventid where latest event is type 0 (active)
SELECT lat.eventid, lat.latest_id
FROM (
SELECT eventid, MAX(id) AS latest_id
FROM alarm_events
WHERE eventid IS NOT NULL
GROUP BY eventid
) lat
INNER JOIN alarm_events latest_event
ON latest_event.id = lat.latest_id
WHERE latest_event.eventtype = 0
AND latest_event.displaypath NOT LIKE '%System Startup%'
AND latest_event.source NOT LIKE '%System Startup%'
AND latest_event.displaypath NOT LIKE '%System Shutdown%'
AND latest_event.source NOT LIKE '%System Shutdown%'
) active
ON ae.id = active.latest_id
LEFT JOIN alarm_event_data loc FORCE INDEX (idx_alarm_event_data_lookup)
ON loc.id = ae.id AND loc.propname = 'myLocation'
WHERE
-- 🔥 Remove alarms with no location (fixes the mismatch)
loc.strValue IS NOT NULL
AND loc.strValue != ''
-- 🔥 Only alarms for MCM01 and MCM02
AND (
loc.strValue LIKE '%MCM01%'
OR loc.strValue LIKE '%MCM02%'
)
GROUP BY Location, ae.priority
ORDER BY Location, Priority;

View File

@ -1,6 +1,6 @@
SELECT SELECT
CASE CASE
WHEN c.sActual_Dest_ID LIKE 'S02%' THEN 'S02' WHEN c.sActual_Dest_ID LIKE 'S03%' THEN 'S03'
ELSE 'S03' ELSE 'S03'
END AS Sorter, END AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time, DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,

View File

@ -0,0 +1,25 @@
SELECT
roundtime AS `Round Time`,
sInduction_Name AS `Induction Name`,
COUNT(*) AS `Total`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S03' AS sInduction_Name
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (
:inductionname IS NULL OR
:inductionname = '' OR
:inductionname = 'S03'
)
) AS x
GROUP BY roundtime, sInduction_Name
ORDER BY roundtime ASC;

View File

@ -0,0 +1,62 @@
-- Hourly Lane Graph Query (Rate per hour)
-- Shows every hour in detail with all lane statistics as rates (items per hour) for graphing
-- Rate calculation matches LaneDetails_Rate.sql formula
-- Filtered by specific lane parameter
SELECT
CONCAT('H', TIMESTAMPDIFF(HOUR,
DATE_FORMAT(Startstamp, "%Y-%m-%d %H:00:00"),
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
)) AS Hour,
ROUND(total_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Total,
ROUND(success_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Sorted,
ROUND(unknown_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Unknown,
ROUND(unexpected_container_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Unexpected,
ROUND(tracking_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS TrackingError,
ROUND(gap_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS GapError,
ROUND(destination_full_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationFull,
ROUND(destination_non_operational_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationFault,
ROUND(invalid_destination_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationInvalid,
ROUND(destination_disabled_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationDisabled,
ROUND(throughput_limit_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS ThroughputLimit,
ROUND(failed_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DivertFail,
ROUND(no_destination_received_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationNone,
ROUND(lost_container_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Lost,
ROUND(dimension_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DimensionError,
ROUND(weight_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS WeightError,
ROUND(container_utilization_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS ContainerUtilization,
ROUND(unable_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS UnableToDivert,
ROUND(destination_not_attempted_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationNotAttempted,
ROUND(scan_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS ScanError
FROM (
SELECT
DATE(t_stamp) AS date_part,
HOUR(t_stamp) AS hour_part,
MIN(t_stamp) AS Startstamp,
MAX(t_stamp) AS Endtstamp,
COUNT(*) AS total_count,
SUM(DivertStatus = 0) AS success_count,
SUM(DivertStatus = 1) AS unknown_count,
SUM(DivertStatus = 2) AS unexpected_container_count,
SUM(DivertStatus = 3) AS tracking_error_count,
SUM(DivertStatus = 4) AS gap_error_count,
SUM(DivertStatus = 5) AS destination_full_count,
SUM(DivertStatus = 6) AS destination_non_operational_count,
SUM(DivertStatus = 7) AS invalid_destination_count,
SUM(DivertStatus = 12) AS destination_disabled_count,
SUM(DivertStatus = 13) AS throughput_limit_count,
SUM(DivertStatus = 14) AS failed_to_divert_count,
SUM(DivertStatus = 16) AS no_destination_received_count,
SUM(DivertStatus = 17) AS lost_container_count,
SUM(DivertStatus = 18) AS dimension_error_count,
SUM(DivertStatus = 19) AS weight_error_count,
SUM(DivertStatus = 20) AS container_utilization_count,
SUM(DivertStatus = 21) AS unable_to_divert_count,
SUM(DivertStatus = 22) AS destination_not_attempted_count,
SUM(DivertStatus IN (8, 9, 10)) AS scan_error_count
FROM alltable
WHERE DEST_REQ = :lane AND t_stamp BETWEEN :starttime AND :endtime
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) counts
ORDER BY Startstamp ASC;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

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(\"/Home\")\n\telse:\n\t\tsystem.perspective.navigate(\"/\")"
},
"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 \"/\":\n\t\tsystem.perspective.navigate(\"/Home\")\n\t\n\telif self.page.props.path \u003d\u003d \"/Home\":\n\t\tsystem.perspective.navigate(\"/\")\n\t\n\telif self.props.selected \u003d\u003d True and self.page.props.path \u003d\u003d \"/\":\n\t\tsystem.perspective.navigate(\"/\")"
},
"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(\"/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": "\tsystem.perspective.closePopup(id \u003d \"Search\")\n\tsystem.perspective.navigate(\n\t view\u003dself.page.props.primaryView,\n\t params\u003d{\"highlightTagPath\": \"CLEAR\"}\n\t)"
},
"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": "/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(\"/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(\"/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": {
"script": "\t# Get the current gateway address dynamically\n\tcurrentHost \u003d self.session.props.gateway.address\n\t\t\n\t# Build the full navigation URL\n\tnavigateUrl \u003d currentHost + \"/data/perspective/client/BNA8\"\n\t\n\t# Navigate\n\tsystem.perspective.navigate(url\u003dnavigateUrl)\n"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Back",
"tooltip": {
"enabled": true,
"text": "Back to "
}
},
"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": false
},
"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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,14 @@
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
'S03' AS `Induction Name`,
'100%' AS `Total Single Carrier`,
'0%' AS `Total Double Carrier`
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
ORDER BY `Start Timestamp` ASC;

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -0,0 +1,44 @@
SELECT
'S03' AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS end_time,
'S03aa' AS sScanner_Name,
CONCAT(COALESCE(sorter_total.total_bad_reads, 0), '%') AS total_bad_reads,
'0%' AS total_comm_faults,
CONCAT(COALESCE(sorter_total.total_good_reads, 0), '%') AS total_good_reads,
'0%' AS total_multi_items,
CONCAT(COALESCE(sorter_total.total_multi_reads, 0), '%') AS total_multi_reads,
CONCAT(COALESCE(sorter_total.total_no_data, 0), '%') AS total_no_data,
CONCAT(COALESCE(sorter_total.total_no_reads, 0), '%') AS total_no_reads,
COALESCE(sorter_total.total, 0) AS total
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
CASE WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END AS total_bad_reads,
CASE WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END AS total_good_reads,
CASE WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END AS total_multi_reads,
CASE WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END AS total_no_data,
CASE WHEN COUNT(*) = 0 THEN 0
ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
END AS total_no_reads,
COUNT(*) AS total
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
) AS sorter_total ON 1=1;

View File

@ -0,0 +1,59 @@
WITH jam_data AS (
/* -------------------------------------------------------
JAM COUNT PER DEVICE (correct rising-edge detection)
------------------------------------------------------- */
SELECT
Name,
COUNT(*) AS Jam_count
FROM
(
/* AREA JAMS */
SELECT
Name,
t_stamp
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
UNION ALL
/* DEVICE JAMS — TRUE RISING EDGE */
SELECT
Name,
t_stamp
FROM
(
SELECT
Name,
t_stamp,
Jam,
IF(@lastName = Name, @prevJam, 0) AS prevJam,
@prevJam := Jam,
@lastName := Name
FROM lane_data
JOIN (SELECT @prevJam := 0, @lastName := '') AS vars
WHERE t_stamp BETWEEN :starttime AND :endtime
ORDER BY Name, t_stamp
) AS x
WHERE Jam = 1 AND prevJam = 0
) AS all_jams
GROUP BY Name
)
SELECT
jd.Name,
ROUND(
(jd.Jam_count * 3600.0)
/ NULLIF(TIMESTAMPDIFF(SECOND, :starttime, :endtime), 0),
2
) AS Jam_rate
FROM jam_data jd
UNION ALL
/* FALLBACK — RETURN ONLY WHEN JAM_DATA IS EMPTY */
SELECT
'N/A' AS Name,
0 AS Jam_rate
WHERE NOT EXISTS (SELECT 1 FROM jam_data)
ORDER BY Jam_rate DESC, Name ASC;

View File

@ -1,797 +0,0 @@
{
"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": "/root.custom.MCM"
},
"type": "property"
}
}
},
"props": {
"style": {
"textIndent": "10px"
},
"textStyle": {
"textIndent": "10px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "JAM",
"tooltip": {
"enabled": true,
"text": "Jams"
}
},
"position": {
"basis": "24px",
"shrink": 0
},
"props": {
"path": "autStand/Equipment/JAM",
"style": {
"marginRight": "5px"
}
},
"type": "ia.display.view"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "10px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.totalJams"
},
"type": "property"
}
}
},
"props": {
"style": {
"marginRight": "20px",
"overflow": "visible",
"textAlign": "end"
},
"textStyle": {
"textAlign": "end"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "60px"
},
"props": {
"style": {
"backgroundColor": "#555555"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"fontFamily": "Roboto",
"fontSize": 12,
"marginLeft": 10
},
"text": "AREA",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "195px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "/root.custom.area_display"
},
"type": "property"
}
}
},
"props": {
"style": {
"fontSize": 12,
"marginLeft": 50
},
"textStyle": {
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5,
"borderLeftColor": "#555555",
"borderLeftStyle": "none",
"borderLeftWidth": 0.5,
"borderRightColor": "#555555",
"borderRightStyle": "none",
"borderRightWidth": 0.5,
"borderTopColor": "#555555",
"borderTopStyle": "solid",
"borderTopWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "50px"
},
"props": {
"style": {
"fontFamily": "Roboto",
"fontSize": 12,
"marginLeft": 10
},
"text": "STATUS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"basis": "200px"
},
"propConfig": {
"props.params.value.tagProps[0]": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"params": {
"value": {
"tagProps": [
null,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"path": "autStand/Equipment/Controller-Views/CommandControlStatus"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "80px"
},
"props": {
"justify": "space-around",
"style": {
"borderBottomColor": "#555555",
"borderBottomStyle": "solid",
"borderBottomWidth": 0.5
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "25px"
},
"propConfig": {
"props.color": {
"binding": {
"config": {
"path": "/root.custom.counts"
},
"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": {
"fontFamily": "Roboto",
"fontSize": 12,
"marginLeft": 10
},
"text": "ACTIVE ALARMS",
"textStyle": {
"fontFamily": "Roboto",
"fontSize": 12
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_3"
},
"position": {
"basis": "80px"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "High",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "Medium",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "Low",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "Diag",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0
},
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0,
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0,
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0,
"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": 0,
"High": 0,
"Low": 0,
"Medium": 0
}
},
"events": {
"dom": {
"onClick": {
"config": {
"script": "\n\tpage \u003d self.view.params.tagProps[0]\n\t\n\tsystem.perspective.navigate(\"/\"+ page)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.MCM": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"type": "property"
}
},
"custom.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_display": {
"binding": {
"config": {
"expression": "jsonGet({this.custom.plc_dict}, \"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.table": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/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(\"Errors: \" + str(e))"
}
},
"custom.totalJams": {
"binding": {
"config": {
"parameters": {
"location": "{this.custom.MCM}",
"priority": "3"
},
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/Active"
},
"transforms": [
{
"code": "\t# value is a dataset returned from your SQL query\n\tfrom java.util import HashSet\n\t\n\tunique_devices \u003d HashSet()\n\t\n\t# iterate rows\n\tfor rowIndex in range(value.getRowCount()):\n\t device \u003d value.getValueAt(rowIndex, \"Description\")\n\t tag \u003d value.getValueAt(rowIndex, \"Tag\")\n\t location \u003d value.getValueAt(rowIndex, \"Location\")\n\t\n\t # match for TPE devices that are jammed and match MCM area\n\t if (\n\t device\n\t and tag\n\t and \"TPE\" in str(device)\n\t and \"Jammed\" in str(tag)\n\t and str(location) \u003d\u003d str(self.custom.MCM)\n\t ):\n\t unique_devices.add(device)\n\t\n\t# return total unique jammed device count\n\treturn unique_devices.size()",
"type": "script"
}
],
"type": "query"
}
},
"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,29 @@
SELECT
'S03' AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,
DATE_FORMAT(:endtime, '%Y-%m-%d %H:%i') AS end_time,
'S03aa' AS sScanner_Name,
COALESCE(sorter_total.total_bad_reads, 0) AS total_bad_reads,
0 AS total_comm_faults,
COALESCE(sorter_total.total_good_reads, 0) AS total_good_reads,
0 AS total_multi_items,
COALESCE(sorter_total.total_multi_reads, 0) AS total_multi_reads,
COALESCE(sorter_total.total_no_data, 0) AS total_no_data,
COALESCE(sorter_total.total_no_reads, 0) AS total_no_reads,
COALESCE(sorter_total.total, 0) AS total
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) AS total_bad_reads,
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS total_good_reads,
SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) AS total_multi_reads,
SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) AS total_no_data,
SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) AS total_no_reads,
COUNT(*) AS total
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
) AS sorter_total ON 1 = 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,50 @@
SELECT
COALESCE(data.roundtime, 'N/A') AS StartTimestamp,
COALESCE(CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(data.roundtime, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))), 'N/A') AS Hour,
COALESCE(data.sInduction_Name, 'N/A') AS sInduction_Name,
COALESCE(data.SingleCarrier_percent, '0%') AS SingleCarrier_percent,
COALESCE(data.DoubleCarrier_percent, '0%') AS DoubleCarrier_percent,
COALESCE(data.Total_count, 0) AS Total_count
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
sInduction_Name,
CONCAT(
CASE
WHEN (COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0)) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diTotal_Single_Carrier), 0) * 100.0) / (
COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0)
), 2)
END, '%'
) AS SingleCarrier_percent,
CONCAT(
CASE
WHEN (COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0)) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diTotal_Double_Carrier), 0) * 100.0) / (
COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0)
), 2)
END, '%'
) AS DoubleCarrier_percent,
COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0) AS Total_count
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sInduction_Name = :inductionname OR :inductionname IS NULL OR :inductionname = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sInduction_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
'S03' AS sInduction_Name,
'100%' AS SingleCarrier_percent,
'0%' AS DoubleCarrier_percent,
COUNT(*) AS Total_count
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) AS data ON 1=1
ORDER BY data.roundtime ASC;

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(cast(COUNT(*) as char),' pph') AS Total_pph
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

View File

@ -1,6 +1,6 @@
SELECT SELECT
CASE CASE
WHEN c.sActual_Dest_ID LIKE 'S02%' THEN 'S02' WHEN c.sActual_Dest_ID LIKE 'S03%' THEN 'S03'
ELSE 'S03' ELSE 'S03'
END AS Sorter, END AS Sorter,
DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time, DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS start_time,

View File

@ -0,0 +1,21 @@
SELECT
roundtime AS `Round Time`,
sInduction_Name AS `Induction Name`,
COUNT(*) AS `Inducted`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S03' AS sInduction_Name
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (COALESCE(:inductionname, '') = '' OR :inductionname = 'S03')
) AS x
GROUP BY roundtime, sInduction_Name
ORDER BY roundtime ASC;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,62 @@
WITH jam_data AS (
/* TRUE JAM COUNTS PER DEVICE */
SELECT
Name,
COUNT(*) AS Jam_count
FROM
(
/* AREA JAMS */
SELECT
Name,
t_stamp
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
UNION ALL
/* DEVICE JAMS EDGE DETECT */
SELECT
Name,
t_stamp
FROM
(
SELECT
Name,
t_stamp,
Jam,
IF(@lastName = Name, @prevJam, 0) AS prevJam,
@prevJam := Jam,
@lastName := Name
FROM lane_data
JOIN (SELECT @prevJam := 0, @lastName := '') AS vars
WHERE t_stamp BETWEEN :starttime AND :endtime
ORDER BY Name, t_stamp
) AS x
WHERE Jam = 1 AND prevJam = 0
) all_jams
GROUP BY Name
),
total AS (
SELECT SUM(Jam_count) AS Total_jams
FROM jam_data
)
SELECT
jd.Name,
ROUND((jd.Jam_count / t.Total_jams) * 100, 2) AS Jam_percentage
FROM jam_data jd
JOIN total t
WHERE t.Total_jams > 0
UNION ALL
/* FALLBACK IF NOTHING EXISTS */
SELECT
'N/A' AS Name,
0 AS Jam_percentage
WHERE NOT EXISTS (
SELECT 1 FROM jam_data
)
ORDER BY Jam_percentage DESC;

View File

@ -8718,6 +8718,98 @@
"visible": true, "visible": true,
"width": "" "width": ""
}, },
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "total_multi_items",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": "Multi Items (#)"
},
"justify": "center",
"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": ""
},
{ {
"align": "center", "align": "center",
"boolean": "checkbox", "boolean": "checkbox",
@ -8809,6 +8901,98 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": "" "width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "total_comm_faults",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": "Comm Faults (#)"
},
"justify": "center",
"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": ""
} }
], ],
"filter": { "filter": {
@ -32344,6 +32528,98 @@
"visible": true, "visible": true,
"width": "" "width": ""
}, },
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "MultiItems",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": "Multi Items (#)"
},
"justify": "center",
"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": ""
},
{ {
"align": "center", "align": "center",
"boolean": "checkbox", "boolean": "checkbox",
@ -32435,6 +32711,98 @@
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": "" "width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "CommFaults",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "center",
"style": {
"classes": ""
},
"title": "Comm Faults (#)"
},
"justify": "center",
"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": ""
} }
], ],
"filter": { "filter": {
@ -33531,6 +33899,266 @@
"yAxis": "Reads", "yAxis": "Reads",
"zIndex": 0 "zIndex": 0
}, },
{
"candlestick": {
"appearance": {
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"fill": {
"color": "",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": "",
"min": ""
},
"stacked": false,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
}
},
"high": {
"x": "",
"y": ""
},
"low": {
"x": "",
"y": ""
},
"open": {
"x": "",
"y": ""
}
},
"column": {
"appearance": {
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"fill": {
"color": "#4415F2",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": "",
"min": ""
},
"height": null,
"stacked": true,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
},
"width": null
},
"open": {
"x": "",
"y": ""
}
},
"data": {
"source": "example",
"x": "Hour",
"y": "Total Multi Items"
},
"defaultState": {
"visible": true
},
"hiddenInLegend": false,
"label": {
"text": "Total Multi Items"
},
"line": {
"appearance": {
"bullets": [
{
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"rotation": "",
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"enabled": false,
"fill": {
"color": "",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": 100,
"min": 2
},
"height": 10,
"label": {
"position": {
"dx": 0,
"dy": 0
},
"text": "{value}"
},
"render": "circle",
"rotation": 0,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
},
"tooltip": {
"background": {
"color": "",
"opacity": 1
},
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "{name}: [bold]{valueY}[/]"
},
"width": 10
}
],
"connect": true,
"fill": {
"color": "",
"opacity": 0
},
"minDistance": 0.5,
"stroke": {
"color": "",
"dashArray": "",
"opacity": 1,
"width": 3
},
"tensionX": 1,
"tensionY": 1
},
"open": {
"x": "",
"y": ""
}
},
"name": "MultiRead",
"render": "column",
"stepLine": {
"appearance": {
"bullets": [
{
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"rotation": "",
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"enabled": true,
"fill": {
"color": "",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": 100,
"min": 2
},
"height": 10,
"label": {
"position": {
"dx": 0,
"dy": 0
},
"text": "{value}"
},
"render": "circle",
"rotation": 0,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
},
"tooltip": {
"background": {
"color": "",
"opacity": 1
},
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "{name}: [bold]{valueY}[/]"
},
"width": 10
}
],
"connect": true,
"fill": {
"color": "",
"opacity": 0
},
"minDistance": 0.5,
"stroke": {
"color": "",
"dashArray": "",
"opacity": 1,
"width": 3
},
"tensionX": 1,
"tensionY": 1
},
"open": {
"x": "",
"y": ""
}
},
"tooltip": {
"background": {
"color": "",
"opacity": 1
},
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Multi Items (#): [bold]{valueY}[/]"
},
"visible": true,
"xAxis": "Hour",
"yAxis": "Reads",
"zIndex": 0
},
{ {
"candlestick": { "candlestick": {
"appearance": { "appearance": {
@ -33790,6 +34418,266 @@
"xAxis": "Hour", "xAxis": "Hour",
"yAxis": "Reads", "yAxis": "Reads",
"zIndex": 0 "zIndex": 0
},
{
"candlestick": {
"appearance": {
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"fill": {
"color": "",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": "",
"min": ""
},
"stacked": false,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
}
},
"high": {
"x": "",
"y": ""
},
"low": {
"x": "",
"y": ""
},
"open": {
"x": "",
"y": ""
}
},
"column": {
"appearance": {
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"fill": {
"color": "#EEFE00",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": "",
"min": ""
},
"height": null,
"stacked": true,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
},
"width": null
},
"open": {
"x": "",
"y": ""
}
},
"data": {
"source": "example",
"x": "Hour",
"y": "Total Comm Faults"
},
"defaultState": {
"visible": true
},
"hiddenInLegend": false,
"label": {
"text": "Total Comm Faults"
},
"line": {
"appearance": {
"bullets": [
{
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"rotation": "",
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"enabled": false,
"fill": {
"color": "",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": 100,
"min": 2
},
"height": 10,
"label": {
"position": {
"dx": 0,
"dy": 0
},
"text": "{value}"
},
"render": "circle",
"rotation": 0,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
},
"tooltip": {
"background": {
"color": "",
"opacity": 1
},
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "{name}: [bold]{valueY}[/]"
},
"width": 10
}
],
"connect": true,
"fill": {
"color": "",
"opacity": 0
},
"minDistance": 0.5,
"stroke": {
"color": "",
"dashArray": "",
"opacity": 1,
"width": 3
},
"tensionX": 1,
"tensionY": 1
},
"open": {
"x": "",
"y": ""
}
},
"name": "CommFaults",
"render": "column",
"stepLine": {
"appearance": {
"bullets": [
{
"deriveFieldsFromData": {
"fill": {
"color": "",
"opacity": ""
},
"rotation": "",
"stroke": {
"color": "",
"opacity": "",
"width": ""
}
},
"enabled": true,
"fill": {
"color": "",
"opacity": 1
},
"heatRules": {
"dataField": "",
"enabled": false,
"max": 100,
"min": 2
},
"height": 10,
"label": {
"position": {
"dx": 0,
"dy": 0
},
"text": "{value}"
},
"render": "circle",
"rotation": 0,
"stroke": {
"color": "",
"opacity": 1,
"width": 1
},
"tooltip": {
"background": {
"color": "",
"opacity": 1
},
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "{name}: [bold]{valueY}[/]"
},
"width": 10
}
],
"connect": true,
"fill": {
"color": "",
"opacity": 0
},
"minDistance": 0.5,
"stroke": {
"color": "",
"dashArray": "",
"opacity": 1,
"width": 3
},
"tensionX": 1,
"tensionY": 1
},
"open": {
"x": "",
"y": ""
}
},
"tooltip": {
"background": {
"color": "",
"opacity": 1
},
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Comm Faults (#): [bold]{valueY}[/]"
},
"visible": true,
"xAxis": "Hour",
"yAxis": "Reads",
"zIndex": 0
} }
], ],
"xAxes": [ "xAxes": [
@ -68004,7 +68892,7 @@
"props.currentTabIndex": { "props.currentTabIndex": {
"onChange": { "onChange": {
"enabled": null, "enabled": null,
"script": "\tdropdown \u003d self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\")\n\tval \u003d currentValue.value\n\t\n\t# Default options\n\toptions \u003d [\n\t {\"value\": \"Count\", \"label\": \"Count\"},\n\t {\"value\": \"Percentage\", \"label\": \"Percentage\"},\n\t {\"value\": \"Rate\", \"label\": \"Rate\"}\n\t]\n\tvalue \u003d \"Count\"\n\t\n\t# Customize options based on current value\n\tif val in (4, 5, 6, 7, 9, 10):\n\t options \u003d [\n\t {\"value\": \"Count\", \"label\": \"Count\"},\n\t {\"value\": \"Percentage\", \"label\": \"Percentage\"}\n\t ]\n\t\n\tif val \u003d\u003d 0:\n\t\toptions \u003d [\n\t\t\t{\"value\": \"Count\", \"label\": \"Count\"},\n\t\t\t{\"value\": \"Rate\", \"label\": \"Rate\"}\n\t\t]\n\t\n\t# Apply changes\n\tdropdown.props.options \u003d options\n\tdropdown.props.value \u003d value" "script": "\tdropdown \u003d self.parent.getChild(\"Aggregation_Mode\").getChild(\"Dropdown_Aggregation_mode\")\n\tval \u003d currentValue.value\n\t\n\t# Default options\n\toptions \u003d [\n\t {\"value\": \"Count\", \"label\": \"Count\"},\n\t {\"value\": \"Percentage\", \"label\": \"Percentage\"},\n\t {\"value\": \"Rate\", \"label\": \"Rate\"}\n\t]\n\tvalue \u003d \"Count\"\n\t\n\t# Customize options based on current value\n\tif val in (4, 5, 6, 7, 9, 10):\n\t options \u003d [\n\t {\"value\": \"Count\", \"label\": \"Count\"},\n\t {\"value\": \"Percentage\", \"label\": \"Percentage\"}\n\t ]\n\t\n\t# Apply changes\n\tdropdown.props.options \u003d options\n\tdropdown.props.value \u003d value"
} }
}, },
"props.tabs": { "props.tabs": {
@ -68093,6 +68981,10 @@
"label": "Count", "label": "Count",
"value": "Count" "value": "Count"
}, },
{
"label": "Percentage",
"value": "Percentage"
},
{ {
"label": "Rate", "label": "Rate",
"value": "Rate" "value": "Rate"
@ -71406,18 +72298,18 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1764580547590 1764661288743
], ],
"$ts": 1764580547589 "$ts": 1764661288742
}, },
"rollingWindow": 30, "rollingWindow": 30,
"startDate": { "startDate": {
"$": [ "$": [
"ts", "ts",
192, 192,
1764580547589 1764661288743
], ],
"$ts": 1764578747589 "$ts": 1764659488742
} }
}, },
"meta": { "meta": {
@ -71590,7 +72482,7 @@
}, },
"props": { "props": {
"dismissOnSelect": false, "dismissOnSelect": false,
"formattedValue": "Dec 1, 2025 12:45 PM", "formattedValue": "Dec 2, 2025 11:11 AM",
"formattedValues": { "formattedValues": {
"date": "Mar 26, 2021", "date": "Mar 26, 2021",
"datetime": "Mar 26, 2021 12:00 AM", "datetime": "Mar 26, 2021 12:00 AM",
@ -71698,7 +72590,7 @@
}, },
"props": { "props": {
"dismissOnSelect": false, "dismissOnSelect": false,
"formattedValue": "Dec 1, 2025 1:15 PM", "formattedValue": "Dec 2, 2025 11:41 AM",
"formattedValues": { "formattedValues": {
"date": "Mar 29, 2021", "date": "Mar 29, 2021",
"datetime": "Mar 29, 2021 1:37 PM", "datetime": "Mar 29, 2021 1:37 PM",

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,727 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 1080,
"width": 70
}
},
"root": {
"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(\"/Home\")\n\telse:\n\t\tsystem.perspective.navigate(\"/\")"
},
"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 \"/\":\n\t\tsystem.perspective.navigate(\"/Home\")\n\t\n\telif self.page.props.path \u003d\u003d \"/Home\":\n\t\tsystem.perspective.navigate(\"/\")\n\t\n\telif self.props.selected \u003d\u003d True and self.page.props.path \u003d\u003d \"/\":\n\t\tsystem.perspective.navigate(\"/\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "ToggleSwitch"
},
"position": {
"basis": "60px"
},
"props": {
"color": {
"background-color": "",
"selected": "#FFFFFF",
"unselected": "#FFFFFF"
},
"label": {
"position": "left",
"style": {
"classes": "",
"fontSize": "10px"
},
"text": "Map View"
},
"selected": true,
"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"
},
{
"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(\"/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": "\tsystem.perspective.closePopup(id \u003d \"Search\")\n\tsystem.perspective.navigate(\n\t view\u003dself.page.props.primaryView,\n\t params\u003d{\"highlightTagPath\": \"CLEAR\"}\n\t)"
},
"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": "/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(\"/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(\"/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": {
"script": "\t# Get the current gateway address dynamically\n\tcurrentHost \u003d self.session.props.gateway.address\n\t\t\n\t# Build the full navigation URL\n\tnavigateUrl \u003d currentHost + \"/data/perspective/client/BNA8\"\n\t\n\t# Navigate\n\tsystem.perspective.navigate(url\u003dnavigateUrl)\n"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Back",
"tooltip": {
"enabled": true,
"text": "Back to "
}
},
"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,56 @@
SELECT
COALESCE(data.roundtime, 'N/A') AS StartTimestamp,
COALESCE(CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(data.roundtime, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))), 'N/A') AS Hour,
COALESCE(data.sScanner_Name, 'N/A') AS sScanner_Name,
COALESCE(data.BadReads, 0) AS BadReads,
COALESCE(data.CommFaults, 0) AS CommFaults,
COALESCE(data.GoodReads, 0) AS GoodReads,
COALESCE(data.MultiItems, 0) AS MultiItems,
COALESCE(data.MultiReads, 0) AS MultiReads,
COALESCE(data.NoData, 0) AS NoData,
COALESCE(data.NoReads, 0) AS NoReads,
COALESCE(data.BadReads, 0) +
COALESCE(data.CommFaults, 0) +
COALESCE(data.GoodReads, 0) +
COALESCE(data.MultiItems, 0) +
COALESCE(data.MultiReads, 0) +
COALESCE(data.NoData, 0) +
COALESCE(data.NoReads, 0) AS Total
FROM (SELECT 1) AS p
LEFT JOIN (
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
sScanner_Name,
SUM(diScanner_bad_reads) AS BadReads,
SUM(diScanner_comm_fault) AS CommFaults,
SUM(diScanner_good_reads) AS GoodReads,
SUM(diScanner_multi_items) AS MultiItems,
SUM(diScanner_multi_reads) AS MultiReads,
SUM(diScanner_no_data) AS NoData,
SUM(diScanner_no_reads) AS NoReads
FROM scanner_reads
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sScanner_Name = :scannername OR :scannername IS NULL OR :scannername = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sScanner_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS roundtime,
'S03aa' AS sScanner_Name,
SUM(CASE WHEN adiSort_Code_0 NOT IN (0, 8, 9, 10, 11, 15) THEN 1 ELSE 0 END) AS BadReads,
0 AS CommFaults,
SUM(CASE WHEN adiSort_Code_0 = 0 THEN 1 ELSE 0 END) AS GoodReads,
0 AS MultiItems,
SUM(CASE WHEN adiSort_Code_0 = 10 THEN 1 ELSE 0 END) AS MultiReads,
SUM(CASE WHEN adiSort_Code_0 = 9 THEN 1 ELSE 0 END) AS NoData,
SUM(CASE WHEN adiSort_Code_0 = 8 THEN 1 ELSE 0 END) AS NoReads
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:scannername IS NULL OR :scannername = '' OR :scannername = 'S03aa')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) AS data ON 1=1
ORDER BY data.roundtime ASC;

View File

@ -1,24 +0,0 @@
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS StartTimestamp,
CONCAT(
'H',
TIMESTAMPDIFF(
HOUR,
DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"),
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
)
) AS Hour,
'S03' AS sInduction_Name,
COUNT(*) AS Total_count
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
ORDER BY StartTimestamp ASC;

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1,60 +0,0 @@
SELECT
roundtime AS `Round Time`,
sInduction_Name AS `Induction Name`,
CONCAT(COALESCE(total_single_carrier, 0), '%') AS `Total Single Carrier`,
CONCAT(COALESCE(total_double_carrier, 0), '%') AS `Total Double Carrier`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
sInduction_Name,
CASE
WHEN (
COALESCE(SUM(diTotal_Single_Carrier), 0) +
COALESCE(SUM(diTotal_Double_Carrier), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diTotal_Single_Carrier), 0) * 100.0) / (
COALESCE(SUM(diTotal_Single_Carrier), 0) +
COALESCE(SUM(diTotal_Double_Carrier), 0)
), 2)
END AS total_single_carrier,
CASE
WHEN (
COALESCE(SUM(diTotal_Single_Carrier), 0) +
COALESCE(SUM(diTotal_Double_Carrier), 0)
) = 0 THEN 0
ELSE ROUND((COALESCE(SUM(diTotal_Double_Carrier), 0) * 100.0) / (
COALESCE(SUM(diTotal_Single_Carrier), 0) +
COALESCE(SUM(diTotal_Double_Carrier), 0)
), 2)
END AS total_double_carrier
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (COALESCE(:inductionname, '') = '' OR sInduction_Name = :inductionname)
GROUP BY roundtime, sInduction_Name
UNION ALL
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S02' AS sInduction_Name,
0 AS total_single_carrier,
0 AS total_double_carrier
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S02%'
AND (COALESCE(:inductionname, '') = '' OR :inductionname = 'S02')
GROUP BY roundtime
ORDER BY roundtime ASC
) basa;

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,51 +0,0 @@
SELECT
roundtime AS `Round Time`,
sInduction_Name AS `Induction Name`,
COALESCE(total_single_carrier, 0) AS `Total Single Carrier`,
COALESCE(total_double_carrier, 0) AS `Total Double Carrier`
FROM (
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
sInduction_Name,
CASE
WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0
ELSE ROUND(SUM(diTotal_Single_Carrier) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2)
END AS total_single_carrier,
CASE
WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0
ELSE ROUND(SUM(diTotal_Double_Carrier) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2)
END AS total_double_carrier
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (COALESCE(:inductionname, '') = '' OR sInduction_Name = :inductionname)
GROUP BY roundtime, sInduction_Name
UNION ALL
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S02' AS sInduction_Name,
0 AS total_single_carrier,
CASE
WHEN CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0) = 0 THEN 0
ELSE ROUND(COUNT(*) * 3600.0 / CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0), 2)
END AS total_double_carrier
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S02%'
AND (COALESCE(:inductionname, '') = '' OR :inductionname = 'S02')
GROUP BY roundtime
ORDER BY roundtime ASC
) basa;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,59 @@
-- Hourly Sorter Details Graph Query (Rate)
-- Shows every hour in detail for graphing with all sorter statistics as rates (items per hour)
-- Rate calculation matches SorterDetails_Rate.sql formula
SELECT
CONCAT('H', TIMESTAMPDIFF(HOUR,
DATE_FORMAT(Startstamp, "%Y-%m-%d %H:00:00"),
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
)) AS Hour,
ROUND(inducted_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Inducted,
ROUND(sorted_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Sorted,
ROUND(unknown_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Unknown,
ROUND(unexpected_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Unexpected,
ROUND(tracking_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS TrackingError,
ROUND(gap_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS GapError,
ROUND(destination_full_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationFull,
ROUND(destination_fault_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationFault,
ROUND(destination_invalid_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationInvalid,
ROUND(destination_disabled_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationDisabled,
ROUND(throughput_limit_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS ThroughputLimit,
ROUND(divert_fail_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DivertFail,
ROUND(destination_none_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationNone,
ROUND(lost_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS Lost,
ROUND(dimension_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DimensionError,
ROUND(weight_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS WeightError,
ROUND(container_util_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS ContainerUtilization,
ROUND(unable_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS UnableToDivert,
ROUND(dest_not_attempted_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS DestinationNotAttempted,
ROUND(scan_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2) AS ScanError
FROM (
SELECT
MIN(t_stamp) AS Startstamp,
MAX(t_stamp) AS Endtstamp,
COUNT(*) AS inducted_count,
SUM(DivertStatus = 0) AS sorted_count,
SUM(DivertStatus = 1) AS unknown_count,
SUM(DivertStatus = 2) AS unexpected_count,
SUM(DivertStatus = 3) AS tracking_error_count,
SUM(DivertStatus = 4) AS gap_error_count,
SUM(DivertStatus = 5) AS destination_full_count,
SUM(DivertStatus = 6) AS destination_fault_count,
SUM(DivertStatus = 7) AS destination_invalid_count,
SUM(DivertStatus = 12) AS destination_disabled_count,
SUM(DivertStatus = 13) AS throughput_limit_count,
SUM(DivertStatus = 14) AS divert_fail_count,
SUM(DivertStatus = 16) AS destination_none_count,
SUM(DivertStatus = 17) AS lost_count,
SUM(DivertStatus = 18) AS dimension_error_count,
SUM(DivertStatus = 19) AS weight_error_count,
SUM(DivertStatus = 20) AS container_util_count,
SUM(DivertStatus = 21) AS unable_to_divert_count,
SUM(DivertStatus = 22) AS dest_not_attempted_count,
SUM(DivertStatus IN (8, 9, 10)) AS scan_error_count
FROM alltable
WHERE t_stamp BETWEEN :starttime AND :endtime
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) counts
ORDER BY Startstamp ASC;

View File

@ -0,0 +1,29 @@
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
sInduction_Name AS `Induction Name`,
COALESCE(SUM(diTotal_Single_Carrier), 0) AS `Total Single Carrier`,
COALESCE(SUM(diTotal_Double_Carrier), 0) AS `Total Double Carrier`,
COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0) AS `Total`
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sInduction_Name = :inductionname OR :inductionname IS NULL OR :inductionname = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sInduction_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
'S03' AS `Induction Name`,
COUNT(*) AS `Total Single Carrier`,
0 AS `Total Double Carrier`,
COUNT(*) AS `Total`
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
ORDER BY `Start Timestamp` ASC;

View File

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

View File

@ -0,0 +1,24 @@
SELECT
roundtime AS `Round Time`,
sInduction_Name AS `Induction Name`,
COUNT(*) AS `Total`
FROM (
-- ONLY S03 from item_data now
SELECT
FROM_UNIXTIME(
FLOOR(UNIX_TIMESTAMP(t_stamp) /
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) *
CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
) AS roundtime,
'S03' AS sInduction_Name
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY roundtime
ORDER BY roundtime ASC
) basa;

View File

@ -3,100 +3,42 @@
"counts": { "counts": {
"Critical": 0, "Critical": 0,
"Diagnostic": 0, "Diagnostic": 0,
"High": 23, "High": 2,
"Low": 10, "Low": 0,
"Medium": 2, "Medium": 1,
"Total": 35 "Total": 3
},
"totalAlarms": {
"$": [
"ds",
192,
1762615945788
],
"$columns": [
{
"data": [
"MCM01",
"MCM01",
"MCM01",
"MCM02",
"MCM02"
],
"name": "Location",
"type": "String"
},
{
"data": [
"High",
"Low",
"Medium",
"High",
"Medium"
],
"name": "Priority",
"type": "String"
},
{
"data": [
23,
10,
2,
9,
1
],
"name": "Count",
"type": "Long"
}
]
} }
}, },
"params": { "params": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"value": { "value": {
"tagProps": [ "tagProps": [
"MCM01", "MCM01"
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
] ]
} }
}, },
"propConfig": { "propConfig": {
"custom.counts": {
"persistent": true
},
"custom.totalAlarms": { "custom.totalAlarms": {
"binding": { "binding": {
"config": { "config": {
"polling": { "fallbackDelay": 2.5,
"enabled": true, "mode": "direct",
"rate": "3" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
}, },
"type": "query" "type": "tag"
}, },
"onChange": { "onChange": {
"enabled": null, "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" "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# Safety check\n\tif queryData is None or queryData.rowCount \u003d\u003d 0:\n\t self.custom.counts \u003d counts\n\t return\n\t\n\t# Loop through dataset\n\tfor row in range(queryData.rowCount):\n\t location \u003d queryData.getValueAt(row, \"Location\")\n\t priority \u003d queryData.getValueAt(row, \"Priority\")\n\t count \u003d queryData.getValueAt(row, \"Count\")\n\t\n\t if location \u003d\u003d MCM:\n\t key \u003d priority.capitalize()\n\t if key in counts:\n\t counts[key] +\u003d count\n\t counts[\"Total\"] +\u003d count\n\t\n\t# Write result\n\tself.custom.counts \u003d counts\n"
}, }
},
"params.classes": {
"paramDirection": "input",
"persistent": true "persistent": true
}, },
"params.value": { "params.value": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": true
},
"params.value.tagProps": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.print(currentValue.value[0])"
}
} }
}, },
"props": { "props": {
@ -111,14 +53,23 @@
"children": [ "children": [
{ {
"meta": { "meta": {
"name": "Label_0" "name": "High_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "High" "text": "High"
@ -127,14 +78,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_1" "name": "Med_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Med" "text": "Med"
@ -143,14 +103,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_2" "name": "Low_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Low" "text": "Low"
@ -159,14 +128,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_3" "name": "Diag_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Diag" "text": "Diag"
@ -175,14 +153,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_4" "name": "Total_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Total" "text": "Total"
@ -191,7 +178,7 @@
} }
], ],
"meta": { "meta": {
"name": "FlexContainer" "name": "FlexContainer_Header"
}, },
"position": { "position": {
"basis": "25px" "basis": "25px"
@ -205,12 +192,20 @@
"children": [ "children": [
{ {
"meta": { "meta": {
"name": "Label_0" "name": "High_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -222,7 +217,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -230,12 +224,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_1" "name": "Med_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -247,7 +249,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -255,12 +256,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_2" "name": "Low_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -272,7 +281,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -280,12 +288,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_3" "name": "Diag_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -297,7 +313,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -305,12 +320,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_4" "name": "Total_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -322,7 +345,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -330,7 +352,7 @@
} }
], ],
"meta": { "meta": {
"name": "FlexContainer_1" "name": "FlexContainer_Values"
}, },
"position": { "position": {
"basis": "25px" "basis": "25px"
@ -341,73 +363,6 @@
"type": "ia.container.flex" "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": { "props": {
"direction": "column" "direction": "column"
}, },

View File

@ -0,0 +1,62 @@
-- Hourly Lane Details Rate Query (Table Display)
-- Shows every hour in detail with all lane statistics as rates (items per hour)
-- Rate calculation matches LaneDetails_Rate.sql formula
-- Filtered by specific lane parameter
SELECT
CONCAT(DATE(Startstamp), ' ', LPAD(HOUR(Startstamp), 2, '0'), ':00') AS StartTimestamp,
CONCAT('H', TIMESTAMPDIFF(HOUR,
DATE_FORMAT(Startstamp, "%Y-%m-%d %H:00:00"),
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
)) AS Hour,
CONCAT(ROUND(total_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS total_rate,
CONCAT(ROUND(success_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS success_rate,
CONCAT(ROUND(unknown_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS unknown_rate,
CONCAT(ROUND(unexpected_container_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS unexpected_container_rate,
CONCAT(ROUND(tracking_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS tracking_error_rate,
CONCAT(ROUND(gap_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS gap_error_rate,
CONCAT(ROUND(destination_full_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_full_rate,
CONCAT(ROUND(destination_non_operational_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_non_operational_rate,
CONCAT(ROUND(invalid_destination_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS invalid_destination_rate,
CONCAT(ROUND(destination_disabled_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_disabled_rate,
CONCAT(ROUND(throughput_limit_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS throughput_limit_rate,
CONCAT(ROUND(failed_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS failed_to_divert_rate,
CONCAT(ROUND(no_destination_received_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS no_destination_received_rate,
CONCAT(ROUND(lost_container_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS lost_container_rate,
CONCAT(ROUND(dimension_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS dimension_error_rate,
CONCAT(ROUND(weight_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS weight_error_rate,
CONCAT(ROUND(container_utilization_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS container_utilization_rate,
CONCAT(ROUND(unable_to_divert_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS unable_to_divert_rate,
CONCAT(ROUND(destination_not_attempted_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS destination_not_attempted_rate,
CONCAT(ROUND(scan_error_count * 3600 / TIMESTAMPDIFF(SECOND, Startstamp, Endtstamp), 2), ' pph') AS scan_error_rate
FROM (
SELECT
DATE(t_stamp) AS date_part,
HOUR(t_stamp) AS hour_part,
MIN(t_stamp) AS Startstamp,
MAX(t_stamp) AS Endtstamp,
COUNT(*) AS total_count,
SUM(DivertStatus = 0) AS success_count,
SUM(DivertStatus = 1) AS unknown_count,
SUM(DivertStatus = 2) AS unexpected_container_count,
SUM(DivertStatus = 3) AS tracking_error_count,
SUM(DivertStatus = 4) AS gap_error_count,
SUM(DivertStatus = 5) AS destination_full_count,
SUM(DivertStatus = 6) AS destination_non_operational_count,
SUM(DivertStatus = 7) AS invalid_destination_count,
SUM(DivertStatus = 12) AS destination_disabled_count,
SUM(DivertStatus = 13) AS throughput_limit_count,
SUM(DivertStatus = 14) AS failed_to_divert_count,
SUM(DivertStatus = 16) AS no_destination_received_count,
SUM(DivertStatus = 17) AS lost_container_count,
SUM(DivertStatus = 18) AS dimension_error_count,
SUM(DivertStatus = 19) AS weight_error_count,
SUM(DivertStatus = 20) AS container_utilization_count,
SUM(DivertStatus = 21) AS unable_to_divert_count,
SUM(DivertStatus = 22) AS destination_not_attempted_count,
SUM(DivertStatus IN (8, 9, 10)) AS scan_error_count
FROM alltable
WHERE DEST_REQ = :lane AND t_stamp BETWEEN :starttime AND :endtime
GROUP BY DATE(t_stamp), HOUR(t_stamp)
) counts
ORDER BY Startstamp ASC;

View File

@ -10,6 +10,7 @@
"show_epc": true, "show_epc": true,
"show_fio_safety": true, "show_fio_safety": true,
"show_labels": true, "show_labels": true,
"show_map": true,
"show_photoeyes": true, "show_photoeyes": true,
"show_px": true, "show_px": true,
"show_solenoids": true "show_solenoids": true

View File

@ -9,8 +9,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-22T09:34:25Z" "timestamp": "2025-12-01T13:16:41Z"
}, },
"lastModificationSignature": "675a41f247094e1feaab4992e02b43781b6dca0a388083fa067bac3fee2fa0d8" "lastModificationSignature": "661cd590890bfd60181fbf647968733269e3d7f99dd6b7d5c0f741218cde9228"
} }
} }

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-22T16:29:27Z" "timestamp": "2025-12-18T10:25:36Z"
}, },
"lastModificationSignature": "34a686c9f934b045aed4f231f36eebf6665a4e7619e8d6855f442ac7f77ba172" "lastModificationSignature": "10e881adff51b239053acf48045674b341b2991a72edc3fdcbdeee729e90a67b"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -249,6 +249,10 @@
} }
], ],
"type": "property" "type": "property"
},
"onChange": {
"enabled": null,
"script": "\ttag_path \u003d \"[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/Priority\"\n\tsystem.tag.writeBlocking([tag_path],[currentValue])"
} }
} }
}, },
@ -479,26 +483,28 @@
"script": "\tfrom system import date\n\t\n\tdef class_color(cls):\n\t\tm \u003d {\"Error\":\"#FFE5E5\",\"Warning\":\"#FFF7E0\",\"Message\":\"#EAF4FF\"}\n\t\treturn m.get(cls, \"#FFFFFF\")\n\t\n\tdef mk_row(number_id, start_ts, end_ts, duration_hms, cls, area, desc_, tag_):\n\t\treturn {\n\t\t\t\"value\": {\n\t\t\t\t\"NumberID\": number_id,\n\t\t\t\t\"Start Timestamp\": start_ts,\n\t\t\t\t\"End Timestamp\": end_ts,\n\t\t\t\t\"Duration\": duration_hms,\n\t\t\t\t\"Class\": cls,\n\t\t\t\t\"Area\": area,\n\t\t\t\t\"Description\": desc_,\n\t\t\t\t\"Tag\": tag_\n\t\t\t},\n\t\t\t\"style\": {\"backgroundColor\": class_color(cls), \"classes\": \"some-class\"}\n\t\t}\n\t\n\tds_name \u003d \"MariaDB80\"\n\t\n\t# Time window (java.util.Date)\n\tend_dt \u003d getattr(self.custom, \"endTime\", None) or date.now()\n\tstart_dt \u003d getattr(self.custom, \"startTime\", None) or date.addHours(end_dt, -24)\n\t\n\t# Class filter from DropdownMinClass\n\ttry:\n\t\tmin_choice \u003d self.parent.parent.parent.getChild(\"DropdownMinClass\").props.value\n\texcept:\n\t\tmin_choice \u003d \"Message\"\n\t\n\tif min_choice \u003d\u003d \"Error\":\n\t\tclass_list \u003d [\"Error\"]\n\telif min_choice \u003d\u003d \"Warning\":\n\t\tclass_list \u003d [\"Error\",\"Warning\"]\n\telse:\n\t\tclass_list \u003d [\"Error\",\"Warning\",\"Message\"]\n\t\n\tcls1 \u003d class_list[0] if len(class_list)\u003e0 else None\n\tcls2 \u003d class_list[1] if len(class_list)\u003e1 else None\n\tcls3 \u003d class_list[2] if len(class_list)\u003e2 else None\n\t\n\t# Optional priorities CSV from self.custom.priorities\n\tpriorities_csv \u003d getattr(self.custom, \"priorities\", \"\") or \"\"\n\t\n\tsql \u003d u\"\"\"\n\tSELECT\n\t ae.id AS NumberID,\n\t ae.eventtime AS `Start Timestamp`,\n\t clr.eventtime AS `End Timestamp`,\n\t IFNULL(\n\t SEC_TO_TIME(TIMESTAMPDIFF(SECOND, ae.eventtime, clr.eventtime)),\n\t SEC_TO_TIME(TIMESTAMPDIFF(SECOND, ae.eventtime, NOW()))\n\t ) AS Duration,\n\t cls.strvalue AS Class,\n\t loc.strvalue AS Area,\n\t des.strvalue AS Description,\n\t tag.strvalue AS Tag\n\tFROM alarm_events ae\n\tLEFT JOIN alarm_events clr\n\t ON clr.eventid \u003d ae.eventid AND clr.eventtype \u003d 1\n\tLEFT JOIN alarm_event_data cls\n\t ON cls.id \u003d ae.id AND cls.propname \u003d \u0027Class\u0027\n\tLEFT JOIN alarm_event_data loc\n\t ON loc.id \u003d ae.id AND loc.propname \u003d \u0027Area\u0027\n\tLEFT JOIN alarm_event_data des\n\t ON des.id \u003d ae.id AND des.propname \u003d \u0027Description\u0027\n\tLEFT JOIN alarm_event_data tag\n\t ON tag.id \u003d ae.id AND tag.propname \u003d \u0027Tag\u0027\n\tWHERE\n\t ae.eventtype \u003d 0\n\t AND ae.eventtime BETWEEN ? AND ?\n\t AND (\n\t ( ? IS NOT NULL AND cls.strvalue \u003d ? )\n\t OR ( ? IS NOT NULL AND cls.strvalue \u003d ? )\n\t OR ( ? IS NOT NULL AND cls.strvalue \u003d ? )\n\t )\n\t AND ( ? \u003d \u0027\u0027 OR FIND_IN_SET(CAST(ae.priority AS CHAR), ?) \u003e 0 )\n\tORDER BY ae.eventtime DESC\n\t\"\"\"\n\t\n\t# ORDER MATTERS: must match the ? placeholders above\n\tparams \u003d [\n\t\tstart_dt, end_dt,\n\t\tcls1, cls1,\n\t\tcls2, cls2,\n\t\tcls3, cls3,\n\t\tpriorities_csv, priorities_csv\n\t]\n\t\n\trows \u003d system.db.runPrepQuery(sql, params, ds_name)\n\t\n\tdata \u003d []\n\tfor r in rows:\n\t\ttry:\n\t\t\tstart_s \u003d system.date.format(r[\"Start Timestamp\"], \"yyyy-MM-dd HH:mm:ss\") if r[\"Start Timestamp\"] else \"\"\n\t\t\tend_s \u003d system.date.format(r[\"End Timestamp\"], \"yyyy-MM-dd HH:mm:ss\") if r[\"End Timestamp\"] else \"\"\n\t\t\tdur_s \u003d str(r[\"Duration\"]) if r[\"Duration\"] is not None else \"\"\n\t\t\tdata.append(\n\t\t\t\tmk_row(\n\t\t\t\t\tnumber_id \u003d int(r[\"NumberID\"]) + 30000,\n\t\t\t\t\tstart_ts \u003d start_s,\n\t\t\t\t\tend_ts \u003d end_s,\n\t\t\t\t\tduration_hms\u003d dur_s,\n\t\t\t\t\tcls \u003d r[\"Class\"] or \"\",\n\t\t\t\t\tarea \u003d r[\"Area\"] or \"\",\n\t\t\t\t\tdesc_ \u003d r[\"Description\"] or \"\",\n\t\t\t\t\ttag_ \u003d r[\"Tag\"] or \"\"\n\t\t\t\t)\n\t\t\t)\n\t\texcept Exception as ex:\n\t\t\tsystem.perspective.print(\"Row shape error: %s\" % ex)\n\t\n\tself.props.data \u003d data" "script": "\tfrom system import date\n\t\n\tdef class_color(cls):\n\t\tm \u003d {\"Error\":\"#FFE5E5\",\"Warning\":\"#FFF7E0\",\"Message\":\"#EAF4FF\"}\n\t\treturn m.get(cls, \"#FFFFFF\")\n\t\n\tdef mk_row(number_id, start_ts, end_ts, duration_hms, cls, area, desc_, tag_):\n\t\treturn {\n\t\t\t\"value\": {\n\t\t\t\t\"NumberID\": number_id,\n\t\t\t\t\"Start Timestamp\": start_ts,\n\t\t\t\t\"End Timestamp\": end_ts,\n\t\t\t\t\"Duration\": duration_hms,\n\t\t\t\t\"Class\": cls,\n\t\t\t\t\"Area\": area,\n\t\t\t\t\"Description\": desc_,\n\t\t\t\t\"Tag\": tag_\n\t\t\t},\n\t\t\t\"style\": {\"backgroundColor\": class_color(cls), \"classes\": \"some-class\"}\n\t\t}\n\t\n\tds_name \u003d \"MariaDB80\"\n\t\n\t# Time window (java.util.Date)\n\tend_dt \u003d getattr(self.custom, \"endTime\", None) or date.now()\n\tstart_dt \u003d getattr(self.custom, \"startTime\", None) or date.addHours(end_dt, -24)\n\t\n\t# Class filter from DropdownMinClass\n\ttry:\n\t\tmin_choice \u003d self.parent.parent.parent.getChild(\"DropdownMinClass\").props.value\n\texcept:\n\t\tmin_choice \u003d \"Message\"\n\t\n\tif min_choice \u003d\u003d \"Error\":\n\t\tclass_list \u003d [\"Error\"]\n\telif min_choice \u003d\u003d \"Warning\":\n\t\tclass_list \u003d [\"Error\",\"Warning\"]\n\telse:\n\t\tclass_list \u003d [\"Error\",\"Warning\",\"Message\"]\n\t\n\tcls1 \u003d class_list[0] if len(class_list)\u003e0 else None\n\tcls2 \u003d class_list[1] if len(class_list)\u003e1 else None\n\tcls3 \u003d class_list[2] if len(class_list)\u003e2 else None\n\t\n\t# Optional priorities CSV from self.custom.priorities\n\tpriorities_csv \u003d getattr(self.custom, \"priorities\", \"\") or \"\"\n\t\n\tsql \u003d u\"\"\"\n\tSELECT\n\t ae.id AS NumberID,\n\t ae.eventtime AS `Start Timestamp`,\n\t clr.eventtime AS `End Timestamp`,\n\t IFNULL(\n\t SEC_TO_TIME(TIMESTAMPDIFF(SECOND, ae.eventtime, clr.eventtime)),\n\t SEC_TO_TIME(TIMESTAMPDIFF(SECOND, ae.eventtime, NOW()))\n\t ) AS Duration,\n\t cls.strvalue AS Class,\n\t loc.strvalue AS Area,\n\t des.strvalue AS Description,\n\t tag.strvalue AS Tag\n\tFROM alarm_events ae\n\tLEFT JOIN alarm_events clr\n\t ON clr.eventid \u003d ae.eventid AND clr.eventtype \u003d 1\n\tLEFT JOIN alarm_event_data cls\n\t ON cls.id \u003d ae.id AND cls.propname \u003d \u0027Class\u0027\n\tLEFT JOIN alarm_event_data loc\n\t ON loc.id \u003d ae.id AND loc.propname \u003d \u0027Area\u0027\n\tLEFT JOIN alarm_event_data des\n\t ON des.id \u003d ae.id AND des.propname \u003d \u0027Description\u0027\n\tLEFT JOIN alarm_event_data tag\n\t ON tag.id \u003d ae.id AND tag.propname \u003d \u0027Tag\u0027\n\tWHERE\n\t ae.eventtype \u003d 0\n\t AND ae.eventtime BETWEEN ? AND ?\n\t AND (\n\t ( ? IS NOT NULL AND cls.strvalue \u003d ? )\n\t OR ( ? IS NOT NULL AND cls.strvalue \u003d ? )\n\t OR ( ? IS NOT NULL AND cls.strvalue \u003d ? )\n\t )\n\t AND ( ? \u003d \u0027\u0027 OR FIND_IN_SET(CAST(ae.priority AS CHAR), ?) \u003e 0 )\n\tORDER BY ae.eventtime DESC\n\t\"\"\"\n\t\n\t# ORDER MATTERS: must match the ? placeholders above\n\tparams \u003d [\n\t\tstart_dt, end_dt,\n\t\tcls1, cls1,\n\t\tcls2, cls2,\n\t\tcls3, cls3,\n\t\tpriorities_csv, priorities_csv\n\t]\n\t\n\trows \u003d system.db.runPrepQuery(sql, params, ds_name)\n\t\n\tdata \u003d []\n\tfor r in rows:\n\t\ttry:\n\t\t\tstart_s \u003d system.date.format(r[\"Start Timestamp\"], \"yyyy-MM-dd HH:mm:ss\") if r[\"Start Timestamp\"] else \"\"\n\t\t\tend_s \u003d system.date.format(r[\"End Timestamp\"], \"yyyy-MM-dd HH:mm:ss\") if r[\"End Timestamp\"] else \"\"\n\t\t\tdur_s \u003d str(r[\"Duration\"]) if r[\"Duration\"] is not None else \"\"\n\t\t\tdata.append(\n\t\t\t\tmk_row(\n\t\t\t\t\tnumber_id \u003d int(r[\"NumberID\"]) + 30000,\n\t\t\t\t\tstart_ts \u003d start_s,\n\t\t\t\t\tend_ts \u003d end_s,\n\t\t\t\t\tduration_hms\u003d dur_s,\n\t\t\t\t\tcls \u003d r[\"Class\"] or \"\",\n\t\t\t\t\tarea \u003d r[\"Area\"] or \"\",\n\t\t\t\t\tdesc_ \u003d r[\"Description\"] or \"\",\n\t\t\t\t\ttag_ \u003d r[\"Tag\"] or \"\"\n\t\t\t\t)\n\t\t\t)\n\t\texcept Exception as ex:\n\t\t\tsystem.perspective.print(\"Row shape error: %s\" % ex)\n\t\n\tself.props.data \u003d data"
} }
}, },
"props.columns[4].filter.string.value": {
"binding": {
"config": {
"path": ".../FlexContainer/FlexContainer/Dropdown.props.value"
},
"type": "property"
}
},
"props.data": { "props.data": {
"binding": { "binding": {
"config": { "config": {
"parameters": { "fallbackDelay": 2.5,
"location": "{.../FlexContainer/FlexContainer/Dropdown.props.value}", "mode": "direct",
"priority": "{.../FlexContainer/FlexContainer.custom.FilterStatus}" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsTable"
},
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/Active"
}, },
"transforms": [ "transforms": [
{ {
"code": "\tfrom system.dataset import toPyDataSet\n\t\n\tds \u003d toPyDataSet(value)\n\tdata \u003d []\n\t\n\tcolumn_names \u003d list(ds.columnNames)\n\t\n\tfor row in ds:\n\t\t# Get the style class from the Style column returned by SQL\n\t\tclassName \u003d row[\"Style\"]\n\t\t\n\t\t# Apply style to each cell individually (required for Ignition Perspective tables)\n\t\trow_dict \u003d {\n\t\t\tcol: {\n\t\t\t\t\"value\": row[col],\n\t\t\t\t\"style\": {\"classes\": className}\n\t\t\t} for col in column_names\n\t\t}\n\t\tdata.append(row_dict)\n\t\n\treturn data", "code": "\tfrom system.dataset import toPyDataSet\n\t\n\tif value is None:\n\t return []\n\t\n\tds \u003d toPyDataSet(value)\n\tcols \u003d list(ds.columnNames)\n\tdata \u003d []\n\t\n\tfor row in ds:\n\t className \u003d row[\"Style\"] # style class from the dataset\n\t\n\t row_dict \u003d {}\n\t for col in cols:\n\t row_dict[col] \u003d {\n\t \"value\": row[col],\n\t \"style\": {\"classes\": className}\n\t }\n\t data.append(row_dict)\n\t\n\treturn data",
"type": "script" "type": "script"
} }
], ],
"type": "query" "type": "tag"
} }
} }
}, },
@ -509,26 +515,7 @@
"boolean": "checkbox", "boolean": "checkbox",
"dateFormat": "MM/DD/YYYY", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "ID", "field": "NumberID",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -543,14 +530,9 @@
"style": { "style": {
"classes": "" "classes": ""
}, },
"title": "" "title": "Number (ID)"
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -594,33 +576,14 @@
"viewParams": {}, "viewParams": {},
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": 30 "width": 40
}, },
{ {
"align": "center", "align": "center",
"boolean": "checkbox", "boolean": "checkbox",
"dateFormat": "MM/DD/YYYY HH:mm:ss", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "StartTimestamp", "field": "EventTimestamp",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -638,11 +601,6 @@
"title": "Event Timestamp" "title": "Event Timestamp"
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -671,7 +629,7 @@
}, },
"render": "auto", "render": "auto",
"resizable": true, "resizable": true,
"sort": "none", "sort": "descending",
"sortable": true, "sortable": true,
"strictWidth": false, "strictWidth": false,
"style": { "style": {
@ -694,25 +652,6 @@
"dateFormat": "MM/DD/YYYY", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "Duration", "field": "Duration",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": true,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "equals",
"value": ""
},
"visible": "never"
},
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -727,14 +666,9 @@
"style": { "style": {
"classes": "" "classes": ""
}, },
"title": "Duration" "title": ""
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -761,7 +695,7 @@
} }
} }
}, },
"render": "string", "render": "auto",
"resizable": true, "resizable": true,
"sort": "none", "sort": "none",
"sortable": true, "sortable": true,
@ -778,7 +712,7 @@
"viewParams": {}, "viewParams": {},
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": 30 "width": 40
}, },
{ {
"align": "center", "align": "center",
@ -788,7 +722,8 @@
"field": "Priority", "field": "Priority",
"filter": { "filter": {
"boolean": { "boolean": {
"condition": "" "condition": "",
"value": ""
}, },
"date": { "date": {
"condition": "", "condition": "",
@ -800,10 +735,10 @@
"value": "" "value": ""
}, },
"string": { "string": {
"condition": "", "condition": "contains",
"value": "" "value": ""
}, },
"visible": "on-hover" "visible": "always"
}, },
"footer": { "footer": {
"align": "center", "align": "center",
@ -822,11 +757,6 @@
"title": "" "title": ""
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -880,20 +810,20 @@
"field": "Location", "field": "Location",
"filter": { "filter": {
"boolean": { "boolean": {
"condition": "" "condition": "",
"value": ""
}, },
"date": { "date": {
"condition": "", "condition": "",
"value": "" "value": ""
}, },
"enabled": false, "enabled": true,
"number": { "number": {
"condition": "", "condition": "",
"value": "" "value": ""
}, },
"string": { "string": {
"condition": "equals", "condition": "contains"
"value": ""
}, },
"visible": "never" "visible": "never"
}, },
@ -911,14 +841,9 @@
"style": { "style": {
"classes": "" "classes": ""
}, },
"title": "" "title": "Location"
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -962,7 +887,7 @@
"viewParams": {}, "viewParams": {},
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": 30 "width": 40
}, },
{ {
"align": "center", "align": "center",
@ -970,25 +895,6 @@
"dateFormat": "MM/DD/YYYY", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "Description", "field": "Description",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -1006,11 +912,6 @@
"title": "" "title": ""
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -1054,7 +955,7 @@
"viewParams": {}, "viewParams": {},
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": 100 "width": 250
}, },
{ {
"align": "center", "align": "center",
@ -1062,25 +963,6 @@
"dateFormat": "MM/DD/YYYY", "dateFormat": "MM/DD/YYYY",
"editable": false, "editable": false,
"field": "Tag", "field": "Tag",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": { "footer": {
"align": "center", "align": "center",
"justify": "left", "justify": "left",
@ -1093,17 +975,11 @@
"align": "center", "align": "center",
"justify": "center", "justify": "center",
"style": { "style": {
"classes": "", "classes": ""
"textAlign": "center"
}, },
"title": "Tag" "title": ""
}, },
"justify": "center", "justify": "center",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value", "number": "value",
"numberFormat": "0,0.##", "numberFormat": "0,0.##",
"progressBar": { "progressBar": {
@ -1147,7 +1023,7 @@
"viewParams": {}, "viewParams": {},
"viewPath": "", "viewPath": "",
"visible": true, "visible": true,
"width": 150 "width": 200
} }
], ],
"emptyMessage": { "emptyMessage": {
@ -1167,6 +1043,9 @@
"pager": { "pager": {
"activeOption": 100 "activeOption": 100
}, },
"sortOrder": [
"EventTimestamp"
],
"style": { "style": {
"margin": 25 "margin": 25
} }
@ -1305,17 +1184,17 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1763826888802 1766048391779
], ],
"$ts": 1763826888802 "$ts": 1766048391779
}, },
"startDate": { "startDate": {
"$": [ "$": [
"ts", "ts",
192, 192,
1763826888802 1766048391779
], ],
"$ts": 1763825088802 "$ts": 1766046591779
} }
}, },
"meta": { "meta": {
@ -1469,7 +1348,7 @@
} }
}, },
"props": { "props": {
"formattedValue": "Nov 13, 2025 1:00 PM", "formattedValue": "Dec 18, 2025 11:59 AM",
"minDate": { "minDate": {
"$": [ "$": [
"ts", "ts",
@ -1561,7 +1440,7 @@
} }
}, },
"props": { "props": {
"formattedValue": "Nov 13, 2025 1:30 PM", "formattedValue": "Dec 18, 2025 12:29 PM",
"style": { "style": {
"margin": 15 "margin": 15
}, },
@ -1569,9 +1448,9 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1763826888802 1766048391779
], ],
"$ts": 1763826888802 "$ts": 1766048391779
} }
}, },
"type": "ia.input.date-time-input" "type": "ia.input.date-time-input"
@ -2618,22 +2497,6 @@
"pager": { "pager": {
"activeOption": 100 "activeOption": 100
}, },
"selection": {
"data": [
{
"Count": 1,
"Description": "S03_CH105 - Jammed",
"Duration": "00:00:54",
"FirstTimestamp": "Sat Nov 22 2025 19:52:00 GMT+0400 (Georgia Standard Time)",
"LastTimestamp": "Sat Nov 22 2025 19:52:00 GMT+0400 (Georgia Standard Time)",
"Location": "MCM02",
"Priority": "High",
"Tag": "[MCM02]S03_CH105.HMI.Alarm.Jammed"
}
],
"selectedColumn": "Location",
"selectedRow": 0
},
"sortOrder": [ "sortOrder": [
"Count" "Count"
], ],
@ -2837,17 +2700,17 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1763828603077 1766048391779
], ],
"$ts": 1763828603077 "$ts": 1766048391779
}, },
"startDate": { "startDate": {
"$": [ "$": [
"ts", "ts",
192, 192,
1763828603077 1766048391779
], ],
"$ts": 1763821403077 "$ts": 1766046591779
} }
}, },
"meta": { "meta": {
@ -3114,9 +2977,9 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1763828603077 1766048391779
], ],
"$ts": 1763828603077 "$ts": 1766048391779
} }
}, },
"scripts": { "scripts": {
@ -5071,7 +4934,6 @@
"contentStyle": { "contentStyle": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"
}, },
"currentTabIndex": 1,
"menuType": "modern", "menuType": "modern",
"style": { "style": {
"classes": "Background-Styles/Grey-Background" "classes": "Background-Styles/Grey-Background"

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-22T15:11:10Z" "timestamp": "2025-12-01T18:30:14Z"
}, },
"lastModificationSignature": "0e81bcf03e5c169b0aa5e2cc5f9378dbdb3b6ed9a8bd430160c1eedbe44538f0" "lastModificationSignature": "cf00c87c68b278053dc942bcf000ce58c5600b5006ca172f83c8ba468c45c38e"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -9,9 +9,9 @@
], ],
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "external",
"timestamp": "2025-11-22T15:53:51Z" "timestamp": "2025-12-01T13:20:02Z"
}, },
"lastModificationSignature": "3f3759ffe0e6259186e01372e4bbf723569e56030c5beea9b7b72ed006164cee" "lastModificationSignature": "c8400dd4a30fa77ea1c0da83ecd2616f93f264c3babd00d12524f06391feb86d"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-13T10:25:59Z" "timestamp": "2025-12-18T10:25:34Z"
}, },
"lastModificationSignature": "6768dd271b00071b34a3a5eca235cd8a91879b0e6097fe51ce5dbe7aa38ea1c2" "lastModificationSignature": "2b7d093487d5db0cc064786df900dd18c4c47a7fbd6cb67182c4e0a8d6923867"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -541,36 +541,20 @@
"grow": 1 "grow": 1
}, },
"propConfig": { "propConfig": {
"custom.key": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
},
"type": "query"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
"polling": { "fallbackDelay": 2.5,
"enabled": true, "mode": "direct",
"rate": "3" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
}, },
"transforms": [ "transforms": [
{ {
"code": "\ttotal \u003d sum(\n\t row[\"Count\"]\n\t for row in value\n\t if \"Count\" in row\n\t and row[\"Count\"] is not None\n\t and row.get(\"Priority\") in (\"Medium\", \"High\")\n\t)\n\treturn total", "code": "\tds \u003d value\n\ttotal \u003d 0\n\t\t\n\tif ds is not None:\n\t\tfor i in range(ds.rowCount):\n\t\t\tpriority \u003d ds.getValueAt(i, \"Priority\")\n\t\t\tcount \u003d ds.getValueAt(i, \"Count\")\n\t\n\t\t\tif priority in (\"Medium\", \"High\") and count is not None:\n\t\t\t\ttotal +\u003d count\n\t\n\treturn total\n",
"type": "script" "type": "script"
} }
], ],
"type": "query" "type": "tag"
} }
} }
}, },

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-13T12:56:40Z" "timestamp": "2025-12-18T10:32:59Z"
}, },
"lastModificationSignature": "ffc72665f95ddace54e413d754fbd30ab2cf6ab1af0f1310d8969bd42a71b2c9" "lastModificationSignature": "1fb604f929498fa98cc47bda5734448bd71e5d773a57a620be06287ec2a0325c"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-08T15:32:26Z" "timestamp": "2025-12-18T11:17:12Z"
}, },
"lastModificationSignature": "90fc1806e908953a152be658af0eee857143ad53da933471d4e6436814223338" "lastModificationSignature": "2f16b910dff748b1567e863d7ba5b62a45a7eafc112ffb951f28936c0c70cc3c"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -3,100 +3,42 @@
"counts": { "counts": {
"Critical": 0, "Critical": 0,
"Diagnostic": 0, "Diagnostic": 0,
"High": 23, "High": 2,
"Low": 10, "Low": 0,
"Medium": 2, "Medium": 1,
"Total": 35 "Total": 3
},
"totalAlarms": {
"$": [
"ds",
192,
1762615945788
],
"$columns": [
{
"data": [
"MCM01",
"MCM01",
"MCM01",
"MCM02",
"MCM02"
],
"name": "Location",
"type": "String"
},
{
"data": [
"High",
"Low",
"Medium",
"High",
"Medium"
],
"name": "Priority",
"type": "String"
},
{
"data": [
23,
10,
2,
9,
1
],
"name": "Count",
"type": "Long"
}
]
} }
}, },
"params": { "params": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"value": { "value": {
"tagProps": [ "tagProps": [
"MCM01", "MCM01"
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
] ]
} }
}, },
"propConfig": { "propConfig": {
"custom.counts": {
"persistent": true
},
"custom.totalAlarms": { "custom.totalAlarms": {
"binding": { "binding": {
"config": { "config": {
"polling": { "fallbackDelay": 2.5,
"enabled": true, "mode": "direct",
"rate": "3" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
}, },
"type": "query" "type": "tag"
}, },
"onChange": { "onChange": {
"enabled": null, "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" "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# Safety check\n\tif queryData is None or queryData.rowCount \u003d\u003d 0:\n\t self.custom.counts \u003d counts\n\t return\n\t\n\t# Loop through dataset\n\tfor row in range(queryData.rowCount):\n\t location \u003d queryData.getValueAt(row, \"Location\")\n\t priority \u003d queryData.getValueAt(row, \"Priority\")\n\t count \u003d queryData.getValueAt(row, \"Count\")\n\t\n\t if location \u003d\u003d MCM:\n\t key \u003d priority.capitalize()\n\t if key in counts:\n\t counts[key] +\u003d count\n\t counts[\"Total\"] +\u003d count\n\t\n\t# Write result\n\tself.custom.counts \u003d counts\n"
}, }
},
"params.classes": {
"paramDirection": "input",
"persistent": true "persistent": true
}, },
"params.value": { "params.value": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": true
},
"params.value.tagProps": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.print(currentValue.value[0])"
}
} }
}, },
"props": { "props": {
@ -111,14 +53,23 @@
"children": [ "children": [
{ {
"meta": { "meta": {
"name": "Label_0" "name": "High_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "High" "text": "High"
@ -127,14 +78,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_1" "name": "Med_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Med" "text": "Med"
@ -143,14 +103,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_2" "name": "Low_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Low" "text": "Low"
@ -159,14 +128,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_3" "name": "Diag_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Diag" "text": "Diag"
@ -175,14 +153,23 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_4" "name": "Total_Label"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
}
},
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
}, },
"text": "Total" "text": "Total"
@ -191,7 +178,7 @@
} }
], ],
"meta": { "meta": {
"name": "FlexContainer" "name": "FlexContainer_Header"
}, },
"position": { "position": {
"basis": "25px" "basis": "25px"
@ -205,12 +192,20 @@
"children": [ "children": [
{ {
"meta": { "meta": {
"name": "Label_0" "name": "High_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -222,7 +217,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -230,12 +224,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_1" "name": "Med_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -247,7 +249,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -255,12 +256,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_2" "name": "Low_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -272,7 +281,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -280,12 +288,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_3" "name": "Diag_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -297,7 +313,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -305,12 +320,20 @@
}, },
{ {
"meta": { "meta": {
"name": "Label_4" "name": "Total_Value"
}, },
"position": { "position": {
"basis": "32px" "basis": "32px"
}, },
"propConfig": { "propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.classes"
},
"type": "property"
}
},
"props.text": { "props.text": {
"binding": { "binding": {
"config": { "config": {
@ -322,7 +345,6 @@
}, },
"props": { "props": {
"style": { "style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center" "textAlign": "center"
} }
}, },
@ -330,7 +352,7 @@
} }
], ],
"meta": { "meta": {
"name": "FlexContainer_1" "name": "FlexContainer_Values"
}, },
"position": { "position": {
"basis": "25px" "basis": "25px"
@ -341,73 +363,6 @@
"type": "ia.container.flex" "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": { "props": {
"direction": "column" "direction": "column"
}, },

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-08T15:32:25Z" "timestamp": "2025-12-18T10:43:16Z"
}, },
"lastModificationSignature": "cb3fc9375f5ecb934aa8fca204aa5929c1c02a4829aad59d9e77fc0178e8c4a8" "lastModificationSignature": "ff5f0a9e15a3c1f6c06117ffd252a7b2c6dfa1b80831df53359a2f13923adf05"
} }
} }

View File

@ -4,25 +4,19 @@
"$": [ "$": [
"ds", "ds",
192, 192,
1762615945641 1766054596663
], ],
"$columns": [ "$columns": [
{ {
"data": [ "data": [
"MCM01", "MCM01",
"MCM01", "MCM01"
"MCM01",
"MCM02",
"MCM02"
], ],
"name": "Location", "name": "Location",
"type": "String" "type": "String"
}, },
{ {
"data": [ "data": [
"High",
"Low",
"Medium",
"High", "High",
"Medium" "Medium"
], ],
@ -31,14 +25,11 @@
}, },
{ {
"data": [ "data": [
23,
10,
2, 2,
9,
1 1
], ],
"name": "Count", "name": "Count",
"type": "Long" "type": "Integer"
} }
] ]
}, },
@ -64,13 +55,11 @@
"custom.state": { "custom.state": {
"binding": { "binding": {
"config": { "config": {
"polling": { "fallbackDelay": 2.5,
"enabled": true, "mode": "direct",
"rate": "1" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsByLocationAndPriority"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
}, },
"type": "query" "type": "tag"
}, },
"onChange": { "onChange": {
"enabled": null, "enabled": null,

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-22T15:11:01Z" "timestamp": "2025-12-18T11:09:48Z"
}, },
"lastModificationSignature": "e4e91693dd7c13d8d1b17ca6434b52f8ff918353bc8bb35a81093ecfd618ec5e" "lastModificationSignature": "395945bf199a2cba477fdf8dced339a85684e3a85e17ecd384c0f47c2b1f4442"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -3,7 +3,7 @@
"params": { "params": {
"Status": "", "Status": "",
"tagProps": [ "tagProps": [
"MCM01", "MCM02",
"value", "value",
"value", "value",
"value", "value",
@ -295,17 +295,13 @@
"config": { "config": {
"path": "/root.custom.counts" "path": "/root.custom.counts"
}, },
"transforms": [ "enabled": false,
{
"code": "\tfor v in value.values():\n\t\tif v \u003e 0:\n\t\t\treturn \"red\"\n\treturn \"\"",
"type": "script"
}
],
"type": "property" "type": "property"
} }
} }
}, },
"props": { "props": {
"color": "#FFF9F9",
"path": "material/notifications_active", "path": "material/notifications_active",
"style": { "style": {
"classes": "", "classes": "",
@ -347,297 +343,44 @@
{ {
"children": [ "children": [
{ {
"children": [
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "High",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "Medium",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "Low",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"text": "Diag",
"textStyle": {
"fontSize": 10
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"fontSize": 10
},
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0
},
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0,
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0,
"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": {
"style": {
"fontSize": 10,
"textAlign": "center"
},
"text": 0,
"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": { "meta": {
"name": "FlexContainer" "name": "EmbeddedView"
}, },
"position": { "position": {
"basis": "334px" "basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.value.tagProps[0]": {
"binding": {
"config": {
"expression": "{view.params.tagProps[0]}"
},
"type": "expr"
}
}
}, },
"props": { "props": {
"direction": "column" "params": {
"classes": "Text-Styles/Ariel-Bold-White-12pt",
"value": {
"tagProps": [
null,
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"path": "autStand/Equipment/Controller-Views/CommandControlAlarms"
}, },
"type": "ia.container.flex" "type": "ia.display.view"
} }
], ],
"meta": { "meta": {
@ -656,15 +399,6 @@
"type": "ia.container.flex" "type": "ia.container.flex"
} }
], ],
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 0,
"High": 0,
"Low": 0,
"Medium": 0
}
},
"events": { "events": {
"dom": { "dom": {
"onClick": { "onClick": {
@ -688,14 +422,6 @@
"type": "property" "type": "property"
} }
}, },
"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_display": { "custom.area_display": {
"binding": { "binding": {
"config": { "config": {
@ -704,12 +430,6 @@
"type": "expr" "type": "expr"
} }
}, },
"custom.counts": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.sendMessage(\"update-alarm-count\", self.custom.counts, \"view\")"
}
},
"custom.plc_dict": { "custom.plc_dict": {
"binding": { "binding": {
"config": { "config": {
@ -729,34 +449,12 @@
"type": "tag" "type": "tag"
} }
}, },
"custom.table": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/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(\"Errors: \" + str(e))"
}
},
"custom.totalJams": { "custom.totalJams": {
"binding": { "binding": {
"config": { "config": {
"parameters": { "fallbackDelay": 2.5,
"location": "{this.custom.MCM}", "mode": "direct",
"priority": "3" "tagPath": "[BNA8_SCADA_TAG_PROVIDER]System/Queries/Alarms/ActiveAlarmsTable"
},
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/Active"
}, },
"transforms": [ "transforms": [
{ {
@ -764,7 +462,7 @@
"type": "script" "type": "script"
} }
], ],
"type": "query" "type": "tag"
} }
}, },
"meta.visible": { "meta.visible": {

View File

@ -10,8 +10,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-12-01T12:31:54Z" "timestamp": "2025-12-02T16:33:24Z"
}, },
"lastModificationSignature": "66448e62c25ca2b4f4effc70f71830fd61d812cf777e1fb1c766aaca1610fdb8" "lastModificationSignature": "3389e38c32d5f7f28cf8f5dfa7c7f27049f15f117c45e51e7947f82ef62538ba"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

View File

@ -9,8 +9,8 @@
"attributes": { "attributes": {
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-12-01T09:40:22Z" "timestamp": "2025-12-18T10:03:18Z"
}, },
"lastModificationSignature": "1001966be8615a467cfcc11efeab3990eefdbf6fa56f9bd0f92fcecee0376913" "lastModificationSignature": "304e2619ee1bf0dd216a946a3cdc293852a2fb6d997304b2f806d2122b155b4e"
} }
} }

View File

@ -1,11 +1,5 @@
SELECT WITH jam_data AS (
jd.Name, /* TRUE JAM COUNTS PER DEVICE */
ROUND((jd.Jam_count / totals.Total_jams) * 100, 2) AS Jam_percentage
FROM
(
/* ---------------------------
TRUE JAM COUNTS PER DEVICE
--------------------------- */
SELECT SELECT
Name, Name,
COUNT(*) AS Jam_count COUNT(*) AS Jam_count
@ -20,7 +14,7 @@ FROM
UNION ALL UNION ALL
/* DEVICE JAMS EDGE DETECT */ /* DEVICE JAMS EDGE DETECT */
SELECT SELECT
Name, Name,
t_stamp t_stamp
@ -39,58 +33,30 @@ FROM
ORDER BY Name, t_stamp ORDER BY Name, t_stamp
) AS x ) AS x
WHERE Jam = 1 AND prevJam = 0 WHERE Jam = 1 AND prevJam = 0
) all_jams
) AS all_jams
GROUP BY Name GROUP BY Name
) AS jd ),
CROSS JOIN total AS (
( SELECT SUM(Jam_count) AS Total_jams
/* --------------------------- FROM jam_data
TOTAL JAM COUNT FOR PERCENT )
--------------------------- */
SELECT
SUM(Jam_count) AS Total_jams
FROM
(
/* repeat jam count block */
SELECT
Name,
COUNT(*) AS Jam_count
FROM
(
/* AREA JAMS */
SELECT
Name,
t_stamp
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
UNION ALL SELECT
jd.Name,
ROUND((jd.Jam_count / t.Total_jams) * 100, 2) AS Jam_percentage
FROM jam_data jd
JOIN total t
WHERE t.Total_jams > 0
/* DEVICE JAMS — EDGE DETECT */ UNION ALL
SELECT
Name,
t_stamp
FROM
(
SELECT
Name,
t_stamp,
Jam,
IF(@lastName2 = Name, @prevJam2, 0) AS prevJam,
@prevJam2 := Jam,
@lastName2 := Name
FROM lane_data
JOIN (SELECT @prevJam2 := 0, @lastName2 := '') AS v2
WHERE t_stamp BETWEEN :starttime AND :endtime
ORDER BY Name, t_stamp
) AS x2
WHERE Jam = 1 AND prevJam = 0
) AS all_jams2 /* FALLBACK IF NOTHING EXISTS */
GROUP BY Name SELECT
) AS summed 'N/A' AS Name,
) AS totals 0 AS Jam_percentage
WHERE NOT EXISTS (
SELECT 1 FROM jam_data
)
ORDER BY Jam_percentage DESC; ORDER BY Jam_percentage DESC;

View File

@ -18,7 +18,7 @@
"cacheEnabled": false, "cacheEnabled": false,
"database": "MariaDB", "database": "MariaDB",
"fallbackEnabled": false, "fallbackEnabled": false,
"lastModificationSignature": "c5386e2acc8b8fd40948d7ef5d5a75534f3d7487e80af0ebdc94ad99dc5d2c4c", "lastModificationSignature": "8303df5f4219c83f85056a5d43f280b6b570026b3869dc638d05d4e6f0999825",
"permissions": [ "permissions": [
{ {
"zone": "", "zone": "",
@ -27,7 +27,7 @@
], ],
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-25T10:20:37Z" "timestamp": "2025-12-02T16:23:03Z"
}, },
"parameters": [ "parameters": [
{ {

View File

@ -0,0 +1,59 @@
WITH jam_data AS (
/* -------------------------------------------------------
JAM COUNT PER DEVICE (correct rising-edge detection)
------------------------------------------------------- */
SELECT
Name,
COUNT(*) AS Jam_count
FROM
(
/* AREA JAMS */
SELECT
Name,
t_stamp
FROM jam_area
WHERE t_stamp BETWEEN :starttime AND :endtime
UNION ALL
/* DEVICE JAMS — TRUE RISING EDGE */
SELECT
Name,
t_stamp
FROM
(
SELECT
Name,
t_stamp,
Jam,
IF(@lastName = Name, @prevJam, 0) AS prevJam,
@prevJam := Jam,
@lastName := Name
FROM lane_data
JOIN (SELECT @prevJam := 0, @lastName := '') AS vars
WHERE t_stamp BETWEEN :starttime AND :endtime
ORDER BY Name, t_stamp
) AS x
WHERE Jam = 1 AND prevJam = 0
) AS all_jams
GROUP BY Name
)
SELECT
jd.Name,
ROUND(
(jd.Jam_count * 3600.0)
/ NULLIF(TIMESTAMPDIFF(SECOND, :starttime, :endtime), 0),
2
) AS Jam_rate
FROM jam_data jd
UNION ALL
/* FALLBACK — RETURN ONLY WHEN JAM_DATA IS EMPTY */
SELECT
'N/A' AS Name,
0 AS Jam_rate
WHERE NOT EXISTS (SELECT 1 FROM jam_data)
ORDER BY Jam_rate DESC, Name ASC;

View File

@ -18,7 +18,7 @@
"cacheEnabled": false, "cacheEnabled": false,
"database": "MariaDB", "database": "MariaDB",
"fallbackEnabled": false, "fallbackEnabled": false,
"lastModificationSignature": "93cde479e5213e13573c3183cad71afe3196a719abd08cd47eeec13dd046e2f3", "lastModificationSignature": "bb08bda6a0e41ed5e24f6feb72814d767c14ec39dd89bcdb4150b19deae64366",
"permissions": [ "permissions": [
{ {
"zone": "", "zone": "",
@ -27,9 +27,8 @@
], ],
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-11-19T14:31:11Z" "timestamp": "2025-12-02T16:32:25Z"
}, },
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [ "parameters": [
{ {
"type": "Parameter", "type": "Parameter",

View File

@ -0,0 +1,29 @@
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
sInduction_Name AS `Induction Name`,
COALESCE(SUM(diTotal_Single_Carrier), 0) AS `Total Single Carrier`,
COALESCE(SUM(diTotal_Double_Carrier), 0) AS `Total Double Carrier`,
COALESCE(SUM(diTotal_Single_Carrier), 0) + COALESCE(SUM(diTotal_Double_Carrier), 0) AS `Total`
FROM induction_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND (sInduction_Name = :inductionname OR :inductionname IS NULL OR :inductionname = '')
GROUP BY DATE(t_stamp), HOUR(t_stamp), sInduction_Name
UNION ALL
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS `Start Timestamp`,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS `Hour`,
'S03' AS `Induction Name`,
COUNT(*) AS `Total Single Carrier`,
0 AS `Total Double Carrier`,
COUNT(*) AS `Total`
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
ORDER BY `Start Timestamp` ASC;

View File

@ -18,7 +18,7 @@
"cacheEnabled": false, "cacheEnabled": false,
"database": "MariaDB", "database": "MariaDB",
"fallbackEnabled": false, "fallbackEnabled": false,
"lastModificationSignature": "d6ae98b57c685eaca4465716cb0357ef2fdd8cc9b8565b920f218799fbb9e01a", "lastModificationSignature": "72f4bf22d47cf5750797d0f92bd9a0acab66194442f363ed17c2862d4e1e05c0",
"permissions": [ "permissions": [
{ {
"zone": "", "zone": "",
@ -27,7 +27,7 @@
], ],
"lastModification": { "lastModification": {
"actor": "admin", "actor": "admin",
"timestamp": "2025-12-01T08:22:54Z" "timestamp": "2025-12-02T11:01:47Z"
}, },
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider", "syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [ "parameters": [
@ -38,13 +38,13 @@
}, },
{ {
"type": "Parameter", "type": "Parameter",
"identifier": "inductionname", "identifier": "endtime",
"sqlType": 7 "sqlType": 8
}, },
{ {
"type": "Parameter", "type": "Parameter",
"identifier": "endtime", "identifier": "inductionname",
"sqlType": 8 "sqlType": 7
} }
] ]
} }

View File

@ -1,24 +0,0 @@
SELECT
CONCAT(DATE(t_stamp), ' ', HOUR(t_stamp), ':00') AS StartTimestamp,
CONCAT(
'H',
TIMESTAMPDIFF(
HOUR,
DATE_FORMAT(t_stamp, "%Y-%m-%d %H:00:00"),
DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00")
)
) AS Hour,
'S03' AS sInduction_Name,
COUNT(*) AS Total_count
FROM item_data
WHERE t_stamp BETWEEN :starttime AND :endtime
AND adiSort_Code_0 NOT IN (11, 15)
AND sLocation_ID LIKE 'S03%'
AND (:inductionname IS NULL OR :inductionname = '' OR :inductionname = 'S03')
GROUP BY DATE(t_stamp), HOUR(t_stamp)
ORDER BY StartTimestamp ASC;

View File

@ -1,6 +0,0 @@
SELECT concat(date(alltable.t_stamp), ' ', hour(alltable.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(alltable.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(cast(COUNT(*) as char),' pph') AS Total_pph
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(alltable.t_stamp)

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