DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
amc_butler.Commands Class Reference

Public Member Functions

 __init__ (self, dict controllers)
 
 stop (self)
 
 start (self)
 
 status (self)
 

Public Attributes

 controllers = controllers
 
int controllers = 10
 

Detailed Description

Definition at line 21 of file amc_butler.py.

Constructor & Destructor Documentation

◆ __init__()

amc_butler.Commands.__init__ ( self,
dict controllers )

Definition at line 22 of file amc_butler.py.

22 def __init__(self, controllers : dict):
23 self.controllers = controllers
24

Member Function Documentation

◆ start()

amc_butler.Commands.start ( self)

Definition at line 31 of file amc_butler.py.

31 def start(self):
32 for k, v in self.controllers.items():
33 print(f"starting: {k}")
34 v.card_start()
35 return
36

◆ status()

amc_butler.Commands.status ( self)

Definition at line 37 of file amc_butler.py.

37 def status(self):
38 # Constantly get the status of the AMCs to check whether they can be accessed.
39 if self.controllers:
40 print("[yellow]Press ctrl-C to exit.[/yellow]")
41 ti = 10
42 t = time.time()
43 while True:
44 for k, v in self.controllers.items():
45 print(f"Reading status of AMC with IP: {k})")
46 v.card_status()
47 print(f"[cyan]Sleeping {ti}s[/cyan]")
48 time.sleep(ti)
49 print(f"-- {time.time() - t:.2g} s elapsed")
50 return
51
52
53@click.command()
54@click.argument('crate_ip', type=str)
55@click.option('-a', '--amcs', type=int, multiple=True, default=[i for i in range(10)])
56@click.option('-c', 'cmd', type=click.Choice(['arping', 'status', 'start', 'stop']), default=None)

◆ stop()

amc_butler.Commands.stop ( self)

Definition at line 25 of file amc_butler.py.

25 def stop(self):
26 for k, v in self.controllers.items():
27 print(f"starting: {k}")
28 v.card_stop()
29 return
30

Member Data Documentation

◆ controllers [1/2]

amc_butler.Commands.controllers = controllers

Definition at line 23 of file amc_butler.py.

◆ controllers [2/2]

int amc_butler.Commands.controllers = 10

Definition at line 39 of file amc_butler.py.


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