YANE-Framework 1.1.0
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes

yane::ModelQt2::SimulatorThread Class Reference

Class to simulate the trajectory for a given model and given controls.

Collaboration diagram for yane::ModelQt2::SimulatorThread:
[legend]

List of all members.

Public Slots

void reset ()
 Slot which triggers the computing thread to be resetted.
void setControl (const QVarLengthArray< double > &control)
 Function to set the control variable.
void setIntervalTime (double sec=INFINITY)
 Function to set the maximally tolerated computing time.
void setState (const QVarLengthArray< double > &state)
 Function to set the state variable.
void setStateNoSignal (const QVarLengthArray< double > &state)
 Function to set the state variable but not to emit a signal.
void setTime (double t)
 Function to set the time instant.
void stop ()
 Slot which triggers the computing thread to stop.

Signals

void stateChanged (QVarLengthArray< double > state)
 Signal which is emitted to update the state in the widget.

Public Member Functions

 SimulatorThread (yane::Model::Model *model, int refresh_msec, QObject *parent=0)
 Constructor.
QVarLengthArray< double > state ()
 Function to return the current state value computed in SimulatorThread _thread.
 ~SimulatorThread ()
 Destructor.

Protected Member Functions

virtual void run ()
 Function which triggers the thread to start.

Protected Attributes

bool _abort
 Decision variable to check if simulation must be stopped.
double * _control
 Control variable.
double _displayrefresh_sec
 Time period inbetween two updates of the display.
double _intervaltime
 Maximal computing time in seconds.
yane::Model::Model_model
 Model used for simulation.
QMutex * _mutex
 Mutex to lock and unlock variables.
yane::Model::Simulator_simulator
 Simulator used to compute the state trajectories.
double * _state
 State variable.
double _t
 Internal simulation time.

Constructor & Destructor Documentation

yane::ModelQt2::SimulatorThread::SimulatorThread ( yane::Model::Model model,
int  refresh_msec,
QObject *  parent = 0 
)
Parameters:
modelModel used for simulation
refresh_msecTimer interval for updating the screen
parentParenting QObject

Member Function Documentation

void yane::ModelQt2::SimulatorThread::setControl ( const QVarLengthArray< double > &  control) [slot]
Parameters:
controlControl variable
void yane::ModelQt2::SimulatorThread::setIntervalTime ( double  sec = INFINITY) [slot]
Parameters:
secMaximal computing time in seconds
void yane::ModelQt2::SimulatorThread::setState ( const QVarLengthArray< double > &  state) [slot]
Parameters:
stateState variable
void yane::ModelQt2::SimulatorThread::setStateNoSignal ( const QVarLengthArray< double > &  state) [slot]
Parameters:
stateState variable
void yane::ModelQt2::SimulatorThread::setTime ( double  t) [slot]
Parameters:
tTime in seconds
QVarLengthArray< double > yane::ModelQt2::SimulatorThread::state ( )
Returns:
Current state value
void yane::ModelQt2::SimulatorThread::stateChanged ( QVarLengthArray< double >  state) [signal]
Parameters:
state