Ejemplo n.º 1
0
  public void addSensorDataToCycleCompleteEvent(String sensorID, DateTime time, double duration) {
    System.out.println(this.getName() + " added sensor data to CycleComplete Event");

    InfoTablePrimitive primitiveInfoTable =
        (InfoTablePrimitive) this.eventInProgress.getPrimitive(XerosWasherThing.SENSOR_DATA);
    InfoTable data = primitiveInfoTable.getValue();

    ValueCollection dataInfo = new ValueCollection();
    dataInfo.put(XerosWasherThing.SENSORID, new StringPrimitive(sensorID));
    dataInfo.put(XerosWasherThing.TIME, new DatetimePrimitive(time));
    dataInfo.put(XerosWasherThing.DURATION, new NumberPrimitive(duration));

    data.addRow(dataInfo);
    this.eventInProgress.put(XerosWasherThing.SENSOR_DATA, new InfoTablePrimitive(data));
  }
Ejemplo n.º 2
0
  public void createCycleCompleteEvent(
      double WM1_LifeTime,
      double WM1_Day,
      double WM1_Cycle,
      double WM2_LifeTime,
      double WM2_Day,
      double WM2_Cycle) {
    System.out.println(this.getName() + " started to create CycleComplete Event");
    this.eventInProgress = new ValueCollection();

    this.eventInProgress.put(XerosWasherThing.WM1_LIFETIME, new NumberPrimitive(WM1_LifeTime));
    this.eventInProgress.put(XerosWasherThing.WM1_DAY, new NumberPrimitive(WM1_Day));
    this.eventInProgress.put(XerosWasherThing.WM1_CYCLE, new NumberPrimitive(WM1_Cycle));
    this.eventInProgress.put(XerosWasherThing.WM2_LIFETIME, new NumberPrimitive(WM2_LifeTime));
    this.eventInProgress.put(XerosWasherThing.WM2_DAY, new NumberPrimitive(WM2_Day));
    this.eventInProgress.put(XerosWasherThing.WM2_CYCLE, new NumberPrimitive(WM2_Cycle));

    InfoTable data = new InfoTable();
    data.setDataShape(this.getDataShapeDefinition("SensorData").clone());
    this.eventInProgress.put(XerosWasherThing.SENSOR_DATA, new InfoTablePrimitive(data));
  }