Relacs Core Library
0.9.8
|
#include <session.h>
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) |
Controls a recording session.
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:
RELACSSESSIONTIME
: The elapsed time of the current session formatted as a string.RELACSSESSIONSECONDS
: The elapsed time of the current session in seconds.RELACSSESSIONSAVED
: Equals "1" if the session gets saved. Session | ( | RELACSWidget * | rw, |
int | height, | ||
QWidget * | parent | ||
) |
Construct a session.
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().
|
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.
|
virtual |
Called whenever the mode is changed.
References RELACSWidget::acquisition(), and RELACSWidget::simulation().
Referenced by RELACSWidget::setMode().
|
slot |
Start a new session, if it is not already running. If startmacro is true
the startsession - macro is called.
References RELACSWidget::startSession().
Referenced by MacroCommand::execute(), and RELACSPlugin::startTheSession().
|
slot |
Start a new session, if it is not already running, and calls the startsession - macro.
Referenced by Session::toggleSession().
|
slot |
Stop a running session by callig the fallback macro first.
References Session::doStopTheSession(), and RELACSWidget::preStopSession().
Referenced by RELACSWidget::doStopActivity(), RELACSPlugin::stopTheSession(), and Session::toggleSession().
|
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().
|
slot |
Toggles the status of the session: stops a running session or start a new session if no session is running.
References Session::startTheSession(), and Session::stopTheSession().
Referenced by Session::addActions(), and RELACSPlugin::toggleSession().
|
protectedvirtual |
References Session::doStopTheSession().