コード例 #1
0
ファイル: TelnetWrapper.java プロジェクト: palade/deri-lsm
  public void addNewADSBHub() {
    List<Sensor> sensors =
        sensorManager.getAllSensorWithSpecifiedSensorType(SensorTypeEnum.ADSBHub.toString());
    if (sensors.size() > 0) {
      sensor = sensors.get(0);
      return;
    }
    User admin = userManager.getUser("admin");
    Place place = new Place();
    place.setTimes(new Date());
    place.setAuthor("hoan");
    place.setLat(0);
    place.setLng(0);

    sensor = new Sensor();
    sensor.setName("admin");
    sensor.setUser(admin);
    sensor.setSensorType(SensorTypeEnum.ADSBHub.toString());
    sensor.setSourceType("stream");
    sensor.setTimes(new Date());
    sensor.setPlace(place);
    sensorManager.addObject(sensor);
  }