I am trying to implement a Custom History Provider. I cannot get the correct values (1 for each) to return in MinMax when displaying the data to a chart or a table.
Expected: (using SQL Lite historian)
Actual: (My History Provider)
Code:
Essentially what I am doing is adding the Minimum aggregate then the Maximum aggregate to the history column
for (var entrySet : tagConfigByTagId.entrySet()){
var values = valuesByTag.get(entrySet.getKey());
if (values != null){
var tagConfig = entrySet.getValue();
var column = columnNodesByName.get(tagConfig.getPath().toStringFull());
if (column instanceof ProcessedHistoryColumn){
List<QualifiedValue> qualifiedValues = new ArrayList<>();
for (var aggregateValues : values.getAggregates().values()){
for (var value : aggregateValues.getValues()){
qualifiedValues.add(new BasicQualifiedValue(value.getValue(), QualityCode.getQualityFor(value.getOpcQuality()), Utility.FormatAsLocalDate(value.getUtcTimestamp())));
}
}
((ProcessedHistoryColumn)column).put(qualifiedValues);
}
}
}