1 | function varargout = sniffer_interface(varargin) |
---|
2 | % SNIFFER_INTERFACE M-file for sniffer_interface.fig |
---|
3 | % SNIFFER_INTERFACE, by itself, creates a new SNIFFER_INTERFACE or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = SNIFFER_INTERFACE returns the handle to a new SNIFFER_INTERFACE or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % SNIFFER_INTERFACE('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in SNIFFER_INTERFACE.M with the given input arguments. |
---|
11 | % |
---|
12 | % SNIFFER_INTERFACE('Property','Value',...) creates a new SNIFFER_INTERFACE or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before sniffer_interface_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to sniffer_interface_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 sniffer_interface |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 29-Sep-2008 14:38:57 |
---|
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', @sniffer_interface_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @sniffer_interface_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 sniffer_interface is made visible. |
---|
48 | function sniffer_interface_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 sniffer_interface (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for sniffer_interface |
---|
56 | handles.output = hObject; |
---|
57 | global continuous; |
---|
58 | continuous=0; |
---|
59 | dev='ANS/DG/fofb-sniffer.1'; |
---|
60 | tango_set_timeout(dev,10000) |
---|
61 | % Update handles structure |
---|
62 | guidata(hObject, handles); |
---|
63 | |
---|
64 | % UIWAIT makes sniffer_interface wait for user response (see UIRESUME) |
---|
65 | % uiwait(handles.figure1); |
---|
66 | |
---|
67 | |
---|
68 | % --- Outputs from this function are returned to the command line. |
---|
69 | function varargout = sniffer_interface_OutputFcn(hObject, eventdata, handles) |
---|
70 | % varargout cell array for returning output args (see VARARGOUT); |
---|
71 | % hObject handle to figure |
---|
72 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
73 | % handles structure with handles and user data (see GUIDATA) |
---|
74 | |
---|
75 | % Get default command line output from handles structure |
---|
76 | varargout{1} = handles.output; |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | function selection_Callback(hObject, eventdata, handles) |
---|
81 | % hObject handle to selection (see GCBO) |
---|
82 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
83 | % handles structure with handles and user data (see GUIDATA) |
---|
84 | |
---|
85 | % Hints: get(hObject,'String') returns contents of selection as text |
---|
86 | % str2double(get(hObject,'String')) returns contents of selection as a double |
---|
87 | |
---|
88 | |
---|
89 | % --- Executes during object creation, after setting all properties. |
---|
90 | function selection_CreateFcn(hObject, eventdata, handles) |
---|
91 | % hObject handle to selection (see GCBO) |
---|
92 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
93 | % handles empty - handles not created until after all CreateFcns called |
---|
94 | |
---|
95 | % Hint: edit controls usually have a white background on Windows. |
---|
96 | % See ISPC and COMPUTER. |
---|
97 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
98 | set(hObject,'BackgroundColor','white'); |
---|
99 | end |
---|
100 | |
---|
101 | |
---|
102 | % --- Executes on button press in RX_link_up_1. |
---|
103 | function RX_link_up_1_Callback(hObject, eventdata, handles) |
---|
104 | % hObject handle to RX_link_up_1 (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 | % Hint: get(hObject,'Value') returns toggle state of RX_link_up_1 |
---|
109 | |
---|
110 | |
---|
111 | % --- Executes on button press in RX_link_up_2. |
---|
112 | function RX_link_up_2_Callback(hObject, eventdata, handles) |
---|
113 | % hObject handle to RX_link_up_2 (see GCBO) |
---|
114 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
115 | % handles structure with handles and user data (see GUIDATA) |
---|
116 | |
---|
117 | % Hint: get(hObject,'Value') returns toggle state of RX_link_up_2 |
---|
118 | |
---|
119 | |
---|
120 | % --- Executes on button press in TX_link_up_1. |
---|
121 | function TX_link_up_1_Callback(hObject, eventdata, handles) |
---|
122 | % hObject handle to TX_link_up_1 (see GCBO) |
---|
123 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
124 | % handles structure with handles and user data (see GUIDATA) |
---|
125 | |
---|
126 | % Hint: get(hObject,'Value') returns toggle state of TX_link_up_1 |
---|
127 | |
---|
128 | |
---|
129 | % --- Executes on button press in TX_link_up_2. |
---|
130 | function TX_link_up_2_Callback(hObject, eventdata, handles) |
---|
131 | % hObject handle to TX_link_up_2 (see GCBO) |
---|
132 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
133 | % handles structure with handles and user data (see GUIDATA) |
---|
134 | |
---|
135 | % Hint: get(hObject,'Value') returns toggle state of TX_link_up_2 |
---|
136 | |
---|
137 | |
---|
138 | |
---|
139 | function sniffer_firmware_Callback(hObject, eventdata, handles) |
---|
140 | % hObject handle to sniffer_firmware (see GCBO) |
---|
141 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
142 | % handles structure with handles and user data (see GUIDATA) |
---|
143 | |
---|
144 | % Hints: get(hObject,'String') returns contents of sniffer_firmware as text |
---|
145 | % str2double(get(hObject,'String')) returns contents of sniffer_firmware as a double |
---|
146 | |
---|
147 | |
---|
148 | % --- Executes during object creation, after setting all properties. |
---|
149 | function sniffer_firmware_CreateFcn(hObject, eventdata, handles) |
---|
150 | % hObject handle to sniffer_firmware (see GCBO) |
---|
151 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
152 | % handles empty - handles not created until after all CreateFcns called |
---|
153 | |
---|
154 | % Hint: edit controls usually have a white background on Windows. |
---|
155 | % See ISPC and COMPUTER. |
---|
156 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
157 | set(hObject,'BackgroundColor','white'); |
---|
158 | end |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | function CC_firmware_Callback(hObject, eventdata, handles) |
---|
163 | % hObject handle to CC_firmware (see GCBO) |
---|
164 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
165 | % handles structure with handles and user data (see GUIDATA) |
---|
166 | |
---|
167 | % Hints: get(hObject,'String') returns contents of CC_firmware as text |
---|
168 | % str2double(get(hObject,'String')) returns contents of CC_firmware as a double |
---|
169 | |
---|
170 | |
---|
171 | % --- Executes during object creation, after setting all properties. |
---|
172 | function CC_firmware_CreateFcn(hObject, eventdata, handles) |
---|
173 | % hObject handle to CC_firmware (see GCBO) |
---|
174 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
175 | % handles empty - handles not created until after all CreateFcns called |
---|
176 | |
---|
177 | % Hint: edit controls usually have a white background on Windows. |
---|
178 | % See ISPC and COMPUTER. |
---|
179 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
180 | set(hObject,'BackgroundColor','white'); |
---|
181 | end |
---|
182 | |
---|
183 | |
---|
184 | |
---|
185 | function link_partner_2_Callback(hObject, eventdata, handles) |
---|
186 | % hObject handle to link_partner_2 (see GCBO) |
---|
187 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
188 | % handles structure with handles and user data (see GUIDATA) |
---|
189 | |
---|
190 | % Hints: get(hObject,'String') returns contents of link_partner_2 as text |
---|
191 | % str2double(get(hObject,'String')) returns contents of link_partner_2 as a double |
---|
192 | |
---|
193 | |
---|
194 | % --- Executes during object creation, after setting all properties. |
---|
195 | function link_partner_2_CreateFcn(hObject, eventdata, handles) |
---|
196 | % hObject handle to link_partner_2 (see GCBO) |
---|
197 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
198 | % handles empty - handles not created until after all CreateFcns called |
---|
199 | |
---|
200 | % Hint: edit controls usually have a white background on Windows. |
---|
201 | % See ISPC and COMPUTER. |
---|
202 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
203 | set(hObject,'BackgroundColor','white'); |
---|
204 | end |
---|
205 | |
---|
206 | |
---|
207 | |
---|
208 | function edit6_Callback(hObject, eventdata, handles) |
---|
209 | % hObject handle to edit6 (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 | % Hints: get(hObject,'String') returns contents of edit6 as text |
---|
214 | % str2double(get(hObject,'String')) returns contents of edit6 as a double |
---|
215 | |
---|
216 | |
---|
217 | % --- Executes during object creation, after setting all properties. |
---|
218 | function edit6_CreateFcn(hObject, eventdata, handles) |
---|
219 | % hObject handle to edit6 (see GCBO) |
---|
220 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
221 | % handles empty - handles not created until after all CreateFcns called |
---|
222 | |
---|
223 | % Hint: edit controls usually have a white background on Windows. |
---|
224 | % See ISPC and COMPUTER. |
---|
225 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
226 | set(hObject,'BackgroundColor','white'); |
---|
227 | end |
---|
228 | |
---|
229 | |
---|
230 | |
---|
231 | function RX_count_2_Callback(hObject, eventdata, handles) |
---|
232 | % hObject handle to RX_count_2 (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 | % Hints: get(hObject,'String') returns contents of RX_count_2 as text |
---|
237 | % str2double(get(hObject,'String')) returns contents of RX_count_2 as a double |
---|
238 | |
---|
239 | |
---|
240 | % --- Executes during object creation, after setting all properties. |
---|
241 | function RX_count_2_CreateFcn(hObject, eventdata, handles) |
---|
242 | % hObject handle to RX_count_2 (see GCBO) |
---|
243 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
244 | % handles empty - handles not created until after all CreateFcns called |
---|
245 | |
---|
246 | % Hint: edit controls usually have a white background on Windows. |
---|
247 | % See ISPC and COMPUTER. |
---|
248 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
249 | set(hObject,'BackgroundColor','white'); |
---|
250 | end |
---|
251 | |
---|
252 | |
---|
253 | |
---|
254 | function RX_count_1_Callback(hObject, eventdata, handles) |
---|
255 | % hObject handle to RX_count_1 (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 | % Hints: get(hObject,'String') returns contents of RX_count_1 as text |
---|
260 | % str2double(get(hObject,'String')) returns contents of RX_count_1 as a double |
---|
261 | |
---|
262 | |
---|
263 | % --- Executes during object creation, after setting all properties. |
---|
264 | function RX_count_1_CreateFcn(hObject, eventdata, handles) |
---|
265 | % hObject handle to RX_count_1 (see GCBO) |
---|
266 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
267 | % handles empty - handles not created until after all CreateFcns called |
---|
268 | |
---|
269 | % Hint: edit controls usually have a white background on Windows. |
---|
270 | % See ISPC and COMPUTER. |
---|
271 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
272 | set(hObject,'BackgroundColor','white'); |
---|
273 | end |
---|
274 | |
---|
275 | |
---|
276 | |
---|
277 | function TX_count_2_Callback(hObject, eventdata, handles) |
---|
278 | % hObject handle to TX_count_2 (see GCBO) |
---|
279 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
280 | % handles structure with handles and user data (see GUIDATA) |
---|
281 | |
---|
282 | % Hints: get(hObject,'String') returns contents of TX_count_2 as text |
---|
283 | % str2double(get(hObject,'String')) returns contents of TX_count_2 as a double |
---|
284 | |
---|
285 | |
---|
286 | % --- Executes during object creation, after setting all properties. |
---|
287 | function TX_count_2_CreateFcn(hObject, eventdata, handles) |
---|
288 | % hObject handle to TX_count_2 (see GCBO) |
---|
289 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
290 | % handles empty - handles not created until after all CreateFcns called |
---|
291 | |
---|
292 | % Hint: edit controls usually have a white background on Windows. |
---|
293 | % See ISPC and COMPUTER. |
---|
294 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
295 | set(hObject,'BackgroundColor','white'); |
---|
296 | end |
---|
297 | |
---|
298 | |
---|
299 | |
---|
300 | function TX_count_1_Callback(hObject, eventdata, handles) |
---|
301 | % hObject handle to TX_count_1 (see GCBO) |
---|
302 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
303 | % handles structure with handles and user data (see GUIDATA) |
---|
304 | |
---|
305 | % Hints: get(hObject,'String') returns contents of TX_count_1 as text |
---|
306 | % str2double(get(hObject,'String')) returns contents of TX_count_1 as a double |
---|
307 | |
---|
308 | |
---|
309 | % --- Executes during object creation, after setting all properties. |
---|
310 | function TX_count_1_CreateFcn(hObject, eventdata, handles) |
---|
311 | % hObject handle to TX_count_1 (see GCBO) |
---|
312 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
313 | % handles empty - handles not created until after all CreateFcns called |
---|
314 | |
---|
315 | % Hint: edit controls usually have a white background on Windows. |
---|
316 | % See ISPC and COMPUTER. |
---|
317 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
318 | set(hObject,'BackgroundColor','white'); |
---|
319 | end |
---|
320 | |
---|
321 | |
---|
322 | |
---|
323 | function hard_err_cnt_2_Callback(hObject, eventdata, handles) |
---|
324 | % hObject handle to hard_err_cnt_2 (see GCBO) |
---|
325 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
326 | % handles structure with handles and user data (see GUIDATA) |
---|
327 | |
---|
328 | % Hints: get(hObject,'String') returns contents of hard_err_cnt_2 as text |
---|
329 | % str2double(get(hObject,'String')) returns contents of hard_err_cnt_2 as a double |
---|
330 | |
---|
331 | |
---|
332 | % --- Executes during object creation, after setting all properties. |
---|
333 | function hard_err_cnt_2_CreateFcn(hObject, eventdata, handles) |
---|
334 | % hObject handle to hard_err_cnt_2 (see GCBO) |
---|
335 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
336 | % handles empty - handles not created until after all CreateFcns called |
---|
337 | |
---|
338 | % Hint: edit controls usually have a white background on Windows. |
---|
339 | % See ISPC and COMPUTER. |
---|
340 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
341 | set(hObject,'BackgroundColor','white'); |
---|
342 | end |
---|
343 | |
---|
344 | |
---|
345 | |
---|
346 | function hard_err_cnt_1_Callback(hObject, eventdata, handles) |
---|
347 | % hObject handle to hard_err_cnt_1 (see GCBO) |
---|
348 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
349 | % handles structure with handles and user data (see GUIDATA) |
---|
350 | |
---|
351 | % Hints: get(hObject,'String') returns contents of hard_err_cnt_1 as text |
---|
352 | % str2double(get(hObject,'String')) returns contents of hard_err_cnt_1 as a double |
---|
353 | |
---|
354 | |
---|
355 | % --- Executes during object creation, after setting all properties. |
---|
356 | function hard_err_cnt_1_CreateFcn(hObject, eventdata, handles) |
---|
357 | % hObject handle to hard_err_cnt_1 (see GCBO) |
---|
358 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
359 | % handles empty - handles not created until after all CreateFcns called |
---|
360 | |
---|
361 | % Hint: edit controls usually have a white background on Windows. |
---|
362 | % See ISPC and COMPUTER. |
---|
363 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
364 | set(hObject,'BackgroundColor','white'); |
---|
365 | end |
---|
366 | |
---|
367 | |
---|
368 | |
---|
369 | function soft_err_cnt_2_Callback(hObject, eventdata, handles) |
---|
370 | % hObject handle to soft_err_cnt_2 (see GCBO) |
---|
371 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
372 | % handles structure with handles and user data (see GUIDATA) |
---|
373 | |
---|
374 | % Hints: get(hObject,'String') returns contents of soft_err_cnt_2 as text |
---|
375 | % str2double(get(hObject,'String')) returns contents of soft_err_cnt_2 as a double |
---|
376 | |
---|
377 | |
---|
378 | % --- Executes during object creation, after setting all properties. |
---|
379 | function soft_err_cnt_2_CreateFcn(hObject, eventdata, handles) |
---|
380 | % hObject handle to soft_err_cnt_2 (see GCBO) |
---|
381 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
382 | % handles empty - handles not created until after all CreateFcns called |
---|
383 | |
---|
384 | % Hint: edit controls usually have a white background on Windows. |
---|
385 | % See ISPC and COMPUTER. |
---|
386 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
387 | set(hObject,'BackgroundColor','white'); |
---|
388 | end |
---|
389 | |
---|
390 | |
---|
391 | |
---|
392 | function soft_err_cnt_1_Callback(hObject, eventdata, handles) |
---|
393 | % hObject handle to soft_err_cnt_1 (see GCBO) |
---|
394 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
395 | % handles structure with handles and user data (see GUIDATA) |
---|
396 | |
---|
397 | % Hints: get(hObject,'String') returns contents of soft_err_cnt_1 as text |
---|
398 | % str2double(get(hObject,'String')) returns contents of soft_err_cnt_1 as a double |
---|
399 | |
---|
400 | |
---|
401 | % --- Executes during object creation, after setting all properties. |
---|
402 | function soft_err_cnt_1_CreateFcn(hObject, eventdata, handles) |
---|
403 | % hObject handle to soft_err_cnt_1 (see GCBO) |
---|
404 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
405 | % handles empty - handles not created until after all CreateFcns called |
---|
406 | |
---|
407 | % Hint: edit controls usually have a white background on Windows. |
---|
408 | % See ISPC and COMPUTER. |
---|
409 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
410 | set(hObject,'BackgroundColor','white'); |
---|
411 | end |
---|
412 | |
---|
413 | |
---|
414 | |
---|
415 | function frame_err_cnt_2_Callback(hObject, eventdata, handles) |
---|
416 | % hObject handle to frame_err_cnt_2 (see GCBO) |
---|
417 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
418 | % handles structure with handles and user data (see GUIDATA) |
---|
419 | |
---|
420 | % Hints: get(hObject,'String') returns contents of frame_err_cnt_2 as text |
---|
421 | % str2double(get(hObject,'String')) returns contents of frame_err_cnt_2 as a double |
---|
422 | |
---|
423 | |
---|
424 | % --- Executes during object creation, after setting all properties. |
---|
425 | function frame_err_cnt_2_CreateFcn(hObject, eventdata, handles) |
---|
426 | % hObject handle to frame_err_cnt_2 (see GCBO) |
---|
427 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
428 | % handles empty - handles not created until after all CreateFcns called |
---|
429 | |
---|
430 | % Hint: edit controls usually have a white background on Windows. |
---|
431 | % See ISPC and COMPUTER. |
---|
432 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
433 | set(hObject,'BackgroundColor','white'); |
---|
434 | end |
---|
435 | |
---|
436 | |
---|
437 | |
---|
438 | function frame_err_cnt_1_Callback(hObject, eventdata, handles) |
---|
439 | % hObject handle to frame_err_cnt_1 (see GCBO) |
---|
440 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
441 | % handles structure with handles and user data (see GUIDATA) |
---|
442 | |
---|
443 | % Hints: get(hObject,'String') returns contents of frame_err_cnt_1 as text |
---|
444 | % str2double(get(hObject,'String')) returns contents of frame_err_cnt_1 as a double |
---|
445 | |
---|
446 | |
---|
447 | % --- Executes during object creation, after setting all properties. |
---|
448 | function frame_err_cnt_1_CreateFcn(hObject, eventdata, handles) |
---|
449 | % hObject handle to frame_err_cnt_1 (see GCBO) |
---|
450 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
451 | % handles empty - handles not created until after all CreateFcns called |
---|
452 | |
---|
453 | % Hint: edit controls usually have a white background on Windows. |
---|
454 | % See ISPC and COMPUTER. |
---|
455 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
456 | set(hObject,'BackgroundColor','white'); |
---|
457 | end |
---|
458 | |
---|
459 | |
---|
460 | |
---|
461 | function edit17_Callback(hObject, eventdata, handles) |
---|
462 | % hObject handle to edit17 (see GCBO) |
---|
463 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
464 | % handles structure with handles and user data (see GUIDATA) |
---|
465 | |
---|
466 | % Hints: get(hObject,'String') returns contents of edit17 as text |
---|
467 | % str2double(get(hObject,'String')) returns contents of edit17 as a double |
---|
468 | |
---|
469 | |
---|
470 | % --- Executes during object creation, after setting all properties. |
---|
471 | function edit17_CreateFcn(hObject, eventdata, handles) |
---|
472 | % hObject handle to edit17 (see GCBO) |
---|
473 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
474 | % handles empty - handles not created until after all CreateFcns called |
---|
475 | |
---|
476 | % Hint: edit controls usually have a white background on Windows. |
---|
477 | % See ISPC and COMPUTER. |
---|
478 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
479 | set(hObject,'BackgroundColor','white'); |
---|
480 | end |
---|
481 | |
---|
482 | |
---|
483 | |
---|
484 | function CC_process_time_Callback(hObject, eventdata, handles) |
---|
485 | % hObject handle to CC_process_time (see GCBO) |
---|
486 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
487 | % handles structure with handles and user data (see GUIDATA) |
---|
488 | |
---|
489 | % Hints: get(hObject,'String') returns contents of CC_process_time as text |
---|
490 | % str2double(get(hObject,'String')) returns contents of CC_process_time as a double |
---|
491 | |
---|
492 | |
---|
493 | % --- Executes during object creation, after setting all properties. |
---|
494 | function CC_process_time_CreateFcn(hObject, eventdata, handles) |
---|
495 | % hObject handle to CC_process_time (see GCBO) |
---|
496 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
497 | % handles empty - handles not created until after all CreateFcns called |
---|
498 | |
---|
499 | % Hint: edit controls usually have a white background on Windows. |
---|
500 | % See ISPC and COMPUTER. |
---|
501 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
502 | set(hObject,'BackgroundColor','white'); |
---|
503 | end |
---|
504 | |
---|
505 | |
---|
506 | |
---|
507 | function bpm_involved_Callback(hObject, eventdata, handles) |
---|
508 | % hObject handle to bpm_involved (see GCBO) |
---|
509 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
510 | % handles structure with handles and user data (see GUIDATA) |
---|
511 | |
---|
512 | % Hints: get(hObject,'String') returns contents of bpm_involved as text |
---|
513 | % str2double(get(hObject,'String')) returns contents of bpm_involved as a double |
---|
514 | |
---|
515 | |
---|
516 | % --- Executes during object creation, after setting all properties. |
---|
517 | function bpm_involved_CreateFcn(hObject, eventdata, handles) |
---|
518 | % hObject handle to bpm_involved (see GCBO) |
---|
519 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
520 | % handles empty - handles not created until after all CreateFcns called |
---|
521 | |
---|
522 | % Hint: edit controls usually have a white background on Windows. |
---|
523 | % See ISPC and COMPUTER. |
---|
524 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
525 | set(hObject,'BackgroundColor','white'); |
---|
526 | end |
---|
527 | |
---|
528 | |
---|
529 | % --- Executes on button press in rd_fifo_full. |
---|
530 | function rd_fifo_full_Callback(hObject, eventdata, handles) |
---|
531 | % hObject handle to rd_fifo_full (see GCBO) |
---|
532 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
533 | % handles structure with handles and user data (see GUIDATA) |
---|
534 | |
---|
535 | % Hint: get(hObject,'Value') returns toggle state of rd_fifo_full |
---|
536 | |
---|
537 | |
---|
538 | % --- Executes on button press in rd_fifo_empty. |
---|
539 | function rd_fifo_empty_Callback(hObject, eventdata, handles) |
---|
540 | % hObject handle to rd_fifo_empty (see GCBO) |
---|
541 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
542 | % handles structure with handles and user data (see GUIDATA) |
---|
543 | |
---|
544 | % Hint: get(hObject,'Value') returns toggle state of rd_fifo_empty |
---|
545 | |
---|
546 | |
---|
547 | % --- Executes on button press in wt_fifo_full. |
---|
548 | function wt_fifo_full_Callback(hObject, eventdata, handles) |
---|
549 | % hObject handle to wt_fifo_full (see GCBO) |
---|
550 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
551 | % handles structure with handles and user data (see GUIDATA) |
---|
552 | |
---|
553 | % Hint: get(hObject,'Value') returns toggle state of wt_fifo_full |
---|
554 | |
---|
555 | |
---|
556 | % --- Executes on button press in wt_fifo_empty. |
---|
557 | function wt_fifo_empty_Callback(hObject, eventdata, handles) |
---|
558 | % hObject handle to wt_fifo_empty (see GCBO) |
---|
559 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
560 | % handles structure with handles and user data (see GUIDATA) |
---|
561 | |
---|
562 | % Hint: get(hObject,'Value') returns toggle state of wt_fifo_empty |
---|
563 | |
---|
564 | |
---|
565 | |
---|
566 | function rd_fifo_data_cnt_Callback(hObject, eventdata, handles) |
---|
567 | % hObject handle to rd_fifo_data_cnt (see GCBO) |
---|
568 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
569 | % handles structure with handles and user data (see GUIDATA) |
---|
570 | |
---|
571 | % Hints: get(hObject,'String') returns contents of rd_fifo_data_cnt as text |
---|
572 | % str2double(get(hObject,'String')) returns contents of rd_fifo_data_cnt as a double |
---|
573 | |
---|
574 | |
---|
575 | % --- Executes during object creation, after setting all properties. |
---|
576 | function rd_fifo_data_cnt_CreateFcn(hObject, eventdata, handles) |
---|
577 | % hObject handle to rd_fifo_data_cnt (see GCBO) |
---|
578 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
579 | % handles empty - handles not created until after all CreateFcns called |
---|
580 | |
---|
581 | % Hint: edit controls usually have a white background on Windows. |
---|
582 | % See ISPC and COMPUTER. |
---|
583 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
584 | set(hObject,'BackgroundColor','white'); |
---|
585 | end |
---|
586 | |
---|
587 | |
---|
588 | |
---|
589 | function sniffer_id_Callback(hObject, eventdata, handles) |
---|
590 | % hObject handle to sniffer_id (see GCBO) |
---|
591 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
592 | % handles structure with handles and user data (see GUIDATA) |
---|
593 | |
---|
594 | % Hints: get(hObject,'String') returns contents of sniffer_id as text |
---|
595 | % str2double(get(hObject,'String')) returns contents of sniffer_id as a double |
---|
596 | |
---|
597 | |
---|
598 | % --- Executes during object creation, after setting all properties. |
---|
599 | function sniffer_id_CreateFcn(hObject, eventdata, handles) |
---|
600 | % hObject handle to sniffer_id (see GCBO) |
---|
601 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
602 | % handles empty - handles not created until after all CreateFcns called |
---|
603 | |
---|
604 | % Hint: edit controls usually have a white background on Windows. |
---|
605 | % See ISPC and COMPUTER. |
---|
606 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
607 | set(hObject,'BackgroundColor','white'); |
---|
608 | end |
---|
609 | |
---|
610 | |
---|
611 | |
---|
612 | function time_frame_lenght_Callback(hObject, eventdata, handles) |
---|
613 | % hObject handle to time_frame_lenght (see GCBO) |
---|
614 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
615 | % handles structure with handles and user data (see GUIDATA) |
---|
616 | |
---|
617 | % Hints: get(hObject,'String') returns contents of time_frame_lenght as text |
---|
618 | % str2double(get(hObject,'String')) returns contents of time_frame_lenght as a double |
---|
619 | |
---|
620 | |
---|
621 | % --- Executes during object creation, after setting all properties. |
---|
622 | function time_frame_lenght_CreateFcn(hObject, eventdata, handles) |
---|
623 | % hObject handle to time_frame_lenght (see GCBO) |
---|
624 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
625 | % handles empty - handles not created until after all CreateFcns called |
---|
626 | |
---|
627 | % Hint: edit controls usually have a white background on Windows. |
---|
628 | % See ISPC and COMPUTER. |
---|
629 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
630 | set(hObject,'BackgroundColor','white'); |
---|
631 | end |
---|
632 | |
---|
633 | |
---|
634 | |
---|
635 | function mgt_powerdown_Callback(hObject, eventdata, handles) |
---|
636 | % hObject handle to mgt_powerdown (see GCBO) |
---|
637 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
638 | % handles structure with handles and user data (see GUIDATA) |
---|
639 | |
---|
640 | % Hints: get(hObject,'String') returns contents of mgt_powerdown as text |
---|
641 | % str2double(get(hObject,'String')) returns contents of mgt_powerdown as a double |
---|
642 | |
---|
643 | |
---|
644 | % --- Executes during object creation, after setting all properties. |
---|
645 | function mgt_powerdown_CreateFcn(hObject, eventdata, handles) |
---|
646 | % hObject handle to mgt_powerdown (see GCBO) |
---|
647 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
648 | % handles empty - handles not created until after all CreateFcns called |
---|
649 | |
---|
650 | % Hint: edit controls usually have a white background on Windows. |
---|
651 | % See ISPC and COMPUTER. |
---|
652 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
653 | set(hObject,'BackgroundColor','white'); |
---|
654 | end |
---|
655 | |
---|
656 | |
---|
657 | |
---|
658 | function mgt_loopback_Callback(hObject, eventdata, handles) |
---|
659 | % hObject handle to mgt_loopback (see GCBO) |
---|
660 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
661 | % handles structure with handles and user data (see GUIDATA) |
---|
662 | |
---|
663 | % Hints: get(hObject,'String') returns contents of mgt_loopback as text |
---|
664 | % str2double(get(hObject,'String')) returns contents of mgt_loopback as a double |
---|
665 | |
---|
666 | |
---|
667 | % --- Executes during object creation, after setting all properties. |
---|
668 | function mgt_loopback_CreateFcn(hObject, eventdata, handles) |
---|
669 | % hObject handle to mgt_loopback (see GCBO) |
---|
670 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
671 | % handles empty - handles not created until after all CreateFcns called |
---|
672 | |
---|
673 | % Hint: edit controls usually have a white background on Windows. |
---|
674 | % See ISPC and COMPUTER. |
---|
675 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
676 | set(hObject,'BackgroundColor','white'); |
---|
677 | end |
---|
678 | |
---|
679 | |
---|
680 | |
---|
681 | function buf_clr_dly_Callback(hObject, eventdata, handles) |
---|
682 | % hObject handle to buf_clr_dly (see GCBO) |
---|
683 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
684 | % handles structure with handles and user data (see GUIDATA) |
---|
685 | |
---|
686 | % Hints: get(hObject,'String') returns contents of buf_clr_dly as text |
---|
687 | % str2double(get(hObject,'String')) returns contents of buf_clr_dly as a double |
---|
688 | |
---|
689 | |
---|
690 | % --- Executes during object creation, after setting all properties. |
---|
691 | function buf_clr_dly_CreateFcn(hObject, eventdata, handles) |
---|
692 | % hObject handle to buf_clr_dly (see GCBO) |
---|
693 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
694 | % handles empty - handles not created until after all CreateFcns called |
---|
695 | |
---|
696 | % Hint: edit controls usually have a white background on Windows. |
---|
697 | % See ISPC and COMPUTER. |
---|
698 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
699 | set(hObject,'BackgroundColor','white'); |
---|
700 | end |
---|
701 | |
---|
702 | |
---|
703 | |
---|
704 | function data_rate_Callback(hObject, eventdata, handles) |
---|
705 | % hObject handle to data_rate (see GCBO) |
---|
706 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
707 | % handles structure with handles and user data (see GUIDATA) |
---|
708 | |
---|
709 | % Hints: get(hObject,'String') returns contents of data_rate as text |
---|
710 | % str2double(get(hObject,'String')) returns contents of data_rate as a double |
---|
711 | |
---|
712 | |
---|
713 | % --- Executes during object creation, after setting all properties. |
---|
714 | function data_rate_CreateFcn(hObject, eventdata, handles) |
---|
715 | % hObject handle to data_rate (see GCBO) |
---|
716 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
717 | % handles empty - handles not created until after all CreateFcns called |
---|
718 | |
---|
719 | % Hint: edit controls usually have a white background on Windows. |
---|
720 | % See ISPC and COMPUTER. |
---|
721 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
722 | set(hObject,'BackgroundColor','white'); |
---|
723 | end |
---|
724 | |
---|
725 | |
---|
726 | |
---|
727 | function lost_frames_Callback(hObject, eventdata, handles) |
---|
728 | % hObject handle to lost_frames (see GCBO) |
---|
729 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
730 | % handles structure with handles and user data (see GUIDATA) |
---|
731 | |
---|
732 | % Hints: get(hObject,'String') returns contents of lost_frames as text |
---|
733 | % str2double(get(hObject,'String')) returns contents of lost_frames as a double |
---|
734 | |
---|
735 | |
---|
736 | % --- Executes during object creation, after setting all properties. |
---|
737 | function lost_frames_CreateFcn(hObject, eventdata, handles) |
---|
738 | % hObject handle to lost_frames (see GCBO) |
---|
739 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
740 | % handles empty - handles not created until after all CreateFcns called |
---|
741 | |
---|
742 | % Hint: edit controls usually have a white background on Windows. |
---|
743 | % See ISPC and COMPUTER. |
---|
744 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
745 | set(hObject,'BackgroundColor','white'); |
---|
746 | end |
---|
747 | |
---|
748 | |
---|
749 | |
---|
750 | function fifo_overruns_Callback(hObject, eventdata, handles) |
---|
751 | % hObject handle to fifo_overruns (see GCBO) |
---|
752 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
753 | % handles structure with handles and user data (see GUIDATA) |
---|
754 | |
---|
755 | % Hints: get(hObject,'String') returns contents of fifo_overruns as text |
---|
756 | % str2double(get(hObject,'String')) returns contents of fifo_overruns as a double |
---|
757 | |
---|
758 | |
---|
759 | % --- Executes during object creation, after setting all properties. |
---|
760 | function fifo_overruns_CreateFcn(hObject, eventdata, handles) |
---|
761 | % hObject handle to fifo_overruns (see GCBO) |
---|
762 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
763 | % handles empty - handles not created until after all CreateFcns called |
---|
764 | |
---|
765 | % Hint: edit controls usually have a white background on Windows. |
---|
766 | % See ISPC and COMPUTER. |
---|
767 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
768 | set(hObject,'BackgroundColor','white'); |
---|
769 | end |
---|
770 | |
---|
771 | |
---|
772 | |
---|
773 | function frame_offset_in_DMA_Callback(hObject, eventdata, handles) |
---|
774 | % hObject handle to frame_offset_in_DMA (see GCBO) |
---|
775 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
776 | % handles structure with handles and user data (see GUIDATA) |
---|
777 | |
---|
778 | % Hints: get(hObject,'String') returns contents of frame_offset_in_DMA as text |
---|
779 | % str2double(get(hObject,'String')) returns contents of frame_offset_in_DMA as a double |
---|
780 | |
---|
781 | |
---|
782 | % --- Executes during object creation, after setting all properties. |
---|
783 | function frame_offset_in_DMA_CreateFcn(hObject, eventdata, handles) |
---|
784 | % hObject handle to frame_offset_in_DMA (see GCBO) |
---|
785 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
786 | % handles empty - handles not created until after all CreateFcns called |
---|
787 | |
---|
788 | % Hint: edit controls usually have a white background on Windows. |
---|
789 | % See ISPC and COMPUTER. |
---|
790 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
791 | set(hObject,'BackgroundColor','white'); |
---|
792 | end |
---|
793 | |
---|
794 | |
---|
795 | |
---|
796 | function frame_offset_between_DMA_Callback(hObject, eventdata, handles) |
---|
797 | % hObject handle to frame_offset_between_DMA (see GCBO) |
---|
798 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
799 | % handles structure with handles and user data (see GUIDATA) |
---|
800 | |
---|
801 | % Hints: get(hObject,'String') returns contents of frame_offset_between_DMA as text |
---|
802 | % str2double(get(hObject,'String')) returns contents of frame_offset_between_DMA as a double |
---|
803 | |
---|
804 | |
---|
805 | % --- Executes during object creation, after setting all properties. |
---|
806 | function frame_offset_between_DMA_CreateFcn(hObject, eventdata, handles) |
---|
807 | % hObject handle to frame_offset_between_DMA (see GCBO) |
---|
808 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
809 | % handles empty - handles not created until after all CreateFcns called |
---|
810 | |
---|
811 | % Hint: edit controls usually have a white background on Windows. |
---|
812 | % See ISPC and COMPUTER. |
---|
813 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
814 | set(hObject,'BackgroundColor','white'); |
---|
815 | end |
---|
816 | |
---|
817 | |
---|
818 | |
---|
819 | function lost_frame_ratio_Callback(hObject, eventdata, handles) |
---|
820 | % hObject handle to lost_frame_ratio (see GCBO) |
---|
821 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
822 | % handles structure with handles and user data (see GUIDATA) |
---|
823 | |
---|
824 | % Hints: get(hObject,'String') returns contents of lost_frame_ratio as text |
---|
825 | % str2double(get(hObject,'String')) returns contents of lost_frame_ratio as a double |
---|
826 | |
---|
827 | |
---|
828 | % --- Executes during object creation, after setting all properties. |
---|
829 | function lost_frame_ratio_CreateFcn(hObject, eventdata, handles) |
---|
830 | % hObject handle to lost_frame_ratio (see GCBO) |
---|
831 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
832 | % handles empty - handles not created until after all CreateFcns called |
---|
833 | |
---|
834 | % Hint: edit controls usually have a white background on Windows. |
---|
835 | % See ISPC and COMPUTER. |
---|
836 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
837 | set(hObject,'BackgroundColor','white'); |
---|
838 | end |
---|
839 | |
---|
840 | |
---|
841 | % --- Executes on button press in refresh. |
---|
842 | function refresh_Callback(hObject, eventdata, handles) |
---|
843 | % hObject handle to refresh (see GCBO) |
---|
844 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
845 | % handles structure with handles and user data (see GUIDATA) |
---|
846 | attr_list={'inputDataRate','lostFrames','fifoOverruns','frameOffsetInDMA','frameOffsetBetweenDMA','firmwareType','comConfig','comProcessTime','bpmCount','rdFIFOContent','rdFIFOFull','wtFIFOFull','rdFIFOEmpty','wtFIFOEmpty','comFirmwareType','comStatus','comLinkPartner1','comLinkPartner2','comLinkUp','comHwErrCont1','comHwErrCont2','comSwErrCont1','comSwErrCont2','comFrameErrCont1','comFrameErrCont2','comRxPacketsCont1','comRxPacketsCont2','comTxPacketsCont1','comTxPacketsCont2','cfgSnifferID','cfgTimeFrameLength','cfgMgtPowerDown','cfgMgtLoopBack','cfgBufferClearDelay','lostFramesRatio'}; |
---|
847 | dev_list=get(handles.sniffer_dev,'string'); |
---|
848 | dev_value=get(handles.sniffer_dev,'value'); |
---|
849 | dev=dev_list{dev_value}; |
---|
850 | result=tango_read_attributes(dev,attr_list) |
---|
851 | set(handles.data_rate,'string',num2str(result(1).value)); |
---|
852 | set(handles.lost_frames,'string',num2str(result(2).value)); |
---|
853 | set(handles.fifo_overruns,'string',num2str(result(3).value)); |
---|
854 | set(handles.frame_offset_in_DMA,'string',num2str(result(4).value)); |
---|
855 | set(handles.frame_offset_between_DMA,'string',num2str(result(5).value)); |
---|
856 | set(handles.sniffer_firmware,'string',num2str(result(6).value)); |
---|
857 | set(handles.CC_process_time,'string',num2str(result(8).value)); |
---|
858 | set(handles.bpm_involved,'string',num2str(result(9).value)); |
---|
859 | set(handles.rd_fifo_data_cnt,'string',num2str(result(10).value)); |
---|
860 | set(handles.rd_fifo_full,'value',(result(11).value)); |
---|
861 | set(handles.wt_fifo_full,'value',(result(12).value)); |
---|
862 | set(handles.rd_fifo_empty,'value',(result(13).value)); |
---|
863 | set(handles.wt_fifo_empty,'value',(result(14).value)); |
---|
864 | set(handles.CC_firmware,'string',num2str(result(15).value)); |
---|
865 | set(handles.link_partner_1,'string',num2str(result(17).value)); |
---|
866 | set(handles.link_partner_2,'string',num2str(result(18).value)); |
---|
867 | link_up=dec2bin(result(19).value,8); |
---|
868 | set(handles.RX_link_up_1,'value',str2num(link_up(8))); |
---|
869 | set(handles.RX_link_up_2,'value',str2num(link_up(7))); |
---|
870 | set(handles.TX_link_up_1,'value',str2num(link_up(4))); |
---|
871 | set(handles.TX_link_up_2,'value',str2num(link_up(3))); |
---|
872 | set(handles.hard_err_cnt_1,'string',num2str(result(20).value)); |
---|
873 | set(handles.hard_err_cnt_2,'string',num2str(result(21).value)); |
---|
874 | set(handles.soft_err_cnt_1,'string',num2str(result(22).value)); |
---|
875 | set(handles.soft_err_cnt_2,'string',num2str(result(23).value)); |
---|
876 | set(handles.frame_err_cnt_1,'string',num2str(result(24).value)); |
---|
877 | set(handles.frame_err_cnt_2,'string',num2str(result(25).value)); |
---|
878 | set(handles.RX_count_1,'string',num2str(result(26).value)); |
---|
879 | set(handles.RX_count_2,'string',num2str(result(27).value)); |
---|
880 | set(handles.TX_count_1,'string',num2str(result(28).value)); |
---|
881 | set(handles.TX_count_2,'string',num2str(result(29).value)); |
---|
882 | set(handles.sniffer_id,'string',num2str(result(30).value)); |
---|
883 | set(handles.time_frame_lenght,'string',num2str(result(31).value)); |
---|
884 | set(handles.mgt_powerdown,'string',num2str(result(32).value)); |
---|
885 | set(handles.mgt_loopback,'string',num2str(result(33).value)); |
---|
886 | set(handles.buf_clr_dly,'string',num2str(result(34).value)); |
---|
887 | set(handles.lost_frame_ratio,'string',num2str(result(35).value)); |
---|
888 | |
---|
889 | |
---|
890 | % --- Executes on button press in display. |
---|
891 | function display_Callback(hObject, eventdata, handles) |
---|
892 | % hObject handle to display (see GCBO) |
---|
893 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
894 | % handles structure with handles and user data (see GUIDATA) |
---|
895 | |
---|
896 | %attr_list={'xPosData','zPosData','firstTimeFrame','lastTimeFrame'}; |
---|
897 | dev_list=get(handles.sniffer_dev,'string'); |
---|
898 | dev_value=get(handles.sniffer_dev,'value'); |
---|
899 | dev=dev_list{dev_value}; |
---|
900 | |
---|
901 | %while continuous==1 |
---|
902 | %Nsamples=4096*Nbuffer; |
---|
903 | |
---|
904 | % for i=1:1:Nbuffer |
---|
905 | % result{i}=tango_read_attributes(dev,attr_list); |
---|
906 | % delai=.8 + sqrt(0.5) * randn |
---|
907 | % pause(delai) |
---|
908 | % waitbar(i/Nbuffer,h); |
---|
909 | % end |
---|
910 | |
---|
911 | axes(handles.graph) |
---|
912 | |
---|
913 | if get(handles.is_orbit,'value') |
---|
914 | attr_list={'XPosMean','ZPosMean'}; |
---|
915 | result=tango_read_attributes2(dev,attr_list) |
---|
916 | plot(double(result(2).value(2:121))./1000) |
---|
917 | hold on |
---|
918 | plot(double(result(1).value(2:121))./1000,'r') |
---|
919 | xlabel('bpm number') |
---|
920 | ylabel('µm') |
---|
921 | title('orbit display') |
---|
922 | legend('Vertical','Horizontal'); |
---|
923 | hold off |
---|
924 | grid on |
---|
925 | |
---|
926 | |
---|
927 | else if get(handles.is_buffer,'value') |
---|
928 | dataX=0; |
---|
929 | dataZ=0; |
---|
930 | bpm=str2num(get(handles.selection,'string')) |
---|
931 | dataX=tango_command_inout2(dev,'GetXPosData',uint16(bpm)); |
---|
932 | dataZ=tango_command_inout2(dev,'GetZPosData',uint16(bpm)); |
---|
933 | |
---|
934 | % for j=2:1:121 |
---|
935 | % [toto tata]=find(result{i}(1).value(j,:)==0); |
---|
936 | % if isempty(find(result{i}(2).value(j,tata)==0))==0 |
---|
937 | % bpm_nul=bpm_nul+1; |
---|
938 | % frame_nulle(tata)=frame_nulle(tata)+1; |
---|
939 | % end |
---|
940 | % |
---|
941 | % end |
---|
942 | |
---|
943 | % index=find(frame_nulle) |
---|
944 | % frame_nulle(index) |
---|
945 | % dataX=dataX(2:size(dataX,2)); |
---|
946 | % dataZ=dataZ(2:size(dataZ,2)); |
---|
947 | plot(double(dataX)./1000.0) |
---|
948 | hold on |
---|
949 | plot(double(dataZ)./1000.0,'r') |
---|
950 | xlabel('sample number (at 10 kHz)') |
---|
951 | ylabel('µm') |
---|
952 | title(['buffer display bpm ',num2str(bpm)]) |
---|
953 | legend('Horizontal','Vertical'); |
---|
954 | hold off |
---|
955 | grid on |
---|
956 | % (result{Nbuffer}(4).value-result{1}(3).value)/4096; |
---|
957 | |
---|
958 | % |
---|
959 | % set(handles.ff_cnt,'string',num2str(result(3).value)); |
---|
960 | % set(handles.lf_cnt,'string',num2str(result(4).value)); |
---|
961 | % |
---|
962 | |
---|
963 | else if get(handles.is_fft,'value') |
---|
964 | dataX=0; |
---|
965 | dataZ=0; |
---|
966 | bpm=str2num(get(handles.selection,'string')) |
---|
967 | dataX=tango_command_inout2(dev,'GetXPosData',uint16(bpm)); |
---|
968 | dataZ=tango_command_inout2(dev,'GetZPosData',uint16(bpm)); |
---|
969 | Nsamples=size(dataX,2) |
---|
970 | xfft=0; |
---|
971 | pxfft=0; |
---|
972 | pxfftaff=0; |
---|
973 | % for i=1:1:Nbuffer |
---|
974 | % dataX=[dataX result{i}(1).value(bpm+1,:)]; |
---|
975 | % dataZ=[dataZ result{i}(2).value(bpm+1,:)]; |
---|
976 | % |
---|
977 | % end |
---|
978 | % dataX=dataX(2:size(dataX,2)); |
---|
979 | % dataZ=dataZ(2:size(dataZ,2)); |
---|
980 | |
---|
981 | fech=10079; |
---|
982 | fmax=100; |
---|
983 | Nfft=1000*Nsamples; |
---|
984 | xfft=fft(double(dataX./10^3),Nsamples)/Nsamples; |
---|
985 | zfft=fft(double(dataZ./10^3),Nsamples)/Nsamples; |
---|
986 | pxfft=2*xfft.*conj(xfft); |
---|
987 | pzfft=2*zfft.*conj(zfft); |
---|
988 | %on normalise pour afficher la dsp en µm^2/Hz et non pas en µm^2/largeur de bande entre 2 échantillons |
---|
989 | pxfftaff=sqrt(pxfft*Nsamples/fech); |
---|
990 | pzfftaff=sqrt(pzfft*Nsamples/fech); |
---|
991 | f_bpm=(1:Nsamples-1)*fech/Nsamples; |
---|
992 | n_bpm=(1:120); |
---|
993 | semilogy(f_bpm,pxfftaff(1,2:Nsamples),'r'); |
---|
994 | hold on; |
---|
995 | semilogy(f_bpm,pzfftaff(1,2:Nsamples),'b'); |
---|
996 | %xlim([0 fmax]); |
---|
997 | fmin=str2num(get(handles.fmin,'string')); |
---|
998 | fmax=str2num(get(handles.fmax,'string')); |
---|
999 | xlim([fmin fmax]); |
---|
1000 | % xlim([0 90]); |
---|
1001 | ylim([10^-3 10^2]); |
---|
1002 | xlabel('frequency (Hz)') |
---|
1003 | ylabel('µm/sqrt(Hz)') |
---|
1004 | title(['fft on bpm ',num2str(bpm)]) |
---|
1005 | legend('Horizontal','Vertical'); |
---|
1006 | hold off |
---|
1007 | grid on; |
---|
1008 | axes(handles.graph2) |
---|
1009 | PXintegrale_bpm(1:Nsamples)=0; |
---|
1010 | PZintegrale_bpm(1:Nsamples)=0; |
---|
1011 | |
---|
1012 | for step=2:Nsamples |
---|
1013 | PXintegrale_bpm(step)=PXintegrale_bpm(step-1) + pxfft(step); |
---|
1014 | PZintegrale_bpm(step)=PZintegrale_bpm(step-1) + pzfft(step); |
---|
1015 | end |
---|
1016 | Xintegrale_bpm=sqrt((PXintegrale_bpm)); |
---|
1017 | Zintegrale_bpm=sqrt((PZintegrale_bpm)); |
---|
1018 | bruitX_bpm = Xintegrale_bpm(floor(Nsamples/2)) |
---|
1019 | bruitZ_bpm = Zintegrale_bpm(floor(Nsamples/2)) |
---|
1020 | plot(f_bpm,Xintegrale_bpm(2:Nsamples),'r') |
---|
1021 | hold on |
---|
1022 | plot(f_bpm,Zintegrale_bpm(2:Nsamples),'b') |
---|
1023 | %xlim([0 fmax]); |
---|
1024 | xlim([fmin fmax]); |
---|
1025 | %xlim([0 90]); |
---|
1026 | xlabel('frequence (Hz)'); |
---|
1027 | ylabel('µm'); |
---|
1028 | legend('Horizontal','Vertical'); |
---|
1029 | hold off |
---|
1030 | grid on; |
---|
1031 | end |
---|
1032 | end |
---|
1033 | |
---|
1034 | end |
---|
1035 | % close(h); |
---|
1036 | %end |
---|
1037 | % first_frame=result{1}(3).value; |
---|
1038 | % last_frame=result{Nbuffer}(4).value; |
---|
1039 | % if last_frame<first_frame |
---|
1040 | % last_frame=last_frame+2^16; |
---|
1041 | % end |
---|
1042 | % last_frame-first_frame |
---|
1043 | % if ((last_frame-first_frame)+1==Nsamples) |
---|
1044 | % set(handles.record_done,'value',1) |
---|
1045 | % else |
---|
1046 | % set(handles.record_done,'value',0) |
---|
1047 | % end |
---|
1048 | % |
---|
1049 | function edit32_Callback(hObject, eventdata, handles) |
---|
1050 | % hObject handle to edit32 (see GCBO) |
---|
1051 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1052 | % handles structure with handles and user data (see GUIDATA) |
---|
1053 | |
---|
1054 | % Hints: get(hObject,'String') returns contents of edit32 as text |
---|
1055 | % str2double(get(hObject,'String')) returns contents of edit32 as a double |
---|
1056 | |
---|
1057 | |
---|
1058 | % --- Executes during object creation, after setting all properties. |
---|
1059 | function edit32_CreateFcn(hObject, eventdata, handles) |
---|
1060 | % hObject handle to edit32 (see GCBO) |
---|
1061 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1062 | % handles empty - handles not created until after all CreateFcns called |
---|
1063 | |
---|
1064 | % Hint: edit controls usually have a white background on Windows. |
---|
1065 | % See ISPC and COMPUTER. |
---|
1066 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1067 | set(hObject,'BackgroundColor','white'); |
---|
1068 | end |
---|
1069 | |
---|
1070 | |
---|
1071 | |
---|
1072 | |
---|
1073 | % --- Executes on selection change in command. |
---|
1074 | function command_Callback(hObject, eventdata, handles) |
---|
1075 | % hObject handle to command (see GCBO) |
---|
1076 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1077 | % handles structure with handles and user data (see GUIDATA) |
---|
1078 | |
---|
1079 | % Hints: contents = get(hObject,'String') returns command contents as cell array |
---|
1080 | % contents{get(hObject,'Value')} returns selected item from command |
---|
1081 | button=questdlg('Apply command ?','Confirm','Yes'); |
---|
1082 | switch button |
---|
1083 | case 'Yes' |
---|
1084 | command_list=get(handles.command,'string') |
---|
1085 | command_line=get(handles.command,'value') |
---|
1086 | command=command_list{command_line} |
---|
1087 | dev_list=get(handles.sniffer_dev,'string'); |
---|
1088 | dev_value=get(handles.sniffer_dev,'value'); |
---|
1089 | dev=dev_list{dev_value}; |
---|
1090 | result=tango_command_inout2(dev,command) |
---|
1091 | otherwise |
---|
1092 | end |
---|
1093 | |
---|
1094 | % --- Executes during object creation, after setting all properties. |
---|
1095 | function command_CreateFcn(hObject, eventdata, handles) |
---|
1096 | % hObject handle to command (see GCBO) |
---|
1097 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1098 | % handles empty - handles not created until after all CreateFcns called |
---|
1099 | |
---|
1100 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
1101 | % See ISPC and COMPUTER. |
---|
1102 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1103 | set(hObject,'BackgroundColor','white'); |
---|
1104 | end |
---|
1105 | |
---|
1106 | |
---|
1107 | |
---|
1108 | |
---|
1109 | % --- Executes on button press in is_fft_3d. |
---|
1110 | function fft_3d_Callback(hObject, eventdata, handles) |
---|
1111 | % hObject handle to is_fft_3d (see GCBO) |
---|
1112 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1113 | % handles structure with handles and user data (see GUIDATA) |
---|
1114 | attr_list={'xPosData','zPosData'}; |
---|
1115 | dev_list=get(handles.sniffer_dev,'string'); |
---|
1116 | dev_value=get(handles.sniffer_dev,'value'); |
---|
1117 | dev=dev_list{dev_value}; |
---|
1118 | result=tango_read_attributes(dev,attr_list) |
---|
1119 | |
---|
1120 | xfft=0; |
---|
1121 | pxfft=0; |
---|
1122 | pxfftaff=0; |
---|
1123 | Nsamples=4096; |
---|
1124 | fech=10079 |
---|
1125 | |
---|
1126 | xfft=fft((double(transpose(result(1).value(2:121,:)./1000))))./Nsamples; |
---|
1127 | zfft=fft((double(transpose(result(2).value(2:121,:)./1000))))./Nsamples; |
---|
1128 | pxfft=2*xfft.*conj(xfft); |
---|
1129 | pzfft=2*zfft.*conj(zfft); |
---|
1130 | pxfftaff=pxfft*Nsamples/fech; |
---|
1131 | pzfftaff=pzfft*Nsamples/fech; |
---|
1132 | f_bpm=(0:Nsamples-1)*fech/Nsamples; |
---|
1133 | n_bpm=(1:120); |
---|
1134 | |
---|
1135 | figure(1) |
---|
1136 | surf(n_bpm,f_bpm(2:Nsamples),log(pxfftaff(2:Nsamples,:))) |
---|
1137 | ylim([0 1000]) |
---|
1138 | xlabel('bpm number'); |
---|
1139 | ylabel('frequency (Hz)'); |
---|
1140 | zlabel('log de la densite spectrale de puissance') |
---|
1141 | title('densité spectrale de puissance mesurée sur les données FA (@10 kHz) sur les 120 BPMs dans le plan horizontal'); |
---|
1142 | figure(2) |
---|
1143 | surf(n_bpm,f_bpm(2:Nsamples),log(pzfftaff(2:Nsamples,:))) |
---|
1144 | ylim([0 1000]) |
---|
1145 | xlabel('bpm number'); |
---|
1146 | ylabel('frequency (Hz)'); |
---|
1147 | zlabel('log de la densite spectrale de puissance') |
---|
1148 | title('densité spectrale de puissance mesurée sur les données FA (@10 kHz) sur les 120 BPMs dans le plan vertical'); |
---|
1149 | |
---|
1150 | |
---|
1151 | |
---|
1152 | % --- Executes on button press in is_fft. |
---|
1153 | function is_fft_Callback(hObject, eventdata, handles) |
---|
1154 | % hObject handle to is_fft (see GCBO) |
---|
1155 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1156 | % handles structure with handles and user data (see GUIDATA) |
---|
1157 | |
---|
1158 | |
---|
1159 | % --- Executes on button press in integrated_noise. |
---|
1160 | function integrated_noise_Callback(hObject, eventdata, handles) |
---|
1161 | % hObject handle to integrated_noise (see GCBO) |
---|
1162 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1163 | % handles structure with handles and user data (see GUIDATA) |
---|
1164 | attr_list={'xPosData','zPosData'}; |
---|
1165 | dev_list=get(handles.sniffer_dev,'string'); |
---|
1166 | dev_value=get(handles.sniffer_dev,'value'); |
---|
1167 | dev=dev_list{dev_value}; |
---|
1168 | result=tango_read_attributes(dev,attr_list) |
---|
1169 | xfft=0; |
---|
1170 | pxfft=0; |
---|
1171 | pxfftaff=0; |
---|
1172 | Nsamples=4096; |
---|
1173 | fech=10079 |
---|
1174 | fmax=1200; |
---|
1175 | xfft=fft((double(transpose(result(1).value(2:121,:)./1000))))./Nsamples; |
---|
1176 | zfft=fft((double(transpose(result(2).value(2:121,:)./1000))))./Nsamples; |
---|
1177 | pxfft=2*xfft.*conj(xfft); |
---|
1178 | pzfft=2*zfft.*conj(zfft); |
---|
1179 | pxfftaff=pxfft*Nsamples/fech; |
---|
1180 | pzfftaff=pzfft*Nsamples/fech; |
---|
1181 | f_bpm=(0:Nsamples-1)*fech/Nsamples; |
---|
1182 | n_bpm=(1:120); |
---|
1183 | |
---|
1184 | PXintegrale_bpm(1:4096,1:120)=0; |
---|
1185 | PZintegrale_bpm(1:4096,1:120)=0; |
---|
1186 | |
---|
1187 | for j=1:1:120 |
---|
1188 | for step=2:Nsamples |
---|
1189 | PXintegrale_bpm(step,j)=PXintegrale_bpm(step-1,j) + pxfft(step,j); |
---|
1190 | PZintegrale_bpm(step,j)=PZintegrale_bpm(step-1,j) + pzfft(step,j); |
---|
1191 | end |
---|
1192 | end |
---|
1193 | Xintegrale_bpm=sqrt((PXintegrale_bpm)); |
---|
1194 | Zintegrale_bpm=sqrt((PZintegrale_bpm)); |
---|
1195 | bruitX_bpm = Xintegrale_bpm(Nsamples/2) |
---|
1196 | bruitZ_bpm = Zintegrale_bpm(Nsamples/2) |
---|
1197 | |
---|
1198 | figure(1) |
---|
1199 | subplot(3,2,1) |
---|
1200 | semilogy(f_bpm(2:Nsamples),pxfftaff(2:Nsamples,:)); |
---|
1201 | xlim([0 fmax]); |
---|
1202 | ylim([10^-6 10^2]) |
---|
1203 | title('densité spectrale de puissance horizontale sur les 120 bpms'); |
---|
1204 | xlabel('frequence (Hz)'); |
---|
1205 | ylabel('µm^2/Hz'); |
---|
1206 | grid on; |
---|
1207 | |
---|
1208 | subplot(3,2,2) |
---|
1209 | semilogy(f_bpm(2:Nsamples),pzfftaff(2:Nsamples,:)); |
---|
1210 | xlim([0 fmax]); |
---|
1211 | ylim([10^-6 10^2]) |
---|
1212 | title('densité spectrale de puissance verticale sur les 120 bpms'); |
---|
1213 | xlabel('frequence (Hz)'); |
---|
1214 | ylabel('µm^2/Hz'); |
---|
1215 | grid on; |
---|
1216 | |
---|
1217 | subplot(3,2,3) |
---|
1218 | plot(f_bpm,Xintegrale_bpm) |
---|
1219 | xlim([0 fmax]); |
---|
1220 | title('bruit integré horizontal en fonction de la frequence sur les 120 bpms'); |
---|
1221 | xlabel('frequence (Hz)'); |
---|
1222 | ylabel('µm'); |
---|
1223 | grid on; |
---|
1224 | |
---|
1225 | subplot(3,2,4) |
---|
1226 | plot(f_bpm,Zintegrale_bpm) |
---|
1227 | xlim([0 fmax]); |
---|
1228 | title('bruit integré vertical en fonction de la frequence sur les 120 bpms'); |
---|
1229 | xlabel('frequence (Hz)'); |
---|
1230 | ylabel('µm'); |
---|
1231 | grid on; |
---|
1232 | |
---|
1233 | index=find(f_bpm>=fmax) |
---|
1234 | |
---|
1235 | subplot(3,2,5) |
---|
1236 | plot(Xintegrale_bpm(index(1),:)) |
---|
1237 | xlim([0 120]); |
---|
1238 | title(['bruit integré horizontal dans la bande 0-',num2str(fmax),' Hz en fonction de la position sur les 120 bpms']); |
---|
1239 | xlabel('numéro du bpm'); |
---|
1240 | ylabel('µm'); |
---|
1241 | grid on; |
---|
1242 | |
---|
1243 | subplot(3,2,6) |
---|
1244 | plot(Zintegrale_bpm(index(1),:)) |
---|
1245 | xlim([0 120]); |
---|
1246 | title(['bruit integré vertical dans la bande 0-',num2str(fmax),' Hz en fonction de la position sur les 120 bpms']); |
---|
1247 | xlabel('numéro du bpm'); |
---|
1248 | ylabel('µm'); |
---|
1249 | grid on; |
---|
1250 | |
---|
1251 | save bruit_integre pxfftaff pzfftaff Xintegrale_bpm Zintegrale_bpm f_bpm |
---|
1252 | |
---|
1253 | |
---|
1254 | % --- Executes on button press in continuous. |
---|
1255 | function continuous_Callback(hObject, eventdata, handles) |
---|
1256 | % hObject handle to continuous (see GCBO) |
---|
1257 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1258 | % handles structure with handles and user data (see GUIDATA) |
---|
1259 | |
---|
1260 | % Hint: get(hObject,'Value') returns toggle state of continuous |
---|
1261 | % global continuous; |
---|
1262 | % |
---|
1263 | % continuous=get(handles.continuous,'value') |
---|
1264 | |
---|
1265 | |
---|
1266 | |
---|
1267 | function ff_cnt_Callback(hObject, eventdata, handles) |
---|
1268 | % hObject handle to ff_cnt (see GCBO) |
---|
1269 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1270 | % handles structure with handles and user data (see GUIDATA) |
---|
1271 | |
---|
1272 | % Hints: get(hObject,'String') returns contents of ff_cnt as text |
---|
1273 | % str2double(get(hObject,'String')) returns contents of ff_cnt as a double |
---|
1274 | |
---|
1275 | |
---|
1276 | % --- Executes during object creation, after setting all properties. |
---|
1277 | function ff_cnt_CreateFcn(hObject, eventdata, handles) |
---|
1278 | % hObject handle to ff_cnt (see GCBO) |
---|
1279 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1280 | % handles empty - handles not created until after all CreateFcns called |
---|
1281 | |
---|
1282 | % Hint: edit controls usually have a white background on Windows. |
---|
1283 | % See ISPC and COMPUTER. |
---|
1284 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1285 | set(hObject,'BackgroundColor','white'); |
---|
1286 | end |
---|
1287 | |
---|
1288 | |
---|
1289 | |
---|
1290 | function lf_cnt_Callback(hObject, eventdata, handles) |
---|
1291 | % hObject handle to lf_cnt (see GCBO) |
---|
1292 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1293 | % handles structure with handles and user data (see GUIDATA) |
---|
1294 | |
---|
1295 | % Hints: get(hObject,'String') returns contents of lf_cnt as text |
---|
1296 | % str2double(get(hObject,'String')) returns contents of lf_cnt as a double |
---|
1297 | |
---|
1298 | |
---|
1299 | % --- Executes during object creation, after setting all properties. |
---|
1300 | function lf_cnt_CreateFcn(hObject, eventdata, handles) |
---|
1301 | % hObject handle to lf_cnt (see GCBO) |
---|
1302 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1303 | % handles empty - handles not created until after all CreateFcns called |
---|
1304 | |
---|
1305 | % Hint: edit controls usually have a white background on Windows. |
---|
1306 | % See ISPC and COMPUTER. |
---|
1307 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1308 | set(hObject,'BackgroundColor','white'); |
---|
1309 | end |
---|
1310 | |
---|
1311 | |
---|
1312 | |
---|
1313 | |
---|
1314 | |
---|
1315 | function Buffer_length_Callback(hObject, eventdata, handles) |
---|
1316 | % hObject handle to Buffer_length (see GCBO) |
---|
1317 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1318 | % handles structure with handles and user data (see GUIDATA) |
---|
1319 | |
---|
1320 | % Hints: get(hObject,'String') returns contents of Buffer_length as text |
---|
1321 | % str2double(get(hObject,'String')) returns contents of Buffer_length as a double |
---|
1322 | duree=get(handles.Buffer_length,'string') |
---|
1323 | dev_list=get(handles.sniffer_dev,'string'); |
---|
1324 | dev_value=get(handles.sniffer_dev,'value'); |
---|
1325 | dev=dev_list{dev_value}; |
---|
1326 | tango_write_attribute2(dev,'recordLengthInSecs',str2num(duree)) |
---|
1327 | |
---|
1328 | |
---|
1329 | % --- Executes during object creation, after setting all properties. |
---|
1330 | function Buffer_length_CreateFcn(hObject, eventdata, handles) |
---|
1331 | % hObject handle to Buffer_length (see GCBO) |
---|
1332 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1333 | % handles empty - handles not created until after all CreateFcns called |
---|
1334 | |
---|
1335 | % Hint: edit controls usually have a white background on Windows. |
---|
1336 | % See ISPC and COMPUTER. |
---|
1337 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1338 | set(hObject,'BackgroundColor','white'); |
---|
1339 | end |
---|
1340 | |
---|
1341 | % --- Executes on button press in record_done. |
---|
1342 | function record_done_Callback(hObject, eventdata, handles) |
---|
1343 | % hObject handle to record_done (see GCBO) |
---|
1344 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1345 | % handles structure with handles and user data (see GUIDATA) |
---|
1346 | |
---|
1347 | % Hint: get(hObject,'Value') returns toggle state of record_done |
---|
1348 | |
---|
1349 | |
---|
1350 | |
---|
1351 | |
---|
1352 | |
---|
1353 | function fmax_Callback(hObject, eventdata, handles) |
---|
1354 | % hObject handle to fmax (see GCBO) |
---|
1355 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1356 | % handles structure with handles and user data (see GUIDATA) |
---|
1357 | |
---|
1358 | % Hints: get(hObject,'String') returns contents of fmax as text |
---|
1359 | % str2double(get(hObject,'String')) returns contents of fmax as a double |
---|
1360 | axes(handles.graph) |
---|
1361 | fmin=str2num(get(handles.fmin,'string')); |
---|
1362 | fmax=str2num(get(handles.fmax,'string')); |
---|
1363 | xlim([fmin fmax]); |
---|
1364 | axes(handles.graph2) |
---|
1365 | xlim([fmin fmax]); |
---|
1366 | |
---|
1367 | % --- Executes during object creation, after setting all properties. |
---|
1368 | function fmax_CreateFcn(hObject, eventdata, handles) |
---|
1369 | % hObject handle to fmax (see GCBO) |
---|
1370 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1371 | % handles empty - handles not created until after all CreateFcns called |
---|
1372 | |
---|
1373 | % Hint: edit controls usually have a white background on Windows. |
---|
1374 | % See ISPC and COMPUTER. |
---|
1375 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1376 | set(hObject,'BackgroundColor','white'); |
---|
1377 | end |
---|
1378 | |
---|
1379 | |
---|
1380 | |
---|
1381 | function fmin_Callback(hObject, eventdata, handles) |
---|
1382 | % hObject handle to fmin (see GCBO) |
---|
1383 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1384 | % handles structure with handles and user data (see GUIDATA) |
---|
1385 | |
---|
1386 | % Hints: get(hObject,'String') returns contents of fmin as text |
---|
1387 | % str2double(get(hObject,'String')) returns contents of fmin as a double |
---|
1388 | axes(handles.graph) |
---|
1389 | fmin=str2num(get(handles.fmin,'string')); |
---|
1390 | fmax=str2num(get(handles.fmax,'string')); |
---|
1391 | xlim([fmin fmax]); |
---|
1392 | axes(handles.graph2) |
---|
1393 | xlim([fmin fmax]); |
---|
1394 | |
---|
1395 | % --- Executes during object creation, after setting all properties. |
---|
1396 | function fmin_CreateFcn(hObject, eventdata, handles) |
---|
1397 | % hObject handle to fmin (see GCBO) |
---|
1398 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1399 | % handles empty - handles not created until after all CreateFcns called |
---|
1400 | |
---|
1401 | % Hint: edit controls usually have a white background on Windows. |
---|
1402 | % See ISPC and COMPUTER. |
---|
1403 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1404 | set(hObject,'BackgroundColor','white'); |
---|
1405 | end |
---|
1406 | |
---|
1407 | |
---|
1408 | |
---|
1409 | |
---|
1410 | % --- Executes on button press in start_record. |
---|
1411 | function start_record_Callback(hObject, eventdata, handles) |
---|
1412 | % hObject handle to start_record (see GCBO) |
---|
1413 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1414 | % handles structure with handles and user data (see GUIDATA) |
---|
1415 | dev_list=get(handles.sniffer_dev,'string'); |
---|
1416 | dev_value=get(handles.sniffer_dev,'value'); |
---|
1417 | dev=dev_list{dev_value}; |
---|
1418 | set(handles.record_done,'value',0) |
---|
1419 | record_done=0; |
---|
1420 | result_duree=tango_read_attribute2(dev,'recordLengthInSecs'); |
---|
1421 | duree=result_duree.value(1) |
---|
1422 | set(handles.Buffer_length,'string',num2str(duree)); |
---|
1423 | tango_command_inout2(dev,'StartRecording'); |
---|
1424 | h = waitbar(0,'Please wait...'); |
---|
1425 | for i=1:10, |
---|
1426 | pause(duree/10) |
---|
1427 | % computation here % |
---|
1428 | waitbar(i/10,h) |
---|
1429 | end |
---|
1430 | while record_done==0 |
---|
1431 | result=tango_read_attribute2(dev,'recordReady') |
---|
1432 | if result.value==1 |
---|
1433 | set(handles.record_done,'value',1) |
---|
1434 | close(h) |
---|
1435 | record_done=1; |
---|
1436 | else |
---|
1437 | pause(1) |
---|
1438 | end |
---|
1439 | end |
---|
1440 | |
---|
1441 | |
---|
1442 | % --- Executes on selection change in sniffer_dev. |
---|
1443 | function sniffer_dev_Callback(hObject, eventdata, handles) |
---|
1444 | % hObject handle to sniffer_dev (see GCBO) |
---|
1445 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1446 | % handles structure with handles and user data (see GUIDATA) |
---|
1447 | |
---|
1448 | % Hints: contents = get(hObject,'String') returns sniffer_dev contents as cell array |
---|
1449 | % contents{get(hObject,'Value')} returns selected item from sniffer_dev |
---|
1450 | |
---|
1451 | |
---|
1452 | % --- Executes during object creation, after setting all properties. |
---|
1453 | function sniffer_dev_CreateFcn(hObject, eventdata, handles) |
---|
1454 | % hObject handle to sniffer_dev (see GCBO) |
---|
1455 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1456 | % handles empty - handles not created until after all CreateFcns called |
---|
1457 | |
---|
1458 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
1459 | % See ISPC and COMPUTER. |
---|
1460 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1461 | set(hObject,'BackgroundColor','white'); |
---|
1462 | end |
---|
1463 | |
---|
1464 | |
---|