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);
}
}
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);
}
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);
}
}
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);
}
}
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);
}
}
}
Aggregations