1 | function varargout = BeamSizeTunette(varargin) |
---|
2 | % BEAMSIZETUNETTE M-file for BeamSizeTunette.fig |
---|
3 | % BEAMSIZETUNETTE, by itself, creates a new BEAMSIZETUNETTE or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = BEAMSIZETUNETTE returns the handle to a new BEAMSIZETUNETTE or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % BEAMSIZETUNETTE('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in BEAMSIZETUNETTE.M with the given input arguments. |
---|
11 | % |
---|
12 | % BEAMSIZETUNETTE('Property','Value',...) creates a new BEAMSIZETUNETTE or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before BeamSizeTunette_OpeningFcn gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to BeamSizeTunette_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 BeamSizeTunette |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 02-Jun-2012 09:04:15 |
---|
26 | |
---|
27 | % Begin initialization code - DO NOT EDIT |
---|
28 | gui_Singleton = 1; |
---|
29 | gui_State = struct('gui_Name', mfilename, ... |
---|
30 | 'gui_Singleton', gui_Singleton, ... |
---|
31 | 'gui_OpeningFcn', @BeamSizeTunette_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @BeamSizeTunette_OutputFcn, ... |
---|
33 | 'gui_LayoutFcn', [] , ... |
---|
34 | 'gui_Callback', []); |
---|
35 | if nargin && ischar(varargin{1}) |
---|
36 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
37 | end |
---|
38 | |
---|
39 | if nargout |
---|
40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
41 | else |
---|
42 | gui_mainfcn(gui_State, varargin{:}); |
---|
43 | end |
---|
44 | % End initialization code - DO NOT EDIT |
---|
45 | |
---|
46 | |
---|
47 | % --- Executes just before BeamSizeTunette is made visible. |
---|
48 | function BeamSizeTunette_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 command line arguments to BeamSizeTunette (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for BeamSizeTunette |
---|
56 | handles.output = hObject; |
---|
57 | |
---|
58 | %%%%%%%%%%%%%%%%%%%%%%%%% |
---|
59 | |
---|
60 | k0 = uibuttongroup('visible','on','Position',[0.05 0.05 .90 .50],... |
---|
61 | 'Title','','TitlePosition','lefttop','FontSize',14,... |
---|
62 | 'BackgroundColor',[.651 0.855 0.924]); |
---|
63 | |
---|
64 | v1 = uicontrol('Style','Radio','String',' Non expert','Tag','radiobutton1',... |
---|
65 | 'pos',[70 160 200 20],'parent',k0,'HandleVisibility','off','FontSize',14,... |
---|
66 | 'BackgroundColor',[.651 0.855 0.924]); |
---|
67 | v2 = uicontrol('Style','Radio','String',' Expert','Tag','radiobutton2','FontSize',14,... |
---|
68 | 'pos',[250. 160 150 20],'parent',k0,'HandleVisibility','off',... |
---|
69 | 'BackgroundColor',[.651 0.855 0.924]); |
---|
70 | set(k0,'SelectedObject',v1); % Non expert par défaut |
---|
71 | set(handles.pourcentage,'Enable','Off') |
---|
72 | set(handles.dispersion_verticale,'Enable','Off') |
---|
73 | set(handles.fichier,'Enable','Off') |
---|
74 | set(k0,'Visible','on'); |
---|
75 | set(k0,'SelectionChangeFcn',... |
---|
76 | {@uibuttongroup_SelectionChangeFcn_expert,handles}); |
---|
77 | pourcentage = 5; |
---|
78 | FileName = '/home/matlabML/measdata/SOLEIL/StorageRingdata/SkewQuad/solution_QT/Nanoscopium/QT_Dipersion_verticale_pure_Nanoscopium'; |
---|
79 | setappdata(handles.figure1,'pourcentage','pourcentage'); |
---|
80 | setappdata(handles.figure1,'fichier','FileName'); |
---|
81 | ModeFlag = 'Online'; % DANGER !! |
---|
82 | setappdata(handles.figure1,'ModeFlag',ModeFlag); |
---|
83 | |
---|
84 | % Update handles structure |
---|
85 | guidata(hObject, handles); |
---|
86 | |
---|
87 | % UIWAIT makes BeamSizeTunette wait for user response (see UIRESUME) |
---|
88 | % uiwait(handles.figure1); |
---|
89 | |
---|
90 | |
---|
91 | % --- Outputs from this function are returned to the command line. |
---|
92 | function varargout = BeamSizeTunette_OutputFcn(hObject, eventdata, handles) |
---|
93 | % varargout cell array for returning output args (see VARARGOUT); |
---|
94 | % hObject handle to figure |
---|
95 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
96 | % handles structure with handles and user data (see GUIDATA) |
---|
97 | |
---|
98 | % Get default command line output from handles structure |
---|
99 | varargout{1} = handles.output; |
---|
100 | |
---|
101 | |
---|
102 | % --- Executes on button press in Augmenter. |
---|
103 | function Augmenter_Callback(hObject, eventdata, handles) |
---|
104 | % hObject handle to Augmenter (see GCBO) |
---|
105 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
106 | % handles structure with handles and user data (see GUIDATA) |
---|
107 | |
---|
108 | pourcentage = str2double(get(handles.pourcentage,'String')); |
---|
109 | FileName = get(handles.fichier,'String'); % fichier de dispersion verticale |
---|
110 | ModeFlag = getappdata(handles.figure1,'ModeFlag'); |
---|
111 | S = load(FileName); |
---|
112 | stepsp('QT',pourcentage*1e-2*S.Deltaskewquad,ModeFlag); % SUPERPOSITION du jeu de QT |
---|
113 | |
---|
114 | |
---|
115 | |
---|
116 | % --- Executes on button press in Diminuer. |
---|
117 | function Diminuer_Callback(hObject, eventdata, handles) |
---|
118 | % hObject handle to Diminuer (see GCBO) |
---|
119 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
120 | % handles structure with handles and user data (see GUIDATA) |
---|
121 | |
---|
122 | pourcentage = str2double(get(handles.pourcentage,'String')); |
---|
123 | FileName = get(handles.fichier,'String'); % fichier de dispersion verticale |
---|
124 | ModeFlag = getappdata(handles.figure1,'ModeFlag'); |
---|
125 | S = load(FileName); |
---|
126 | stepsp('QT',-pourcentage*1e-2*S.Deltaskewquad,ModeFlag); % SUPERPOSITION du jeu de QT |
---|
127 | |
---|
128 | |
---|
129 | function Titre_Callback(hObject, eventdata, handles) |
---|
130 | % hObject handle to Titre (see GCBO) |
---|
131 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
132 | % handles structure with handles and user data (see GUIDATA) |
---|
133 | |
---|
134 | % Hints: get(hObject,'String') returns contents of Titre as text |
---|
135 | % str2double(get(hObject,'String')) returns contents of Titre as a double |
---|
136 | |
---|
137 | |
---|
138 | % --- Executes during object creation, after setting all properties. |
---|
139 | function Titre_CreateFcn(hObject, eventdata, handles) |
---|
140 | % hObject handle to Titre (see GCBO) |
---|
141 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
142 | % handles empty - handles not created until after all CreateFcns called |
---|
143 | |
---|
144 | % Hint: edit controls usually have a white background on Windows. |
---|
145 | % See ISPC and COMPUTER. |
---|
146 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
147 | set(hObject,'BackgroundColor','white'); |
---|
148 | end |
---|
149 | |
---|
150 | |
---|
151 | |
---|
152 | function pourcentage_Callback(hObject, eventdata, handles) |
---|
153 | % hObject handle to pourcentage (see GCBO) |
---|
154 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
155 | % handles structure with handles and user data (see GUIDATA) |
---|
156 | |
---|
157 | % Hints: get(hObject,'String') returns contents of pourcentage as text |
---|
158 | % str2double(get(hObject,'String')) returns contents of pourcentage as a double |
---|
159 | pourcentage = str2double(get(hObject,'String')); |
---|
160 | setappdata(handles.figure1,'pourcentage','pourcentage'); |
---|
161 | |
---|
162 | |
---|
163 | % --- Executes during object creation, after setting all properties. |
---|
164 | function pourcentage_CreateFcn(hObject, eventdata, handles) |
---|
165 | % hObject handle to pourcentage (see GCBO) |
---|
166 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
167 | % handles empty - handles not created until after all CreateFcns called |
---|
168 | |
---|
169 | % Hint: edit controls usually have a white background on Windows. |
---|
170 | % See ISPC and COMPUTER. |
---|
171 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
172 | set(hObject,'BackgroundColor','white'); |
---|
173 | end |
---|
174 | |
---|
175 | % --- Executes on button press in dispersion_verticale. |
---|
176 | function dispersion_verticale_Callback(hObject, eventdata, handles) |
---|
177 | % hObject handle to dispersion_verticale (see GCBO) |
---|
178 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
179 | % handles structure with handles and user data (see GUIDATA) |
---|
180 | |
---|
181 | DirectoryName = getfamilydata('Directory', 'Coupling'); |
---|
182 | if isempty(DirectoryName) |
---|
183 | % DirectoryName = [getfamilydata('Directory','DataRoot'), 'Response', filesep, 'BPM', filesep]; |
---|
184 | else |
---|
185 | % Make sure default directory exists |
---|
186 | DirStart = pwd; |
---|
187 | [DirectoryName, ErrorFlag] = gotodirectory(DirectoryName); |
---|
188 | cd(DirStart); |
---|
189 | end |
---|
190 | %[FileName, DirectoryName] = uigetfile('*.mat', 'Select a Skew corrector list ("Save" starts measurement)', [DirectoryName FileName]); |
---|
191 | |
---|
192 | [FileName, DirectoryName] = uigetfile('*.mat', 'Select a new Dispersion Wave ("Save" starts measurement)',DirectoryName); |
---|
193 | if FileName == 0 |
---|
194 | ArchiveFlag = 0; |
---|
195 | disp(' Skew correction canceled.'); |
---|
196 | return |
---|
197 | end |
---|
198 | FileName = [DirectoryName, FileName]; |
---|
199 | set(handles.fichier,'String',FileName) |
---|
200 | |
---|
201 | |
---|
202 | |
---|
203 | function uibuttongroup_SelectionChangeFcn_expert(hObject,eventdata,handles) |
---|
204 | % hObject handle to uipanel1 (see GCBO) |
---|
205 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
206 | % handles structure with handles and user data (see GUIDATA) |
---|
207 | |
---|
208 | switch get(get(hObject,'SelectedObject'),'Tag') % Get Tag of selected object |
---|
209 | |
---|
210 | case 'radiobutton2' |
---|
211 | % code piece when radiobutton2 is selected goes here |
---|
212 | %setappdata(handles.figure1,'Correction','fichier'); % |
---|
213 | set(handles.pourcentage,'Enable','On') |
---|
214 | set(handles.dispersion_verticale,'Enable','On') |
---|
215 | set(handles.fichier,'Enable','Off') |
---|
216 | |
---|
217 | case 'radiobutton1' |
---|
218 | % code piece when radiobutton1 is selected goes here |
---|
219 | set(handles.pourcentage,'Enable','Off') |
---|
220 | set(handles.dispersion_verticale,'Enable','Off') |
---|
221 | set(handles.fichier,'Enable','Off') |
---|
222 | |
---|
223 | end |
---|
224 | |
---|
225 | |
---|
226 | |
---|
227 | function fichier_Callback(hObject, eventdata, handles) |
---|
228 | % hObject handle to fichier (see GCBO) |
---|
229 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
230 | % handles structure with handles and user data (see GUIDATA) |
---|
231 | |
---|
232 | % Hints: get(hObject,'String') returns contents of fichier as text |
---|
233 | % str2double(get(hObject,'String')) returns contents of fichier as a double |
---|
234 | |
---|
235 | |
---|
236 | % --- Executes during object creation, after setting all properties. |
---|
237 | function fichier_CreateFcn(hObject, eventdata, handles) |
---|
238 | % hObject handle to fichier (see GCBO) |
---|
239 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
240 | % handles empty - handles not created until after all CreateFcns called |
---|
241 | |
---|
242 | % Hint: edit controls usually have a white background on Windows. |
---|
243 | % See ISPC and COMPUTER. |
---|
244 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
245 | set(hObject,'BackgroundColor','white'); |
---|
246 | end |
---|