DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
hermesbutler.HermesCliObj Class Reference

Public Member Functions

 __init__ (self)
 
 check_device_id (self)
 
 hermes (self)
 
 cm (self)
 

Public Attributes

 hw = None
 
 device_id = None
 
str connection_file_path = 'file://${HERMESMODULES_SHARE}/config/c.xml'
 
bool _cm = CONTEXT_SETTINGS)
 

Protected Attributes

 _cm = None
 
 _controller = None
 

Detailed Description

Definition at line 180 of file hermesbutler.py.

Constructor & Destructor Documentation

◆ __init__()

hermesbutler.HermesCliObj.__init__ ( self)

Definition at line 182 of file hermesbutler.py.

182 def __init__(self):
183 uhal.setLogLevelTo(uhal.LogLevel.WARNING)
184 self._cm = None
185 self.hw = None
186 self.device_id = None
187 self.connection_file_path = 'file://${HERMESMODULES_SHARE}/config/c.xml'
188 self._controller = None
189

Member Function Documentation

◆ check_device_id()

hermesbutler.HermesCliObj.check_device_id ( self)

Definition at line 190 of file hermesbutler.py.

190 def check_device_id(self):
191 if not self.device_id:
192 raise ValueError('the option --device/-d must be provided to run this command. for a list of available device names you can provide, run "hermesbutler.py addrbook".')
193

◆ cm()

hermesbutler.HermesCliObj.cm ( self)

Definition at line 219 of file hermesbutler.py.

219 def cm(self):
220 if self._cm is None:
221 self._cm = uhal.ConnectionManager(self.connection_file_path)
222
223 return self._cm
224
225
226@click.group(chain=True, context_settings=CONTEXT_SETTINGS)
227@click.option('-c', '--connection-file', default=None, help="IPBus connection file ")
228@click.option('-d', '--device', callback=validate_device, help="IPBus device")
229# @click.pass_context
230@click.pass_obj

◆ hermes()

hermesbutler.HermesCliObj.hermes ( self)

Definition at line 195 of file hermesbutler.py.

195 def hermes(self):
196 if self._controller is None:
197 hw = self.cm.getDevice(self.device_id)
198
199 # Identify board
200 is_zcu = hw.getNodes('tx.info')
201 is_detector = hw.getNodes('info')
202
203 if is_zcu:
204 print("zcu mode")
205 tx_mux = hw.getNode('tx')
206 elif is_detector:
207 print("detector mode")
208 tx_mux = hw.getNode()
209 else:
210 raise ValueError(f"{self.device_id} is neither a zcu nor a detector board")
211
212 self.hw = hw
213 # pprint(vars(self))
214 self._controller = HermesModule(tx_mux)
215
216 return self._controller
217

Member Data Documentation

◆ _cm [1/2]

hermesbutler.HermesCliObj._cm = None
protected

Definition at line 184 of file hermesbutler.py.

◆ _cm [2/2]

bool hermesbutler.HermesCliObj._cm = CONTEXT_SETTINGS)

Definition at line 221 of file hermesbutler.py.

◆ _controller

hermesbutler.HermesCliObj._controller = None
protected

Definition at line 188 of file hermesbutler.py.

◆ connection_file_path

str hermesbutler.HermesCliObj.connection_file_path = 'file://${HERMESMODULES_SHARE}/config/c.xml'

Definition at line 187 of file hermesbutler.py.

◆ device_id

hermesbutler.HermesCliObj.device_id = None

Definition at line 186 of file hermesbutler.py.

◆ hw

hermesbutler.HermesCliObj.hw = None

Definition at line 185 of file hermesbutler.py.


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