private void switchToState(FSECONOMY_STATES newState) { currentState = newState; if (currentState == FSECONOMY_STATES.FINISHED) { if (currentFlight != null) { currentFlight.requestFinishData(connection); } } }
void disposeFlight() { if (currentFlight != null) { currentFlight.stop(connection); currentFlight = null; } cargoView.Rows.Clear(); currentState = FSECONOMY_STATES.IDLE; connection.MenuDeleteSubItem(EVENTS.MENU1, EVENTS.MENU3); connection.MenuAddSubItem(EVENTS.MENU1, "Start flight", EVENTS.MENU2, 0); }