public void emergency() { // Emergency button mScheduleTaskExecutor.shutdownNow(); mScheduleTaskExecutor = Executors.newSingleThreadScheduledExecutor(); mThreads.bWatchDog = true; mThreads.StartEmergency(); AttenteMs(50); }
/** * This function stops the steering threads using a boolean, it stops the * * <p>timer and starts the Atterissage and Watchdog threads (the emergency landing * * <p>function is the same, only the thread and thus the associated command * * <p>change). */ public void atterissage() { mScheduleTaskExecutor.shutdownNow(); mScheduleTaskExecutor = Executors.newSingleThreadScheduledExecutor(); mThreads.bWatchDog = true; AttenteMs(50); mThreads.StartAtterissage(); AttenteMs(50); mThreads.StartWatchDog(); }
/** * This function resets the variables (chronometer sequence, flight’s * * <p>Boolean ..) and then start Piloting threads, which use * * <p>EnvoiTrameUDP() function to send the AT command. */ public void decollage() { mThreads.bWatchDog = false; iVal = 1; iSecondeU = 0; iSecondeD = 0; iMinuteU = 0; iMinuteD = 0; icSecondeU = 0; icSecondeD = 0; AttenteMs(50); mThreads.Startdecollage(); AttenteMs(50); mThreads.StartPilotage(); mScheduleTaskExecutor.scheduleAtFixedRate(mThreads.mTaskChrono, 0, 10, TimeUnit.MILLISECONDS); }