mcx::state_machine::State

mcx::state_machine::State

More…

Public Functions

Name
template <class STATE ,class MACHINE >
void
create(MACHINE * newMachine, const STATE & state, int id, ErrorHandleBase * errorHandle)
void addErrorsHelper(ErrorGroup * stateErrors, const ErrorGroup & errorsToAdd)
void enableErrorsHelper(ErrorGroup * stateErrors, const ErrorGroup & refErrors, const ErrorGroup & errorsToAdd)
void disableErrorsHelper(ErrorGroup * stateErrors, const ErrorGroup & errorsToAdd)
void addErrors(const ErrorGroup & codes, signal_monitor::MonitorAction newAction)
virtual void registerUserEvents()
template <class MACHINE >
void
setMachine(MACHINE * newMachine)
template <class MACHINE >
MACHINE *
getMachine()
State()
virtual ~State()
double getDtSec() const
int id()
void clearEventQueue(bool highPriority =true, bool lowPriority =true)
SUPER_STATE * setActiveState(int state_id)
template <class NEWSTATE >
NEWSTATE *
setActiveState()
template <class NEWSTATE >
NEWSTATE *
setActiveState(const NEWSTATE & state)
template <typename… STATES>
bool
isStateActive()
bool isStateActive(int id)
void addEvent(const Event0< SUPER_STATE > & event, double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC, EventPriority priority =HIGH_PRIORITY_EVENT)
void addEvent(const Event1< SUPER_STATE > & event, double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC, EventPriority priority =HIGH_PRIORITY_EVENT)
void addEvent(const Event2< SUPER_STATE > & event, double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC, EventPriority priority =HIGH_PRIORITY_EVENT)
void addEvent(const Event3< SUPER_STATE > & event, double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC, EventPriority priority =HIGH_PRIORITY_EVENT)
double getActiveTimeoutSec()
virtual const char * stateName() const
virtual const char * eventName(Event< SUPER_STATE > * event)
virtual EventStatus acknowledgeErrors()
bool clearErrorMonitor(bool warnings_only =false)
ErrorHandleBase * getErrorMonitor()
EventStatus warning(const Error & error)
EventStatus forcedDisengaged(const Error & error)
EventStatus shutdown(const Error & error)
EventStatus emergencyStop(const Error & error)
EventStatus delayEvent()
virtual EventStatus terminateEvent()
void errorMonitorAction()
virtual void enter()
virtual void enter(int prev_state_id)
virtual void leave()
virtual void leave(int next_state_id)
virtual void iterate(double dt_sec)
template <class STATE >
int
id(id_caller< STATE > )

Protected Functions

Name
void addToEventList(const event_name & event)
void addEventName(const Event0< SUPER_STATE > & event, const std::string & eventName)
void addEventName(const Event1< SUPER_STATE > & event, const std::string & eventName)
void addEventName(const Event2< SUPER_STATE > & event, const std::string & eventName)
void addEventName(const Event3< SUPER_STATE > & event, const std::string & eventName)
virtual EventStatus warning_(const Error & error) =0
virtual EventStatus forcedDisengaged_(const Error & error) =0
virtual EventStatus shutdown_(const Error & error) =0
virtual EventStatus emergencyStop_(const Error & error) =0

Detailed Description

template <class SUPER_STATE >
class mcx::state_machine::State;

Public Functions Documentation

function create

template <class STATE ,
class MACHINE >
inline void create(
    MACHINE * newMachine,
    const STATE & state,
    int id,
    ErrorHandleBase * errorHandle
)

function addErrorsHelper

inline void addErrorsHelper(
    ErrorGroup * stateErrors,
    const ErrorGroup & errorsToAdd
)

function enableErrorsHelper

inline void enableErrorsHelper(
    ErrorGroup * stateErrors,
    const ErrorGroup & refErrors,
    const ErrorGroup & errorsToAdd
)

function disableErrorsHelper

inline void disableErrorsHelper(
    ErrorGroup * stateErrors,
    const ErrorGroup & errorsToAdd
)

function addErrors

inline void addErrors(
    const ErrorGroup & codes,
    signal_monitor::MonitorAction newAction
)

function registerUserEvents

inline virtual void registerUserEvents()

Reimplemented by: mcx::drive::Cia402FsmBase::registerUserEvents, mcx::drive::SercosFsmBase::registerUserEvents

function setMachine

template <class MACHINE >
inline void setMachine(
    MACHINE * newMachine
)

function getMachine

template <class MACHINE >
inline MACHINE * getMachine()

function State

inline State()

function ~State

inline virtual ~State()

function getDtSec

inline double getDtSec() const

function id

inline int id()

function clearEventQueue

inline void clearEventQueue(
    bool highPriority =true,
    bool lowPriority =true
)

function setActiveState

inline SUPER_STATE * setActiveState(
    int state_id
)

function setActiveState

template <class NEWSTATE >
inline NEWSTATE * setActiveState()

function setActiveState

template <class NEWSTATE >
inline NEWSTATE * setActiveState(
    const NEWSTATE & state
)

function isStateActive

template <typename... STATES>
inline bool isStateActive()

function isStateActive

inline bool isStateActive(
    int id
)

function addEvent

inline void addEvent(
    const Event0< SUPER_STATE > & event,
    double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC,
    EventPriority priority =HIGH_PRIORITY_EVENT
)

function addEvent

inline void addEvent(
    const Event1< SUPER_STATE > & event,
    double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC,
    EventPriority priority =HIGH_PRIORITY_EVENT
)

function addEvent

inline void addEvent(
    const Event2< SUPER_STATE > & event,
    double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC,
    EventPriority priority =HIGH_PRIORITY_EVENT
)

function addEvent

inline void addEvent(
    const Event3< SUPER_STATE > & event,
    double timeoutSec =EVENT_DEFAULT_TIMEOUT_SEC,
    EventPriority priority =HIGH_PRIORITY_EVENT
)

function getActiveTimeoutSec

inline double getActiveTimeoutSec()

function stateName

inline virtual const char * stateName() const

function eventName

inline virtual const char * eventName(
    Event< SUPER_STATE > * event
)

function acknowledgeErrors

inline virtual EventStatus acknowledgeErrors()

function clearErrorMonitor

inline bool clearErrorMonitor(
    bool warnings_only =false
)

function getErrorMonitor

inline ErrorHandleBase * getErrorMonitor()

function warning

inline EventStatus warning(
    const Error & error
)

function forcedDisengaged

inline EventStatus forcedDisengaged(
    const Error & error
)

function shutdown

inline EventStatus shutdown(
    const Error & error
)

function emergencyStop

inline EventStatus emergencyStop(
    const Error & error
)

function delayEvent

inline EventStatus delayEvent()

function terminateEvent

inline virtual EventStatus terminateEvent()

Reimplemented by: mcx::drive::Transition::terminateEvent, mcx::drive::TransitionSercos::terminateEvent

function errorMonitorAction

inline void errorMonitorAction()

function enter

inline virtual void enter()

Reimplemented by: mcx::drive::NotReadyToSwitchOn::enter, mcx::drive::SwitchOnDisabled::enter, mcx::drive::SwitchOn::enter, mcx::drive::OperationEnable::enter, mcx::drive::QuickStopActive::enter, mcx::drive::Fault::enter, mcx::drive::NotReadyToPowerOn::enter, mcx::drive::ReadyForPowerOn::enter, mcx::drive::ReadyForOperation::enter, mcx::drive::InOperation::enter, mcx::drive::Halt::enter, mcx::drive::FaultSercos::enter

function enter

inline virtual void enter(
    int prev_state_id
)

function leave

inline virtual void leave()

Reimplemented by: mcx::drive::OperationEnable::leave, mcx::drive::Fault::leave, mcx::drive::FaultSercos::leave

function leave

inline virtual void leave(
    int next_state_id
)

function iterate

inline virtual void iterate(
    double dt_sec
)

Reimplemented by: mcx::drive::OperationEnable::iterate, mcx::drive::QuickStopActive::iterate, mcx::drive::Fault::iterate, mcx::drive::InOperation::iterate, mcx::drive::FaultSercos::iterate, mcx::drive::SwitchOnDisabled::iterate

function id

template <class STATE >
static inline int id(
    id_caller< STATE > 
)

Protected Functions Documentation

function addToEventList

inline void addToEventList(
    const event_name & event
)

function addEventName

inline void addEventName(
    const Event0< SUPER_STATE > & event,
    const std::string & eventName
)

function addEventName

inline void addEventName(
    const Event1< SUPER_STATE > & event,
    const std::string & eventName
)

function addEventName

inline void addEventName(
    const Event2< SUPER_STATE > & event,
    const std::string & eventName
)

function addEventName

inline void addEventName(
    const Event3< SUPER_STATE > & event,
    const std::string & eventName
)

function warning_

virtual EventStatus warning_(
    const Error & error
) =0

Reimplemented by: mcx::drive::Cia402FsmBase::warning_, mcx::drive::SercosFsmBase::warning_

function forcedDisengaged_

virtual EventStatus forcedDisengaged_(
    const Error & error
) =0

Reimplemented by: mcx::drive::Cia402FsmBase::forcedDisengaged_, mcx::drive::SercosFsmBase::forcedDisengaged_

function shutdown_

virtual EventStatus shutdown_(
    const Error & error
) =0

Reimplemented by: mcx::drive::Cia402FsmBase::shutdown_, mcx::drive::SercosFsmBase::shutdown_

function emergencyStop_

virtual EventStatus emergencyStop_(
    const Error & error
) =0

Reimplemented by: mcx::drive::Cia402FsmBase::emergencyStop_, mcx::drive::SercosFsmBase::emergencyStop_


Updated on 2022-04-05 at 16:21:27 +0200