source: MML/trunk/machine/THOMX/StorageRing/thomxringgui.m @ 5

Last change on this file since 5 was 5, checked in by zhangj, 11 years ago

ThomX MML version on the LAL server @ 17/12/2013

  • Property svn:executable set to *
File size: 14.5 KB
Line 
1function varargout = thomxringgui(varargin)
2% OPERATIONGUI M-file for thomxringgui.fig
3%      OPERATIONGUI, by itself, creates a new OPERATIONGUI or raises the existing
4%      singleton*.
5%
6%      H = OPERATIONGUI returns the handle to a new OPERATIONGUI or the handle to
7%      the existing singleton*.
8%
9%      OPERATIONGUI('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in OPERATIONGUI.M with the given input arguments.
11%
12%      OPERATIONGUI('Property','Value',...) creates a new OPERATIONGUI or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before operationgui_OpeningFcn gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to operationgui_OpeningFcn via varargin.
17%
18%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
19%      instance to run (singleton)".
20%
21% See also: GUIDE, GUIDATA, GUIHANDLES
22
23% Edit the above text to modify the response to help operationgui
24
25% Last Modified by GUIDE v2.5 23-Oct-2013 10:13:07
26
27% Begin initialization code - DO NOT EDIT
28%
29%  Modified by Jianfeng Zhang @ LAL, 01/10/2013
30%  See also operationgui.
31
32gui_Singleton = 1;
33gui_State = struct('gui_Name',       mfilename, ...
34                   'gui_Singleton',  gui_Singleton, ...
35                   'gui_OpeningFcn', @operationgui_OpeningFcn, ...
36                   'gui_OutputFcn',  @operationgui_OutputFcn, ...
37                   'gui_LayoutFcn',  [] , ...
38                   'gui_Callback',   []);
39if nargin && ischar(varargin{1})
40    gui_State.gui_Callback = str2func(varargin{1});
41end
42
43if nargout
44    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
45else
46    gui_mainfcn(gui_State, varargin{:});
47end
48% End initialization code - DO NOT EDIT
49
50
51% --- Executes just before operationgui is made visible.
52function operationgui_OpeningFcn(hObject, eventdata, handles, varargin)
53% This function has no output args, see OutputFcn.
54% hObject    handle to figure
55% eventdata  reserved - to be defined in a future version of MATLAB
56% handles    structure with handles and user data (see GUIDATA)
57% varargin   command line arguments to operationgui (see VARARGIN)
58
59% Choose default command line output for operationgui
60handles.output = hObject;
61
62% Update handles structure
63guidata(hObject, handles);
64
65% UIWAIT makes operationgui wait for user response (see UIRESUME)
66% uiwait(handles.FigMenuGui);
67
68
69% --- Outputs from this function are returned to the command line.
70function varargout = operationgui_OutputFcn(hObject, eventdata, handles)
71% varargout  cell array for returning output args (see VARARGOUT);
72% hObject    handle to figure
73% eventdata  reserved - to be defined in a future version of MATLAB
74% handles    structure with handles and user data (see GUIDATA)
75
76% Get default command line output from handles structure
77varargout{1} = handles.output;
78
79
80% --- Executes on button press in pushbutton_plotfamily.
81function pushbutton_plotfamily_Callback(hObject, eventdata, handles)
82% hObject    handle to pushbutton_plotfamily (see GCBO)
83% eventdata  reserved - to be defined in a future version of MATLAB
84% handles    structure with handles and user data (see GUIDATA)
85plotfamily;
86
87% --- Executes on button press in pushbutton_measdisp.
88function pushbutton_measdisp_Callback(hObject, eventdata, handles)
89% hObject    handle to pushbutton_measdisp (see GCBO)
90% eventdata  reserved - to be defined in a future version of MATLAB
91% handles    structure with handles and user data (see GUIDATA)
92measdisp;
93
94% --- Executes on button press in pushbutton19.
95function pushbutton19_Callback(hObject, eventdata, handles)
96% hObject    handle to pushbutton19 (see GCBO)
97% eventdata  reserved - to be defined in a future version of MATLAB
98% handles    structure with handles and user data (see GUIDATA)
99%Variation_points_source;
100
101% --- Executes on button press in pushbutton_SOFB.
102function pushbutton_SOFB_Callback(hObject, eventdata, handles)
103% hObject    handle to pushbutton_SOFB (see GCBO)
104% eventdata  reserved - to be defined in a future version of MATLAB
105% handles    structure with handles and user data (see GUIDATA)
106
107% to be updated for ThomX
108%orbitcontrol;
109
110% --- Executes on button press in pushbutton_FOFB.
111function pushbutton_FOFB_Callback(hObject, eventdata, handles)
112% hObject    handle to pushbutton_FOFB (see GCBO)
113% eventdata  reserved - to be defined in a future version of MATLAB
114% handles    structure with handles and user data (see GUIDATA)
115
116% to be updated for ThomX
117%FOFBguiTango;
118
119% --- Executes on button press in pushbutton_FBNU.
120function pushbutton_FBNU_Callback(hObject, eventdata, handles)
121% hObject    handle to pushbutton_FBNU (see GCBO)
122% eventdata  reserved - to be defined in a future version of MATLAB
123% handles    structure with handles and user data (see GUIDATA)
124
125% to be updated for ThomX
126tuneFBgui;
127
128% --- Executes on button press in pushbutton_setoperationalmode.
129function pushbutton_setoperationalmode_Callback(hObject, eventdata, handles)
130% hObject    handle to pushbutton_setoperationalmode (see GCBO)
131% eventdata  reserved - to be defined in a future version of MATLAB
132% handles    structure with handles and user data (see GUIDATA)
133setoperationalmode
134
135% --- Executes on button press in pushbutton_cyclage.
136function pushbutton_cyclage_Callback(hObject, eventdata, handles)
137% hObject    handle to pushbutton_cyclage (see GCBO)
138% eventdata  reserved - to be defined in a future version of MATLAB
139% handles    structure with handles and user data (see GUIDATA)
140Ringcycling;
141
142% --- Executes on button press in pushbutton_configgui.
143function pushbutton_configgui_Callback(hObject, eventdata, handles)
144% hObject    handle to pushbutton_configgui (see GCBO)
145% eventdata  reserved - to be defined in a future version of MATLAB
146% handles    structure with handles and user data (see GUIDATA)
147configgui;
148
149% --- Executes on button press in pushbutton_setchrogolden.
150function pushbutton_setchrogolden_Callback(hObject, eventdata, handles)
151% hObject    handle to pushbutton_setchrogolden (see GCBO)
152% eventdata  reserved - to be defined in a future version of MATLAB
153% handles    structure with handles and user data (see GUIDATA)
154
155%% need to change back to the online model 'setchro('Physics')' when the ThomX machine is ready
156setchro('Physics','Simulator');
157
158% --- Executes on button press in pushbuttonstepchro.
159function pushbuttonstepchro_Callback(hObject, eventdata, handles)
160% hObject    handle to pushbuttonstepchro (see GCBO)
161% eventdata  reserved - to be defined in a future version of MATLAB
162% handles    structure with handles and user data (see GUIDATA)
163
164
165%% Need to change back to the 'online' model in the future for the ThomX...
166%pop up a dialog window to input the tune change range
167    answer = inputdlg({'Change the horizontal chromaticity by', 'Change the vertical chromaticity by'},'STEPCHRO',1,{'0','0'});
168    if isempty(answer)
169            return
170    end
171
172    DeltaChrom(1,1) = str2num(answer{1});
173    DeltaChrom(2,1) = str2num(answer{2});
174   
175    %InitialChrom = measchro;
176    InitialChrom = measchro('Model'); 
177    FinalChrom = InitialChrom + DeltaChrom;
178   
179    while (abs(DeltaChrom(1)) > 1e-3 || abs(DeltaChrom(2)) > 1e-3)
180        stepchro(DeltaChrom, 'Physics');
181        %stepchro('Physics');
182        DeltaChrom = FinalChrom-measchro('Model');
183        %DeltaChrom = FinalChrom-measchro;
184    end
185
186
187
188
189% --- Executes on button press in pushbutton_measchro.
190function pushbutton_measchro_Callback(hObject, eventdata, handles)
191% hObject    handle to pushbutton_measchro (see GCBO)
192% eventdata  reserved - to be defined in a future version of MATLAB
193% handles    structure with handles and user data (see GUIDATA)
194
195%% need to change back to  'measchro('Physics','Display')' when the ThomX ring is ready...
196
197measchro('Simulator','Physics','Display');
198%measchro('Physics','Display');
199
200% --- Executes on button press in pushbutton_settunegolden.
201function pushbutton_settunegolden_Callback(hObject, eventdata, handles)
202% hObject    handle to pushbutton_settunegolden (see GCBO)
203% eventdata  reserved - to be defined in a future version of MATLAB
204% handles    structure with handles and user data (see GUIDATA)
205settune;
206
207% --- Executes on button press in pushbutton_steptune.
208function pushbutton_steptune_Callback(hObject, eventdata, handles)
209% hObject    handle to pushbutton_steptune (see GCBO)
210% eventdata  reserved - to be defined in a future version of MATLAB
211% handles    structure with handles and user data (see GUIDATA)
212
213%pop up a dialog window to input the tune change range
214    answer = inputdlg({'Change the horizontal tune by', 'Change the vertical tune by'},'STEPTUNE',1,{'0','0'});
215    if isempty(answer)
216            return
217    end
218     DeltaTune(1,1) = str2num(answer{1});
219    DeltaTune(2,1) = str2num(answer{2});
220     
221    InitialTune = gettune;
222    FinalTune = InitialTune + DeltaTune;
223   
224    while (abs(DeltaTune(1)) > 1e-4 || abs(DeltaTune(2)) > 1e-4)
225        steptune(DeltaTune);
226        DeltaTune = FinalTune-gettune;
227    end
228
229   
230% --- Executes on button press in pushbutton_measchroFBT.
231function pushbutton_measchroFBT_Callback(hObject, eventdata, handles)
232% hObject    handle to pushbutton_measchroFBT (see GCBO)
233% eventdata  reserved - to be defined in a future version of MATLAB
234% handles    structure with handles and user data (see GUIDATA)
235
236% to be updated for ThomX
237% measchroFBT('Physics')
238
239% --- Executes on button press in pushbutton_stepchroFBT.
240function pushbutton_stepchroFBT_Callback(hObject, eventdata, handles)
241% hObject    handle to pushbutton_stepchroFBT (see GCBO)
242% eventdata  reserved - to be defined in a future version of MATLAB
243% handles    structure with handles and user data (see GUIDATA)
244stepchro('Physics');
245
246% --- Executes on button press in pushbutton_setchroGoldenFBT.
247function pushbutton_setchroGoldenFBT_Callback(hObject, eventdata, handles)
248% hObject    handle to pushbutton_setchroGoldenFBT (see GCBO)
249% eventdata  reserved - to be defined in a future version of MATLAB
250% handles    structure with handles and user data (see GUIDATA)
251setchro('Physics','FBT');
252
253% --- Executes on button press in pushbutton_settuneGoldenFBT.
254function pushbutton_settuneGoldenFBT_Callback(hObject, eventdata, handles)
255% hObject    handle to pushbutton_settuneGoldenFBT (see GCBO)
256% eventdata  reserved - to be defined in a future version of MATLAB
257% handles    structure with handles and user data (see GUIDATA)
258
259% to be updated for ThomX
260% settune('FBT');
261
262% --- Executes on button press in pushbutton_steptuneFBT.
263function pushbutton_steptuneFBT_Callback(hObject, eventdata, handles)
264% hObject    handle to pushbutton_steptuneFBT (see GCBO)
265% eventdata  reserved - to be defined in a future version of MATLAB
266% handles    structure with handles and user data (see GUIDATA)
267
268% to be updated for ThomX
269%steptune;
270
271% --- Executes on button press in pushbutton_getpinhole.
272function pushbutton_getpinhole_Callback(hObject, eventdata, handles)
273% hObject    handle to pushbutton_getpinhole (see GCBO)
274% eventdata  reserved - to be defined in a future version of MATLAB
275% handles    structure with handles and user data (see GUIDATA)
276getpinhole('NoArchive')
277
278% --- Executes on button press in pushbutton_lifetime.
279function pushbutton_lifetime_Callback(hObject, eventdata, handles)
280% hObject    handle to pushbutton_lifetime (see GCBO)
281% eventdata  reserved - to be defined in a future version of MATLAB
282% handles    structure with handles and user data (see GUIDATA)
283measlifetime(30,'Display');
284
285% --- Executes on button press in pushbutton_monbpm.
286function pushbutton_monbpm_Callback(hObject, eventdata, handles)
287% hObject    handle to pushbutton_monbpm (see GCBO)
288% eventdata  reserved - to be defined in a future version of MATLAB
289% handles    structure with handles and user data (see GUIDATA)
290monbpm(60);
291
292% --- Executes on button press in pushbutton_BBA.
293function pushbutton_BBA_Callback(hObject, eventdata, handles)
294% hObject    handle to pushbutton_BBA (see GCBO)
295% eventdata  reserved - to be defined in a future version of MATLAB
296% handles    structure with handles and user data (see GUIDATA)
297bbacentergui
298
299% --- Executes on button press in pushbutton_checklibera.
300function pushbutton_checklibera_Callback(hObject, eventdata, handles)
301% hObject    handle to pushbutton_checklibera (see GCBO)
302% eventdata  reserved - to be defined in a future version of MATLAB
303% handles    structure with handles and user data (see GUIDATA)
304Check_Libera_config
305
306% --- Executes on button press in pushbutton_findrf.
307function pushbutton_findrf_Callback(hObject, eventdata, handles)
308% hObject    handle to pushbutton_findrf (see GCBO)
309% eventdata  reserved - to be defined in a future version of MATLAB
310% handles    structure with handles and user data (see GUIDATA)
311findrf;
312
313% --- Executes on button press in pushbutton_firstturn.
314function pushbutton_firstturn_Callback(hObject, eventdata, handles)
315% hObject    handle to pushbutton_firstturn (see GCBO)
316% eventdata  reserved - to be defined in a future version of MATLAB
317% handles    structure with handles and user data (see GUIDATA)
318getbpmsum;
319
320
321% --- Executes on button press in pushbutton_gettune.
322function pushbutton_gettune_Callback(hObject, eventdata, handles)
323% hObject    handle to pushbutton_gettune (see GCBO)
324% eventdata  reserved - to be defined in a future version of MATLAB
325% handles    structure with handles and user data (see GUIDATA)
326gettune
327
328% --- Executes on button press in pushbutton_gettuneFBT.
329function pushbutton_gettuneFBT_Callback(hObject, eventdata, handles)
330% hObject    handle to pushbutton_gettuneFBT (see GCBO)
331% eventdata  reserved - to be defined in a future version of MATLAB
332% handles    structure with handles and user data (see GUIDATA)
333
334% to be updated for ThomX
335%gettuneFBT
336
337
338% --- Executes on button press in pushbutton_steprf.
339function pushbutton_steprf_Callback(hObject, eventdata, handles)
340% hObject    handle to pushbutton_steprf (see GCBO)
341% eventdata  reserved - to be defined in a future version of MATLAB
342% handles    structure with handles and user data (see GUIDATA)
343Step_RF_Progressive;
344
345
346% --- Executes on button press in pushbutton_BeamsizeTunette.
347function pushbutton_BeamsizeTunette_Callback(hObject, eventdata, handles)
348% hObject    handle to pushbutton_BeamsizeTunette (see GCBO)
349% eventdata  reserved - to be defined in a future version of MATLAB
350% handles    structure with handles and user data (see GUIDATA)
351BeamSizeTunette
352
353
354% --- Executes on button press in meas_mcf.
355function meas_mcf_Callback(hObject, eventdata, handles)
356% hObject    handle to meas_mcf (see GCBO)
357% eventdata  reserved - to be defined in a future version of MATLAB
358% handles    structure with handles and user data (see GUIDATA)
359
360measmcf;
Note: See TracBrowser for help on using the repository browser.