I’m curious, if that provides the same function as system.tag.queryTagHistory, why not just use system.tag.queryTagHistory?
Also what is the streamingDatasetWriter?
I’m fairly new to Ignition and have done quite a bit of scripting with tags and tag history, I’m wondering what there is to gain with your method. Sorry I know this doesn’t answer your question
To do this, you would just use a BasicStreamingDataset - although in your case, I think a custom StreamingDatasetWriter would be better - though you could try just overriding write() on BasicStreamingDataset. You'll need to update the dataList and qualityList fields inside the dataset. By overriding write, you could match multiple streamed rows by the timestamp.
@mazeyrat is doing module development - so this is actual Java code directly against the API.
@PGriffith thanks a lot, overrinding seem to be a good solution to merge data.
But what do you mean by You’ll need to update the dataList and qualityList fields inside the dataset.
I need to create new fields ? I can’t modify the raw data inside the datset ?
write method only append a new row ?
Another question,
if I use a BasicStreamingDataset with TagManager::queryHistory,
when the function return, all the data are available in the dataset or I need to override finish() method to be notified ?
Can I use a StreamingDataset class with TagManager::queryHistory and use readFully() to wait until all the data are available ?
Ok I think I've understood what you mean with the overriding of write method of the BasicStreamingDataset.
I will keep row in a buffer as long as the date is the same and flush the row when the date change.
The default implementation of write in BasicStreamingDataset just adds each data and quality array to fields on the class - dataList and qualityList. If you override write, you can keep the rest of the class working fine as long as you take responsibility for updating those lists yourself. The definitions are pretty simple:
If you use the TagHistoryQueryFlags.NO_INTERPOLATION flag, it won’t include any rows that only have interpolated values. Then, you can set your return size to be based on the smallest amount of time you would ever see changing values (typically 1 second).
For example, if you query for 1 day and request 86400 results, but have NO_INTERPOLATION set, what you should get is a row at a 1 second resolution each time any of the values in that row have changed. If you didn’t have the flag, you would of course get a row for each second of the day.
Flag.and() doesn’t mutate the object, it returns a new one. So try: flags = Flags.of(TagHistoryQueryFlags.BOUNDING_VALUES_YES, TagHistoryQueryFlags.NO_INTERPOLATION, TagHistoryQueryFlags.NO_SCANCLASS_VALIDATION);