Relacs Core Library  0.9.8
Public Slots | Public Member Functions | Protected Member Functions | List of all members
Session Class Reference

#include <session.h>

Inheritance diagram for Session:
Inheritance graph
[legend]
Collaboration diagram for Session:
Collaboration graph
[legend]

Public Slots

void startTheSession (bool startmacro)
 
void startTheSession (void)
 
void stopTheSession (void)
 
void doStopTheSession (bool savedialog=true, bool stopmacro=true)
 
void toggleSession (void)
 

Public Member Functions

 Session (RELACSWidget *rw, int height, QWidget *parent)
 
 ~Session (void)
 
bool running (void) const
 
int sessions (void) const
 
time_t startSessionTime (void) const
 
double sessionTime (void) const
 
string sessionTimeStr (void) const
 
double totalTime (void) const
 
int reproCount (void) const
 
void incrReProCount (void)
 
virtual void addActions (QMenu *menu)
 
bool saveData (void) const
 
void setSaveData (bool save)
 
virtual void modeChanged (void)
 

Protected Member Functions

virtual void customEvent (QEvent *qe)
 

Detailed Description

Controls a recording session.

Author
Jan Benda
Version
2.0

A recording session is started by pressing the Enter or Return key, from the RELACS menu, or clicking a button, that a Control implementation might provide.

During a session, running() returns true, sessions() returns the number of so far executed sessions, startSessionTime() returns the absolute time the session was started, sessionTime() and sessionTimeStr() return the time the current session is running. totalTime() returns the time RELACS is running.

Session sets the following environment variables that can be used from within a shell command:

Constructor & Destructor Documentation

Session ( RELACSWidget rw,
int  height,
QWidget *  parent 
)

Construct a session.

~Session ( void  )

Deconstruct the Session.

Member Function Documentation

bool running ( void  ) const

Returns true if a session is currently runnig, returns false otherwise.

Referenced by RELACSPlugin::sessionRunning(), and RELACSPlugin::sessionTimeStr().

int sessions ( void  ) const

The number of so far executed sessions including the running one.

time_t startSessionTime ( void  ) const

The time the session was started.

Referenced by SaveFiles::openFiles(), and MetaData::update().

double sessionTime ( void  ) const

The elapsed time of the current session in seconds.

Referenced by RELACSPlugin::sessionTime(), Session::sessionTimeStr(), and MetaData::update().

string sessionTimeStr ( void  ) const

A string displaying the elapsed time of the current session as specified by SessionTimeFormat.

References relacs::floor(), Str::format(), ConfigDialog::lock(), relacs::min(), Session::sessionTime(), ConfigClass::text(), and ConfigDialog::unlock().

double totalTime ( void  ) const

The elapsed time of the total program in seconds.

int reproCount ( void  ) const

The number of so far executed RePros of the running session.

Referenced by RELACSPlugin::reproCount().

void incrReProCount ( void  )

Increment the RePro counter.

Referenced by RELACSWidget::startRePro().

void addActions ( QMenu *  menu)
virtual

Add actions to the menu.

References Session::toggleSession().

Referenced by RELACSWidget::RELACSWidget().

bool saveData ( void  ) const

Returns true if the data currently recorded should be saved on disc, returns false otherwise.

void setSaveData ( bool  save)

Set the flag indicating whether data of this session should be saved to save.

void modeChanged ( void  )
virtual

Called whenever the mode is changed.

References RELACSWidget::acquisition(), and RELACSWidget::simulation().

Referenced by RELACSWidget::setMode().

void startTheSession ( bool  startmacro)
slot

Start a new session, if it is not already running. If startmacro is true the startsession - macro is called.

Note
This function must not be called from a non GUI thread!

References RELACSWidget::startSession().

Referenced by MacroCommand::execute(), and RELACSPlugin::startTheSession().

void startTheSession ( void  )
slot

Start a new session, if it is not already running, and calls the startsession - macro.

Note
This function must not be called from a non GUI thread!

Referenced by Session::toggleSession().

void stopTheSession ( void  )
slot

Stop a running session by callig the fallback macro first.

Note
This function must not be called from a non GUI thread!
See Also
doStopTheSession()

References Session::doStopTheSession(), and RELACSWidget::preStopSession().

Referenced by RELACSWidget::doStopActivity(), RELACSPlugin::stopTheSession(), and Session::toggleSession().

void doStopTheSession ( bool  savedialog = true,
bool  stopmacro = true 
)
slot

Stop a running session by launching the metadata dialog if savedialog is true. After the session is stopped the stop session macro is called if stopmacro equals true .

References MetaData::dialog(), RELACSWidget::resumeSession(), and RELACSWidget::stopSession().

Referenced by Session::customEvent(), RELACSWidget::doStopActivity(), MacroCommand::execute(), and Session::stopTheSession().

void toggleSession ( void  )
slot

Toggles the status of the session: stops a running session or start a new session if no session is running.

Note
This function must not be called from a non GUI thread!

References Session::startTheSession(), and Session::stopTheSession().

Referenced by Session::addActions(), and RELACSPlugin::toggleSession().

void customEvent ( QEvent *  qe)
protectedvirtual

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