Add time range buttons (1H/6H/24H) to flow rate popup

Replace static tag-history binding with expression binding using
runScript to call flowrate.queryHistory(), which dynamically queries
tag history based on the selected time range. Buttons highlight
blue when active, grey when inactive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dohertj2
2026-02-22 06:07:14 -05:00
parent 6ee1c9e522
commit f78c290074
3 changed files with 39 additions and 74 deletions

View File

@@ -0,0 +1,14 @@
def queryHistory(timeHours):
from java.util import Date
end = Date()
start = Date(end.getTime() - long(timeHours * 3600000))
return system.tag.queryTagHistory(
paths=["[CoreDB/ignition-ignition:default]watermeter/prefilterflowrate"],
startDate=start,
endDate=end,
returnSize=120,
aggregationMode="Average",
returnFormat="Wide"
)