|
ifw-daq
1.0.0
IFW Data Acquisition modules
|
Simulator that implements RecCmdsSyncService and sets up simulation behaviour for Simulator. More...
Public Member Functions | |
| def | __init__ (self, name, mal) |
| RecStatus | RecStart (self, RecProperties properties) |
| RecStatus | RecStop (self) |
| str | RecAbort (self) |
| RecStatus | RecWait (self, RecWaitSpec spec) |
| RecStatus | RecStatus (self, str rec_id) |
| Recording | get_recording (self, rec_id) |
| Get recording or raise ExceptionErr. More... | |
| RecStatus | make_rec_status (self, rec_id) |
| RecStatus | populate_rec_status (self, Recording rec, RecStatus status) |
| Populates RecStatus from status. More... | |
| RecWaitStatus | make_rec_wait_status (self, rec_id) |
| Creates RecWaitStatus and populates attributes. More... | |
| def | add_sim_hook (self, str cmd_name, hook) |
Add the simulation hook hook for the specified command cmd_name (e.g. More... | |
| def | reset (self) |
| Reset simulator to initial default state. More... | |
| def | clear_sim_hooks (self) |
| Remove all simulation hooks. More... | |
| def | run_sim_hook (self, result, *args) |
| Runs simulation hook that may modify or replace the default implementation. More... | |
Public Attributes | |
| name | |
| mal | |
| current_rec | |
| recordings | |
| sim_hooks | |
Simulator that implements RecCmdsSyncService and sets up simulation behaviour for Simulator.
Registered hooks are run once and then removed before executed. Each hook is a callable that takes the result from the default implementation as well as the arguments given to the original implementation. The hook can then choose to modify the existing result or replace it.
Definition at line 54 of file simulator.py.
| def recifsim.simulator.Simulator.__init__ | ( | self, | |
| name, | |||
| mal | |||
| ) |
Definition at line 56 of file simulator.py.
| def recifsim.simulator.Simulator.add_sim_hook | ( | self, | |
| str | cmd_name, | ||
| hook | |||
| ) |
Add the simulation hook hook for the specified command cmd_name (e.g.
"RecStart").
Any previous hooks will be replaced.
Definition at line 197 of file simulator.py.
| def recifsim.simulator.Simulator.clear_sim_hooks | ( | self | ) |
Remove all simulation hooks.
Definition at line 207 of file simulator.py.
| Recording recifsim.simulator.Simulator.get_recording | ( | self, | |
| rec_id | |||
| ) |
Get recording or raise ExceptionErr.
Definition at line 135 of file simulator.py.
| RecStatus recifsim.simulator.Simulator.make_rec_status | ( | self, | |
| rec_id | |||
| ) |
Definition at line 156 of file simulator.py.
| RecWaitStatus recifsim.simulator.Simulator.make_rec_wait_status | ( | self, | |
| rec_id | |||
| ) |
Creates RecWaitStatus and populates attributes.
Definition at line 180 of file simulator.py.
| RecStatus recifsim.simulator.Simulator.populate_rec_status | ( | self, | |
| Recording | rec, | ||
| RecStatus | status | ||
| ) |
Populates RecStatus from status.
Definition at line 164 of file simulator.py.
| str recifsim.simulator.Simulator.RecAbort | ( | self | ) |
Definition at line 104 of file simulator.py.
| RecStatus recifsim.simulator.Simulator.RecStart | ( | self, | |
| RecProperties | properties | ||
| ) |
Definition at line 65 of file simulator.py.
| RecStatus recifsim.simulator.Simulator.RecStatus | ( | self, | |
| str | rec_id | ||
| ) |
Definition at line 129 of file simulator.py.
| RecStatus recifsim.simulator.Simulator.RecStop | ( | self | ) |
Definition at line 78 of file simulator.py.
| RecStatus recifsim.simulator.Simulator.RecWait | ( | self, | |
| RecWaitSpec | spec | ||
| ) |
For the moment we simply simulate that the recording was completed as soon as this request was received.
Definition at line 122 of file simulator.py.
| def recifsim.simulator.Simulator.reset | ( | self | ) |
Reset simulator to initial default state.
Definition at line 201 of file simulator.py.
| def recifsim.simulator.Simulator.run_sim_hook | ( | self, | |
| result, | |||
| * | args | ||
| ) |
Runs simulation hook that may modify or replace the default implementation.
The hook to execute is automatically determined from the call stack, so this should only ever be executed directly from the service command implementation method.
Definition at line 216 of file simulator.py.
| recifsim.simulator.Simulator.current_rec |
Definition at line 59 of file simulator.py.
| recifsim.simulator.Simulator.mal |
Definition at line 58 of file simulator.py.
| recifsim.simulator.Simulator.name |
Definition at line 57 of file simulator.py.
| recifsim.simulator.Simulator.recordings |
Definition at line 60 of file simulator.py.
| recifsim.simulator.Simulator.sim_hooks |
Definition at line 62 of file simulator.py.