hlcc 2.0.0-beta2+pre1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
hlcc::trksim::ActionsApp Class Reference

#include <actionsApp.hpp>

Inheritance diagram for hlcc::trksim::ActionsApp:

Public Member Functions

 ActionsApp (rad::Application &appl, ActionMgr &action_mgr, DataContext &data)
 
void GetConfig (scxml4cpp::Context *c)
 
void SetConfig (scxml4cpp::Context *c)
 
void LoadConfig (scxml4cpp::Context *c)
 
void TrsBadHealthGoIdle (scxml4cpp::Context *c)
 
virtual ~ActionsApp ()
 
 ActionsApp (const ActionsApp &)=delete
 
ActionsAppoperator= (const ActionsApp &)=delete
 Disable copy constructor.
 

Detailed Description

We override some actions from RAD App because of the more fine-grained control they give. Perhaps could be merged to RAD in the future.

TODO: Make methods of rad::ActionsApp virtual. Currently we violate https://isocpp.org/wiki/faq/strange-inheritance#redefining-nonvirtuals.

Constructor & Destructor Documentation

◆ ActionsApp() [1/2]

hlcc::trksim::ActionsApp::ActionsApp ( rad::Application &  appl,
ActionMgr action_mgr,
DataContext data 
)

Constructor.

Parameters
applReference to the Application used to inject internal events.
action_mgrReference to the ActionMgr used to trigger the re-initialize notification to all ActionGroup and Activity objects when processing the Init request.
dataData shared within the application among actions and activities.

◆ ~ActionsApp()

hlcc::trksim::ActionsApp::~ActionsApp ( )
virtual

◆ ActionsApp() [2/2]

hlcc::trksim::ActionsApp::ActionsApp ( const ActionsApp )
delete

Member Function Documentation

◆ GetConfig()

void hlcc::trksim::ActionsApp::GetConfig ( scxml4cpp::Context *  c)

Implementation of the GetConfig action. Overrides rad::ActionsApp::GetConfig. This action:

  • retrieves the value(s) of the given configuration parameter(s) identified via the key(s). If multiple keys are provided they must be separated by one empty space.
  • replies back to the originator of the GetConfig request with the retrieved values. If no key is provided, the complete application configuration is returned.
Parameters
[in]cContext containing the last event received by the State Machine.

◆ LoadConfig()

void hlcc::trksim::ActionsApp::LoadConfig ( scxml4cpp::Context *  c)

Implementation of the LoadConfig action. Overrides rad::ActionsApp::LoadConfig. This action:

  • Loads the configuration file whose path is provided in the payload and merges its content into the current configuration.
  • updates the OLDB
  • triggers the re-configuration notification to the others ActionGroup and Activities.
  • replies back to the originator of the LoadConfig request.
Parameters
[in]cContext containing the last event received by the State Machine.

◆ operator=()

ActionsApp & hlcc::trksim::ActionsApp::operator= ( const ActionsApp )
delete

Disable copy constructor.

◆ SetConfig()

void hlcc::trksim::ActionsApp::SetConfig ( scxml4cpp::Context *  c)

Implementation of the SetConfig action. Overrides rad::ActionsApp::SetConfig. This action:

  • writes the value(s) for the given configuration parameter(s). Parameters should be provided as a yaml string containing keys and values.
  • updates the OLDB
  • trigger the re-configuration notification to the others ActionGroup and Activities.
  • replies back to the originator of the SetConfig request.
Parameters
[in]cContext containing the last event received by the State Machine.

◆ TrsBadHealthGoIdle()

void hlcc::trksim::ActionsApp::TrsBadHealthGoIdle ( scxml4cpp::Context *  c)

Implementation of the TrsBadHealthGoIdle action.

Our SM, when in states "On::Operational::Presetting" or "On::Operational::Tracking", calls this action for a "TrsEvents.HealthBad" event. If SCXML and our stack of tools would support running 2 actions for 1 event, we could define the SM to run actions "ActionsApp.TrsHealth" and "ActionsStopMoving". But instead we run this separate action that combines them into one.

Another note on SM design: With our estimator-driven design, it does not help to add target="On::Operational::Idle" to the "HealthBad" event in states Presetting and Tracking. Without disabling the RA/DEC target (which the stop action does, and we also do here in TrsBadHealthGoIdle), the estimator would immediately produce "EstimatedStateIsTrackingUnexpected" and thus bring the SM back from Idle to Tracking.

Parameters
[in]cContext containing the last event received by the State Machine.

The documentation for this class was generated from the following files: