1 | function varargout = Lifetime_with_Liberas(varargin) |
---|
2 | % LIFETIME_WITH_LIBERAS M-file for Lifetime_with_Liberas.fig |
---|
3 | % LIFETIME_WITH_LIBERAS, by itself, creates a new LIFETIME_WITH_LIBERAS or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = LIFETIME_WITH_LIBERAS returns the handle to a new LIFETIME_WITH_LIBERAS or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % LIFETIME_WITH_LIBERAS('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in LIFETIME_WITH_LIBERAS.M with the given input arguments. |
---|
11 | % |
---|
12 | % LIFETIME_WITH_LIBERAS('Property','Value',...) creates a new LIFETIME_WITH_LIBERAS or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before Lifetime_with_Liberas_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to Lifetime_with_Liberas_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 Lifetime_with_Liberas |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 11-Jul-2011 11:59:21 |
---|
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', @Lifetime_with_Liberas_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @Lifetime_with_Liberas_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 Lifetime_with_Liberas is made visible. |
---|
48 | function Lifetime_with_Liberas_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 Lifetime_with_Liberas (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for Lifetime_with_Liberas |
---|
56 | handles.output = hObject; |
---|
57 | |
---|
58 | % Update handles structure |
---|
59 | guidata(hObject, handles); |
---|
60 | |
---|
61 | % UIWAIT makes Lifetime_with_Liberas wait for user response (see UIRESUME) |
---|
62 | % uiwait(handles.figure1); |
---|
63 | Red=0.877; |
---|
64 | Green=0.889; |
---|
65 | Blue=1.000; |
---|
66 | BackgroundColor=[Red Green Blue]; |
---|
67 | setappdata(handles.figure1,'BackGroundColor',BackgroundColor); |
---|
68 | |
---|
69 | set(handles.figure1,'Color',BackgroundColor); |
---|
70 | set(handles.text_buff_length,'BackgroundColor',BackgroundColor); |
---|
71 | set(handles.text_seuil_1,'BackgroundColor',BackgroundColor); |
---|
72 | set(handles.text_seuil_2,'BackgroundColor',BackgroundColor); |
---|
73 | set(handles.text_NLib2valid,'BackgroundColor',BackgroundColor); |
---|
74 | set(handles.text_historic_size,'BackgroundColor',BackgroundColor); |
---|
75 | set(handles.text_LT_Libera,'BackgroundColor',BackgroundColor); |
---|
76 | set(handles.text_LT_DCCT,'BackgroundColor',BackgroundColor); |
---|
77 | set(handles.text_title,'BackgroundColor',BackgroundColor); |
---|
78 | set(handles.N_Liberas,'BackgroundColor',BackgroundColor); |
---|
79 | set(handles.Process_Time,'BackgroundColor',BackgroundColor); |
---|
80 | set(handles.start_stop,'BackgroundColor','Green'); |
---|
81 | |
---|
82 | text_color=[0.824 0.824 0.895] |
---|
83 | set(handles.Lib_list,'BackgroundColor',text_color); |
---|
84 | |
---|
85 | |
---|
86 | N_samples=1000; |
---|
87 | setappdata(handles.figure1,'N_samples',N_samples); |
---|
88 | set(handles.N_samples,'string',num2str(N_samples)); |
---|
89 | |
---|
90 | historic_size=10000; |
---|
91 | setappdata(handles.figure1,'historic_size',historic_size); |
---|
92 | set(handles.historic_size,'string',num2str(historic_size)); |
---|
93 | |
---|
94 | seuil_1=0.2; |
---|
95 | setappdata(handles.figure1,'seuil_1',seuil_1); |
---|
96 | set(handles.seuil_1,'string',num2str(seuil_1)); |
---|
97 | |
---|
98 | seuil_2=0.06; |
---|
99 | setappdata(handles.figure1,'seuil_2',seuil_2); |
---|
100 | set(handles.seuil_2,'string',num2str(seuil_2)); |
---|
101 | |
---|
102 | NLib2valid=60; |
---|
103 | setappdata(handles.figure1,'NLib2valid',NLib2valid); |
---|
104 | set(handles.NLib2valid,'string',num2str(NLib2valid)); |
---|
105 | |
---|
106 | NBPM=size(family2tangodev('BPMx'),1) |
---|
107 | previous_LT_Lib(1:NBPM)=0; |
---|
108 | setappdata(handles.figure1,'previous_LT_Lib',previous_LT_Lib); |
---|
109 | |
---|
110 | N_lib_valid(1:historic_size)=NaN; |
---|
111 | setappdata(handles.figure1,'N_lib_valid',N_lib_valid); |
---|
112 | |
---|
113 | N_lib_valid_first_sort(1:historic_size)=NaN; |
---|
114 | setappdata(handles.figure1,'N_lib_valid_first_sort',N_lib_valid_first_sort); |
---|
115 | |
---|
116 | N_lib_valid_second_sort(1:historic_size)=NaN; |
---|
117 | setappdata(handles.figure1,'N_lib_valid_second_sort',N_lib_valid_second_sort); |
---|
118 | |
---|
119 | LT_lib_mean(1:historic_size)=NaN; |
---|
120 | setappdata(handles.figure1,'LT_lib_mean',LT_lib_mean); |
---|
121 | |
---|
122 | LT_lib_by_quarter(1:4,1:historic_size)=NaN; |
---|
123 | setappdata(handles.figure1,'LT_lib_by_quarter',LT_lib_by_quarter); |
---|
124 | |
---|
125 | LT_DCCT(1:historic_size)=NaN; |
---|
126 | setappdata(handles.figure1,'LT_DCCT',LT_DCCT); |
---|
127 | |
---|
128 | Time_history(1:historic_size)=NaN; |
---|
129 | setappdata(handles.figure1,'Time_history',Time_history); |
---|
130 | |
---|
131 | DCCT_history(1:historic_size)=NaN; |
---|
132 | setappdata(handles.figure1,'DCCT_history',DCCT_history); |
---|
133 | |
---|
134 | |
---|
135 | |
---|
136 | bpm_group=tango_group_create('bpms') |
---|
137 | dev_list=family2tangodev('BPMx') |
---|
138 | for i=1:1:size(dev_list,1) |
---|
139 | tango_group_add(bpm_group,dev_list{i}) |
---|
140 | BPM_index(i)=i; |
---|
141 | end |
---|
142 | tango_group_dump(bpm_group) |
---|
143 | tango_group_ping(bpm_group) |
---|
144 | N_BPM=tango_group_size(bpm_group); |
---|
145 | setappdata(handles.figure1,'dev_list',dev_list); |
---|
146 | setappdata(handles.figure1,'N_BPM',N_BPM); |
---|
147 | setappdata(handles.figure1,'BPM_index',BPM_index); |
---|
148 | setappdata(handles.figure1,'bpm_group',bpm_group); |
---|
149 | |
---|
150 | timer_id=timer('Period', 2.0,'ExecutionMode','fixedSpacing'); |
---|
151 | timer_id.TimerFcn = {@LT_Process,handles,hObject,eventdata}; |
---|
152 | %timer_id.StopFcn = {@stop_fofb,handles,hObject,eventdata}; |
---|
153 | setappdata(handles.figure1,'timer_id',timer_id); |
---|
154 | |
---|
155 | |
---|
156 | % --- Outputs from this function are returned to the command line. |
---|
157 | function varargout = Lifetime_with_Liberas_OutputFcn(hObject, eventdata, handles) |
---|
158 | % varargout cell array for returning output args (see VARARGOUT); |
---|
159 | % hObject handle to figure |
---|
160 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
161 | % handles structure with handles and user data (see GUIDATA) |
---|
162 | |
---|
163 | % Get default command line output from handles structure |
---|
164 | varargout{1} = handles.output; |
---|
165 | |
---|
166 | function LT_Process(obj, event, handles,hObject,eventdata) |
---|
167 | |
---|
168 | previous_LT_Lib=getappdata(handles.figure1,'previous_LT_Lib'); |
---|
169 | N_lib_valid=getappdata(handles.figure1,'N_lib_valid'); |
---|
170 | N_lib_valid_first_sort=getappdata(handles.figure1,'N_lib_valid_first_sort'); |
---|
171 | N_lib_valid_second_sort=getappdata(handles.figure1,'N_lib_valid_second_sort'); |
---|
172 | LT_lib_mean=getappdata(handles.figure1,'LT_lib_mean'); |
---|
173 | LT_lib_by_quarter=getappdata(handles.figure1,'LT_lib_by_quarter'); |
---|
174 | LT_DCCT=getappdata(handles.figure1,'LT_DCCT'); |
---|
175 | N_BPM=getappdata(handles.figure1,'N_BPM'); |
---|
176 | BPM_index=getappdata(handles.figure1,'BPM_index'); |
---|
177 | bpm_group=getappdata(handles.figure1,'bpm_group'); |
---|
178 | N_samples=str2num(get(handles.N_samples,'string')); |
---|
179 | historic_size=str2num(get(handles.historic_size,'string')); |
---|
180 | seuil_1=str2num(get(handles.seuil_1,'string')); |
---|
181 | seuil_2=str2num(get(handles.seuil_2,'string')); |
---|
182 | NLib2valid=str2num(get(handles.NLib2valid,'string')); |
---|
183 | setappdata(handles.figure1,'NLib2valid',NLib2valid); |
---|
184 | BackgroundColor=getappdata(handles.figure1,'BackGroundColor'); |
---|
185 | |
---|
186 | Time_history=getappdata(handles.figure1,'Time_history'); |
---|
187 | DCCT_history=getappdata(handles.figure1,'DCCT_history'); |
---|
188 | old_historic_size=getappdata(handles.figure1,'historic_size'); |
---|
189 | if old_historic_size<historic_size |
---|
190 | fill(1:historic_size-old_historic_size)=NaN; |
---|
191 | fill4(4,1:historic_size-old_historic_size)=NaN; |
---|
192 | N_lib_valid=[fill N_lib_valid]; |
---|
193 | N_lib_valid_first_sort=[fill N_lib_valid_first_sort]; |
---|
194 | N_lib_valid_second_sort=[fill N_lib_valid_second_sort]; |
---|
195 | LT_lib_mean=[fill LT_lib_mean]; |
---|
196 | LT_lib_by_quarter=[fill4 LT_lib_by_quarter]; |
---|
197 | LT_DCCT=[fill LT_DCCT]; |
---|
198 | Time_history=[fill Time_history]; |
---|
199 | DCCT_history=[fill DCCT_history]; |
---|
200 | elseif old_historic_size>historic_size |
---|
201 | N_lib_valid=N_lib_valid(old_historic_size-historic_size+1:old_historic_size); |
---|
202 | N_lib_valid_first_sort=N_lib_valid_first_sort(old_historic_size-historic_size+1:old_historic_size); |
---|
203 | N_lib_valid_second_sort=N_lib_valid_second_sort(old_historic_size-historic_size+1:old_historic_size); |
---|
204 | LT_lib_mean=LT_lib_mean(old_historic_size-historic_size+1:old_historic_size); |
---|
205 | LT_lib_by_quarter=LT_lib_by_quarter(:,old_historic_size-historic_size+1:old_historic_size); |
---|
206 | |
---|
207 | LT_DCCT=LT_DCCT(old_historic_size-historic_size+1:old_historic_size); |
---|
208 | Time_history=Time_history(old_historic_size-historic_size+1:old_historic_size); |
---|
209 | DCCT_history=DCCT_history(old_historic_size-historic_size+1:old_historic_size); |
---|
210 | end |
---|
211 | tic |
---|
212 | h=now; |
---|
213 | [previous_LT_Lib,LT_lib_mean,LT_lib_by_quarter,N_lib_valid,N_lib_valid_first_sort,N_lib_valid_second_sort,LT_DCCT,index_seuil_1,index_seuil_2,Time_history, DCCT_history]=... |
---|
214 | get_LT(bpm_group,BPM_index,N_samples,previous_LT_Lib,LT_lib_mean,LT_lib_by_quarter,N_lib_valid,... |
---|
215 | N_lib_valid_first_sort,N_lib_valid_second_sort,LT_DCCT,seuil_1,seuil_2,NLib2valid,Time_history,DCCT_history); |
---|
216 | t=toc; |
---|
217 | set(handles.Liberas_LT,'string',[num2str(LT_lib_mean(size(LT_lib_mean,2)),'%3.2f'),' Hrs']); |
---|
218 | set(handles.DCCT_LT,'string',[num2str(LT_DCCT(size(LT_DCCT,2)),'%3.2f'),' Hrs']); |
---|
219 | set(handles.N_Liberas,'string',['Number of valid Liberas = ',num2str(N_lib_valid_second_sort(size(N_lib_valid_second_sort,2)))]); |
---|
220 | if N_lib_valid_second_sort(size(N_lib_valid_second_sort,2))<NLib2valid |
---|
221 | set(handles.N_Liberas,'BackgroundColor','Red'); |
---|
222 | else |
---|
223 | set(handles.N_Liberas,'BackgroundColor',BackgroundColor); |
---|
224 | end |
---|
225 | |
---|
226 | set(handles.Process_Time,'string',['Process Time = ',num2str(t,'%2.1f'),' sec']); |
---|
227 | |
---|
228 | axes(handles.LT_Libera) |
---|
229 | plot(handles.LT_Libera,previous_LT_Lib,'bo','LineWidth',2) |
---|
230 | xlabel(handles.LT_Libera,'BPM Number') |
---|
231 | ylabel(handles.LT_Libera,'Hours') |
---|
232 | title(handles.LT_Libera,'Last LT measurment for each Libera') |
---|
233 | hold(handles.LT_Libera,'on') |
---|
234 | plot(handles.LT_Libera,index_seuil_2,previous_LT_Lib(index_seuil_2),'gx','LineWidth',3,'MarkerSize',20) |
---|
235 | plot(handles.LT_Libera,index_seuil_1,previous_LT_Lib(index_seuil_1),'rx','LineWidth',3,'MarkerSize',20) |
---|
236 | hold(handles.LT_Libera,'off') |
---|
237 | |
---|
238 | dev_list=getappdata(handles.figure1,'dev_list'); |
---|
239 | |
---|
240 | text=datestr(now); |
---|
241 | text=strvcat(text,'First Sort:'); |
---|
242 | [Y1,I1]=sort(previous_LT_Lib(index_seuil_1)); |
---|
243 | for k=1:1:size(index_seuil_1,2) |
---|
244 | next_line=[dev_list{index_seuil_1(I1(k))},': ',num2str(Y1(k),'%3.2f'),' hours']; |
---|
245 | text=strvcat(text,next_line); |
---|
246 | end |
---|
247 | text=strvcat(text,'Second Sort:'); |
---|
248 | [Y2,I2]=sort(previous_LT_Lib(index_seuil_2)); |
---|
249 | for k=1:1:size(index_seuil_2,2) |
---|
250 | if isempty(find(I1==I2(k))) |
---|
251 | next_line=[dev_list{index_seuil_2(I2(k))},': ',num2str(Y2(k),'%3.2f'),' hours']; |
---|
252 | text=strvcat(text,next_line); |
---|
253 | end |
---|
254 | end |
---|
255 | set(handles.Lib_list,'string',text); |
---|
256 | |
---|
257 | formatstr= 'HH:MM'; |
---|
258 | |
---|
259 | axes(handles.N_Libera_remaining) |
---|
260 | if get(handles.is_stats,'value') |
---|
261 | plot(handles.N_Libera_remaining,Time_history,N_lib_valid,'b') |
---|
262 | hold(handles.N_Libera_remaining,'on') |
---|
263 | plot(handles.N_Libera_remaining,Time_history,N_lib_valid_first_sort,'r') |
---|
264 | plot(handles.N_Libera_remaining,Time_history,N_lib_valid_second_sort,'g') |
---|
265 | hold(handles.N_Libera_remaining,'off') |
---|
266 | legend(handles.N_Libera_remaining,'valid buffer length','first sort','second sort','Location','NorthWest') |
---|
267 | title(handles.N_Libera_remaining,'History of valid Libera measurments number') |
---|
268 | else |
---|
269 | plot(handles.N_Libera_remaining,Time_history,DCCT_history,'b') |
---|
270 | end |
---|
271 | datetick(handles.N_Libera_remaining,'x',formatstr); |
---|
272 | |
---|
273 | |
---|
274 | axes(handles.LT_History) |
---|
275 | plot(handles.LT_History,Time_history,LT_lib_mean,'b','LineWidth',3) |
---|
276 | hold(handles.LT_History,'on') |
---|
277 | plot(handles.LT_History,Time_history,LT_DCCT,'r','LineWidth',3) |
---|
278 | if get(handles.disp_quarter,'value') |
---|
279 | plot(handles.LT_History,Time_history,LT_lib_by_quarter(1,:),'k'); |
---|
280 | plot(handles.LT_History,Time_history,LT_lib_by_quarter(2,:),'g'); |
---|
281 | plot(handles.LT_History,Time_history,LT_lib_by_quarter(3,:),'m'); |
---|
282 | plot(handles.LT_History,Time_history,LT_lib_by_quarter(4,:),'c'); |
---|
283 | legend(handles.LT_History,'Libera all','DCCT','Libera Q1','Libera Q2','Libera Q3','Libera Q4','Location','NorthWest') |
---|
284 | else |
---|
285 | legend(handles.LT_History,'Libera all','DCCT','Location','NorthWest') |
---|
286 | end |
---|
287 | hold(handles.LT_History,'off') |
---|
288 | ylabel(handles.LT_History,'Hours') |
---|
289 | title(handles.LT_History,'Lifetime History') |
---|
290 | datetick(handles.LT_History,'x',formatstr); |
---|
291 | |
---|
292 | setappdata(handles.figure1,'previous_LT_Lib',previous_LT_Lib); |
---|
293 | setappdata(handles.figure1,'N_lib_valid',N_lib_valid); |
---|
294 | setappdata(handles.figure1,'N_lib_valid_first_sort',N_lib_valid_first_sort); |
---|
295 | setappdata(handles.figure1,'N_lib_valid_second_sort',N_lib_valid_second_sort); |
---|
296 | setappdata(handles.figure1,'LT_lib_mean',LT_lib_mean); |
---|
297 | setappdata(handles.figure1,'LT_lib_by_quarter',LT_lib_by_quarter); |
---|
298 | setappdata(handles.figure1,'LT_DCCT',LT_DCCT); |
---|
299 | setappdata(handles.figure1,'N_BPM',N_BPM); |
---|
300 | setappdata(handles.figure1,'BPM_index',BPM_index); |
---|
301 | setappdata(handles.figure1,'bpm_group',bpm_group); |
---|
302 | |
---|
303 | setappdata(handles.figure1,'N_samples',N_samples); |
---|
304 | setappdata(handles.figure1,'historic_size',historic_size); |
---|
305 | setappdata(handles.figure1,'seuil_1',seuil_1); |
---|
306 | setappdata(handles.figure1,'seuil_2',seuil_2); |
---|
307 | setappdata(handles.figure1,'NLib2valid',NLib2valid); |
---|
308 | |
---|
309 | setappdata(handles.figure1,'Time_history',Time_history); |
---|
310 | setappdata(handles.figure1,'DCCT_history',DCCT_history); |
---|
311 | |
---|
312 | |
---|
313 | function N_samples_Callback(hObject, eventdata, handles) |
---|
314 | % hObject handle to N_samples (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 N_samples as text |
---|
319 | % str2double(get(hObject,'String')) returns contents of N_samples as a double |
---|
320 | |
---|
321 | |
---|
322 | % --- Executes during object creation, after setting all properties. |
---|
323 | function N_samples_CreateFcn(hObject, eventdata, handles) |
---|
324 | % hObject handle to N_samples (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. |
---|
330 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
331 | set(hObject,'BackgroundColor','white'); |
---|
332 | end |
---|
333 | |
---|
334 | |
---|
335 | |
---|
336 | function DCCT_LT_Callback(hObject, eventdata, handles) |
---|
337 | % hObject handle to DCCT_LT (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 DCCT_LT as text |
---|
342 | % str2double(get(hObject,'String')) returns contents of DCCT_LT as a double |
---|
343 | |
---|
344 | |
---|
345 | % --- Executes during object creation, after setting all properties. |
---|
346 | function DCCT_LT_CreateFcn(hObject, eventdata, handles) |
---|
347 | % hObject handle to DCCT_LT (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. |
---|
353 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
354 | set(hObject,'BackgroundColor','white'); |
---|
355 | end |
---|
356 | |
---|
357 | |
---|
358 | |
---|
359 | function Liberas_LT_Callback(hObject, eventdata, handles) |
---|
360 | % hObject handle to Liberas_LT (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 Liberas_LT as text |
---|
365 | % str2double(get(hObject,'String')) returns contents of Liberas_LT as a double |
---|
366 | |
---|
367 | |
---|
368 | % --- Executes during object creation, after setting all properties. |
---|
369 | function Liberas_LT_CreateFcn(hObject, eventdata, handles) |
---|
370 | % hObject handle to Liberas_LT (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. |
---|
376 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
377 | set(hObject,'BackgroundColor','white'); |
---|
378 | end |
---|
379 | |
---|
380 | |
---|
381 | % --- Executes on button press in start_stop. |
---|
382 | function start_stop_Callback(hObject, eventdata, handles) |
---|
383 | % hObject handle to start_stop (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 | state=get(handles.start_stop,'string'); |
---|
387 | switch state |
---|
388 | case 'Stop' |
---|
389 | set(handles.start_stop,'string','Start'); |
---|
390 | set(handles.start_stop,'BackgroundColor','Green'); |
---|
391 | %stop timer |
---|
392 | timer_id=getappdata(handles.figure1,'timer_id'); |
---|
393 | stop(timer_id); |
---|
394 | case 'Start' |
---|
395 | set(handles.start_stop,'string','Stop'); |
---|
396 | set(handles.start_stop,'BackgroundColor','Red'); |
---|
397 | %start timer |
---|
398 | timer_id=getappdata(handles.figure1,'timer_id'); |
---|
399 | start(timer_id); |
---|
400 | |
---|
401 | end |
---|
402 | |
---|
403 | |
---|
404 | % --- Executes on selection change in Lib_list. |
---|
405 | function Lib_list_Callback(hObject, eventdata, handles) |
---|
406 | % hObject handle to Lib_list (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: contents = get(hObject,'String') returns Lib_list contents as cell array |
---|
411 | % contents{get(hObject,'Value')} returns selected item from Lib_list |
---|
412 | |
---|
413 | |
---|
414 | % --- Executes during object creation, after setting all properties. |
---|
415 | function Lib_list_CreateFcn(hObject, eventdata, handles) |
---|
416 | % hObject handle to Lib_list (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: listbox controls usually have a white background on Windows. |
---|
421 | % See ISPC and COMPUTER. |
---|
422 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
423 | set(hObject,'BackgroundColor','white'); |
---|
424 | end |
---|
425 | |
---|
426 | |
---|
427 | |
---|
428 | function historic_size_Callback(hObject, eventdata, handles) |
---|
429 | % hObject handle to historic_size (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 historic_size as text |
---|
434 | % str2double(get(hObject,'String')) returns contents of historic_size as a double |
---|
435 | |
---|
436 | |
---|
437 | % --- Executes during object creation, after setting all properties. |
---|
438 | function historic_size_CreateFcn(hObject, eventdata, handles) |
---|
439 | % hObject handle to historic_size (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. |
---|
445 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
446 | set(hObject,'BackgroundColor','white'); |
---|
447 | end |
---|
448 | |
---|
449 | |
---|
450 | |
---|
451 | function seuil_1_Callback(hObject, eventdata, handles) |
---|
452 | % hObject handle to seuil_1 (see GCBO) |
---|
453 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
454 | % handles structure with handles and user data (see GUIDATA) |
---|
455 | |
---|
456 | % Hints: get(hObject,'String') returns contents of seuil_1 as text |
---|
457 | % str2double(get(hObject,'String')) returns contents of seuil_1 as a double |
---|
458 | |
---|
459 | |
---|
460 | % --- Executes during object creation, after setting all properties. |
---|
461 | function seuil_1_CreateFcn(hObject, eventdata, handles) |
---|
462 | % hObject handle to seuil_1 (see GCBO) |
---|
463 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
464 | % handles empty - handles not created until after all CreateFcns called |
---|
465 | |
---|
466 | % Hint: edit controls usually have a white background on Windows. |
---|
467 | % See ISPC and COMPUTER. |
---|
468 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
469 | set(hObject,'BackgroundColor','white'); |
---|
470 | end |
---|
471 | |
---|
472 | |
---|
473 | |
---|
474 | function seuil_2_Callback(hObject, eventdata, handles) |
---|
475 | % hObject handle to seuil_2 (see GCBO) |
---|
476 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
477 | % handles structure with handles and user data (see GUIDATA) |
---|
478 | |
---|
479 | % Hints: get(hObject,'String') returns contents of seuil_2 as text |
---|
480 | % str2double(get(hObject,'String')) returns contents of seuil_2 as a double |
---|
481 | |
---|
482 | |
---|
483 | % --- Executes during object creation, after setting all properties. |
---|
484 | function seuil_2_CreateFcn(hObject, eventdata, handles) |
---|
485 | % hObject handle to seuil_2 (see GCBO) |
---|
486 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
487 | % handles empty - handles not created until after all CreateFcns called |
---|
488 | |
---|
489 | % Hint: edit controls usually have a white background on Windows. |
---|
490 | % See ISPC and COMPUTER. |
---|
491 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
492 | set(hObject,'BackgroundColor','white'); |
---|
493 | end |
---|
494 | |
---|
495 | |
---|
496 | |
---|
497 | function NLib2valid_Callback(hObject, eventdata, handles) |
---|
498 | % hObject handle to NLib2valid (see GCBO) |
---|
499 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
500 | % handles structure with handles and user data (see GUIDATA) |
---|
501 | |
---|
502 | % Hints: get(hObject,'String') returns contents of NLib2valid as text |
---|
503 | % str2double(get(hObject,'String')) returns contents of NLib2valid as a double |
---|
504 | |
---|
505 | |
---|
506 | % --- Executes during object creation, after setting all properties. |
---|
507 | function NLib2valid_CreateFcn(hObject, eventdata, handles) |
---|
508 | % hObject handle to NLib2valid (see GCBO) |
---|
509 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
510 | % handles empty - handles not created until after all CreateFcns called |
---|
511 | |
---|
512 | % Hint: edit controls usually have a white background on Windows. |
---|
513 | % See ISPC and COMPUTER. |
---|
514 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
515 | set(hObject,'BackgroundColor','white'); |
---|
516 | end |
---|
517 | |
---|
518 | |
---|
519 | % --- Executes on button press in disp_quarter. |
---|
520 | function disp_quarter_Callback(hObject, eventdata, handles) |
---|
521 | % hObject handle to disp_quarter (see GCBO) |
---|
522 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
523 | % handles structure with handles and user data (see GUIDATA) |
---|
524 | |
---|
525 | % Hint: get(hObject,'Value') returns toggle state of disp_quarter |
---|
526 | |
---|
527 | |
---|
528 | % --- Executes on button press in save. |
---|
529 | function save_Callback(hObject, eventdata, handles) |
---|
530 | % hObject handle to save (see GCBO) |
---|
531 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
532 | % handles structure with handles and user data (see GUIDATA) |
---|
533 | struct.LT_lib_mean=getappdata(handles.figure1,'LT_lib_mean'); |
---|
534 | struct.LT_lib_by_quarter=getappdata(handles.figure1,'LT_lib_by_quarter'); |
---|
535 | struct.LT_DCCT=getappdata(handles.figure1,'LT_DCCT'); |
---|
536 | struct.Time_history=getappdata(handles.figure1,'Time_history'); |
---|
537 | struct.DCCT_history=getappdata(handles.figure1,'DCCT_history'); |
---|
538 | uisave('struct','/home/operateur/GrpDiagnostics/matlab/data/'); |
---|