From 11b84c27d7078382f9cf10de9daebca6c7e9494c Mon Sep 17 00:00:00 2001 From: dohertj2 Date: Sun, 22 Feb 2026 05:28:30 -0500 Subject: [PATCH] Add flow rate popup and low priority alarms - Create FlowRatePopup view with time series chart for prefilter flow rate - Add onClick event to GPM label in Home view to open popup - Add Low priority alarms to PrimaryValveClosedInd, PumpInd, SedimentFilterValveOpenInd Co-Authored-By: Claude Opus 4.6 --- .../tag-type-definition/default/udts.json | 33 ++++- .../views/FlowRatePopup/resource.json | 13 ++ .../views/FlowRatePopup/view.json | 138 ++++++++++++++++++ .../views/Home/view.json | 16 +- 4 files changed, 195 insertions(+), 5 deletions(-) create mode 100644 projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/resource.json create mode 100644 projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/view.json diff --git a/config/resources/core/ignition/tag-type-definition/default/udts.json b/config/resources/core/ignition/tag-type-definition/default/udts.json index 844073d..6b7dee5 100644 --- a/config/resources/core/ignition/tag-type-definition/default/udts.json +++ b/config/resources/core/ignition/tag-type-definition/default/udts.json @@ -173,7 +173,16 @@ "opcServer": { "bindType": "parameter", "binding": "{OpcServer}" - } + }, + "alarms": [ + { + "setpointA": 1.0, + "name": "Alarm", + "label": "Primary valve closed", + "priority": "Low", + "ackMode": "Auto" + } + ] }, { "valueSource": "expr", @@ -217,7 +226,16 @@ "opcServer": { "bindType": "parameter", "binding": "{OpcServer}" - } + }, + "alarms": [ + { + "setpointA": 1.0, + "name": "Alarm", + "label": "Pump running", + "priority": "Low", + "ackMode": "Auto" + } + ] }, { "valueSource": "opc", @@ -341,7 +359,16 @@ "opcServer": { "bindType": "parameter", "binding": "{OpcServer}" - } + }, + "alarms": [ + { + "setpointA": 1.0, + "name": "Alarm", + "label": "Sediment filter valve opened", + "priority": "Low", + "ackMode": "Auto" + } + ] }, { "valueSource": "expr", diff --git a/projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/resource.json b/projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/resource.json new file mode 100644 index 0000000..449e7f7 --- /dev/null +++ b/projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/resource.json @@ -0,0 +1,13 @@ +{ + "scope": "G", + "version": 1, + "restricted": false, + "files": ["view.json"], + "attributes": { + "lastModificationSignature": "", + "lastModification": { + "actor": "external", + "timestamp": "2026-02-22T00:00:00Z" + } + } +} diff --git a/projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/view.json b/projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/view.json new file mode 100644 index 0000000..237cc2c --- /dev/null +++ b/projects/watermeter/com.inductiveautomation.perspective/views/FlowRatePopup/view.json @@ -0,0 +1,138 @@ +{ + "custom": {}, + "params": {}, + "props": { + "defaultSize": { + "width": 800, + "height": 500 + } + }, + "root": { + "children": [ + { + "meta": { + "name": "TimeSeriesChart" + }, + "position": { + "basis": "500px", + "grow": 1 + }, + "propConfig": { + "props.series[0].data": { + "binding": { + "config": { + "aggregate": "Average", + "avoidScanClassValidation": true, + "dateRange": { + "mostRecent": "1", + "mostRecentUnits": "HOUR" + }, + "enableValueCache": true, + "ignoreBadQuality": false, + "polling": { + "enabled": true, + "rate": "30" + }, + "preventInterpolation": false, + "returnFormat": "Wide", + "returnSize": { + "delay": "1", + "delayUnits": "MIN", + "type": "INTERVAL" + }, + "tags": [ + { + "alias": "Flow Rate", + "path": "[CoreDB/ignition-ignition:default]watermeter/prefilterflowrate" + } + ], + "valueFormat": "DATASET" + }, + "type": "tag-history" + } + } + }, + "props": { + "defaultStyles": { + "colors": [ + "#0000FF" + ] + }, + "legend": { + "position": "right", + "style": { + "color": "#000000" + }, + "visible": true + }, + "series": [ + { + "name": "Flow Rate" + } + ], + "style": { + "color": "#000000" + }, + "timeAxis": { + "color": "#000000", + "grid": { + "color": "#000000" + }, + "style": { + "color": "#000000" + }, + "tick": { + "color": "#000000", + "label": { + "font": { + "color": "#000000" + } + } + } + }, + "timeRange": { + "dateFormat": "MM-DD-YYYY", + "timeFormat": "h:mm:ss A" + }, + "title": { + "font": { + "color": "#000000" + }, + "height": 20, + "style": { + "color": "#000000" + }, + "text": "Prefilter Flow Rate (GPM)", + "visible": true + }, + "xTrace": { + "infoBox": { + "dateFormat": "MM-DD-YYYY", + "fill": { + "color": "#FFFFFF" + }, + "font": { + "color": "#000000" + }, + "stroke": { + "color": "#000000" + }, + "timeFormat": "h:mm:ss A" + }, + "line": { + "color": "#000000" + } + } + }, + "type": "ia.chart.timeseries" + } + ], + "meta": { + "name": "root" + }, + "props": { + "direction": "column" + }, + "type": "ia.container.flex" + } +} diff --git a/projects/watermeter/com.inductiveautomation.perspective/views/Home/view.json b/projects/watermeter/com.inductiveautomation.perspective/views/Home/view.json index 2ca3eff..b27bca7 100644 --- a/projects/watermeter/com.inductiveautomation.perspective/views/Home/view.json +++ b/projects/watermeter/com.inductiveautomation.perspective/views/Home/view.json @@ -1287,10 +1287,22 @@ "style": { "backgroundColor": "#D5D5D5", "margin": 5, - "textAlign": "center" + "textAlign": "center", + "cursor": "pointer" } }, - "type": "ia.display.label" + "type": "ia.display.label", + "events": { + "dom": { + "onClick": { + "config": { + "script": "system.perspective.openPopup('flowRatePopup', 'FlowRatePopup', params={}, title='Flow Rate History', modal=True)" + }, + "scope": "G", + "type": "script" + } + } + } } ], "meta": {