![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
#include <StateWin.h>
Public Member Functions | |
| StateWin (int nStateId, SessionWin &session, const std::string &strStateName="", const std::string &strRefTag="") | |
| Initialization constructor. More... | |
| StateWin (int nStateId, SessionWin &session, const std::string &strStateName, const std::string &strRefTag, StateEvent *listStateEvents[]) | |
| List constructor. More... | |
| virtual | ~StateWin () |
| Destructor. | |
| virtual int | receiveEvent () |
| Receive next window event. More... | |
| virtual void | actionEnterState (int nPrevStateId, int nEventId) |
| Execute "enter state" action. More... | |
| virtual void | actionExitState (int nNextStateId, int nEventId) |
| Execute "exit state" action. More... | |
| virtual void | setButtonStates () |
| Set button states. More... | |
| SessionWin & | session () |
| Get the embedding window session. More... | |
| void | enableMouseEvents (bool bEnable) |
| Enable/disable mouse events. More... | |
| void | enableKbEvents (bool bEnable) |
| Enable/disable keyboard events. More... | |
Public Member Functions inherited from rnr::State | |
| State (int nStateId, const std::string &strStateName="", const std::string &strRefTag="") | |
| Initialization constructor. More... | |
| State (int nStateId, const std::string &strStateName, const std::string &strRefTag, StateEvent *listStateEvents[]) | |
| List constructor. More... | |
| virtual | ~State () |
| Destructor. | |
| int | addStateEvents (StateEvent *pStateEvent,...) |
| Add a list of state events to this state. More... | |
| void | addStateEvent (StateEvent *pStateEvent) |
| Add state to this state. More... | |
| bool | deleteStateEvent (int nEventId) |
| Delete state event from this state. More... | |
| uint_t | setTimeOut (uint_t usecTimeOut) |
| Set recieve event time out. More... | |
| uint_t | getTimeOut () |
| Get recieve event time out. More... | |
| virtual void | queueNextEvent (int nEventId) |
| Queue the next event to be "recieved". More... | |
| virtual int | dispatchEvent (int nPrevStateId, int nEventId) |
| Dispatch received event by executing associated action and transitioning to the next state. More... | |
| virtual int | actionDefault (int nPrevStateId, int nEventId) |
| Execute 'default' action. More... | |
| int | getStateId () const |
| Get state id. More... | |
| std::string | getStateName () const |
| Get state name. More... | |
| std::string | getRefTag () const |
| Get state reference tag. More... | |
| std::string | getEventName (int nEventId) |
| Get state event name. More... | |
| std::string | getActionName (int nEventId) |
| Get state action name. More... | |
| virtual void | printState (FILE *fp=stdout, int indent=0) |
| Print out state. More... | |
| State (Session &session, int nInitAction=UIActionNone) | |
| virtual int | getNextAction (Session &session, int nTimeoutMs) |
| virtual int | setNextAction (int nAction) |
| Set the next input action to process. More... | |
| int | getCurAction () |
| Get the currently retrieved input action. More... | |
| bool | hasFatal () |
| Test if state has fatal condition. More... | |
| void | setFatal () |
| bool | isModified () |
| void | setModifiedState (bool bModified) |
| void | maskHardButton (bool bEnDis) |
| Enable/disable masking of hard button input. More... | |
| virtual bool | isHardButtonPushed (Session &session) |
| virtual void | prompt (Session &session) |
| Prompt user, given the state. More... | |
| virtual void | setMenuStates (Session &session) |
| virtual void | transQuit (Session &session) |
| virtual void | transPrev (Session &session) |
Protected Member Functions | |
| virtual void | initOnceGuiInterface () |
| One-time initialization of the window gui interface. More... | |
| virtual void | initOnceButtons () |
| One-time button menu initialization. More... | |
| virtual void | buildGuiInterface () |
| Build the window gui interface. More... | |
| virtual void | showGuiInterface () |
| Show the window gui interface. More... | |
| virtual void | destroyGuiInterface () |
| Destroy the window gui interface. More... | |
Protected Member Functions inherited from rnr::State | |
| void | init (int nStateId, const std::string &strStateName="", const std::string &strRefTag="") |
| Initialize data. More... | |
| virtual std::string | getReservedStateName (int nStateId) |
| Get the reserved state name. More... | |
| virtual void | buildInterface (Session &session) |
| virtual void | destroyInterface () |
| virtual void | initButtonMenu () |
Protected Attributes | |
| SessionWin & | m_session |
| state id | |
| bool | m_bOneTimeInit |
| state's one-time initializaion | |
| bool | m_bMouseEvents |
| enable/disable mouse events | |
| bool | m_bKbEvents |
| enable/disable keyboard events | |
| WinButtonMenu * | m_pButtons |
| button menu | |
| WinCvMouse | m_mouse |
| mouse | |
Protected Attributes inherited from rnr::State | |
| int | m_nStateId |
| state id | |
| std::string | m_strStateName |
| state name | |
| std::string | m_strRefTag |
| state tag (short id string) | |
| TransTblMap_T | m_mapTransTbl |
| state transition table | |
| int | m_nQueuedEventId |
| queue state event | |
| bool | m_bHasQueuedEvent |
| [no] queued state event | |
| uint_t | m_usecTimeOut |
| receive event time out (useconds) | |
| Window * | m_pWin |
| bound window | |
| Menu * | m_pMenu |
| button menu | |
| int | m_nInitAction |
| initial state input action | |
| int | m_nCurAction |
| current state input action | |
| bool | m_bFatal |
| fatal error | |
| bool | m_bModified |
| state [not] modified | |
| bool | m_bHardBttnEnable |
| enable/disable hard button input | |
Friends | |
| class | StateEvent |
| friend | |
Additional Inherited Members | |
Public Types inherited from rnr::State | |
| typedef std::map< int, StateEvent * > | TransTblMap_T |
| transition table type | |
Static Public Attributes inherited from rnr::State | |
| static const int | StateIdUndef = 0 |
| undefined state | |
| static const int | StateIdStart = 1 |
| start state | |
| static const int | StateIdPrev = 2 |
| the previous state | |
| static const int | StateIdThis = 3 |
| the current (this) state | |
| static const int | StateIdTerminate = 4 |
| terminate state | |
| static const int | StateIdNumOf = 5 |
| number of reserved state id's | |
State base class.
Definition at line 84 of file StateWin.h.
|
inline |
Initialization constructor.
| nStateId | State id. Must be state machine unique. |
| session | State's embedding in (derived) window session. |
| strStateName | State name. |
| strRefTag | State reference id. |
Definition at line 95 of file StateWin.h.
References m_bKbEvents, m_bMouseEvents, m_bOneTimeInit, and m_pButtons.
|
inline |
List constructor.
| nStateId | State id. Must be state machine unique. |
| session | State's embedding in (derived) window session. |
| strStateName | State name. |
| strRefTag | State reference id. |
| listStateEvents | Declaration list of allocated state events. NULL terminated. |
Definition at line 118 of file StateWin.h.
References m_bKbEvents, m_bMouseEvents, m_bOneTimeInit, and m_pButtons.
|
virtual |
Execute "enter state" action.
| nPrevStateId | Previous state id. |
| nEventId | Received event id. |
Reimplemented from rnr::State.
Definition at line 115 of file StateWin.cxx.
Referenced by ~StateWin().
|
virtual |
Execute "exit state" action.
| nNextStateId | Next state id. |
| nEventId | Received event id. |
Reimplemented from rnr::State.
Definition at line 141 of file StateWin.cxx.
Referenced by ~StateWin().
|
inlineprotectedvirtual |
Build the window gui interface.
This function is called on the "enter state" action.
Reimplemented in rnr::StateWinCamera.
Definition at line 251 of file StateWin.h.
|
inlineprotectedvirtual |
Destroy the window gui interface.
This function is called on the "exit state" action.
Definition at line 272 of file StateWin.h.
References rnr::Win::eraseWorkspace(), and rnr::SessionWin::win().
|
inline |
Enable/disable keyboard events.
| bEnable | Enable (true) or disable (false) state. |
Definition at line 203 of file StateWin.h.
References m_bKbEvents.
|
inline |
Enable/disable mouse events.
| bEnable | Enable (true) or disable (false) state. |
Definition at line 193 of file StateWin.h.
References m_bMouseEvents.
|
inlineprotectedvirtual |
One-time button menu initialization.
This function is called on the "enter state" action.
Reimplemented in rnr::StateWinCamera.
Definition at line 241 of file StateWin.h.
Referenced by initOnceGuiInterface().
|
inlineprotectedvirtual |
One-time initialization of the window gui interface.
This function is called on the "enter state" action. Another option, is to do these one-time initialization during object construction. However, derived class objects would call the base classes one-time initialization unnecessarily. So, lazy initialization is used to make use of C++ inheritence.
Definition at line 227 of file StateWin.h.
References initOnceButtons().
|
virtual |
Receive next window event.
The receive event may set state internal variables used specifically by the state.
Reimplemented from rnr::State.
Definition at line 78 of file StateWin.cxx.
References rnr::UIEventNone.
Referenced by ~StateWin().
|
inline |
Get the embedding window session.
Definition at line 183 of file StateWin.h.
References m_session.
|
inlinevirtual |
Set button states.
State and/or session data determine the state of the buttons.
Reimplemented in rnr::StateWinCamera.
Definition at line 174 of file StateWin.h.
|
inlineprotectedvirtual |
Show the window gui interface.
This function is called on the "enter state" action.
Definition at line 261 of file StateWin.h.
References rnr::Win::showWorkspace(), and rnr::SessionWin::win().