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

Public Member Functions

 __init__ (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

◆ cm()

hermesbutler.HermesCliObj.cm ( self)

Definition at line 215 of file hermesbutler.py.

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

◆ hermes()

hermesbutler.HermesCliObj.hermes ( self)

Definition at line 191 of file hermesbutler.py.

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

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 217 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: