#include <sp_dplpexecutor.h>
Inheritance diagram for faudes::DeviceExecutor:
The SyncStep() procedure implements the below stages. It returns true, if indeed a transition was executed. It returns false on if synchronistion fails or the specified duration expired.
Implementation note: if multiple sensor events are available, they will be all executed. This may change in a future version.
Naturally, the DeviceExecutor requires the IO Device plugin in order to be functional. In the absence of the plugin, the DeviceExecutor will behave like a ProposingExecutor.
Definition at line 77 of file sp_dplpexecutor.h.
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. | |
Application Interface | |
bool | SyncTime (void) |
Execute generator 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. | |
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 | Tolerance (tpTime::Type maxgap) |
Set tolerance for time synchonisation. | |
void | Devicep (vDevice *dev) |
Set device. | |
void | DeviceStart (void) |
Convenience: Start the device. | |
void | DeviceStop (void) |
Convenience: Stop the device. | |
Protected Attributes | |
bool | mSyncError |
Sync error flag. | |
tpTime::Type | mMaxSyncGap |
Max gap between physical and generator time. | |
vDevice * | pDevice |
Device reference. |
|
Creates an emtpy DeviceExecutor.
Definition at line 21 of file sp_dplpexecutor.cpp. |
|
Explicit destructor.
Definition at line 26 of file sp_dplpexecutor.cpp. |
|
Clear all data (generators, simulation attributes etc). This includes the "HardwareReset" event. Reimplemented from faudes::ProposingExecutor. Definition at line 56 of file sp_dplpexecutor.cpp. |
|
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.
Definition at line 30 of file sp_dplpexecutor.cpp. |
|
Convenience: Start the device.
Definition at line 40 of file sp_dplpexecutor.cpp. |
|
Convenience: Stop the device.
Definition at line 48 of file sp_dplpexecutor.cpp. |
|
Execute event. Programmatically override any internal schedules and execute the specified event. This routine will does neither synchronize generator time nor events.
Reimplemented from faudes::ProposingExecutor. Definition at line 71 of file sp_dplpexecutor.cpp. |
|
Test Syncronisation.
Definition at line 221 of file sp_dplpexecutor.h. |
|
Reset the DeviceExecutor. Reset the executor to its initial state and reset the device, ie clear queued sensor event set actuators to a passive state
Reimplemented from faudes::ProposingExecutor. Definition at line 62 of file sp_dplpexecutor.cpp. |
|
Execute scheduled or sensor events now. If sensor events are ready, execute one of them. Otherwise execute any event scheduled for now. Otherwise execute nothing.
Definition at line 159 of file sp_dplpexecutor.cpp. |
|
Run execution with synchronous physical signals. Loops SyncStep until the specified amount on time expired.
Definition at line 261 of file sp_dplpexecutor.cpp. |
|
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.
Definition at line 233 of file sp_dplpexecutor.cpp. |
|
Execute generator time to sync with device time. If possible, execute the amount of time required for an exact match. Otherwise, accept the specified tolerance. As a last resort, issue a sync error.
Definition at line 93 of file sp_dplpexecutor.cpp. |
|
Wait for sensor events. Wait the specified amount of time, for the proposed time to elaps, or a sensor evemnt to occur - whatever comes first. This function will *not* synchronise with generator time. You may call SyncTime afterwards.
Definition at line 201 of file sp_dplpexecutor.cpp. |
|
Set tolerance for time synchonisation.
Definition at line 230 of file sp_dplpexecutor.h. |
|
Max gap between physical and generator time.
Definition at line 266 of file sp_dplpexecutor.h. |
|
Sync error flag.
Definition at line 263 of file sp_dplpexecutor.h. |
|
Device reference.
Definition at line 269 of file sp_dplpexecutor.h. |