FEL colors buttons
This commit is contained in:
98
colors.py
Normal file
98
colors.py
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
from epics import caget, caput
|
||||||
|
from slic.utils import as_shortcut
|
||||||
|
|
||||||
|
|
||||||
|
KSET_FMT = "SATUN{:02}-UIND030:K_SET"
|
||||||
|
N_UND_CHIC = 14
|
||||||
|
N_UNDS = list(range(6, 22+1))
|
||||||
|
N_UNDS.remove(N_UND_CHIC)
|
||||||
|
|
||||||
|
|
||||||
|
#ksets = {n: caget(KSET_FMT.format(n)) for n in n_unds}
|
||||||
|
#ksets
|
||||||
|
|
||||||
|
|
||||||
|
color1 = {
|
||||||
|
6: 2.22,
|
||||||
|
7: 3.22,
|
||||||
|
8: 3.22,
|
||||||
|
9: 3.22,
|
||||||
|
10: 3.22,
|
||||||
|
11: 3.2150000000000003,
|
||||||
|
12: 3.21,
|
||||||
|
13: 3.205,
|
||||||
|
15: 2.40762,
|
||||||
|
16: 2.74837,
|
||||||
|
17: 2.91624,
|
||||||
|
18: 3.42306,
|
||||||
|
19: 2.53846,
|
||||||
|
20: 2.76525,
|
||||||
|
21: 2.65308,
|
||||||
|
22: 2.18091
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
color2 = {
|
||||||
|
6: 2.26391,
|
||||||
|
7: 3.72,
|
||||||
|
8: 2.96096,
|
||||||
|
9: 3.44431,
|
||||||
|
10: 3.4889,
|
||||||
|
11: 3.13665,
|
||||||
|
12: 3.27923,
|
||||||
|
13: 2.83135,
|
||||||
|
15: 2.7198458495604054,
|
||||||
|
16: 2.7198458495604054,
|
||||||
|
17: 2.7198,
|
||||||
|
18: 2.7198458495604054,
|
||||||
|
19: 2.7198458495604054,
|
||||||
|
20: 2.7144,
|
||||||
|
21: 2.708949212510313,
|
||||||
|
22: 2.7035008678547685
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
colors_both = {
|
||||||
|
6: 2.22,
|
||||||
|
7: 3.22,
|
||||||
|
8: 3.22,
|
||||||
|
9: 3.22,
|
||||||
|
10: 3.22,
|
||||||
|
11: 3.2150000000000003,
|
||||||
|
12: 3.21,
|
||||||
|
13: 3.205,
|
||||||
|
15: 2.7198458495604054,
|
||||||
|
16: 2.7198458495604054,
|
||||||
|
17: 2.7198,
|
||||||
|
18: 2.7198458495604054,
|
||||||
|
19: 2.7198458495604054,
|
||||||
|
20: 2.7144,
|
||||||
|
21: 2.708949212510313,
|
||||||
|
22: 2.7035008678547685
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def put_color(cols):
|
||||||
|
for n, k in cols.items():
|
||||||
|
pv = KSET_FMT.format(n)
|
||||||
|
caput(pv, k)
|
||||||
|
|
||||||
|
|
||||||
|
@as_shortcut
|
||||||
|
def enable_color1():
|
||||||
|
put_color(color1)
|
||||||
|
|
||||||
|
@as_shortcut
|
||||||
|
def enable_color2():
|
||||||
|
put_color(color2)
|
||||||
|
|
||||||
|
@as_shortcut
|
||||||
|
def enable_colors_both():
|
||||||
|
put_color(colors_both)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user