This class is for the overall application orchestration to coordinate all the user interactions, screens, displays, connection management, and other application states.  
 More...
#include <AppOrchestrator.h>
This class is for the overall application orchestration to coordinate all the user interactions, screens, displays, connection management, and other application states. 
 
◆ AppOrchestrator()
Constructor for the application orchestrator object. 
- Parameters
 - 
  
    | displayInterface | Pointer to the display interface to ensure is updated  | 
    | connectionManager | Pointer to the connection manager  | 
    | menuManager | Pointer to the menu manager  | 
    | commandStationClient | Pointer to the CommandStation client  | 
    | userConfirmationInterface | Pointer to the user confirmation interface to monitor  | 
    | userSelectionInterface | Pointer the user selection interface to monitor  | 
    | throttleScreen | Pointer to the throttle screen  | 
  
   
 
 
◆ _displayMenu()
  
  
      
        
          | void AppOrchestrator::_displayMenu  | 
          ( | 
          BaseMenu *  | 
          menu | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Display a menu. 
- Parameters
 - 
  
    | menu | Pointer to the menu to be displayed  | 
  
   
 
 
◆ _handleConnectCommandStationState()
  
  
      
        
          | void AppOrchestrator::_handleConnectCommandStationState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show the connection progress screen until a connection is made. 
 
 
◆ _handleErrorState()
  
  
      
        
          | void AppOrchestrator::_handleErrorState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show any errors on screen and process user interaction to recover. 
 
 
◆ _handleJoinProgTrack()
  
  
      
        
          | void AppOrchestrator::_handleJoinProgTrack  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Join programming track to main and return to the Select Loco menu. 
 
 
◆ _handleReadLocoState()
  
  
      
        
          | void AppOrchestrator::_handleReadLocoState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show the read loco progress screen until it is read or times out. 
 
 
◆ _handleReceivedReadLoco()
  
  
      
        
          | void AppOrchestrator::_handleReceivedReadLoco  | 
          ( | 
          int  | 
          address | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Set throttle to the received loco address when reading, or return to the select screen if failed. 
- Parameters
 - 
  
    | address | DCC address of the loco read from the programming track, or -1 says fail  | 
  
   
 
 
◆ _handleSelectActionState()
  
  
      
        
          | void AppOrchestrator::_handleSelectActionState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show the select action menu and process user interaction to select one. 
 
 
◆ _handleSelectCommandStationState()
  
  
      
        
          | void AppOrchestrator::_handleSelectCommandStationState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Display the CommandStation menu and process user interaction to select one. 
 
 
◆ _handleSelectLocoState()
  
  
      
        
          | void AppOrchestrator::_handleSelectLocoState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show the loco selection menu and process user interaction to select one. 
 
 
◆ _handleSetTrackPower()
  
  
      
        
          | void AppOrchestrator::_handleSetTrackPower  | 
          ( | 
          Event  | 
          event | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Set track power according to the provided Event details. 
- Parameters
 - 
  
  
 
 
 
◆ _handleStartupState()
  
  
      
        
          | void AppOrchestrator::_handleStartupState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show the startup screen and wait for user interaction before continuing. 
 
 
◆ _handleThrottleState()
  
  
      
        
          | void AppOrchestrator::_handleThrottleState  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Show the throttle screen and process user interaction with the throttle. 
 
 
◆ _readLoco()
  
  
      
        
          | void AppOrchestrator::_readLoco  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Send read loco command to CommandStation client and set ReadLoco state for progress. 
 
 
◆ _switchState()
  
  
      
        
          | void AppOrchestrator::_switchState  | 
          ( | 
          AppState  | 
          appState | ) | 
           | 
         
       
   | 
  
private   | 
  
 
Switch application states. 
- Parameters
 - 
  
    | appState | State to switch to  | 
  
   
 
 
◆ begin()
      
        
          | void AppOrchestrator::begin  | 
          ( | 
           | ) | 
           | 
        
      
 
Anything required to be initiated when the orchestrator starts is called here. 
 
 
◆ onEvent()
  
  
      
        
          | void AppOrchestrator::onEvent  | 
          ( | 
          Event &  | 
          event | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
 
◆ setThrottleLoco()
      
        
          | void AppOrchestrator::setThrottleLoco  | 
          ( | 
          Loco *  | 
          loco | ) | 
           | 
        
      
 
Set the loco being managed by the throttle screen. 
- Parameters
 - 
  
    | loco | Pointer to the loco object  | 
  
   
 
 
◆ setupSelectLocoMenu()
      
        
          | void AppOrchestrator::setupSelectLocoMenu  | 
          ( | 
           | ) | 
           | 
        
      
 
Method to setup the roster list in the SelectLocoMenu when the roster has been received. 
 
 
◆ update()
      
        
          | void AppOrchestrator::update  | 
          ( | 
           | ) | 
           | 
        
      
 
Call this method at least once per main loop iteration to monitor for user interactions, ensure the display is updated, and connections are managed. 
 
 
◆ updateThrottleLoco()
      
        
          | void AppOrchestrator::updateThrottleLoco  | 
          ( | 
          LocoBroadcast  | 
          locoBroadcast | ) | 
           | 
        
      
 
Notify the throttle screen an update has been received for the associated loco. 
- Parameters
 - 
  
    | locoBroadcast | Loco broadcast data containing address, speed, direction, and function map  | 
  
   
 
 
◆ updateThrottleTrackPower()
      
        
          | void AppOrchestrator::updateThrottleTrackPower  | 
          ( | 
          TrackPower  | 
          trackPower | ) | 
           | 
        
      
 
Notify the throttle screen of a track power update. 
- Parameters
 - 
  
    | trackPower | Track power state  | 
  
   
 
 
◆ _commandStationClient
◆ _connectionManager
◆ _currentAppState
  
  
      
        
          | AppState AppOrchestrator::_currentAppState | 
         
       
   | 
  
private   | 
  
 
 
◆ _displayInterface
◆ _errorScreen
◆ _menuManager
◆ _progressScreen
◆ _startupScreen
◆ _throttleScreen
◆ _userConfirmationInterface
◆ _userSelectionInterface
The documentation for this class was generated from the following files: