![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
#include <SessionWin.h>
Public Types | |
| enum | VideoSrcType { VideoSrcTypeDevice = 0, VideoSrcTypeUdp, VideoSrcTypeFile, VideoSrcTypeNumOf } |
| Video source types. More... | |
Public Member Functions | |
| SessionWin (int nSessionId=0, const std::string &strSessionName="Session", Win *pWin=NULL) | |
| Default initialization contructor. More... | |
| ~SessionWin () | |
| Destructor. | |
| void | setWin (Win *pWin) |
| Set session's window. More... | |
| Win * | getWin () |
| Get the session window object. More... | |
| Win & | win () |
| Get the session window object. More... | |
| VideoSrcType | getVideoSrcType () |
| Get the video source type. More... | |
| void | setVideoSrcType (VideoSrcType eVideoSrcType) |
| Set the video source type. More... | |
| int | setVideoDevice (const std::string &strVideoDevName) |
| Set the video device name. More... | |
| std::string | getVideoDevName () |
| Get the video device name. More... | |
| int | getVideoIndex () |
| Get the video device index. More... | |
| int | getVideoIndex (const std::string &strVideoDevName) |
| Get the video index associated with the device. More... | |
| int | getVideoPort () |
| Get the video stream port. More... | |
| void | setVideoPort (int nVideoPort) |
| Set the video stream port. More... | |
Public Member Functions inherited from rnr::Session | |
| Session (int nSessionId=0, const std::string &strSessionName="Session") | |
| Default initialization contructor. More... | |
| ~Session () | |
| Destructor. | |
| StateMach & | sm () |
| Session's state machine. More... | |
| int | getSessionId () const |
| Get session id. More... | |
| std::string | getSessionName () const |
| Get session name. More... | |
| void | setContext (void *pContext) |
| Set state relevant context. More... | |
| void * | getContext () |
| Get state relevant context. More... | |
| void | setError (int ecode, const char *sFmt,...) |
| Set session error. More... | |
| void | setFatal (int ecode, const char *sFmt,...) |
| Set session fatal error. More... | |
| int | getErrorCode () |
| Get the last error code. More... | |
| std::string | getErrorMsg () |
| Get the last error message. More... | |
| bool | isFatal () |
| Test if session is in fatal condition. More... | |
Static Public Attributes | |
| static const VideoSrcType | VideoSrcTypeDft = VideoSrcTypeDevice |
| static const char *const | VideoDevNameDft = "/dev/video0" |
| static const int | VideoIndexDft = 0 |
| static const int | VideoPortDft = 4000 |
Protected Attributes | |
| Win * | m_pWin |
| application main gui window | |
| VideoSrcType | m_eVideoSrcType |
| video source type | |
| std::string | m_strVideoDevName |
| video device name | |
| int | m_nVideoIndex |
| video index (device minor number) | |
| int | m_nVideoPort |
| video stream UDP/IP port | |
Protected Attributes inherited from rnr::Session | |
| int | m_nSessionId |
| session id | |
| std::string | m_strSessionName |
| session name | |
| StateMach | m_sm |
| session state machine | |
| void * | m_pContext |
| state specific data | |
| int | m_ecode |
| last error code | |
| char | m_bufErrorMsg [256] |
| error message | |
| bool | m_bHasFatal |
| does [not] have fatal condition | |
Workflow Session Class
Session state persist throughout the livetime of an application. A series of workflow states, each with its on finite state machine, is supportedc.
Definition at line 86 of file SessionWin.h.
Video source types.
| Enumerator | |
|---|---|
| VideoSrcTypeDevice |
source direct from video device |
| VideoSrcTypeUdp |
source from UDP stream |
| VideoSrcTypeFile |
source from file |
| VideoSrcTypeNumOf |
number of video source types |
Definition at line 92 of file SessionWin.h.
|
inline |
Default initialization contructor.
Definition at line 112 of file SessionWin.h.
|
inline |
Get the video device name.
Definition at line 206 of file SessionWin.h.
References m_strVideoDevName.
|
inline |
Get the video device index.
Definition at line 216 of file SessionWin.h.
References m_nVideoIndex.
| int rnr::SessionWin::getVideoIndex | ( | const std::string & | strVideoDevName | ) |
Get the video index associated with the device.
| strVideoDevName | Video camera device name. |
|
inline |
Get the video stream port.
Definition at line 235 of file SessionWin.h.
References m_nVideoPort.
|
inline |
Get the video source type.
Definition at line 177 of file SessionWin.h.
References m_eVideoSrcType.
|
inline |
Get the session window object.
Definition at line 157 of file SessionWin.h.
References m_pWin.
| int SessionWin::setVideoDevice | ( | const std::string & | strVideoDevName | ) |
Set the video device name.
The video index (device minor number) is determined and also set.
| strVideoDevName | Video device name. |
Definition at line 77 of file SessionWin.cxx.
Referenced by setVideoSrcType().
|
inline |
Set the video stream port.
| nVideoPort | UDP port. |
Definition at line 245 of file SessionWin.h.
References m_nVideoPort.
|
inline |
Set the video source type.
| eVideoSrcType | One of VideoSrcType. |
Definition at line 187 of file SessionWin.h.
References m_eVideoSrcType, and setVideoDevice().
|
inline |
Set session's window.
The session own the window object and will delete it window replacement or on session object deletion.
| pWin | Pointer to window object. |
Definition at line 143 of file SessionWin.h.
References m_pWin.
|
inline |
Get the session window object.
Definition at line 167 of file SessionWin.h.
References m_pWin.
Referenced by rnr::StateWin::destroyGuiInterface(), and rnr::StateWin::showGuiInterface().