-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlimalambda.mac
69 lines (51 loc) · 1.79 KB
/
limalambda.mac
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
#%NAME%
# Specific macros for Lima Lambda detector
#%CATEGORY% Detection, Ccd
#%LOG%
#
def limalambdasetup(ccdname) '{
# --- common control init
_limapar_controlinit(ccdname, 0)
# --- parameter definition
_limapar_addconfig(ccdname, "energy_threshold", LP_RW|LP_MOT, 1)
_limapar_addconfig(ccdname, "high_voltage", LP_RW, 1)
_limapar_addconfig(ccdname, "humidity",LP_READ,1)
_limapar_addconfig(ccdname, "temperature",LP_READ,1)
# --- parameter description
_limapar_addtext(ccdname, "energy_threshold", "Energy Threshold (KeV)")
_limapar_addtext(ccdname, "high_voltage", "High Voltage (V)")
_limapar_addtext(ccdname, "humidity", "Module humidity (%)")
_limapar_addtext(ccdname, "temperature", "Module Temperature (C)")
}'
lima_addlimatype("Lambda", "limalambdasetup", "limalambdamenu")
def limalambdamenu(ccdname) '{
local items[] parname
local nl option
items["energy_threshold"] = -1
items["high_voltage"] = -1
items["humidity"] = -1
items["temperature"] = -1
option= 1
while (option) {
for (parname in items) {
items[parname]= _limapar_get(ccdname, parname)
}
nl = _limamenu_printtitle(ccdname, "Configuration", "config")
tty_move(4, nl++, sprintf("Temperature %.2f C, Humidity %.2f %%", items["temperature"], items["humidity"]))
nl++
_limamenu_printitem(ccdname, "energy_threshold", items["energy_threshold"], nl++,1)
_limamenu_printitem(ccdname, "high_voltage", items["high_voltage"], nl++,2)
option= getval("\n\n\tOption ---> ", 0)
printf("\n\n")
if(option=="r")
continue
if(option==1)
_limapar_ask(ccdname, "energy_threshold",items["energy_threshold"])
if(option==2)
_limapar_ask(ccdname, "high_voltage",items["high_voltage"])
}
}'
#%MACROS%
#%IMACROS%
#%TOC%
#%AUTHOR% LIMA Team