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>
15 lines
350 B
Python
15 lines
350 B
Python
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"
|
|
)
|