Search in sources :

Example 1 with BrickletIndustrialDualAnalogIn

use of com.tinkerforge.BrickletIndustrialDualAnalogIn in project openhab1-addons by openhab.

the class MBrickletIndustrialDualAnalogInImpl method enable.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void enable() {
    if (tfConfig != null) {
        if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("sampleRate"))) {
            Short sampleRate = tfConfig.getSampleRate();
            logger.debug("sampleRate {}", sampleRate);
            setSampleRate(sampleRate);
        }
    }
    try {
        tinkerforgeDevice = new BrickletIndustrialDualAnalogIn(getUid(), getIpConnection());
        tinkerforgeDevice.setSampleRate(getSampleRate());
    } 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 : NotConnectedException(com.tinkerforge.NotConnectedException) MBrickletIndustrialDualAnalogIn(org.openhab.binding.tinkerforge.internal.model.MBrickletIndustrialDualAnalogIn) BrickletIndustrialDualAnalogIn(com.tinkerforge.BrickletIndustrialDualAnalogIn) TimeoutException(com.tinkerforge.TimeoutException)

Example 2 with BrickletIndustrialDualAnalogIn

use of com.tinkerforge.BrickletIndustrialDualAnalogIn in project openhab1-addons by openhab.

the class MBrickletIndustrialDualAnalogInImpl method setTinkerforgeDevice.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setTinkerforgeDevice(BrickletIndustrialDualAnalogIn newTinkerforgeDevice) {
    BrickletIndustrialDualAnalogIn oldTinkerforgeDevice = tinkerforgeDevice;
    tinkerforgeDevice = newTinkerforgeDevice;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_INDUSTRIAL_DUAL_ANALOG_IN__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) MBrickletIndustrialDualAnalogIn(org.openhab.binding.tinkerforge.internal.model.MBrickletIndustrialDualAnalogIn) BrickletIndustrialDualAnalogIn(com.tinkerforge.BrickletIndustrialDualAnalogIn)

Aggregations

BrickletIndustrialDualAnalogIn (com.tinkerforge.BrickletIndustrialDualAnalogIn)2 MBrickletIndustrialDualAnalogIn (org.openhab.binding.tinkerforge.internal.model.MBrickletIndustrialDualAnalogIn)2 NotConnectedException (com.tinkerforge.NotConnectedException)1 TimeoutException (com.tinkerforge.TimeoutException)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1