Search in sources :

Example 1 with NonNumericPointValueStatisticsQuantizerJsonCallback

use of com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NonNumericPointValueStatisticsQuantizerJsonCallback in project ma-modules-public by infiniteautomation.

the class AbstractPointValueRollupCalculator method createQuantizer.

/**
 * Create the proper quantizer for json generation
 * @param startValue
 * @param bc
 * @param jgen
 * @return
 */
protected AbstractDataQuantizer createQuantizer(DataPointVO vo, DataValue startValue, BucketCalculator bc, JsonGenerator jgen) {
    if (vo.getPointLocator().getDataTypeId() == DataTypes.NUMERIC) {
        return new AnalogStatisticsQuantizer(bc, startValue, new NumericPointValueStatisticsQuantizerJsonCallback(jgen, vo, this.useRendered, this.unitConversion, this.rollup, 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 NonNumericPointValueStatisticsQuantizerJsonCallback(jgen, vo, useRendered, unitConversion, this.rollup, this.limit, this.dateTimeFormat, this.timezone));
    }
}
Also used : NumericPointValueStatisticsQuantizerJsonCallback(com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NumericPointValueStatisticsQuantizerJsonCallback) NonNumericPointValueStatisticsQuantizerJsonCallback(com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NonNumericPointValueStatisticsQuantizerJsonCallback) ValueChangeCounterQuantizer(com.serotonin.m2m2.view.quantize2.ValueChangeCounterQuantizer) NonNumericPointValueStatisticsQuantizerJsonCallback(com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NonNumericPointValueStatisticsQuantizerJsonCallback) AnalogStatisticsQuantizer(com.serotonin.m2m2.view.quantize2.AnalogStatisticsQuantizer)

Aggregations

AnalogStatisticsQuantizer (com.serotonin.m2m2.view.quantize2.AnalogStatisticsQuantizer)1 ValueChangeCounterQuantizer (com.serotonin.m2m2.view.quantize2.ValueChangeCounterQuantizer)1 NonNumericPointValueStatisticsQuantizerJsonCallback (com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NonNumericPointValueStatisticsQuantizerJsonCallback)1 NumericPointValueStatisticsQuantizerJsonCallback (com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.statistics.NumericPointValueStatisticsQuantizerJsonCallback)1