Search in sources :

Example 6 with ModelFactory

use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.

the class MBrickletColorImpl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    ColorColor color = factory.createColorColor();
    color.setUid(getUid());
    String subIdColor = "color";
    color.setSubId(subIdColor);
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdColor);
    color.init();
    color.setMbrick(this);
    ColorColorTemperature temperature = factory.createColorColorTemperature();
    temperature.setUid(getUid());
    String subIdTemperature = "temperature";
    temperature.setSubId(subIdTemperature);
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdTemperature);
    temperature.init();
    temperature.setMbrick(this);
    ColorIlluminance illuminance = factory.createColorIlluminance();
    illuminance.setUid(getUid());
    String subIdIlluminance = "illuminance";
    illuminance.setSubId(subIdIlluminance);
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdIlluminance);
    illuminance.init();
    illuminance.setMbrick(this);
    ColorLed led = factory.createColorLed();
    led.setUid(getUid());
    String subIdLed = "led";
    led.setSubId(subIdLed);
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);
    led.init();
    led.setMbrick(this);
}
Also used : ColorColor(org.openhab.binding.tinkerforge.internal.model.ColorColor) ColorIlluminance(org.openhab.binding.tinkerforge.internal.model.ColorIlluminance) ColorLed(org.openhab.binding.tinkerforge.internal.model.ColorLed) ColorColorTemperature(org.openhab.binding.tinkerforge.internal.model.ColorColorTemperature) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory)

Example 7 with ModelFactory

use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.

the class MBrickServoImpl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    for (int i = 0; i < 7; i++) {
        MServo mServo = factory.createMServo();
        mServo.setUid(uid);
        String subId = "servo" + String.valueOf(i);
        logger.debug("addSubDevice " + subId);
        mServo.setSubId(subId);
        mServo.init();
        mServo.setMbrick(this);
        getMsubdevices().add(mServo);
    }
}
Also used : MServo(org.openhab.binding.tinkerforge.internal.model.MServo) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory)

Example 8 with ModelFactory

use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.

the class MBrickletAccelerometerImpl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    AccelerometerDirection x = factory.createAccelerometerDirection();
    x.setDirection(AccelerometerCoordinate.X);
    x.setUid(getUid());
    String subIdX = "x";
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdX);
    x.setSubId(subIdX);
    x.init();
    x.setMbrick(this);
    AccelerometerDirection y = factory.createAccelerometerDirection();
    y.setDirection(AccelerometerCoordinate.Y);
    y.setUid(getUid());
    String subIdY = "y";
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdY);
    y.setSubId(subIdY);
    y.init();
    y.setMbrick(this);
    AccelerometerDirection z = factory.createAccelerometerDirection();
    z.setDirection(AccelerometerCoordinate.Z);
    z.setUid(getUid());
    String subIdZ = "z";
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdZ);
    z.setSubId(subIdZ);
    z.init();
    z.setMbrick(this);
    AccelerometerTemperature temperature = factory.createAccelerometerTemperature();
    temperature.setUid(getUid());
    String subIdTemperature = "temperature";
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdTemperature);
    temperature.setSubId(subIdTemperature);
    temperature.init();
    temperature.setMbrick(this);
    AccelerometerLed led = factory.createAccelerometerLed();
    led.setUid(getUid());
    String subIdLed = "led";
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);
    led.setSubId(subIdLed);
    led.init();
    led.setMbrick(this);
}
Also used : AccelerometerDirection(org.openhab.binding.tinkerforge.internal.model.AccelerometerDirection) AccelerometerTemperature(org.openhab.binding.tinkerforge.internal.model.AccelerometerTemperature) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory) AccelerometerLed(org.openhab.binding.tinkerforge.internal.model.AccelerometerLed)

Example 9 with ModelFactory

use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.

the class MBrickletRemoteSwitchImpl method addSubDevice.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void addSubDevice(String subId, String subDeviceType) {
    ModelFactory factory = ModelFactory.eINSTANCE;
    RemoteSwitch subDevice = null;
    if (subDeviceType.equals("A")) {
        logger.debug("{} addSubDevice A for subId {}", LoggerConstants.TFINITSUB, subId);
        subDevice = factory.createRemoteSwitchA();
    } else if (subDeviceType.equals("B")) {
        logger.debug("{} addSubDevice B for subId {}", LoggerConstants.TFINITSUB, subId);
        subDevice = factory.createRemoteSwitchB();
    } else if (subDeviceType.equals("C")) {
        logger.debug("{} addSubDevice C for subId {}", LoggerConstants.TFINITSUB, subId);
        subDevice = factory.createRemoteSwitchC();
    } else {
        logger.error("{} unknown sub device type {} for {}", LoggerConstants.TFINITSUB, subDeviceType, subId);
    }
    if (subDevice != null) {
        logger.debug("{} add sub device subId {} for uid {}", LoggerConstants.TFINITSUB, subId, getUid());
        subDevice.setUid(getUid());
        subDevice.setSubId(subId);
        subDevice.init();
        subDevice.setMbrick(this);
    }
}
Also used : ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory) MBrickletRemoteSwitch(org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch) BrickletRemoteSwitch(com.tinkerforge.BrickletRemoteSwitch) RemoteSwitch(org.openhab.binding.tinkerforge.internal.model.RemoteSwitch)

Example 10 with ModelFactory

use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.

the class MBrickletMultiTouchImpl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    for (int i = 0; i < 12; i++) {
        Electrode electrode = factory.createElectrode();
        electrode.setUid(getUid());
        String subId = "electrode" + i;
        electrode.setSubId(subId);
        electrode.setPin(i);
        electrode.init();
        electrode.setMbrick(this);
        logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
    }
    Proximity proximity = factory.createProximity();
    proximity.setUid(getUid());
    String subId = "proximity";
    proximity.setSubId(subId);
    proximity.setPin(12);
    proximity.init();
    proximity.setMbrick(this);
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
}
Also used : Electrode(org.openhab.binding.tinkerforge.internal.model.Electrode) Proximity(org.openhab.binding.tinkerforge.internal.model.Proximity) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory)

Aggregations

ModelFactory (org.openhab.binding.tinkerforge.internal.model.ModelFactory)17 BrickletRemoteSwitch (com.tinkerforge.BrickletRemoteSwitch)1 ArrayList (java.util.ArrayList)1 AccelerometerDirection (org.openhab.binding.tinkerforge.internal.model.AccelerometerDirection)1 AccelerometerLed (org.openhab.binding.tinkerforge.internal.model.AccelerometerLed)1 AccelerometerTemperature (org.openhab.binding.tinkerforge.internal.model.AccelerometerTemperature)1 ColorColor (org.openhab.binding.tinkerforge.internal.model.ColorColor)1 ColorColorTemperature (org.openhab.binding.tinkerforge.internal.model.ColorColorTemperature)1 ColorIlluminance (org.openhab.binding.tinkerforge.internal.model.ColorIlluminance)1 ColorLed (org.openhab.binding.tinkerforge.internal.model.ColorLed)1 DigitalActorDigitalOut4 (org.openhab.binding.tinkerforge.internal.model.DigitalActorDigitalOut4)1 DigitalActorIO16 (org.openhab.binding.tinkerforge.internal.model.DigitalActorIO16)1 DigitalActorIO4 (org.openhab.binding.tinkerforge.internal.model.DigitalActorIO4)1 DigitalSensor (org.openhab.binding.tinkerforge.internal.model.DigitalSensor)1 DigitalSensorIO4 (org.openhab.binding.tinkerforge.internal.model.DigitalSensorIO4)1 Electrode (org.openhab.binding.tinkerforge.internal.model.Electrode)1 IndustrialDualAnalogInChannel (org.openhab.binding.tinkerforge.internal.model.IndustrialDualAnalogInChannel)1 LaserRangeFinderDistance (org.openhab.binding.tinkerforge.internal.model.LaserRangeFinderDistance)1 LaserRangeFinderLaser (org.openhab.binding.tinkerforge.internal.model.LaserRangeFinderLaser)1 LaserRangeFinderVelocity (org.openhab.binding.tinkerforge.internal.model.LaserRangeFinderVelocity)1