Package de.nordakademie.nxtsimulation.util

Examples of de.nordakademie.nxtsimulation.util.SimException


  public int readSensorValue(int aPortId) {
    if (ports[aPortId] != null) {
      return ports[aPortId].readSensorValue();
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here


  public int i2cBusyById(int aPortId) {
    if (ports[aPortId] != null) {
      return ports[aPortId].i2cBusy();
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

        // aufgetreten:
        return ret;
      }
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

  public void i2cDisableById(int aPortId) {
    if (ports[aPortId] != null) {
      ports[aPortId].i2cDisable();
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

  public void i2cEnableById(int aPortId, int mode) {
    if (ports[aPortId] != null) {
      ports[aPortId].i2cEnable(mode);
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

    if (ports[aPortId] != null) {
      return ports[aPortId].i2cStart(address, internalAddress,
          numInternalBytes, buffer, numBytes, transferType);
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

  public void setADTypeById(int aPortId, int aADType) {
    if (ports[aPortId] != null) {
      ports[aPortId].setADType(aADType);
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

  public void setPowerTypeById(int aPortId, int aPortType) {
    if (ports[aPortId] != null) {
      ports[aPortId].setPowerType(aPortType);
    } else {
      logErrorPortNotAttached(aPortId);
      throw new SimException("Kein Sensor an Port " + aPortId
          + " angeschlossen");
    }
  }
View Full Code Here

          "Ung�ltige/nicht " + "implementierte internal address: "
              + internalAddress
              + " (Diese sind nicht implementiert:"
              + " 17=FACTORY_DATA,"
              + " 74=CALIBRATION und 64=PING_INTERVAL)");
      throw new SimException("Ung�ltige/nicht "
          + "implementierte internal address: " + internalAddress
          + " beim Aufruf des UltraSonicSensorStubs verwendet.");

    default:
      Logger.getLogger(getClass()).error(
          "Ung�ltige/nicht " + "implementierte internal address: "
              + internalAddress);
      throw new SimException("Ung�ltige/nicht "
          + "implementierte internal address: " + internalAddress
          + " beim Aufruf des UltraSonicSensorStubs verwendet.");
    }
  }
View Full Code Here

      case MODE_CAPTURE:
        // Dieser Modus wird von der Simulation nicht unterst�tzt.
        Logger.getLogger(getClass()).error(
            "Ung�ltiger/nicht implementierter Modus: CAPTURE");
        throw new SimException("Ung�ltige/nicht "
            + "implementierter Modus CAPTURE beim Aufruf"
            + " des UltraSonicSensorStubs verwendet.");

      default:
        Logger.getLogger(getClass()).error(
            "Ung�ltiger/nicht implementierter Modus: " + mode);
        throw new SimException("Ung�ltige/nicht "
            + "implementierter Modus beim Aufruf des"
            + " UltraSonicSensorStubs verwendet: " + mode);
      }

    case UNITS:
      // Wenn die Ma�einheit zur�ckgeliefert werden soll
      char[] chars = unit.toCharArray();
      for (int i = 0; i < chars.length; i++) {
        buffer[i] = (byte) chars[i];
      }
      return buffer.length;

    case MODE:
      // Wenn der Sensor-Modus gesetzt oder gelesen werden soll
      // Dies wurde bereits in i2cStart() erledigt
      return 0;

    default:
      Logger.getLogger(getClass()).error(
          "Ung�ltiger/nicht implementiertecontrol location: "
              + controlLocation);
      throw new SimException("Ung�ltige/nicht "
          + "implementierte control location: " + controlLocation
          + " beim Aufruf des UltraSonicSensorStubs verwendet.");
    }
  }
View Full Code Here

TOP

Related Classes of de.nordakademie.nxtsimulation.util.SimException

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.