-
Notifications
You must be signed in to change notification settings - Fork 1
/
limapilatus.mac
89 lines (68 loc) · 2.77 KB
/
limapilatus.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
def limapilatussetup(ccdname) '{
# --- common control init
_limapar_controlinit(ccdname, 0)
# --- parameter definition
_limapar_addconfig(ccdname, "threshold_gain", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "threshold", LP_RW, 1,"long")
_limapar_addconfig(ccdname, "energy_threshold", LP_RW|LP_MOT, 1,"double")
_limapar_addconfig(ccdname, "fill_mode",LP_RW|LP_LIST,1)
_limapar_addconfig(ccdname, "nb_exposure_per_frame", LP_RW|LP_MOT, 1,"double")
# --- parameter description
_limapar_addtext(ccdname, "threshold_gain", "Threshold Gain")
_limapar_addtext(ccdname, "threshold", "Threshold value in (eV)")
_limapar_addtext(ccdname, "fill_mode", "Pixel Gap Filling")
_limapar_addtext(ccdname, "energy_threshold", "Energy Threshold (keV)")
_limapar_addtext(ccdname, "nb_exposure_per_frame", "Number exposure per frame")
}'
lima_addlimatype("Pilatus", "limapilatussetup", "limapilatusmenu")
def limapilatusmenu(ccdname) '{
local items[] parname
local nl option
items["threshold_gain"] = ""
items["threshold"] = -1
items["energy_threshold"] = -1
items["fill_mode"] = "OFF"
option= 1
while (option) {
for (parname in items) {
items[parname]= _limapar_get(ccdname, parname)
}
nl= _limamenu_printtitle(ccdname, "Configuration", "config")
tty_move(0, nl++, "(1) Calibration Basic:")
_limamenu_printitem(ccdname, "energy_threshold", items["energy_threshold"], nl++, 11)
_limamenu_printitem(ccdname, "fill_mode", items["fill_mode"], nl++, 12)
nl++
tty_move(0, nl++, "Calibration Expert:")
_limamenu_printitem(ccdname, "threshold", items["threshold"], nl++, 21)
_limamenu_printitem(ccdname, "threshold_gain", items["threshold_gain"], nl++, 22)
nl++
option= getval("\n\n\tOption ---> (0=quit, 2=refresh) ", 0)
printf("\n\n")
if ((option==1)||(option==11))
_limapar_ask(ccdname, "energy_threshold", items["energy_threshold"])
if ((option==1)||(option==12))
_limapar_ask(ccdname, "fill_mode", items["fill_mode"])
if (option==21)
_limapar_ask(ccdname, "threshold", items["threshold"])
else if (option==22)
_limapar_ask(ccdname, "threshold_gain", items["threshold_gain"])
}
}'
def limapilatusResetHighVoltage '{
local ccd_name sleep_time timeout dev_name
if ($# < 1 || $# > 2) {
print "Usage: $0 <ccdname> [<sleep_time(s)>]"
print
print "(default sleep_time is 1 second)"
exit
}
ccdname = "$1"
sleep_time = $# == 1 ? 1 : "$2"
dev_name = LIMA_DEV[ccdname]["config"]
# This command takes a few seconds (~30) + sleep time
timeout = tango_io(dev_name, "timeout")
tango_io(dev_name, "timeout", 30 + sleep_time)
tango_io(LIMA_DEV[ccdname]["config"], "resetHighVoltage", sleep_time)
# restore old timeout
tango_io(dev_name, "timeout", timeout)
}'