private void setupButtonsByFlightState() {
   final State droneState = getDrone().getAttribute(AttributeType.STATE);
   if (droneState != null && droneState.isConnected()) {
     if (droneState.isArmed()) {
       if (droneState.isFlying()) {
         setupButtonsForFlying();
       } else {
         setupButtonsForArmed();
       }
     } else {
       setupButtonsForDisarmed();
     }
   } else {
     setupButtonsForDisconnected();
   }
 }
 @Override
 public boolean isSlidingUpPanelEnabled(Drone drone) {
   final State droneState = drone.getAttribute(AttributeType.STATE);
   return droneState.isConnected() && droneState.isArmed() && droneState.isFlying();
 }
Beispiel #3
0
 public boolean isConnected() {
   final IDroneApi droneApi = droneApiRef.get();
   State droneState = getAttribute(AttributeType.STATE);
   return isStarted(droneApi) && droneState.isConnected();
 }