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

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

Public Member Functions

def __init__ (self, name, mal, dataroot)
 
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
 
 dataroot
 
 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 49 of file simulator.py.

Constructor & Destructor Documentation

◆ __init__()

def metadaq.simulator.Simulator.__init__ (   self,
  name,
  mal,
  dataroot 
)

Definition at line 51 of file simulator.py.

Member Function Documentation

◆ AbortDaq()

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

Definition at line 104 of file simulator.py.

◆ add_sim_hook()

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

◆ clear_sim_hooks()

def metadaq.simulator.Simulator.clear_sim_hooks (   self)

Remove all simulation hooks.

Definition at line 165 of file simulator.py.

◆ get_daq()

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

Get daq or raise DaqException.

Definition at line 119 of file simulator.py.

◆ GetDaqStatus()

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

Definition at line 113 of file simulator.py.

◆ make_daq_reply()

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

Definition at line 124 of file simulator.py.

◆ make_daq_status()

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

Create DaqStatus instance.

Definition at line 132 of file simulator.py.

◆ make_daq_stop_reply()

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

Create DaqStopReply instance.

Definition at line 142 of file simulator.py.

◆ reset()

def metadaq.simulator.Simulator.reset (   self)

Reset simulator to initial default state.

Definition at line 159 of file simulator.py.

◆ run_sim_hook()

def metadaq.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 174 of file simulator.py.

◆ StartDaq()

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

Definition at line 61 of file simulator.py.

◆ StopDaq()

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

Definition at line 72 of file simulator.py.

Member Data Documentation

◆ current_daq

metadaq.simulator.Simulator.current_daq

Definition at line 55 of file simulator.py.

◆ daqs

metadaq.simulator.Simulator.daqs

Definition at line 56 of file simulator.py.

◆ dataroot

metadaq.simulator.Simulator.dataroot

Definition at line 54 of file simulator.py.

◆ mal

metadaq.simulator.Simulator.mal

Definition at line 53 of file simulator.py.

◆ name

metadaq.simulator.Simulator.name

Definition at line 52 of file simulator.py.

◆ sim_hooks

metadaq.simulator.Simulator.sim_hooks

Definition at line 58 of file simulator.py.


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