Package de.hpi.eworld.visualizer.simulation.traci.common

Examples of de.hpi.eworld.visualizer.simulation.traci.common.TraciInputStream.readUnsignedByte()


  public static ResponseVehicleValueCommandReader fromCommand(Command command) throws IOException, TraciException{
    TraciInputStream payload = command.getPayload();
   
    String objectId = new String(payload.readTraciString());
    // variable count == 1
    payload.readUnsignedByte();
    // variable id == POSITION (0x42)
    payload.readUnsignedByte();
    int status = payload.readUnsignedByte();
    if (status == 0xff){
      payload.readUnsignedByte(); // type: String
View Full Code Here


   
    String objectId = new String(payload.readTraciString());
    // variable count == 1
    payload.readUnsignedByte();
    // variable id == POSITION (0x42)
    payload.readUnsignedByte();
    int status = payload.readUnsignedByte();
    if (status == 0xff){
      payload.readUnsignedByte(); // type: String
      String message = new String(payload.readTraciString());
      throw new TraciException(message);
View Full Code Here

    String objectId = new String(payload.readTraciString());
    // variable count == 1
    payload.readUnsignedByte();
    // variable id == POSITION (0x42)
    payload.readUnsignedByte();
    int status = payload.readUnsignedByte();
    if (status == 0xff){
      payload.readUnsignedByte(); // type: String
      String message = new String(payload.readTraciString());
      throw new TraciException(message);
    }
View Full Code Here

    payload.readUnsignedByte();
    // variable id == POSITION (0x42)
    payload.readUnsignedByte();
    int status = payload.readUnsignedByte();
    if (status == 0xff){
      payload.readUnsignedByte(); // type: String
      String message = new String(payload.readTraciString());
      throw new TraciException(message);
    }
    float[] position = (float[]) payload.readTraciTypeAndObject();
   
View Full Code Here

  public static ResponseSimulationValueCommandReader fromCommand(Command command) throws IOException, TraciException {
   
    TraciInputStream payload = command.getPayload();
   
    String objectId = new String(payload.readTraciString());
    int count = payload.readUnsignedByte();
    HashMap<Integer, Object> values = new HashMap<Integer, Object>();
    for (int i = 0; i < count; i++) {
      int id = payload.readUnsignedByte(); // value id
      int status = payload.readUnsignedByte();
      if (status == 0x00) {
View Full Code Here

   
    String objectId = new String(payload.readTraciString());
    int count = payload.readUnsignedByte();
    HashMap<Integer, Object> values = new HashMap<Integer, Object>();
    for (int i = 0; i < count; i++) {
      int id = payload.readUnsignedByte(); // value id
      int status = payload.readUnsignedByte();
      if (status == 0x00) {
        // value could be retrieved without an error
        int type = payload.readUnsignedByte();
        if (type == TraciConstants.DATATYPE_INT)
View Full Code Here

    String objectId = new String(payload.readTraciString());
    int count = payload.readUnsignedByte();
    HashMap<Integer, Object> values = new HashMap<Integer, Object>();
    for (int i = 0; i < count; i++) {
      int id = payload.readUnsignedByte(); // value id
      int status = payload.readUnsignedByte();
      if (status == 0x00) {
        // value could be retrieved without an error
        int type = payload.readUnsignedByte();
        if (type == TraciConstants.DATATYPE_INT)
          values.put(id, payload.readInt());
View Full Code Here

    for (int i = 0; i < count; i++) {
      int id = payload.readUnsignedByte(); // value id
      int status = payload.readUnsignedByte();
      if (status == 0x00) {
        // value could be retrieved without an error
        int type = payload.readUnsignedByte();
        if (type == TraciConstants.DATATYPE_INT)
          values.put(id, payload.readInt());
        else if (type == TraciConstants.DATATYPE_STRING_LIST) {
          List<String> ids = new ArrayList<String>();
          int length = payload.readInt();
View Full Code Here

            ids.add(new String(payload.readTraciString()));
          }
          values.put(id, ids);
        }
      } else if (status == 0xff){
        payload.readUnsignedByte(); // type: String
        String message = new String(payload.readTraciString());
        throw new TraciException(message);
      }
       
    }
View Full Code Here

 
  public static ResponseCommandReader fromCommand(Command command) throws IOException {
   
    TraciInputStream payload = command.getPayload();
   
    int result = payload.readUnsignedByte();
    byte[] description = payload.readTraciString();
   
    return new ResponseCommandReader(result, description);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.