Exemplo n.º 1
0
 @Override
 public void doAction() {
   if (newRouteLayer.getRoute().getWaypoints().size() > 1) {
     Route route = new Route(newRouteLayer.getRoute());
     route.setName("New route");
     int i = 1;
     LinkedList<RouteWaypoint> waypoints = route.getWaypoints();
     for (RouteWaypoint routeWaypoint : waypoints) {
       if (routeWaypoint.getOutLeg() != null) {
         RouteLeg outLeg = routeWaypoint.getOutLeg();
         double xtd = EeINS.getSettings().getNavSettings().getDefaultXtd();
         outLeg.setXtdPort(xtd);
         outLeg.setXtdStarboard(xtd);
         outLeg.setHeading(Heading.RL);
         outLeg.setSpeed(EeINS.getSettings().getNavSettings().getDefaultSpeed());
       }
       routeWaypoint.setTurnRad(EeINS.getSettings().getNavSettings().getDefaultTurnRad());
       routeWaypoint.setName(String.format("WP_%03d", i));
       i++;
     }
     route.calcValues(true);
     routeManager.addRoute(route);
     routeManager.notifyListeners(null);
   }
   newRouteLayer.getWaypoints().clear();
   newRouteLayer.getRouteGraphics().clear();
   newRouteLayer.doPrepare();
   EeINS.getMainFrame().getChartPanel().editMode(false);
 }
Exemplo n.º 2
0
 /** Routine for monitoring timeout */
 @Override
 public void run() {
   while (true) {
     if (gpsTimedOut()) {
       markBadPos();
       distributeUpdate();
     }
     EeINS.sleep(10000);
   }
 }
Exemplo n.º 3
0
 public GpsHandler() {
   EeINS.startThread(this, "GpsHandler");
 }