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 22 of file amc_butler.py.

Constructor & Destructor Documentation

◆ __init__()

amc_butler.Commands.__init__ ( self,
dict controllers )

Definition at line 23 of file amc_butler.py.

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

Member Function Documentation

◆ start()

amc_butler.Commands.start ( self)

Definition at line 32 of file amc_butler.py.

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

◆ status()

amc_butler.Commands.status ( self)

Definition at line 38 of file amc_butler.py.

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

◆ stop()

amc_butler.Commands.stop ( self)

Definition at line 26 of file amc_butler.py.

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

Member Data Documentation

◆ controllers [1/2]

amc_butler.Commands.controllers = controllers

Definition at line 24 of file amc_butler.py.

◆ controllers [2/2]

int amc_butler.Commands.controllers = 10

Definition at line 40 of file amc_butler.py.


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