source: MML/trunk/machine/SOLEIL/StorageRing/insertions/FFTABLE_INVAC.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 21.1 KB
Line 
1function varargout = FFTABLE_INVAC(varargin)
2%FFTABLE_INVAC M-file for FFTABLE_INVAC.fig
3%      FFTABLE_INVAC, by itself, creates a new FFTABLE_INVAC or raises the existing
4%      singleton*.
5%
6%      H = FFTABLE_INVAC returns the handle to a new FFTABLE_INVAC or the handle to
7%      the existing singleton*.
8%
9%      FFTABLE_INVAC('Property','Value',...) creates a new FFTABLE_INVAC using the
10%      given property value pairs. Unrecognized properties are passed via
11%      varargin to FFTABLE_INVAC_OpeningFcn.  This calling syntax produces a
12%      warning when there is an existing singleton*.
13%
14%      FFTABLE_INVAC('CALLBACK') and FFTABLE_INVAC('CALLBACK',hObject,...) call the
15%      local function named CALLBACK in FFTABLE_INVAC.M with the given input
16%      arguments.
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 FFTABLE_INVAC
24
25% Last Modified by GUIDE v2.5 22-Dec-2010 04:17:52
26
27% Begin initialization code - DO NOT EDIT
28gui_Singleton = 1;
29gui_State = struct('gui_Name',       mfilename, ...
30                   'gui_Singleton',  gui_Singleton, ...
31                   'gui_OpeningFcn', @FFTABLE_INVAC_OpeningFcn, ...
32                   'gui_OutputFcn',  @FFTABLE_INVAC_OutputFcn, ...
33                   'gui_LayoutFcn',  [], ...
34                   'gui_Callback',   []);
35if nargin && ischar(varargin{1})
36   gui_State.gui_Callback = str2func(varargin{1});
37end
38
39if nargout
40    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
41else
42    gui_mainfcn(gui_State, varargin{:});
43end
44% End initialization code - DO NOT EDIT
45
46
47% --- Executes just before FFTABLE_INVAC is made visible.
48function FFTABLE_INVAC_OpeningFcn(hObject, eventdata, handles, varargin)
49% This function has no output args, see OutputFcn.
50% hObject    handle to figure
51% eventdata  reserved - to be defined in a future version of MATLAB
52% handles    structure with handles and user data (see GUIDATA)
53% varargin   unrecognized PropertyName/PropertyValue pairs from the
54%            command line (see VARARGIN)
55
56% Choose default command line output for FFTABLE_INVAC
57handles.output = hObject;
58
59% Update handles structure
60guidata(hObject, handles);
61
62% UIWAIT makes FFTABLE_INVAC wait for user response (see UIRESUME)
63% uiwait(handles.figure1);
64
65
66% --- Outputs from this function are returned to the command line.
67function varargout = FFTABLE_INVAC_OutputFcn(hObject, eventdata, handles)
68% varargout  cell array for returning output args (see VARARGOUT);
69% hObject    handle to figure
70% eventdata  reserved - to be defined in a future version of MATLAB
71% handles    structure with handles and user data (see GUIDATA)
72
73% Get default command line output from handles structure
74varargout{1} = handles.output;
75
76
77
78function CellName_Callback(hObject, eventdata, handles)
79% hObject    handle to CellName (see GCBO)
80% eventdata  reserved - to be defined in a future version of MATLAB
81% handles    structure with handles and user data (see GUIDATA)
82
83% Hints: get(hObject,'String') returns contents of CellName as text
84%        str2double(get(hObject,'String')) returns contents of CellName as a double
85
86
87% --- Executes during object creation, after setting all properties.
88function CellName_CreateFcn(hObject, eventdata, handles)
89% hObject    handle to CellName (see GCBO)
90% eventdata  reserved - to be defined in a future version of MATLAB
91% handles    empty - handles not created until after all CreateFcns called
92
93% Hint: edit controls usually have a white background on Windows.
94%       See ISPC and COMPUTER.
95if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
96    set(hObject,'BackgroundColor','white');
97end
98
99
100
101function SSType_Callback(hObject, eventdata, handles)
102% hObject    handle to SSType (see GCBO)
103% eventdata  reserved - to be defined in a future version of MATLAB
104% handles    structure with handles and user data (see GUIDATA)
105
106% Hints: get(hObject,'String') returns contents of SSType as text
107%        str2double(get(hObject,'String')) returns contents of SSType as a double
108
109
110% --- Executes during object creation, after setting all properties.
111function SSType_CreateFcn(hObject, eventdata, handles)
112% hObject    handle to SSType (see GCBO)
113% eventdata  reserved - to be defined in a future version of MATLAB
114% handles    empty - handles not created until after all CreateFcns called
115
116% Hint: edit controls usually have a white background on Windows.
117%       See ISPC and COMPUTER.
118if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
119    set(hObject,'BackgroundColor','white');
120end
121
122
123
124function UndType_Callback(hObject, eventdata, handles)
125% hObject    handle to UndType (see GCBO)
126% eventdata  reserved - to be defined in a future version of MATLAB
127% handles    structure with handles and user data (see GUIDATA)
128
129% Hints: get(hObject,'String') returns contents of UndType as text
130%        str2double(get(hObject,'String')) returns contents of UndType as a double
131
132
133% --- Executes during object creation, after setting all properties.
134function UndType_CreateFcn(hObject, eventdata, handles)
135% hObject    handle to UndType (see GCBO)
136% eventdata  reserved - to be defined in a future version of MATLAB
137% handles    empty - handles not created until after all CreateFcns called
138
139% Hint: edit controls usually have a white background on Windows.
140%       See ISPC and COMPUTER.
141if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
142    set(hObject,'BackgroundColor','white');
143end
144
145
146
147function TableName_Callback(hObject, eventdata, handles)
148% hObject    handle to TableName (see GCBO)
149% eventdata  reserved - to be defined in a future version of MATLAB
150% handles    structure with handles and user data (see GUIDATA)
151
152% Hints: get(hObject,'String') returns contents of TableName as text
153%        str2double(get(hObject,'String')) returns contents of TableName as a double
154
155
156% --- Executes during object creation, after setting all properties.
157function TableName_CreateFcn(hObject, eventdata, handles)
158% hObject    handle to TableName (see GCBO)
159% eventdata  reserved - to be defined in a future version of MATLAB
160% handles    empty - handles not created until after all CreateFcns called
161
162% Hint: edit controls usually have a white background on Windows.
163%       See ISPC and COMPUTER.
164if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
165    set(hObject,'BackgroundColor','white');
166end
167
168
169
170function SESSION_Callback(hObject, eventdata, handles)
171% hObject    handle to SESSION (see GCBO)
172% eventdata  reserved - to be defined in a future version of MATLAB
173% handles    structure with handles and user data (see GUIDATA)
174
175% Hints: get(hObject,'String') returns contents of SESSION as text
176%        str2double(get(hObject,'String')) returns contents of SESSION as a double
177
178
179% --- Executes during object creation, after setting all properties.
180function SESSION_CreateFcn(hObject, eventdata, handles)
181% hObject    handle to SESSION (see GCBO)
182% eventdata  reserved - to be defined in a future version of MATLAB
183% handles    empty - handles not created until after all CreateFcns called
184
185% Hint: edit controls usually have a white background on Windows.
186%       See ISPC and COMPUTER.
187if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
188    set(hObject,'BackgroundColor','white');
189end
190
191
192% --- Executes on button press in APPLY.
193function APPLY_Callback(hObject, eventdata, handles)
194% hObject    handle to APPLY (see GCBO)
195% eventdata  reserved - to be defined in a future version of MATLAB
196% handles    structure with handles and user data (see GUIDATA)
197CellName=get(handles.CellName,'String');
198SSType=get(handles.SSType,'String');
199UndType=get(handles.UndType,'String');
200TableName=get(handles.TableName,'String');
201SESSION=get(handles.SESSION,'String');
202fprintf('%s\t %s\t %s\t %s\t %s\n',SESSION,CellName,SSType,UndType,TableName)
203Update_InVacID(SESSION,CellName,SSType,UndType,TableName)
204
205
206function CurMin_Callback(hObject, eventdata, handles)
207% hObject    handle to CurMin (see GCBO)
208% eventdata  reserved - to be defined in a future version of MATLAB
209% handles    structure with handles and user data (see GUIDATA)
210
211% Hints: get(hObject,'String') returns contents of CurMin as text
212%        str2double(get(hObject,'String')) returns contents of CurMin as a double
213
214
215% --- Executes during object creation, after setting all properties.
216function CurMin_CreateFcn(hObject, eventdata, handles)
217% hObject    handle to CurMin (see GCBO)
218% eventdata  reserved - to be defined in a future version of MATLAB
219% handles    empty - handles not created until after all CreateFcns called
220
221% Hint: edit controls usually have a white background on Windows.
222%       See ISPC and COMPUTER.
223if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
224    set(hObject,'BackgroundColor','white');
225end
226
227
228
229function CurMax_Callback(hObject, eventdata, handles)
230% hObject    handle to CurMax (see GCBO)
231% eventdata  reserved - to be defined in a future version of MATLAB
232% handles    structure with handles and user data (see GUIDATA)
233
234% Hints: get(hObject,'String') returns contents of CurMax as text
235%        str2double(get(hObject,'String')) returns contents of CurMax as a double
236
237
238% --- Executes during object creation, after setting all properties.
239function CurMax_CreateFcn(hObject, eventdata, handles)
240% hObject    handle to CurMax (see GCBO)
241% eventdata  reserved - to be defined in a future version of MATLAB
242% handles    empty - handles not created until after all CreateFcns called
243
244% Hint: edit controls usually have a white background on Windows.
245%       See ISPC and COMPUTER.
246if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
247    set(hObject,'BackgroundColor','white');
248end
249
250function CurStep_Callback(hObject, eventdata, handles)
251% hObject    handle to CurStep (see GCBO)
252% eventdata  reserved - to be defined in a future version of MATLAB
253% handles    structure with handles and user data (see GUIDATA)
254
255% Hints: get(hObject,'String') returns contents of CurStep as text
256%        str2double(get(hObject,'String')) returns contents of CurStep as a double
257
258
259% --- Executes during object creation, after setting all properties.
260function CurStep_CreateFcn(hObject, eventdata, handles)
261% hObject    handle to CurStep (see GCBO)
262% eventdata  reserved - to be defined in a future version of MATLAB
263% handles    empty - handles not created until after all CreateFcns called
264
265% Hint: edit controls usually have a white background on Windows.
266%       See ISPC and COMPUTER.
267if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
268    set(hObject,'BackgroundColor','white');
269end
270
271
272function BLName_Callback(hObject, eventdata, handles)
273% hObject    handle to BLName (see GCBO)
274% eventdata  reserved - to be defined in a future version of MATLAB
275% handles    structure with handles and user data (see GUIDATA)
276
277% Hints: get(hObject,'String') returns contents of BLName as text
278%        str2double(get(hObject,'String')) returns contents of BLName as a double
279
280
281% --- Executes during object creation, after setting all properties.
282function BLName_CreateFcn(hObject, eventdata, handles)
283% hObject    handle to BLName (see GCBO)
284% eventdata  reserved - to be defined in a future version of MATLAB
285% handles    empty - handles not created until after all CreateFcns called
286
287% Hint: edit controls usually have a white background on Windows.
288%       See ISPC and COMPUTER.
289if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
290    set(hObject,'BackgroundColor','white');
291end
292
293
294% --- Executes on button press in CorCalib.
295function CorCalib_Callback(hObject, eventdata, handles)
296% hObject    handle to CorCalib (see GCBO)
297% eventdata  reserved - to be defined in a future version of MATLAB
298% handles    structure with handles and user data (see GUIDATA)
299CellName=get(handles.CellName,'String');
300SSType=get(handles.SSType,'String');
301UndType=get(handles.UndType,'String');
302CurMin=str2double(get(handles.CurMin,'String'));
303CurMax=str2double(get(handles.CurMax,'String'));
304CurStep=str2double(get(handles.CurStep,'String'));
305TableName=get(handles.TableName,'String');
306BLName=TableName(4:findstr(TableName,'.')-1);
307DeviceServerName=[CellName '/EI/' SSType '-' UndType ]
308FullUndName=[UndType '_' BLName]
309IdCorCalibInVac(FullUndName,DeviceServerName,CurMin,CurMax,CurStep)
310
311
312
313function edit19_Callback(hObject, eventdata, handles)
314% hObject    handle to edit19 (see GCBO)
315% eventdata  reserved - to be defined in a future version of MATLAB
316% handles    structure with handles and user data (see GUIDATA)
317
318% Hints: get(hObject,'String') returns contents of edit19 as text
319%        str2double(get(hObject,'String')) returns contents of edit19 as a double
320
321
322% --- Executes during object creation, after setting all properties.
323function edit19_CreateFcn(hObject, eventdata, handles)
324% hObject    handle to edit19 (see GCBO)
325% eventdata  reserved - to be defined in a future version of MATLAB
326% handles    empty - handles not created until after all CreateFcns called
327
328% Hint: edit controls usually have a white background on Windows.
329%       See ISPC and COMPUTER.
330if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
331    set(hObject,'BackgroundColor','white');
332end
333
334
335
336function LinExp_Callback(hObject, eventdata, handles)
337% hObject    handle to LinExp (see GCBO)
338% eventdata  reserved - to be defined in a future version of MATLAB
339% handles    structure with handles and user data (see GUIDATA)
340
341% Hints: get(hObject,'String') returns contents of LinExp as text
342%        str2double(get(hObject,'String')) returns contents of LinExp as a double
343
344
345% --- Executes during object creation, after setting all properties.
346function LinExp_CreateFcn(hObject, eventdata, handles)
347% hObject    handle to LinExp (see GCBO)
348% eventdata  reserved - to be defined in a future version of MATLAB
349% handles    empty - handles not created until after all CreateFcns called
350
351% Hint: edit controls usually have a white background on Windows.
352%       See ISPC and COMPUTER.
353if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
354    set(hObject,'BackgroundColor','white');
355end
356
357
358
359function edit21_Callback(hObject, eventdata, handles)
360% hObject    handle to edit21 (see GCBO)
361% eventdata  reserved - to be defined in a future version of MATLAB
362% handles    structure with handles and user data (see GUIDATA)
363
364% Hints: get(hObject,'String') returns contents of edit21 as text
365%        str2double(get(hObject,'String')) returns contents of edit21 as a double
366
367
368% --- Executes during object creation, after setting all properties.
369function edit21_CreateFcn(hObject, eventdata, handles)
370% hObject    handle to edit21 (see GCBO)
371% eventdata  reserved - to be defined in a future version of MATLAB
372% handles    empty - handles not created until after all CreateFcns called
373
374% Hint: edit controls usually have a white background on Windows.
375%       See ISPC and COMPUTER.
376if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
377    set(hObject,'BackgroundColor','white');
378end
379
380
381
382function GapMin_Callback(hObject, eventdata, handles)
383% hObject    handle to GapMin (see GCBO)
384% eventdata  reserved - to be defined in a future version of MATLAB
385% handles    structure with handles and user data (see GUIDATA)
386
387% Hints: get(hObject,'String') returns contents of GapMin as text
388%        str2double(get(hObject,'String')) returns contents of GapMin as a double
389
390
391% --- Executes during object creation, after setting all properties.
392function GapMin_CreateFcn(hObject, eventdata, handles)
393% hObject    handle to GapMin (see GCBO)
394% eventdata  reserved - to be defined in a future version of MATLAB
395% handles    empty - handles not created until after all CreateFcns called
396
397% Hint: edit controls usually have a white background on Windows.
398%       See ISPC and COMPUTER.
399if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
400    set(hObject,'BackgroundColor','white');
401end
402
403
404
405function GapMax_Callback(hObject, eventdata, handles)
406% hObject    handle to GapMax (see GCBO)
407% eventdata  reserved - to be defined in a future version of MATLAB
408% handles    structure with handles and user data (see GUIDATA)
409
410% Hints: get(hObject,'String') returns contents of GapMax as text
411%        str2double(get(hObject,'String')) returns contents of GapMax as a double
412
413
414% --- Executes during object creation, after setting all properties.
415function GapMax_CreateFcn(hObject, eventdata, handles)
416% hObject    handle to GapMax (see GCBO)
417% eventdata  reserved - to be defined in a future version of MATLAB
418% handles    empty - handles not created until after all CreateFcns called
419
420% Hint: edit controls usually have a white background on Windows.
421%       See ISPC and COMPUTER.
422if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
423    set(hObject,'BackgroundColor','white');
424end
425
426
427
428function Npts_Callback(hObject, eventdata, handles)
429% hObject    handle to Npts (see GCBO)
430% eventdata  reserved - to be defined in a future version of MATLAB
431% handles    structure with handles and user data (see GUIDATA)
432
433% Hints: get(hObject,'String') returns contents of Npts as text
434%        str2double(get(hObject,'String')) returns contents of Npts as a double
435
436
437% --- Executes during object creation, after setting all properties.
438function Npts_CreateFcn(hObject, eventdata, handles)
439% hObject    handle to Npts (see GCBO)
440% eventdata  reserved - to be defined in a future version of MATLAB
441% handles    empty - handles not created until after all CreateFcns called
442
443% Hint: edit controls usually have a white background on Windows.
444%       See ISPC and COMPUTER.
445if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
446    set(hObject,'BackgroundColor','white');
447end
448
449
450% --- Executes on button press in ZeroCurrentTable.
451function ZeroCurrentTable_Callback(hObject, eventdata, handles)
452% hObject    handle to ZeroCurrentTable (see GCBO)
453% eventdata  reserved - to be defined in a future version of MATLAB
454% handles    structure with handles and user data (see GUIDATA)
455LinExp=str2double(get(handles.LinExp,'String'));
456CellName=get(handles.CellName,'String');
457UndType=get(handles.UndType,'String');
458GapMin=str2double(get(handles.GapMin,'String'));
459GapMax=str2double(get(handles.GapMax,'String'));
460Npts=str2double(get(handles.Npts,'String'));
461FolderAndFFTableName=['/usr/Local/configFiles/InsertionFFTables/' CellName '-' UndType '/FF_TEST.txt'];
462GenerateFFTableWithZeros(FolderAndFFTableName,GapMin,GapMax,Npts,LinExp)
463
464
465
466function edit_TABLE_AFTER_ANALYSE_Callback(hObject, eventdata, handles)
467% hObject    handle to edit_TABLE_AFTER_ANALYSE (see GCBO)
468% eventdata  reserved - to be defined in a future version of MATLAB
469% handles    structure with handles and user data (see GUIDATA)
470
471% Hints: get(hObject,'String') returns contents of edit_TABLE_AFTER_ANALYSE as text
472%        str2double(get(hObject,'String')) returns contents of edit_TABLE_AFTER_ANALYSE as a double
473
474
475% --- Executes during object creation, after setting all properties.
476function edit_TABLE_AFTER_ANALYSE_CreateFcn(hObject, eventdata, handles)
477% hObject    handle to edit_TABLE_AFTER_ANALYSE (see GCBO)
478% eventdata  reserved - to be defined in a future version of MATLAB
479% handles    empty - handles not created until after all CreateFcns called
480
481% Hint: edit controls usually have a white background on Windows.
482%       See ISPC and COMPUTER.
483if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
484    set(hObject,'BackgroundColor','white');
485end
486
487
488
489function edit_OrbitMax_Callback(hObject, eventdata, handles)
490% hObject    handle to edit_OrbitMax (see GCBO)
491% eventdata  reserved - to be defined in a future version of MATLAB
492% handles    structure with handles and user data (see GUIDATA)
493
494% Hints: get(hObject,'String') returns contents of edit_OrbitMax as text
495%        str2double(get(hObject,'String')) returns contents of edit_OrbitMax as a double
496
497
498% --- Executes during object creation, after setting all properties.
499function edit_OrbitMax_CreateFcn(hObject, eventdata, handles)
500% hObject    handle to edit_OrbitMax (see GCBO)
501% eventdata  reserved - to be defined in a future version of MATLAB
502% handles    empty - handles not created until after all CreateFcns called
503
504% Hint: edit controls usually have a white background on Windows.
505%       See ISPC and COMPUTER.
506if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
507    set(hObject,'BackgroundColor','white');
508end
509
510
511% --- Executes on button press in pushbutton6.
512function pushbutton6_Callback(hObject, eventdata, handles)
513CellName=get(handles.CellName,'String');
514SSType=get(handles.SSType,'String');
515UndType=get(handles.UndType,'String');
516TableName=get(handles.TableName,'String');
517OrbitMax=str2double(get(handles.edit_OrbitMax,'String'));
518NewTable=get(handles.edit_TABLE_AFTER_ANALYSE,'String');
519AnalyseOrbitAndFixTheGapStep(NewTable,CellName,SSType,UndType,TableName,OrbitMax)
520% hObject    handle to pushbutton6 (see GCBO)
521% eventdata  reserved - to be defined in a future version of MATLAB
522% handles    structure with handles and user data (see GUIDATA)
Note: See TracBrowser for help on using the repository browser.