Exemplo n.º 1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_planning);

    planningMapFragment =
        ((PlanningMapFragment) getFragmentManager().findFragmentById(R.id.planningMapFragment));
    gestureMapFragment =
        ((GestureMapFragment) getFragmentManager().findFragmentById(R.id.gestureMapFragment));
    missionFragment = (MissionFragment) getFragmentManager().findFragmentById(R.id.missionFragment);
    surveyFragment = (SurveyFragment) getFragmentManager().findFragmentById(R.id.surveyFragment);

    lengthView = (TextView) findViewById(R.id.textViewTotalLength);

    polygon = new Polygon();

    gestureMapFragment.setOnPathFinishedListner(this);
    missionFragment.setMission(drone.mission);
    planningMapFragment.setMission(drone.mission);
    surveyFragment.setSurveyData(polygon, drone.mission.getDefaultAlt());
    surveyFragment.setOnSurveyListner(this);

    drone.mission.missionListner = this;

    checkIntent();

    update();
  }
Exemplo n.º 2
0
 @Override
 public void onNewGrid(Grid grid) {
   drone.mission.setWaypoints(grid.getWaypoints());
   planningMapFragment.cameraOverlays.removeAll();
   if (surveyFragment.isFootPrintOverlayEnabled()) {
     planningMapFragment.cameraOverlays.addOverlays(
         grid.getCameraLocations(), surveyFragment.getSurveyData());
   }
   update();
 }
Exemplo n.º 3
0
 private void processReceivedPoints(List<LatLng> points) {
   switch (surveyFragment.getPathToDraw()) {
     case MISSION:
       drone.mission.addWaypointsWithDefaultAltitude(points);
       break;
     case POLYGON:
       polygon.addPoints(points);
       surveyFragment.generateGrid();
       break;
     default:
       break;
   }
   update();
 }