| |
libFAUDES
Sections
Index
|
faudes::DeviceExecutor Class Reference |
Application Interface | |
enum | SyncMode { SyncStrictTime = 0x01, SyncStrictEvents = 0x02 } |
Modes of synchronisation. More... | |
void | ToleranceTime (tpTime::Type maxgap) |
Set tolerance for time synchonisation. | |
void | ToleranceMode (int flag) |
Set synchronisation flags. | |
bool | SyncTime (void) |
Execute generator clock time to sync with device time. | |
Idx | SyncEvents () |
Execute scheduled or sensor events now. | |
bool | SyncWait (tpTime::Type duration=tpTime::Max) |
Wait for sensor events. | |
bool | SyncWaitMs (int durationms) |
Wait for sensor events. | |
Idx | SyncStep (tpTime::Type duration=tpTime::Max) |
Execute one transition with synchronous physical signals. | |
bool | SyncRun (tpTime::Type duration=tpTime::Max) |
Run execution with synchronous physical signals. | |
bool | IsSynchronous (void) const |
Test Syncronisation. | |
void | Devicep (vDevice *dev) |
Set device. | |
vDevice * | Devicep () |
Get device. | |
void | DeviceStart (void) |
Convenience: Start the device. | |
void | DeviceStop (void) |
Convenience: Stop the device. | |
Public Member Functions | |
Constructors & Destructor | |
DeviceExecutor () | |
Creates an emtpy DeviceExecutor. | |
~DeviceExecutor () | |
Explicit destructor. | |
Re-implemenented from ParallelExecutor | |
virtual void | Reset (long int seed=0) |
Reset the DeviceExecutor. | |
virtual void | Clear (void) |
Clear all data (generators, simulation attributes etc). | |
bool | ExecuteEvent (Idx event) |
Execute event. | |
Protected Attributes | |
bool | mSyncError |
Sync error flag. | |
tpTime::Type | mMaxSyncGap |
Max gap between physical and generator clock time. | |
int | mSyncMode |
Mode flags for synchronisation. | |
vDevice * | pDevice |
Device reference. |
faudes::DeviceExecutor::DeviceExecutor | ( | void | ) |
faudes::DeviceExecutor::~DeviceExecutor | ( | void | ) |
void faudes::DeviceExecutor::Reset | ( | long int | seed = 0 |
) | [virtual] |
Reset the DeviceExecutor.
doxygen group
Reset the executor to its initial state and reset the device, ie clear queued sensor event set actuators to a passive state
seed | Seed for PropossingExecutor random generator, 0<>system time |
Reimplemented from faudes::ProposingExecutor.
Definition at line 64 of file sp_dplpexecutor.cpp.
void faudes::DeviceExecutor::Clear | ( | void | ) | [virtual] |
Clear all data (generators, simulation attributes etc).
This includes the "HardwareReset" event.
Reimplemented from faudes::ProposingExecutor.
Definition at line 58 of file sp_dplpexecutor.cpp.
bool faudes::DeviceExecutor::ExecuteEvent | ( | Idx | event | ) | [virtual] |
Execute event.
Programmatically override any internal schedules and execute the specified event. This routine will neither synchronize generator time nor events.
event | Event by index |
Reimplemented from faudes::ProposingExecutor.
Definition at line 88 of file sp_dplpexecutor.cpp.
void faudes::DeviceExecutor::ToleranceTime | ( | tpTime::Type | maxgap | ) | [inline] |
Set tolerance for time synchonisation.
doxygen group
maxgap | Max acceptable amount of faudes-time units by which the generators global clock may be behind physical time |
Definition at line 157 of file sp_dplpexecutor.h.
void faudes::DeviceExecutor::ToleranceMode | ( | int | flag | ) | [inline] |
Set synchronisation flags.
Semantics are defined via the enum typedef SyncMode.
flag | Flag word to set mode |
Definition at line 176 of file sp_dplpexecutor.h.
bool faudes::DeviceExecutor::SyncTime | ( | void | ) |
Execute generator clock time to sync with device time.
If possible, execute the amount of clock time required for an exact match. Otherwise, accept the specified tolerance. As a last resort, issue a sync error.
Definition at line 110 of file sp_dplpexecutor.cpp.
Idx faudes::DeviceExecutor::SyncEvents | ( | void | ) |
Execute scheduled or sensor events now.
If an event is scheduled for now, execute it. Otherwise, execute a sensor event if such is ready. Otherwise execute do nothing.
Definition at line 184 of file sp_dplpexecutor.cpp.
bool faudes::DeviceExecutor::SyncWait | ( | tpTime::Type | duration = tpTime::Max |
) |
Wait for sensor events.
Wait the specified amount of time, for the proposed time to elaps, or a sensor event to occur - whatever comes first. This function will *not* synchronise with generator time. You may call SyncTime afterwards.
duration | Max duration to wait for |
Definition at line 243 of file sp_dplpexecutor.cpp.
bool faudes::DeviceExecutor::SyncWaitMs | ( | int | durationms | ) |
Wait for sensor events.
Wait the specified amount of time, for the proposed time to elaps, or a sensor event to occur - whatever comes first. This function will *not* synchronise with generator time. You may call SyncTime afterwards.
Note that the executor does not know about msecs, and thus the core interface referc to faudes-time units only. This function is an exception of this rule and is for convenience only.
durationms | Max duration in msecs to wait for |
Definition at line 275 of file sp_dplpexecutor.cpp.
Idx faudes::DeviceExecutor::SyncStep | ( | tpTime::Type | duration = tpTime::Max |
) |
Execute one transition with synchronous physical signals.
Calls SyncTime, SyncEvents and SyncWait to execute one transition. It will, however, not pass more than the specified duration.
duration | Max duration of execution wrt generator time, tpTime::Max for unlimited |
Definition at line 307 of file sp_dplpexecutor.cpp.
bool faudes::DeviceExecutor::SyncRun | ( | tpTime::Type | duration = tpTime::Max |
) |
Run execution with synchronous physical signals.
Loops SyncStep until the specified amount on time expired.
duration | Duration of execution wrt generator time, tpTime::Max for infinite |
Definition at line 335 of file sp_dplpexecutor.cpp.
bool faudes::DeviceExecutor::IsSynchronous | ( | void | ) | const [inline] |
Test Syncronisation.
Definition at line 269 of file sp_dplpexecutor.h.
void faudes::DeviceExecutor::Devicep | ( | vDevice * | dev | ) |
Set device.
The device must be configured. You must start the device befor the first call to SyncRun. Ownership of the device stays with the caller.
dev | IO Device to use |
Definition at line 31 of file sp_dplpexecutor.cpp.
vDevice* faudes::DeviceExecutor::Devicep | ( | ) | [inline] |
Get device.
Retturn a refernce to the device for inspection. Note: you must not interfear with the device during synchronuous execution.
Definition at line 294 of file sp_dplpexecutor.h.
void faudes::DeviceExecutor::DeviceStart | ( | void | ) |
void faudes::DeviceExecutor::DeviceStop | ( | void | ) |
bool faudes::DeviceExecutor::mSyncError [protected] |
tpTime::Type faudes::DeviceExecutor::mMaxSyncGap [protected] |
Max gap between physical and generator clock time.
Definition at line 317 of file sp_dplpexecutor.h.
int faudes::DeviceExecutor::mSyncMode [protected] |
vDevice* faudes::DeviceExecutor::pDevice [protected] |
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6