source: MML/trunk/machine/SOLEIL/StorageRing/srsetup.m

Last change on this file was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 9.8 KB
Line 
1function srsetup
2%SRSETUP - GUI for doing storage ring setup
3% GUI for doing storage ring setup
4%
5% Written by Laurent S. Nadolski
6
7checkforao;
8createInterface
9
10function gui = createInterface
11% Create the user interface for the applicdata.ATion and return a
12% structure of handles for global use.
13
14orbfig = findobj(allchild(0),'Name','Expert Menu Control Room');
15
16% if already open, then close it
17if ~isempty(orbfig)
18    close(orbfig); % IHM already exists
19end
20
21gui = struct();
22% Open a window and add some menus
23gui.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
31uiextras.set(gui.Window, 'DefaultBoxPanelTitleColor', [0.7 1.0 0.7] );
32
33PanelLayout = uiextras.TabPanel( 'Parent', gui.Window);
34
35% Arrange the main interface
36% + MML based functions
37mmlLayout = uiextras.HBox( 'Parent', PanelLayout, 'Spacing', 3);
38% + Genuine AT functions
39ATLayout  = uiextras.HBox( 'Parent', PanelLayout, 'Spacing', 3);
40% + Tests functions
41TestLayout  = uiextras.HBox( 'Parent', PanelLayout, 'Spacing', 3);
42
43set(PanelLayout,'TabNames', {'SDC', 'Model', 'Test functions'}, 'SelectedChild', 1);
44% + Make bigger Tabs
45set(PanelLayout,'TabSize', 100)
46% Colors tab and top bar
47set(PanelLayout,'BackgroundColor', [ 0.7 0.7 1])
48
49% + Create the panels
50
51mmlColumn(1) = uiextras.BoxPanel( ...
52    'Parent', mmlLayout, ...
53    'Title', 'Select options:' );
54mmlColumn(2) = uiextras.BoxPanel( ...
55    'Parent', mmlLayout, ...
56    'Title', 'BPM/orbit functions:' );
57mmlColumn(3) = uiextras.BoxPanel( ...
58    'Parent', mmlLayout, ...
59    'Title', 'Select options:' );
60mmlColumn(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
68mmlColumnLayout{1} = uiextras.VBox( 'Parent', mmlColumn(1), ...
69    'Padding', 3, 'Spacing', 3 );
70uicontrol('Parent',mmlColumnLayout{1}, 'Callback','setpathsoleil(''StorageRing'');', 'String','Soleilinit','BackgroundColor','g');
71uicontrol('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');
76uicontrol('Parent',mmlColumnLayout{1}, 'Callback','steerette', 'String','Steerette', 'BackgroundColor','y');
77uicontrol('Parent',mmlColumnLayout{1}, 'Callback','energytunette', 'String', 'Energytunette', 'BackgroundColor','y');
78uicontrol('Parent',mmlColumnLayout{1}, 'Callback','fourturnalgorithm', 'String', 'Nombres d''onde Algo 4 tours');
79uicontrol('Parent',mmlColumnLayout{1}, 'Callback','kicker_scaling', 'String', 'kicker scaling', 'BackgroundColor','c');
80uicontrol('Parent',mmlColumnLayout{1}, 'Callback','getnus', 'String', 'Synchrotron tune');
81
82% + Create Layout for Second mmlColumn
83%%-------------------------------------------------------
84mmlColumnLayout{2} = uiextras.VBox( 'Parent', mmlColumn(2), ...
85    'Padding', 3, 'Spacing', 3 );
86%%-------------------------------------------------------
87uicontrol('Parent',mmlColumnLayout{2}, 'Callback','figure;plotorbit;', 'String','Plotorbit');
88uicontrol('Parent',mmlColumnLayout{2},  'Callback','solorbit', 'String','solorbit');
89uicontrol('Parent',mmlColumnLayout{2},  'Callback','figure; disp([''   setorbit;'']); setorbit(''Display'');', 'String','Correction d''orbite');
90uicontrol('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');
96uicontrol('Parent',mmlColumnLayout{2},  'Callback','getbpmsum;', 'String','Signal Somme (1er tour)', 'BackgroundColor','c');
97uicontrol('Parent',mmlColumnLayout{2},  'Callback','nombre_onde_ans;', 'String','FFT Tour par Tour');
98uicontrol('Parent',mmlColumnLayout{2},  'Callback','bpmconfigurator;', 'String','Configuration BPM', 'BackgroundColor','r');
99uicontrol('Parent',mmlColumnLayout{2}, 'Callback','getbpmagcgain', 'String','BPM gain AGC');
100
101%%-------------------------------------------------------
102mmlColumnLayout{3} = uiextras.VBox( 'Parent', mmlColumn(3), ...
103    'Padding', 3, 'Spacing', 3 );
104%%-------------------------------------------------------
105uicontrol('Parent',mmlColumnLayout{3}, 'Callback','tango_staticdb_config', 'String','DBT config','BackgroundColor','r');
106uicontrol('Parent',mmlColumnLayout{3}, 'Callback','tango_archiving_config', 'String','Archivage');
107uicontrol('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');
112uicontrol('Parent',mmlColumnLayout{3}, 'Callback','disp([''   getmachineconfig;'']); getmachineconfig(''Archive'');', 'String','Save Lattice');
113uicontrol('Parent',mmlColumnLayout{3}, 'Callback','disp([''   setmachineconfig;'']); setmachineconfig;', 'String','Load Lattice');
114
115%%-------------------------------------------------------
116mmlColumnLayout{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');
120uicontrol('Parent',mmlColumnLayout{4}, 'Callback','geophonegui', 'String','Geophones','BackgroundColor','c');
121uicontrol('Parent',mmlColumnLayout{4}, 'Callback','plotquad;', 'String','Etat QUAD');
122uicontrol('Parent',mmlColumnLayout{4}, 'Callback','bpmrespmatgui;', 'String','LOCO Interface','BackgroundColor','c');
123uicontrol('Parent',mmlColumnLayout{4}, 'Callback','BeamLossgui;', 'String','Beam Loss w/o RF');
124
125% + Create the panels
126%%-------------------------------------------------------
127ATColumn(1) = uiextras.BoxPanel( ...
128    'Parent', ATLayout, ...
129    'Title', 'AT functions:', ...
130    'HelpFcn', 'doc(''at'')' );
131ATColumn(2) = uiextras.BoxPanel( ...
132    'Parent', ATLayout, ...
133    'Title', 'MML functions:', ...
134    'HelpFcn', 'doc(''at'')' );
135ATColumn(3) = uiextras.BoxPanel( ...
136    'Parent', ATLayout, ...
137    'Title', 'Simulation', ...
138    'HelpFcn', 'doc(''at'')' );
139
140for ik=1:length(ATColumn),
141    ATColumnLayout{ik} = uiextras.VBox( 'Parent', ATColumn(ik), ...
142        'Padding', 3, 'Spacing', 3 );
143end
144%%-------------------------------------------------------
145% + For control room
146uicontrol('Parent',ATColumnLayout{1}, 'Callback','plotbeta', 'String','Beta function');
147uicontrol('Parent',ATColumnLayout{1}, 'Callback','plotcod', 'String','Cod function');
148uicontrol('Parent',ATColumnLayout{1}, 'Callback','intlat', 'String','Synoptics');
149
150%+ For model
151uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelalpha', 'String','Alpha function');
152uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelbeamsize', 'String','Beam sizesfunction');
153uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelbeta', 'String','Beta function');
154uicontrol('Parent',ATColumnLayout{2}, 'Callback','modeldisp', 'String','Dispersion function');
155uicontrol('Parent',ATColumnLayout{2}, 'Callback','modeletaprime', 'String','Dispersion'' function');
156uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelemit', 'String','Emittance');
157uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelcurlh', 'String','H-function');
158uicontrol('Parent',ATColumnLayout{2}, 'Callback','modelphase', 'String','Phase function');
159
160%+ For simulation (Office, Hyperion, etc.. )
161uicontrol('Parent',ATColumnLayout{3}, 'Callback','naffgui', 'String','Naff plotting (Tracy)');
162uicontrol('Parent',ATColumnLayout{3}, 'Callback','resongui', 'String','Resonance plot');
163uicontrol('Parent',ATColumnLayout{3}, 'Callback','RadiaMapGui', 'String','Radia maps');
164uicontrol('Parent',ATColumnLayout{3}, 'Callback','mosteffectivecorrectorgui', 'String','MostEffective Corrector');
165
166% + Create the panels
167%%-------------------------------------------------------
168TestColumn(1) = uiextras.BoxPanel( ...
169    'Parent', TestLayout, ...
170    'Title', 'Not validated functions:', ...
171    'HelpFcn', 'doc(''at'')' );
172TestColumnLayout{1} = uiextras.VBox( 'Parent', TestColumn(1), ...
173    'Padding', 3, 'Spacing', 3 );
174uicontrol('Parent',TestColumnLayout{1}, 'Callback','plotBPMturns', 'String','PLot BPM TbT Data');
175uicontrol('Parent',TestColumnLayout{1}, 'Callback','KEMgui', 'String','KEM gui');
176uicontrol('Parent',TestColumnLayout{1}, 'Callback','TbT_PSBgui', 'String','PSB gui');
177
178return;
179
Note: See TracBrowser for help on using the repository browser.