Search in sources :

Example 16 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class MStepperVelocityImpl method setSensorValue.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated
     */
@Override
public void setSensorValue(DecimalValue newSensorValue) {
    DecimalValue oldSensorValue = sensorValue;
    sensorValue = newSensorValue;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MSTEPPER_VELOCITY__SENSOR_VALUE, oldSensorValue, sensorValue));
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 17 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class Dual020mADeviceImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        int current = tinkerforgeDevice.getCurrent(getSensorNum());
        DecimalValue value = Tools.calculate1000000(current);
        setSensorValue(value);
    } catch (TimeoutException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
    } catch (NotConnectedException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) NotConnectedException(com.tinkerforge.NotConnectedException) TimeoutException(com.tinkerforge.TimeoutException)

Example 18 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class Dual020mADeviceImpl method setSensorValue.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setSensorValue(DecimalValue newSensorValue) {
    DecimalValue oldSensorValue = sensorValue;
    sensorValue = newSensorValue;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DUAL020M_ADEVICE__SENSOR_VALUE, oldSensorValue, sensorValue));
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 19 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class JoystickYPositionImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        Position position = tinkerforgeDevice.getPosition();
        DecimalValue value = Tools.calculate(position.y);
        setSensorValue(value);
    } catch (TimeoutException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
    } catch (NotConnectedException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) NotConnectedException(com.tinkerforge.NotConnectedException) Position(com.tinkerforge.BrickletJoystick.Position) JoystickYPosition(org.openhab.binding.tinkerforge.internal.model.JoystickYPosition) TimeoutException(com.tinkerforge.TimeoutException)

Example 20 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class JoystickYPositionImpl method setSensorValue.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setSensorValue(DecimalValue newSensorValue) {
    DecimalValue oldSensorValue = sensorValue;
    sensorValue = newSensorValue;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.JOYSTICK_YPOSITION__SENSOR_VALUE, oldSensorValue, sensorValue));
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

DecimalValue (org.openhab.binding.tinkerforge.internal.types.DecimalValue)92 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)51 NotConnectedException (com.tinkerforge.NotConnectedException)36 TimeoutException (com.tinkerforge.TimeoutException)36 OnOffValue (org.openhab.binding.tinkerforge.internal.types.OnOffValue)3 Position (com.tinkerforge.BrickletJoystick.Position)2 BigDecimal (java.math.BigDecimal)2 Acceleration (com.tinkerforge.BrickletAccelerometer.Acceleration)1 TinkerforgeBindingProvider (org.openhab.binding.tinkerforge.TinkerforgeBindingProvider)1 JoystickXPosition (org.openhab.binding.tinkerforge.internal.model.JoystickXPosition)1 JoystickYPosition (org.openhab.binding.tinkerforge.internal.model.JoystickYPosition)1 DirectionValue (org.openhab.binding.tinkerforge.internal.types.DirectionValue)1 HSBValue (org.openhab.binding.tinkerforge.internal.types.HSBValue)1 HighLowValue (org.openhab.binding.tinkerforge.internal.types.HighLowValue)1 PercentValue (org.openhab.binding.tinkerforge.internal.types.PercentValue)1 ColorItem (org.openhab.core.library.items.ColorItem)1 ContactItem (org.openhab.core.library.items.ContactItem)1 DimmerItem (org.openhab.core.library.items.DimmerItem)1 NumberItem (org.openhab.core.library.items.NumberItem)1 RollershutterItem (org.openhab.core.library.items.RollershutterItem)1