use of com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.IdPointValueStatisticsQuantizerCsvCallback in project ma-modules-public by infiniteautomation.
the class IdPointValueRollupCalculator method generateStream.
/* (non-Javadoc)
* @see com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.AbstractPointValueRollupCalculator#generateStream(org.joda.time.DateTime, org.joda.time.DateTime, com.serotonin.m2m2.web.mvc.rest.v1.csv.CSVPojoWriter)
*/
@Override
protected void generateStream(DateTime from, DateTime to, CSVPojoWriter<PointValueTimeModel> writer) {
BucketCalculator bc = this.getBucketCalculator(from, to);
IdPointValueStatisticsQuantizerCsvCallback callback = new IdPointValueStatisticsQuantizerCsvCallback(writer.getWriter(), this.voMap, this.useRendered, this.unitConversion, this.rollup, this.dateTimeFormat, timezone);
Iterator<Integer> it = this.voMap.keySet().iterator();
ParentDataQuantizer quantizer = new ParentDataQuantizer(bc, callback);
while (it.hasNext()) {
DataPointVO vo = this.voMap.get(it.next());
DataValue startValue = this.getStartValue(vo.getId());
if (vo.getPointLocator().getDataTypeId() == DataTypes.NUMERIC) {
quantizer.startQuantizer(vo.getId(), startValue, new AnalogStatisticsChildQuantizer(vo.getId(), quantizer));
} else {
quantizer.startQuantizer(vo.getId(), startValue, new ValueChangeCounterChildQuantizer(vo.getId(), quantizer));
}
}
this.calculate(quantizer, from, to);
}
Aggregations