|
ifw-daq
3.0.0-pre2
IFW Data Acquisition modules
|
Simulator that implements RecCmdsSyncService and sets up simulation behaviour for Simulator. More...
Public Member Functions | |
| def | __init__ (self, name, mal, dataroot) |
| RecStatus | RecStart (self, RecProperties properties) |
| RecStatus | RecStop (self) |
| str | RecAbort (self) |
| RecStatus | RecWait (self, RecWaitSpec spec) |
| RecStatus | RecStatus (self, str rec_id) |
| RecStatus | RecPause (self) |
| Recording | get_recording (self, rec_id) |
| Get recording or raise ExceptionErr. More... | |
| RecStatus | make_rec_status (self, rec_id) |
| <struct name="RecStatus"> <member name="dpFiles" type="string" arrayDimensions="(32)"> <member name="endTime" type="double"> <member name="filesGenerated" type="int32_t"> <member name="framesProcessed" type="int32_t"> <member name="framesRemaining" type="int32_t"> <member name="id" type="string"> <member name="info" type="string"> <member name="remainingTime" type="double"> <member name="sizeRecorded" type="int32_t"> <member name="startTime" type="double"> <member name="status" type="nonBasic" nonBasicTypeName="RecStatusNames"> <member name="timeElapsed" type="double"> </struct> More... | |
| 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 | |
| dataroot | |
| 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 50 of file simulator.py.
| def rec.simulator.Simulator.__init__ | ( | self, | |
| name, | |||
| mal, | |||
| dataroot | |||
| ) |
Definition at line 52 of file simulator.py.
| def rec.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 230 of file simulator.py.
| def rec.simulator.Simulator.clear_sim_hooks | ( | self | ) |
Remove all simulation hooks.
Definition at line 240 of file simulator.py.
| Recording rec.simulator.Simulator.get_recording | ( | self, | |
| rec_id | |||
| ) |
Get recording or raise ExceptionErr.
Definition at line 161 of file simulator.py.
| RecStatus rec.simulator.Simulator.make_rec_status | ( | self, | |
| rec_id | |||
| ) |
<struct name="RecStatus"> <member name="dpFiles" type="string" arrayDimensions="(32)"> <member name="endTime" type="double"> <member name="filesGenerated" type="int32_t"> <member name="framesProcessed" type="int32_t"> <member name="framesRemaining" type="int32_t"> <member name="id" type="string"> <member name="info" type="string"> <member name="remainingTime" type="double"> <member name="sizeRecorded" type="int32_t"> <member name="startTime" type="double"> <member name="status" type="nonBasic" nonBasicTypeName="RecStatusNames"> <member name="timeElapsed" type="double"> </struct>
Definition at line 182 of file simulator.py.
| RecWaitStatus rec.simulator.Simulator.make_rec_wait_status | ( | self, | |
| rec_id | |||
| ) |
Creates RecWaitStatus and populates attributes.
Definition at line 211 of file simulator.py.
Populates RecStatus from status.
Definition at line 190 of file simulator.py.
| str rec.simulator.Simulator.RecAbort | ( | self | ) |
Definition at line 116 of file simulator.py.
| RecStatus rec.simulator.Simulator.RecPause | ( | self | ) |
Definition at line 156 of file simulator.py.
| RecStatus rec.simulator.Simulator.RecStart | ( | self, | |
| RecProperties | properties | ||
| ) |
Definition at line 62 of file simulator.py.
| RecStatus rec.simulator.Simulator.RecStatus | ( | self, | |
| str | rec_id | ||
| ) |
Definition at line 150 of file simulator.py.
| RecStatus rec.simulator.Simulator.RecStop | ( | self | ) |
Definition at line 75 of file simulator.py.
| RecStatus rec.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 141 of file simulator.py.
| def rec.simulator.Simulator.reset | ( | self | ) |
Reset simulator to initial default state.
Definition at line 234 of file simulator.py.
| def rec.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 249 of file simulator.py.
| rec.simulator.Simulator.current_rec |
Definition at line 56 of file simulator.py.
| rec.simulator.Simulator.dataroot |
Definition at line 55 of file simulator.py.
| rec.simulator.Simulator.mal |
Definition at line 54 of file simulator.py.
| rec.simulator.Simulator.name |
Definition at line 53 of file simulator.py.
| rec.simulator.Simulator.recordings |
Definition at line 57 of file simulator.py.
| rec.simulator.Simulator.sim_hooks |
Definition at line 59 of file simulator.py.