コード例 #1
0
ファイル: SetStatement.java プロジェクト: tkok/GSD-code
 public void execute() {
   logger.debug("IN SET STATMENT");
   logger.debug("Sensor Id is " + sensorID);
   // SensorValueCache.setValue(sensorID, aValue);
   if (sensorID.contains("wildcard") && !sensorID.contains("room")) {
     logger.info("It is a wildcard" + " - sensor id is " + sensorID);
     try {
       List<String> sensors = new Wildcards().getSensorListByWildcard(sensorID);
       String[] data = sensorID.split("-");
       for (String s : sensors) {
         System.out.println("SET STATEMNET - " + s);
         new Connection().setSensorValue(s + "-" + data[data.length - 1], aValue.getIntValue());
       }
     } catch (MalformedURLException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     } catch (URISyntaxException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   } else {
     try {
       new Connection().setSensorValue(sensorID, aValue.getIntValue());
     } catch (Exception e) {
       logger.error(e);
     }
   }
 }
コード例 #2
0
  void ckFloatValue(Value retValue) {
    Field theValueField = targetClass.fieldByName("efloatValue");
    FloatValue theValue = (FloatValue) targetClass.getValue(theValueField);

    float vv = theValue.value();
    float rv = ((FloatValue) retValue).value();
    if (vv != rv) {
      failure("failure: float: expected " + vv + ", got " + rv);
    } else {
      System.out.println("Passed: float " + rv);
      earlyReturns++;
    }
  }
コード例 #3
0
ファイル: SetStatement.java プロジェクト: tkok/GSD-code
 public void execute(String sensorId) {
   try {
     new Connection().setSensorValue(sensorId, aValue.getIntValue());
   } catch (Exception e) {
     logger.error(e);
   }
 }