Package org.openhab.binding.tinkerforge.internal.model

Examples of org.openhab.binding.tinkerforge.internal.model.ModelFactory


   * <!-- end-user-doc -->
   * @generated NOT
   */
  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){
View Full Code Here


   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated NOT
   */
  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);
View Full Code Here

  private void addDevice(String uid, String connectedUid, int deviceIdentifier) {
    logger.debug("{} addDevice called for uid: {}", LoggerConstants.TFINIT, uid);
    if (getDevice(uid) != null) {
      logger.debug("{} device already exists. uid: {}", LoggerConstants.TFINIT, uid);
    } else {
      ModelFactory factory = ModelFactory.eINSTANCE;
      MDevice<?> mDevice = null;
      if (deviceIdentifier == BrickletTemperature.DEVICE_IDENTIFIER) {
        logger.debug("{} addDevice temperature", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickletTemperature();
        mDevice.setDeviceIdentifier(BrickletTemperature.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletHumidity.DEVICE_IDENTIFIER) {
        logger.debug("{} addDevice humidity", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickletHumidity();
        mDevice.setDeviceIdentifier(BrickletHumidity.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickServo.DEVICE_IDENTIFIER){
        logger.debug("{} addDevice BrickServo", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickServo();
        mDevice.setDeviceIdentifier(BrickServo.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletDualRelay.DEVICE_IDENTIFIER){
        logger.debug("{} addDevice BrickletDualRelayBricklet", LoggerConstants.TFINIT);
        mDevice = factory.createMDualRelayBricklet();
        mDevice.setDeviceIdentifier(BrickletDualRelay.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletIndustrialQuadRelay.DEVICE_IDENTIFIER){
        logger.debug("{} addDevice BrickletIndustrialQuadRelayBricklet", LoggerConstants.TFINIT);
        mDevice = factory.createMIndustrialQuadRelayBricklet();
        mDevice.setDeviceIdentifier(BrickletIndustrialQuadRelay.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletBarometer.DEVICE_IDENTIFIER){
        logger.debug("{} addDevice BrickletBarometer", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickletBarometer();
        mDevice.setDeviceIdentifier(BrickletBarometer.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletAmbientLight.DEVICE_IDENTIFIER){
        logger.debug("{} addDevice AmbientLight", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickletAmbientLight();
        mDevice.setDeviceIdentifier(BrickletAmbientLight.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletDistanceIR.DEVICE_IDENTIFIER){
        logger.debug("{} addDevice DistanceIR", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickletDistanceIR();
        mDevice.setDeviceIdentifier(BrickletDistanceIR.DEVICE_IDENTIFIER);   
      } else if (deviceIdentifier == BrickDC.DEVICE_IDENTIFIER) {
        logger.debug("{} addDevice BrickDC", LoggerConstants.TFINIT);
        mDevice = factory.createMBrickDC();
        mDevice.setDeviceIdentifier(BrickDC.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletLCD20x4.DEVICE_IDENTIFIER){
        logger.debug("addDevice BrickletLCD20x4");
        mDevice = factory.createMBrickletLCD20x4();
        mDevice.setDeviceIdentifier(BrickletLCD20x4.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletIndustrialDigitalIn4.DEVICE_IDENTIFIER){
        logger.debug("addDevice BrickletIndustrialDigitalIn4");
        mDevice = factory.createMBrickletIndustrialDigitalIn4();
        mDevice.setDeviceIdentifier(BrickletIndustrialDigitalIn4.DEVICE_IDENTIFIER);
      } else if (deviceIdentifier == BrickletIO16.DEVICE_IDENTIFIER){
        logger.debug("addDevice BrickletIO16");
        mDevice = factory.createMBrickletIO16();
        mDevice.setDeviceIdentifier(BrickletIO16.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletRemoteSwitch.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletRemoteSwitch");
              mDevice = factory.createMBrickletRemoteSwitch();
              mDevice.setDeviceIdentifier(BrickletRemoteSwitch.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletMotionDetector.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletMotionDetector");
              mDevice = factory.createMBrickletMotionDetector();
              mDevice.setDeviceIdentifier(BrickletMotionDetector.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletMultiTouch.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletMultiTouch");
              mDevice = factory.createMBrickletMultiTouch();
              mDevice.setDeviceIdentifier(BrickletMultiTouch.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletTemperatureIR.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletTemperatureIR");
              mDevice = factory.createMBrickletTemperatureIR();
              mDevice.setDeviceIdentifier(BrickletTemperatureIR.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletSoundIntensity.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletSoundIntensity");
              mDevice = factory.createMBrickletSoundIntensity();
              mDevice.setDeviceIdentifier(BrickletSoundIntensity.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletMoisture.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletMoisture");
              mDevice = factory.createMBrickletMoisture();
              mDevice.setDeviceIdentifier(BrickletMoisture.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletDistanceUS.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletDistanceUS");
              mDevice = factory.createMBrickletDistanceUS();
              mDevice.setDeviceIdentifier(BrickletDistanceUS.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletVoltageCurrent.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletVoltageCurrent");
              mDevice = factory.createMBrickletVoltageCurrent();
              mDevice.setDeviceIdentifier(BrickletVoltageCurrent.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletTilt.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletTilt");
              mDevice = factory.createMBrickletTilt();
              mDevice.setDeviceIdentifier(BrickletTilt.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletIO4.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletIO4");
              mDevice = factory.createMBrickletIO4();
              mDevice.setDeviceIdentifier(BrickletIO4.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletHallEffect.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletHallEffect");
              mDevice = factory.createMBrickletHallEffect();
              mDevice.setDeviceIdentifier(BrickletHallEffect.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletIndustrialDigitalOut4.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletIndustrilaDigitalOut4");
              mDevice = factory.createMBrickletIndustrialDigitalOut4();
              mDevice.setDeviceIdentifier(BrickletIndustrialDigitalOut4.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletSegmentDisplay4x7.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletSegmentDisplay4x7");
              mDevice = factory.createMBrickletSegmentDisplay4x7();
              mDevice.setDeviceIdentifier(BrickletSegmentDisplay4x7.DEVICE_IDENTIFIER);
            } else if (deviceIdentifier == BrickletLEDStrip.DEVICE_IDENTIFIER){
              logger.debug("addDevice BrickletLEDStrip");
              mDevice = factory.createMBrickletLEDStrip();
              mDevice.setDeviceIdentifier(BrickletLEDStrip.DEVICE_IDENTIFIER);
            }
      if (mDevice != null) {
        mDevice.setIpConnection(getIpConnection());
        logger.debug("{} addDevice uid: {}", LoggerConstants.TFINIT, uid);
View Full Code Here

TOP

Related Classes of org.openhab.binding.tinkerforge.internal.model.ModelFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.