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 167 of file hermesbutler.py.

Constructor & Destructor Documentation

◆ __init__()

hermesbutler.HermesCliObj.__init__ ( self)

Definition at line 169 of file hermesbutler.py.

169 def __init__(self):
170 uhal.setLogLevelTo(uhal.LogLevel.WARNING)
171 self._cm = None
172 self.hw = None
173 self.device_id = None
174 self.connection_file_path = 'file://${HERMESMODULES_SHARE}/config/c.xml'
175 self._controller = None
176

Member Function Documentation

◆ cm()

hermesbutler.HermesCliObj.cm ( self)

Definition at line 202 of file hermesbutler.py.

202 def cm(self):
203 if self._cm is None:
204 self._cm = uhal.ConnectionManager(self.connection_file_path)
205
206 return self._cm
207
208
209@click.group(chain=True, context_settings=CONTEXT_SETTINGS)
210@click.option('-c', '--connection-file', default=None, help="IPBus connection file ")
211@click.option('-d', '--device', callback=validate_device, help="IPBus device")
212# @click.pass_context
213@click.pass_obj

◆ hermes()

hermesbutler.HermesCliObj.hermes ( self)

Definition at line 178 of file hermesbutler.py.

178 def hermes(self):
179 if self._controller is None:
180 hw = self.cm.getDevice(self.device_id)
181
182 # Identify board
183 is_zcu = hw.getNodes('tx.info')
184 is_wib = hw.getNodes('info')
185
186 if is_zcu:
187 print("zcu mode")
188 tx_mux = hw.getNode('tx')
189 elif is_wib:
190 print("wib mode")
191 tx_mux = hw.getNode()
192 else:
193 raise ValueError(f"{self.device_id} is neither a zcu nor a wib")
194
195 self.hw = hw
196 # pprint(vars(self))
197 self._controller = HermesModule(tx_mux)
198
199 return self._controller
200

Member Data Documentation

◆ _cm [1/2]

hermesbutler.HermesCliObj._cm = None
protected

Definition at line 171 of file hermesbutler.py.

◆ _cm [2/2]

bool hermesbutler.HermesCliObj._cm = CONTEXT_SETTINGS)

Definition at line 204 of file hermesbutler.py.

◆ _controller

hermesbutler.HermesCliObj._controller = None
protected

Definition at line 175 of file hermesbutler.py.

◆ connection_file_path

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

Definition at line 174 of file hermesbutler.py.

◆ device_id

hermesbutler.HermesCliObj.device_id = None

Definition at line 173 of file hermesbutler.py.

◆ hw

hermesbutler.HermesCliObj.hw = None

Definition at line 172 of file hermesbutler.py.


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