Skip to content

Commit 6de215b

Browse files
author
Kay Kasemir (ky9)
committed
Table scan update to python3, bob
1 parent 56f3c98 commit 6de215b

File tree

11 files changed

+213
-435
lines changed

11 files changed

+213
-435
lines changed

example/beamline_setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self):
4545
# The example/opi for alignment uses these to
4646
# populate drop-downs
4747
self.settable = [ "motor_x", "motor_y" ]
48-
self.waitable = [ "seconds", "pcharge" ]
48+
self.waitable = [ "seconds", "time", "pcharge" ]
4949
self.loggable = [ "signal" ]
5050

5151
def getReadbackName(self, device_name):
@@ -61,6 +61,11 @@ def getReadbackName(self, device_name):
6161
setScanSettings(scan_settings)
6262

6363
# 'Meta Commands'
64+
def Pre():
65+
return Set('shutter', 1)
66+
def Post():
67+
return Set('shutter', 0)
68+
6469
def Start():
6570
"""Start data acquisition"""
6671
return Sequence( Set('loc://daq_reset(0)', 1),
@@ -84,6 +89,8 @@ def SetChopper(wavelength, phase):
8489
def table_scan(headers, rows):
8590
"""Create table scan with pre/post/start/stop for this beam line"""
8691
table = TableScan(headers, rows,
92+
pre=Pre(),
93+
post=Post(),
8794
start=Start(),
8895
stop=Stop())
8996
return table.createScan()

example/opi/3_Table_Scan.bob

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--Saved on 2024-03-26 14:45:37 by ky9-->
3+
<display version="2.0.0">
4+
<name>Table Scan</name>
5+
<macros>
6+
<S>Demo</S>
7+
</macros>
8+
<width>1080</width>
9+
<height>800</height>
10+
<actions>
11+
</actions>
12+
<grid_step_x>6</grid_step_x>
13+
<grid_step_y>6</grid_step_y>
14+
<widget type="table" version="2.0.0">
15+
<name>TableScan</name>
16+
<y>25</y>
17+
<width>967</width>
18+
<height>768</height>
19+
<columns>
20+
<column>
21+
<name>Column 1</name>
22+
<width>100</width>
23+
<editable>true</editable>
24+
</column>
25+
</columns>
26+
<actions>
27+
</actions>
28+
<scripts>
29+
<script file="scripts/tablescan_init.py">
30+
<pv_name>=1</pv_name>
31+
<pv_name trigger="false">$(S):CS:Scan:TableFile</pv_name>
32+
</script>
33+
</scripts>
34+
</widget>
35+
<widget type="action_button" version="3.0.0">
36+
<name>Action Button</name>
37+
<actions>
38+
<action type="execute">
39+
<script file="scripts/tablescan_load.py">
40+
</script>
41+
<description>Load</description>
42+
</action>
43+
</actions>
44+
<x>972</x>
45+
<y>3</y>
46+
<width>103</width>
47+
<height>25</height>
48+
<tooltip>(Re-)Load scan from file</tooltip>
49+
<border_alarm_sensitive>false</border_alarm_sensitive>
50+
</widget>
51+
<widget type="action_button" version="3.0.0">
52+
<name>Action Button_1</name>
53+
<actions>
54+
<action type="execute">
55+
<script file="scripts/tablescan_save.py">
56+
</script>
57+
<description>Save</description>
58+
</action>
59+
</actions>
60+
<x>972</x>
61+
<y>33</y>
62+
<width>103</width>
63+
<height>25</height>
64+
<tooltip>Save scan table to file</tooltip>
65+
<border_alarm_sensitive>false</border_alarm_sensitive>
66+
</widget>
67+
<widget type="label" version="2.0.0">
68+
<name>Label</name>
69+
<text>Table:</text>
70+
<width>49</width>
71+
<height>26</height>
72+
<vertical_alignment>1</vertical_alignment>
73+
<actions>
74+
</actions>
75+
<border_color>
76+
<color red="0" green="128" blue="255">
77+
</color>
78+
</border_color>
79+
</widget>
80+
<widget type="textentry" version="3.0.0">
81+
<name>TableFile</name>
82+
<pv_name>$(S):CS:Scan:TableFile</pv_name>
83+
<x>54</x>
84+
<y>3</y>
85+
<width>873</width>
86+
<height>19</height>
87+
<background_color>
88+
<color name="WritePV_Background" red="128" green="255" blue="255">
89+
</color>
90+
</background_color>
91+
<format>6</format>
92+
<actions>
93+
</actions>
94+
<tooltip>Table file name
95+
$(pv_value)</tooltip>
96+
<border_color>
97+
<color red="0" green="128" blue="255">
98+
</color>
99+
</border_color>
100+
</widget>
101+
<widget type="action_button" version="3.0.0">
102+
<name>Action Button_6</name>
103+
<actions>
104+
<action type="execute">
105+
<script file="scripts/tablescan_submit.py">
106+
</script>
107+
<description>Submit</description>
108+
</action>
109+
</actions>
110+
<x>972</x>
111+
<y>84</y>
112+
<width>103</width>
113+
<height>25</height>
114+
<tooltip>Submit scan based on table</tooltip>
115+
<border_alarm_sensitive>false</border_alarm_sensitive>
116+
</widget>
117+
<widget type="fileselector" version="2.0.0">
118+
<pv_name>$(S):CS:Scan:TableFile</pv_name>
119+
<x>927</x>
120+
<y>3</y>
121+
<height>19</height>
122+
</widget>
123+
</display>

0 commit comments

Comments
 (0)