1 | function srsetup |
---|
2 | %SRSETUP - GUI for doing storage ring setup |
---|
3 | % GUI for doing storage ring setup |
---|
4 | % |
---|
5 | % Written by Laurent S. Nadolski |
---|
6 | |
---|
7 | checkforao; |
---|
8 | createInterface |
---|
9 | |
---|
10 | function gui = createInterface |
---|
11 | % Create the user interface for the applicdata.ATion and return a |
---|
12 | % structure of handles for global use. |
---|
13 | |
---|
14 | orbfig = findobj(allchild(0),'Name','Expert Menu Control Room'); |
---|
15 | |
---|
16 | % if already open, then close it |
---|
17 | if ~isempty(orbfig) |
---|
18 | close(orbfig); % IHM already exists |
---|
19 | end |
---|
20 | |
---|
21 | gui = struct(); |
---|
22 | % Open a window and add some menus |
---|
23 | gui.Window = figure( ... |
---|
24 | 'Name', 'Expert Menu Control Room', ... |
---|
25 | 'NumberTitle', 'off', ... |
---|
26 | 'MenuBar', 'none', ... |
---|
27 | 'Toolbar', 'none', ... |
---|
28 | 'HandleVisibility', 'off' ); |
---|
29 | |
---|
30 | % Set default panel color |
---|
31 | uiextras.set(gui.Window, 'DefaultBoxPanelTitleColor', [0.7 1.0 0.7] ); |
---|
32 | |
---|
33 | PanelLayout = uiextras.TabPanel( 'Parent', gui.Window); |
---|
34 | |
---|
35 | % Arrange the main interface |
---|
36 | % + MML based functions |
---|
37 | mmlLayout = uiextras.HBox( 'Parent', PanelLayout, 'Spacing', 3); |
---|
38 | % + Genuine AT functions |
---|
39 | ATLayout = uiextras.HBox( 'Parent', PanelLayout, 'Spacing', 3); |
---|
40 | % + Tests functions |
---|
41 | TestLayout = uiextras.HBox( 'Parent', PanelLayout, 'Spacing', 3); |
---|
42 | |
---|
43 | set(PanelLayout,'TabNames', {'SDC', 'Model', 'Test functions'}, 'SelectedChild', 1); |
---|
44 | % + Make bigger Tabs |
---|
45 | set(PanelLayout,'TabSize', 100) |
---|
46 | % Colors tab and top bar |
---|
47 | set(PanelLayout,'BackgroundColor', [ 0.7 0.7 1]) |
---|
48 | |
---|
49 | % + Create the panels |
---|
50 | |
---|
51 | mmlColumn(1) = uiextras.BoxPanel( ... |
---|
52 | 'Parent', mmlLayout, ... |
---|
53 | 'Title', 'Select options:' ); |
---|
54 | mmlColumn(2) = uiextras.BoxPanel( ... |
---|
55 | 'Parent', mmlLayout, ... |
---|
56 | 'Title', 'BPM/orbit functions:' ); |
---|
57 | mmlColumn(3) = uiextras.BoxPanel( ... |
---|
58 | 'Parent', mmlLayout, ... |
---|
59 | 'Title', 'Select options:' ); |
---|
60 | mmlColumn(4) = uiextras.BoxPanel( ... |
---|
61 | 'Parent', mmlLayout, ... |
---|
62 | 'Title', 'Select options:' ); |
---|
63 | |
---|
64 | % + Adjust the main layout |
---|
65 | %set( mmlLayout, 'Sizes', ones(1,4)*-1); |
---|
66 | |
---|
67 | % + Create Layout for First mmlColumn |
---|
68 | mmlColumnLayout{1} = uiextras.VBox( 'Parent', mmlColumn(1), ... |
---|
69 | 'Padding', 3, 'Spacing', 3 ); |
---|
70 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','setpathsoleil(''StorageRing'');', 'String','Soleilinit','BackgroundColor','g'); |
---|
71 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','refreshthering', 'String','Recharger la maille'); |
---|
72 | %uicontrol('Parent',mmlColumnLayout{1}, 'Callback','plotfamily', 'String','Plotfamily'); |
---|
73 | %uicontrol('Parent',mmlColumnLayout{1}, 'Callback','disp(['' Fichiers de Consignes;'']); configgui;;', 'String','Fichiers de Consignes'); |
---|
74 | %uicontrol('Parent',mmlColumnLayout{1}, 'Callback','disp(['' Ringcycling;'']);Ringcycling', 'String','Cyclage'); |
---|
75 | %uicontrol('Parent',mmlColumnLayout{1}, 'Callback','disp(['' Timing;'']); synchro_injecteur7_rafale;', 'String','Synchronisation'); |
---|
76 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','steerette', 'String','Steerette', 'BackgroundColor','y'); |
---|
77 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','energytunette', 'String', 'Energytunette', 'BackgroundColor','y'); |
---|
78 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','fourturnalgorithm', 'String', 'Nombres d''onde Algo 4 tours'); |
---|
79 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','kicker_scaling', 'String', 'kicker scaling', 'BackgroundColor','c'); |
---|
80 | uicontrol('Parent',mmlColumnLayout{1}, 'Callback','getnus', 'String', 'Synchrotron tune'); |
---|
81 | |
---|
82 | % + Create Layout for Second mmlColumn |
---|
83 | %%------------------------------------------------------- |
---|
84 | mmlColumnLayout{2} = uiextras.VBox( 'Parent', mmlColumn(2), ... |
---|
85 | 'Padding', 3, 'Spacing', 3 ); |
---|
86 | %%------------------------------------------------------- |
---|
87 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','figure;plotorbit;', 'String','Plotorbit'); |
---|
88 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','solorbit', 'String','solorbit'); |
---|
89 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','figure; disp(['' setorbit;'']); setorbit(''Display'');', 'String','Correction d''orbite'); |
---|
90 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','figure; disp(['' setorbitbumpgui;'']); setorbitbumpgui;', 'String','Bump d''orbite (IHM)'); |
---|
91 | %uicontrol('Parent',mmlColumnLayout{2}, 'Callback','disp(['' measbpmresp;'']); measbpmresp;', 'String','Generate BPM Response Matrix'); |
---|
92 | %uicontrol('Parent',mmlColumnLayout{2}, 'Callback','figure; disp(['' rmdisp;'']); rmdisp(''BPMx'',''Display'');', 'String','Find New RF Frequency (LS Fit)'); |
---|
93 | %uicontrol('Parent',mmlColumnLayout{2}, 'Callback','figure; disp(['' findrf;'']); findrf;', 'String','Find New RF Frequency (Dot Product)'); |
---|
94 | %uicontrol('Parent',mmlColumnLayout{2}, 'Callback','disp(['' gettune;'']); gettune(''Display'');', 'String','Get Tunes'); |
---|
95 | %uicontrol('Parent',mmlColumnLayout{2}, 'Callback','disp(['' settune;'']); settune;', 'String','Set Tunes'); |
---|
96 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','getbpmsum;', 'String','Signal Somme (1er tour)', 'BackgroundColor','c'); |
---|
97 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','nombre_onde_ans;', 'String','FFT Tour par Tour'); |
---|
98 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','bpmconfigurator;', 'String','Configuration BPM', 'BackgroundColor','r'); |
---|
99 | uicontrol('Parent',mmlColumnLayout{2}, 'Callback','getbpmagcgain', 'String','BPM gain AGC'); |
---|
100 | |
---|
101 | %%------------------------------------------------------- |
---|
102 | mmlColumnLayout{3} = uiextras.VBox( 'Parent', mmlColumn(3), ... |
---|
103 | 'Padding', 3, 'Spacing', 3 ); |
---|
104 | %%------------------------------------------------------- |
---|
105 | uicontrol('Parent',mmlColumnLayout{3}, 'Callback','tango_staticdb_config', 'String','DBT config','BackgroundColor','r'); |
---|
106 | uicontrol('Parent',mmlColumnLayout{3}, 'Callback','tango_archiving_config', 'String','Archivage'); |
---|
107 | uicontrol('Parent',mmlColumnLayout{3}, 'Callback','disp(['' meastuneresp;'']); meastuneresp;', 'String','Generate Tune Response Matrix'); |
---|
108 | %uicontrol('Parent',mmlColumnLayout{3}, 'Callback','figure; disp(['' measdisp;'']); measdisp;', 'String','Measure Dispersion'); |
---|
109 | %uicontrol('Parent',mmlColumnLayout{3}, 'Callback','figure; disp(['' measchro;'']); measchro(''Physics'');', 'String','Measure The Chromaticity'); |
---|
110 | %uicontrol('Parent',mmlColumnLayout{3}, 'Callback','disp(['' stepchro;'']); stepchro(''Physics'');', 'String','Step The Chromaticity'); |
---|
111 | %uicontrol('Parent',mmlColumnLayout{3}, 'Callback','figure; disp(['' measchroresp;'']); measchroresp;', 'String','Generate Chromaticity Response Matrix'); |
---|
112 | uicontrol('Parent',mmlColumnLayout{3}, 'Callback','disp(['' getmachineconfig;'']); getmachineconfig(''Archive'');', 'String','Save Lattice'); |
---|
113 | uicontrol('Parent',mmlColumnLayout{3}, 'Callback','disp(['' setmachineconfig;'']); setmachineconfig;', 'String','Load Lattice'); |
---|
114 | |
---|
115 | %%------------------------------------------------------- |
---|
116 | mmlColumnLayout{4} = uiextras.VBox( 'Parent', mmlColumn(4), ... |
---|
117 | 'Padding', 3, 'Spacing', 3 ); |
---|
118 | %%------------------------------------------------------- |
---|
119 | %uicontrol('Parent',mmlColumnLayout{4}, 'Callback','couplage_2012', 'String','Couplage 2012 (MAT)','BackgroundColor','c'); |
---|
120 | uicontrol('Parent',mmlColumnLayout{4}, 'Callback','geophonegui', 'String','Geophones','BackgroundColor','c'); |
---|
121 | uicontrol('Parent',mmlColumnLayout{4}, 'Callback','plotquad;', 'String','Etat QUAD'); |
---|
122 | uicontrol('Parent',mmlColumnLayout{4}, 'Callback','bpmrespmatgui;', 'String','LOCO Interface','BackgroundColor','c'); |
---|
123 | uicontrol('Parent',mmlColumnLayout{4}, 'Callback','BeamLossgui;', 'String','Beam Loss w/o RF'); |
---|
124 | |
---|
125 | % + Create the panels |
---|
126 | %%------------------------------------------------------- |
---|
127 | ATColumn(1) = uiextras.BoxPanel( ... |
---|
128 | 'Parent', ATLayout, ... |
---|
129 | 'Title', 'AT functions:', ... |
---|
130 | 'HelpFcn', 'doc(''at'')' ); |
---|
131 | ATColumn(2) = uiextras.BoxPanel( ... |
---|
132 | 'Parent', ATLayout, ... |
---|
133 | 'Title', 'MML functions:', ... |
---|
134 | 'HelpFcn', 'doc(''at'')' ); |
---|
135 | ATColumn(3) = uiextras.BoxPanel( ... |
---|
136 | 'Parent', ATLayout, ... |
---|
137 | 'Title', 'Simulation', ... |
---|
138 | 'HelpFcn', 'doc(''at'')' ); |
---|
139 | |
---|
140 | for ik=1:length(ATColumn), |
---|
141 | ATColumnLayout{ik} = uiextras.VBox( 'Parent', ATColumn(ik), ... |
---|
142 | 'Padding', 3, 'Spacing', 3 ); |
---|
143 | end |
---|
144 | %%------------------------------------------------------- |
---|
145 | % + For control room |
---|
146 | uicontrol('Parent',ATColumnLayout{1}, 'Callback','plotbeta', 'String','Beta function'); |
---|
147 | uicontrol('Parent',ATColumnLayout{1}, 'Callback','plotcod', 'String','Cod function'); |
---|
148 | uicontrol('Parent',ATColumnLayout{1}, 'Callback','intlat', 'String','Synoptics'); |
---|
149 | |
---|
150 | %+ For model |
---|
151 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelalpha', 'String','Alpha function'); |
---|
152 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelbeamsize', 'String','Beam sizesfunction'); |
---|
153 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelbeta', 'String','Beta function'); |
---|
154 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modeldisp', 'String','Dispersion function'); |
---|
155 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modeletaprime', 'String','Dispersion'' function'); |
---|
156 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelemit', 'String','Emittance'); |
---|
157 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelcurlh', 'String','H-function'); |
---|
158 | uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelphase', 'String','Phase function'); |
---|
159 | |
---|
160 | %+ For simulation (Office, Hyperion, etc.. ) |
---|
161 | uicontrol('Parent',ATColumnLayout{3}, 'Callback','naffgui', 'String','Naff plotting (Tracy)'); |
---|
162 | uicontrol('Parent',ATColumnLayout{3}, 'Callback','resongui', 'String','Resonance plot'); |
---|
163 | uicontrol('Parent',ATColumnLayout{3}, 'Callback','RadiaMapGui', 'String','Radia maps'); |
---|
164 | uicontrol('Parent',ATColumnLayout{3}, 'Callback','mosteffectivecorrectorgui', 'String','MostEffective Corrector'); |
---|
165 | |
---|
166 | % + Create the panels |
---|
167 | %%------------------------------------------------------- |
---|
168 | TestColumn(1) = uiextras.BoxPanel( ... |
---|
169 | 'Parent', TestLayout, ... |
---|
170 | 'Title', 'Not validated functions:', ... |
---|
171 | 'HelpFcn', 'doc(''at'')' ); |
---|
172 | TestColumnLayout{1} = uiextras.VBox( 'Parent', TestColumn(1), ... |
---|
173 | 'Padding', 3, 'Spacing', 3 ); |
---|
174 | uicontrol('Parent',TestColumnLayout{1}, 'Callback','plotBPMturns', 'String','PLot BPM TbT Data'); |
---|
175 | uicontrol('Parent',TestColumnLayout{1}, 'Callback','KEMgui', 'String','KEM gui'); |
---|
176 | uicontrol('Parent',TestColumnLayout{1}, 'Callback','TbT_PSBgui', 'String','PSB gui'); |
---|
177 | |
---|
178 | return; |
---|
179 | |
---|