ifw-daq  1.0.0
IFW Data Acquisition modules
Public Member Functions | Public Attributes | List of all members
metadaqsim.simulator.Simulator Class Reference

Simulator that implements Modmetadaqsimif and sets up simulation behaviour for Simulator. More...

Public Member Functions

def __init__ (self, name, mal)
 
DaqReply StartDaq (self, str daq_id)
 
DaqStopReply StopDaq (self, str daq_id)
 
DaqReply AbortDaq (self, str daq_id)
 
DaqStatus GetDaqStatus (self, str daq_id)
 
Daq get_daq (self, daq_id)
 Get daq or raise DaqException. More...
 
DaqReply make_daq_reply (self, daq_id)
 
DaqStatus make_daq_status (self, daq_id)
 Create DaqStatus instance. More...
 
DaqStopReply make_daq_stop_reply (self, daq_id)
 Create DaqStopReply instance. 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_daq
 
 daqs
 
 sim_hooks
 

Detailed Description

Simulator that implements Modmetadaqsimif 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 46 of file simulator.py.

Constructor & Destructor Documentation

◆ __init__()

def metadaqsim.simulator.Simulator.__init__ (   self,
  name,
  mal 
)

Definition at line 48 of file simulator.py.

Member Function Documentation

◆ AbortDaq()

DaqReply metadaqsim.simulator.Simulator.AbortDaq (   self,
str  daq_id 
)

Definition at line 79 of file simulator.py.

◆ add_sim_hook()

def metadaqsim.simulator.Simulator.add_sim_hook (   self,
str  cmd_name,
  hook 
)

Add the simulation hook hook for the specified command cmd_name (e.g.

"StartDaq").

Any previous hooks will be replaced.

Definition at line 134 of file simulator.py.

◆ clear_sim_hooks()

def metadaqsim.simulator.Simulator.clear_sim_hooks (   self)

Remove all simulation hooks.

Definition at line 146 of file simulator.py.

◆ get_daq()

Daq metadaqsim.simulator.Simulator.get_daq (   self,
  daq_id 
)

Get daq or raise DaqException.

Definition at line 96 of file simulator.py.

◆ GetDaqStatus()

DaqStatus metadaqsim.simulator.Simulator.GetDaqStatus (   self,
str  daq_id 
)

Definition at line 89 of file simulator.py.

◆ make_daq_reply()

DaqReply metadaqsim.simulator.Simulator.make_daq_reply (   self,
  daq_id 
)

Definition at line 101 of file simulator.py.

◆ make_daq_status()

DaqStatus metadaqsim.simulator.Simulator.make_daq_status (   self,
  daq_id 
)

Create DaqStatus instance.

Definition at line 110 of file simulator.py.

◆ make_daq_stop_reply()

DaqStopReply metadaqsim.simulator.Simulator.make_daq_stop_reply (   self,
  daq_id 
)

Create DaqStopReply instance.

Definition at line 121 of file simulator.py.

◆ reset()

def metadaqsim.simulator.Simulator.reset (   self)

Reset simulator to initial default state.

Definition at line 139 of file simulator.py.

◆ run_sim_hook()

def metadaqsim.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 155 of file simulator.py.

◆ StartDaq()

DaqReply metadaqsim.simulator.Simulator.StartDaq (   self,
str  daq_id 
)

Definition at line 58 of file simulator.py.

◆ StopDaq()

DaqStopReply metadaqsim.simulator.Simulator.StopDaq (   self,
str  daq_id 
)

Definition at line 70 of file simulator.py.

Member Data Documentation

◆ current_daq

metadaqsim.simulator.Simulator.current_daq

Definition at line 51 of file simulator.py.

◆ daqs

metadaqsim.simulator.Simulator.daqs

Definition at line 52 of file simulator.py.

◆ mal

metadaqsim.simulator.Simulator.mal

Definition at line 50 of file simulator.py.

◆ name

metadaqsim.simulator.Simulator.name

Definition at line 49 of file simulator.py.

◆ sim_hooks

metadaqsim.simulator.Simulator.sim_hooks

Definition at line 54 of file simulator.py.


The documentation for this class was generated from the following file: