Search in sources :

Example 11 with ModelFactory

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

the class MBrickletIndustrialDigitalOut4Impl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    for (int i = 0; i < 4; i++) {
        DigitalActorDigitalOut4 out4 = factory.createDigitalActorDigitalOut4();
        out4.setUid(getUid());
        String subId = "out" + String.valueOf(i);
        logger.debug("addSubDevice: {}", subId);
        out4.setSubId(subId);
        out4.setPin(i);
        out4.init();
        out4.setMbrick(this);
        getMsubdevices().add(out4);
    }
}
Also used : DigitalActorDigitalOut4(org.openhab.binding.tinkerforge.internal.model.DigitalActorDigitalOut4) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory)

Example 12 with ModelFactory

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

the class MBrickletLCD20x4Impl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    for (int i = 0; i < 4; i++) {
        MLCD20x4Button mButton = factory.createMLCD20x4Button();
        mButton.setUid(uid);
        String subId = "button" + String.valueOf(i);
        logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
        mButton.setSubId(subId);
        mButton.init();
        mButton.setMbrick(this);
    }
    MLCD20x4Backlight backlight = factory.createMLCD20x4Backlight();
    backlight.setUid(uid);
    String subId = "backlight";
    logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
    backlight.setSubId(subId);
    backlight.init();
    backlight.setMbrick(this);
}
Also used : MLCD20x4Button(org.openhab.binding.tinkerforge.internal.model.MLCD20x4Button) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory) MLCD20x4Backlight(org.openhab.binding.tinkerforge.internal.model.MLCD20x4Backlight)

Example 13 with ModelFactory

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

the class MBrickletIO4Impl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    for (int i = 0; i < 4; i++) {
        DigitalSensorIO4 sensor = factory.createDigitalSensorIO4();
        sensor.setUid(getUid());
        String genericDeviceId = String.valueOf(i);
        String subId = "in" + genericDeviceId;
        sensor.setSubId(subId);
        sensor.setPin(i);
        sensor.setGenericDeviceId(genericDeviceId);
        sensor.init();
        sensor.setMbrick(this);
        logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
    }
    for (int i = 0; i < 4; i++) {
        DigitalActorIO4 actor = factory.createDigitalActorIO4();
        actor.setUid(getUid());
        String genericDeviceId = String.valueOf(i);
        String subId = "out" + genericDeviceId;
        actor.setSubId(subId);
        actor.setPin(i);
        actor.setGenericDeviceId(genericDeviceId);
        actor.init();
        actor.setMbrick(this);
        logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
    }
}
Also used : DigitalSensorIO4(org.openhab.binding.tinkerforge.internal.model.DigitalSensorIO4) DigitalActorIO4(org.openhab.binding.tinkerforge.internal.model.DigitalActorIO4) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory)

Example 14 with ModelFactory

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

the class MBrickletIndustrialDigitalIn4Impl method initSubDevices.

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

Example 15 with ModelFactory

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

the class MBrickletIO16Impl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    ArrayList<String> portList = new ArrayList<String>(2);
    portList.add("a");
    portList.add("b");
    char[] a = { 'a', 'b' };
    for (int j = 0; j < a.length; j++) {
        char port = a[j];
        for (int i = 0; i < 8; i++) {
            DigitalSensor sensor = factory.createDigitalSensor();
            sensor.setUid(getUid());
            String genericDeviceId = port + String.valueOf(i);
            String subId = "in" + genericDeviceId;
            sensor.setSubId(subId);
            sensor.setPin(i);
            sensor.setPort(port);
            sensor.setGenericDeviceId(genericDeviceId);
            sensor.init();
            sensor.setMbrick(this);
            logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
        }
        for (int i = 0; i < 8; i++) {
            DigitalActorIO16 actor = factory.createDigitalActorIO16();
            actor.setUid(getUid());
            String genericDeviceId = port + String.valueOf(i);
            String subId = "out" + genericDeviceId;
            actor.setSubId(subId);
            actor.setPin(i);
            actor.setPort(port);
            actor.setGenericDeviceId(genericDeviceId);
            actor.init();
            actor.setMbrick(this);
            logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) DigitalSensor(org.openhab.binding.tinkerforge.internal.model.DigitalSensor) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory) DigitalActorIO16(org.openhab.binding.tinkerforge.internal.model.DigitalActorIO16)

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