Esempio n. 1
0
  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);
  }