Definition at line 180 of file hermesbutler.py.
◆ __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
◆ 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
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
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
214 self._controller = HermesModule(tx_mux)
215
216 return self._controller
217
◆ _cm [1/2]
| hermesbutler.HermesCliObj._cm = None |
|
protected |
◆ _cm [2/2]
◆ _controller
| hermesbutler.HermesCliObj._controller = None |
|
protected |
◆ connection_file_path
| str hermesbutler.HermesCliObj.connection_file_path = 'file://${HERMESMODULES_SHARE}/config/c.xml' |
◆ device_id
| hermesbutler.HermesCliObj.device_id = None |
◆ hw
| hermesbutler.HermesCliObj.hw = None |
The documentation for this class was generated from the following file: