use of com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NonNumericPointValueStatisticsQuantizerCsvCallback in project ma-modules-public by infiniteautomation.
the class AbstractPointValueRollupCalculator method createQuantizer.
/**
* Create the proper quantizer for csv generation
* @param vo
* @param startValue
* @param bc
* @param writer
* @return
*/
protected AbstractDataQuantizer createQuantizer(DataPointVO vo, DataValue startValue, BucketCalculator bc, CSVPojoWriter<T> writer, boolean writeXidColumn, boolean writeHeaders) {
if (vo.getPointLocator().getDataTypeId() == DataTypes.NUMERIC) {
return new AnalogStatisticsQuantizer(bc, startValue, new NumericPointValueStatisticsQuantizerCsvCallback(writer.getWriter(), vo, this.useRendered, this.unitConversion, this.rollup, writeXidColumn, writeHeaders, this.limit, this.dateTimeFormat, this.timezone));
} else {
if (!rollup.nonNumericSupport()) {
LOG.warn("Invalid non-numeric rollup type: " + rollup);
// Default to first
rollup = RollupEnum.FIRST;
}
return new ValueChangeCounterQuantizer(bc, startValue, new NonNumericPointValueStatisticsQuantizerCsvCallback(writer.getWriter(), vo, useRendered, unitConversion, this.rollup, writeXidColumn, writeHeaders, this.limit, this.dateTimeFormat, this.timezone));
}
}
Aggregations