Examples of NumberWithUnit


Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class TemperatureNumberWithUnitConverter extends StateConverter<NumberWithUnit, DecimalType> {

    @Override
    protected NumberWithUnit convertFromImpl(DecimalType source) {
        return new NumberWithUnit(Unit.DEGREE_CELSIUS, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class HumidityConverter extends StateConverter<NumberWithUnit, PercentType> {

    @Override
    protected NumberWithUnit convertFromImpl(PercentType source) {
        return new NumberWithUnit(Unit.HUMIDITY, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class PPMConverter extends StateConverter<NumberWithUnit, DecimalType> {

    @Override
    protected NumberWithUnit convertFromImpl(DecimalType source) {
        return new NumberWithUnit(Unit.PPM, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class IlluminationConverter extends StateConverter<NumberWithUnit, DecimalType> {

    @Override
    protected NumberWithUnit convertFromImpl(DecimalType source) {
        return new NumberWithUnit(Unit.LUX, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class PPBConverter extends StateConverter<NumberWithUnit, DecimalType> {

    @Override
    protected NumberWithUnit convertFromImpl(DecimalType source) {
        return new NumberWithUnit(Unit.PPB, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class VoltageConverter extends StateConverter<NumberWithUnit, DecimalType> {

    @Override
    protected NumberWithUnit convertFromImpl(DecimalType source) {
        return new NumberWithUnit(Unit.VOLTAGE, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

*/
public class PowerConverter extends StateConverter<NumberWithUnit, DecimalType> {

    @Override
    protected NumberWithUnit convertFromImpl(DecimalType source) {
        return new NumberWithUnit(Unit.WATT, source.toBigDecimal());
    }
View Full Code Here

Examples of org.opencean.core.common.values.NumberWithUnit

        parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.TEMPERATURE);
        provider.setParameterAddress(parameterAddress);
        binding.addBindingProvider(provider);
        provider.setItem(new NumberItem("dummie"));
        BigDecimal temperature = new BigDecimal("20.3");
        binding.valueChanged(parameterAddress, new NumberWithUnit(Unit.DEGREE_CELSIUS, temperature));
        assertEquals("Update State", new DecimalType(temperature), publisher.getUpdateState());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.