forked from cta-sst-1m/CTS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCTSControl.py
69 lines (55 loc) · 1.9 KB
/
CTSControl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import cts_core.original_master as cts_master
import sys
from matplotlib.pyplot import ion
try:
import IPython
except ImportError:
import code
def embed():
vars = globals()
vars.update(locals())
shell = code.InteractiveConsole(vars)
shell.interact()
ion()
def man():
string_help = '''
Welcome in the CTS control.
here are the functions available from ctsclient:
- Generic control functions:
>> ctsmaster.reset()
>> ctsmaster.update()
>> ctsmaster.plot()
>> ctsmaster.print_status()
- Low level LED control:
>> ctsmaster.turn_on( pixel , led_type , level )
>> ctsmaster.turn_off( pixel , led_type )
>> ctsmaster.all_on( led_type , level )
- Predefined scans:
>> ctsmaster.loop_over_dc_pixels( level , timeout )
>> ctsmaster.loop_over_ac_pixels( level , timeout )
>> ctsmaster.loop_over_dc_patches( level , timeout )
>> ctsmaster.loop_over_ac_patches( level , timeout )
For more informations on the argument of each function, type:
>> help(ctsmaster.function_you_want_to_understand)
From ctsmaster, you have access to all mapping information through the CTS class accessible
with ctsmaster.cts_core
'''
print(string_help)
if __name__ == "__main__":
ion()
ctsmaster = cts_master.CTSMaster(float(sys.argv[1]))
print('---|> The client is starting, reset of the board can take a little time')
ctsmaster.reset()
cts = ctsmaster.cts
generator = ctsmaster.generator
print('---|> The client have been started')
man()
try:
IPython.embed()
finally:
print('---|> The client will be reset and turned off, wait...')
ctsmaster.reset()
ctsmaster.cts_client.client_off()
ctsmaster.generator.inst.write('LOCAL')
ctsmaster.generator.inst.close()
print('---|> Done')