#include <packml_state_machine.h>
Public Member Functions | |
virtual bool | activate () override |
Override to handle activate command. More... | |
virtual bool | deactivate () override |
Override to handle deactivate command. More... | |
virtual bool | isActive () override |
Override to provide an accessor to whether the state machine is currently active. More... | |
virtual bool | setAborting (std::function< int()> state_method) override |
Override to handle setting the aborting state method. More... | |
virtual bool | setClearing (std::function< int()> state_method) override |
Override to handle setting the clearing state method. More... | |
virtual bool | setCompleting (std::function< int()> state_method) override |
Override to handle setting the completing state method. More... | |
virtual bool | setExecute (std::function< int()> state_method) override |
Override to handle setting the execute state method. More... | |
virtual bool | setHolding (std::function< int()> state_method) override |
Override to handle setting the holding state method. More... | |
virtual bool | setResetting (std::function< int()> state_method) override |
Override to handle setting the resetting state method. More... | |
virtual bool | setStarting (std::function< int()> state_method) override |
Override to handle setting the starting state method. More... | |
virtual bool | setStopping (std::function< int()> state_method) override |
Override to handle setting the stopping state method. More... | |
virtual bool | setSuspending (std::function< int()> state_method) override |
Override to handle setting the suspending state method. More... | |
virtual bool | setUnholding (std::function< int()> state_method) override |
Override to handle setting unholding state method. More... | |
virtual bool | setUnsuspending (std::function< int()> state_method) override |
Override to handle setting the un-suspending state method. More... | |
virtual | ~PackmlStateMachine () |
Public Member Functions inherited from packml_sm::AbstractStateMachine | |
virtual bool | abort () |
Call to send the abort command. More... | |
AbstractStateMachine () | |
Constructor for AbstractStateMachine. More... | |
virtual bool | clear () |
Call to send the clear command. More... | |
double | getAbortedTime () |
Accessor for the duration spent in aborted. More... | |
double | getAbortingTime () |
Accessor for the duration spent in aborting. More... | |
double | getClearingTime () |
Accessor for the duration spent in clearing. More... | |
double | getCompleteTime () |
Accessor for the duration spent in complete. More... | |
StatesEnum | getCurrentState () const |
Accessor for the current state. More... | |
void | getCurrentStatSnapshot (PackmlStatsSnapshot &snapshot_out) |
Fills the reference variable with the current stats snapshot. More... | |
double | getExecuteTime () |
Accessor for the duration spent in execute. More... | |
double | getHeldTime () |
Accessor for the duration spent in held. More... | |
double | getHoldingTime () |
Accessor for the duration spent in holding. More... | |
double | getIdleTime () |
Accessor for the duration spent in idle time. More... | |
double | getResettingTime () |
Accessor for the duration spent in resetting. More... | |
double | getStartingTime () |
Accessor for the duration spent in starting. More... | |
double | getStoppedTime () |
Accessor for the duration spent in stopped. More... | |
double | getStoppingTime () |
Accessor for the duration spent in stopping. More... | |
double | getSuspendedTime () |
Accessor for the duration spent in suspended. More... | |
double | getSuspendingTime () |
Accessor for the duration spent in suspending. More... | |
double | getUnholdingTime () |
Accessor for the duration spent in unholding. More... | |
double | getUnsuspendingTime () |
Accessor for the duration spent in unsuspending. More... | |
virtual bool | hold () |
Call to send the hold command. More... | |
void | incrementErrorStatItem (int16_t id, int32_t count, double duration) |
Call to increment or add a specific Itemized error stat. More... | |
void | incrementFailureCount () |
Call to increment the failed operation count. More... | |
void | incrementQualityStatItem (int16_t id, int32_t count, double duration) |
Call to increment or add a specific Itemized quality stat. More... | |
void | incrementSuccessCount () |
Call to increment the successful operation count. More... | |
virtual bool | reset () |
Call to send the reset command. More... | |
void | resetStats () |
Reset all of the tracked states. More... | |
void | setIdealCycleTime (float ideal_cycle_time) |
Sets the ideal cycle time in operations per second. More... | |
virtual bool | start () |
Call to send the start command. More... | |
virtual bool | stop () |
Call to send the stop command. More... | |
virtual bool | suspend () |
Call to send the suspend command. More... | |
virtual bool | unhold () |
Call to send the unhold command. More... | |
virtual bool | unsuspend () |
Call to send the unsuspend command. More... | |
virtual | ~AbstractStateMachine () |
Destructor for AbstractStateMachine. More... | |
Protected Member Functions | |
virtual void | _abort () override |
Override to call implementations version of the abort command. More... | |
virtual void | _clear () override |
Override to call implementations version of clear command. More... | |
virtual void | _hold () override |
Override to call implementations version of the hold command. More... | |
virtual void | _reset () override |
Override to call implementations version of the reset command. More... | |
virtual void | _start () override |
Override to call implementations version of start command. More... | |
virtual void | _stop () override |
Override to call implementations version of the stop command. More... | |
virtual void | _suspend () override |
Override to call implementations version of the suspend command. More... | |
virtual void | _unhold () override |
Override to call implementations version of the unhold command. More... | |
virtual void | _unsuspend () override |
Override to call implementations version of the unsuspend command. More... | |
PackmlStateMachine () | |
Protected Member Functions inherited from packml_sm::AbstractStateMachine | |
void | invokeStateChangedEvent (const std::string &name, StatesEnum value) |
Call to invoke a state changed event. More... | |
Private Member Functions | |
PackmlState * | getPackmlState (StatesEnum state) |
void | handleStateChanged (StateChangeNotifier &state_machine, const StateChangedEventArgs &args) |
void | sendCommand (CmdEnum command) |
bool | setStateMethod (StatesEnum state, std::function< int()> state_method) |
void | update (StateMachineEventLoop &event_loop, const EventArgs &args) |
Private Attributes | |
boost::msm::back::state_machine< T > | boost_fsm_ |
StateMachineEventLoop | event_loop_ |
bool | is_active_ = false |
Additional Inherited Members | |
Public Attributes inherited from packml_sm::AbstractStateMachine | |
EventHandler< AbstractStateMachine, StateChangedEventArgs > | stateChangedEvent |
Definition at line 36 of file packml_state_machine.h.
|
virtual |
Definition at line 36 of file packml_state_machine.cpp.
|
protected |
Definition at line 24 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the abort command.
Implements packml_sm::AbstractStateMachine.
Definition at line 186 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of clear command.
Implements packml_sm::AbstractStateMachine.
Definition at line 144 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the hold command.
Implements packml_sm::AbstractStateMachine.
Definition at line 156 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the reset command.
Implements packml_sm::AbstractStateMachine.
Definition at line 150 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of start command.
Implements packml_sm::AbstractStateMachine.
Definition at line 138 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the stop command.
Implements packml_sm::AbstractStateMachine.
Definition at line 180 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the suspend command.
Implements packml_sm::AbstractStateMachine.
Definition at line 168 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the unhold command.
Implements packml_sm::AbstractStateMachine.
Definition at line 162 of file packml_state_machine.cpp.
|
overrideprotectedvirtual |
Override to call implementations version of the unsuspend command.
Implements packml_sm::AbstractStateMachine.
Definition at line 174 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle activate command.
Implements packml_sm::AbstractStateMachine.
Definition at line 48 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle deactivate command.
Implements packml_sm::AbstractStateMachine.
Definition at line 57 of file packml_state_machine.cpp.
|
private |
Definition at line 229 of file packml_state_machine.cpp.
|
private |
Definition at line 308 of file packml_state_machine.cpp.
|
overridevirtual |
Override to provide an accessor to whether the state machine is currently active.
Implements packml_sm::AbstractStateMachine.
Definition at line 132 of file packml_state_machine.cpp.
|
private |
Definition at line 192 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the aborting state method.
state_method | The state method to execute when entering the aborting state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 84 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the clearing state method.
state_method | The state method to execute when entering the clearing state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 90 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the completing state method.
state_method | The state method to execute when entering the completing state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 78 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the execute state method.
state_method | The state method to execute when entering the exec state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 72 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the holding state method.
state_method | The state method to execute when entering the holding state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 120 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the resetting state method.
state_method | The state method to execute when entering the resetting state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 102 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the starting state method.
state_method | The state method to execute when entering the start state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 66 of file packml_state_machine.cpp.
|
private |
Definition at line 294 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the stopping state method.
state_method | The state method to execute when entering the stopping state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 96 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the suspending state method.
state_method | The state method to execute when entering the suspending state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 108 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting unholding state method.
state_method | The state method to execute when entering the unholding state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 126 of file packml_state_machine.cpp.
|
overridevirtual |
Override to handle setting the un-suspending state method.
state_method | The state method to execute when entering the unsuspending state. |
Implements packml_sm::AbstractStateMachine.
Definition at line 114 of file packml_state_machine.cpp.
|
private |
Definition at line 314 of file packml_state_machine.cpp.
|
private |
Definition at line 73 of file packml_state_machine.h.
|
private |
Definition at line 74 of file packml_state_machine.h.
|
private |
Definition at line 71 of file packml_state_machine.h.