TIMINGGUI_DIV M-file for timinggui_div.fig TIMINGGUI_DIV, by itself, creates a new TIMINGGUI_DIV or raises the existing singleton*. H = TIMINGGUI_DIV returns the handle to a new TIMINGGUI_DIV or the handle to the existing singleton*. TIMINGGUI_DIV('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in TIMINGGUI_DIV.M with the given input arguments. TIMINGGUI_DIV('Property','Value',...) creates a new TIMINGGUI_DIV or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before timinggui_div_OpeningFunction gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to timinggui_div_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES
0001 function varargout = timinggui_div(varargin) 0002 % TIMINGGUI_DIV M-file for timinggui_div.fig 0003 % TIMINGGUI_DIV, by itself, creates a new TIMINGGUI_DIV or raises the existing 0004 % singleton*. 0005 % 0006 % H = TIMINGGUI_DIV returns the handle to a new TIMINGGUI_DIV or the handle to 0007 % the existing singleton*. 0008 % 0009 % TIMINGGUI_DIV('CALLBACK',hObject,eventData,handles,...) calls the local 0010 % function named CALLBACK in TIMINGGUI_DIV.M with the given input arguments. 0011 % 0012 % TIMINGGUI_DIV('Property','Value',...) creates a new TIMINGGUI_DIV or raises the 0013 % existing singleton*. Starting from the left, property value pairs are 0014 % applied to the GUI before timinggui_div_OpeningFunction gets called. An 0015 % unrecognized property name or invalid value makes property application 0016 % stop. All inputs are passed to timinggui_div_OpeningFcn via varargin. 0017 % 0018 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 0019 % instance to run (singleton)". 0020 % 0021 % See also: GUIDE, GUIDATA, GUIHANDLES 0022 0023 % Copyright 2002-2003 The MathWorks, Inc. 0024 0025 % Edit the above text to modify the response to help timinggui_div 0026 0027 % Last Modified by GUIDE v2.5 03-Apr-2006 18:40:04 0028 0029 % Begin initialization code - DO NOT EDIT 0030 gui_Singleton = 1; 0031 gui_State = struct('gui_Name', mfilename, ... 0032 'gui_Singleton', gui_Singleton, ... 0033 'gui_OpeningFcn', @timinggui_div_OpeningFcn, ... 0034 'gui_OutputFcn', @timinggui_div_OutputFcn, ... 0035 'gui_LayoutFcn', [] , ... 0036 'gui_Callback', []); 0037 if nargin && ischar(varargin{1}) 0038 gui_State.gui_Callback = str2func(varargin{1}); 0039 end 0040 0041 if nargout 0042 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 0043 else 0044 gui_mainfcn(gui_State, varargin{:}); 0045 end 0046 % End initialization code - DO NOT EDIT 0047 0048 0049 % --- Executes just before timinggui_div is made visible. 0050 function timinggui_div_OpeningFcn(hObject, eventdata, handles, varargin) 0051 % This function has no output args, see OutputFcn. 0052 % hObject handle to figure 0053 % eventdata reserved - to be defined in a future version of MATLAB 0054 % handles structure with handles and user data (see GUIDATA) 0055 % varargin command line arguments to timinggui_div (see VARARGIN) 0056 0057 % Choose default command line output for timinggui_div 0058 handles.output = hObject; 0059 0060 % Update handles structure 0061 guidata(hObject, handles); 0062 0063 % UIWAIT makes timinggui_div wait for user response (see UIRESUME) 0064 % uiwait(handles.figure1); 0065 0066 handles.device_carte1 ='BOO/SY/CPT.1'; 0067 handles.device_carte2 ='LT1/SY/CPT.1'; 0068 handles.device_carte3 ='BOO/SY/CPT.2'; 0069 handles.device_carte4 ='LIN/SY/FREQDIV'; 0070 0071 str1 = {'delayCounter0', 'delayCounter1', 'delayCounter2', ... 0072 'delayCounter3', 'delayCounter4', 'delayCounter5', 'delayCounter6', 'delayCounter7'}; 0073 0074 str2 = {'counter0Enable', 'counter1Enable', 'counter2Enable', ... 0075 'counter3Enable', 'counter4Enable', 'counter5Enable', 'counter6Enable', ... 0076 'counter7Enable'}; 0077 0078 str3 ={'divisionCounter0', 'divisionCounter1', 'divisionCounter2', ... 0079 'divisionCounter3', 'divisionCounter4', 'divisionCounter5', 'divisionCounter6', 'divisionCounter7'}; 0080 0081 nb = length(str1); 0082 handles.delayname1 = [repmat(handles.device_carte1,nb,1) repmat('/',nb,1) cell2mat(str1')]; 0083 handles.delayname2 = [repmat(handles.device_carte2,nb,1) repmat('/',nb,1) cell2mat(str1')]; 0084 handles.delayname3 = [repmat(handles.device_carte3,nb,1) repmat('/',nb,1) cell2mat(str1')]; 0085 handles.divisionname4 = [repmat(handles.device_carte4,nb,1) repmat('/',nb,1) cell2mat(str3')]; 0086 0087 handles.enablename1 = [repmat(handles.device_carte1,nb,1) repmat('/',nb,1) cell2mat(str2')]; 0088 handles.enablename2 = [repmat(handles.device_carte2,nb,1) repmat('/',nb,1) cell2mat(str2')]; 0089 handles.enablename3 = [repmat(handles.device_carte3,nb,1) repmat('/',nb,1) cell2mat(str2')]; 0090 handles.enablename4 = [repmat(handles.device_carte4,nb,1) repmat('/',nb,1) cell2mat(str2')]; 0091 0092 % Reads all delays for card #1, 2 0093 handles.delayvalue1 = readattribute(handles.delayname1); 0094 handles.delayvalue2 = readattribute(handles.delayname2); 0095 handles.delayvalue3 = readattribute(handles.delayname3); 0096 0097 % Reads all division for card #4 0098 handles.divisionvalue4 = readattribute(handles.divisionname4); 0099 0100 % Update handles structure 0101 guidata(hObject, handles); 0102 0103 %pushbutton_acquisition_Callback(handles.pushbutton_acquisition,eventdata,handles); 0104 0105 0106 % --- Outputs from this function are returned to the command line. 0107 function varargout = timinggui_div_OutputFcn(hObject, eventdata, handles) 0108 % varargout cell array for returning output args (see VARARGOUT); 0109 % hObject handle to figure 0110 % eventdata reserved - to be defined in a future version of MATLAB 0111 % handles structure with handles and user data (see GUIDATA) 0112 0113 % Get default command line output from handles structure 0114 varargout{1} = handles.output; 0115 0116 0117 0118 function edit_carte1_5_Callback(hObject, eventdata, handles) 0119 % hObject handle to edit_carte1_5 (see GCBO) 0120 % eventdata reserved - to be defined in a future version of MATLAB 0121 % handles structure with handles and user data (see GUIDATA) 0122 0123 % Hints: get(hObject,'String') returns contents of edit_carte1_5 as text 0124 % str2double(get(hObject,'String')) returns contents of edit_carte1_5 as a double 0125 0126 setdelay(hObject, handles); 0127 0128 % --- Executes during object creation, after setting all properties. 0129 function edit_carte1_5_CreateFcn(hObject, eventdata, handles) 0130 % hObject handle to edit_carte1_5 (see GCBO) 0131 % eventdata reserved - to be defined in a future version of MATLAB 0132 % handles empty - handles not created until after all CreateFcns called 0133 0134 % Hint: edit controls usually have a white background on Windows. 0135 % See ISPC and COMPUTER. 0136 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0137 set(hObject,'BackgroundColor','white'); 0138 end 0139 0140 0141 0142 function edit_carte1_4_Callback(hObject, eventdata, handles) 0143 % hObject handle to edit_carte1_4 (see GCBO) 0144 % eventdata reserved - to be defined in a future version of MATLAB 0145 % handles structure with handles and user data (see GUIDATA) 0146 0147 % Hints: get(hObject,'String') returns contents of edit_carte1_4 as text 0148 % str2double(get(hObject,'String')) returns contents of edit_carte1_4 as a double 0149 0150 setdelay(hObject, handles); 0151 0152 % --- Executes during object creation, after setting all properties. 0153 function edit_carte1_4_CreateFcn(hObject, eventdata, handles) 0154 % hObject handle to edit_carte1_4 (see GCBO) 0155 % eventdata reserved - to be defined in a future version of MATLAB 0156 % handles empty - handles not created until after all CreateFcns called 0157 0158 % Hint: edit controls usually have a white background on Windows. 0159 % See ISPC and COMPUTER. 0160 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0161 set(hObject,'BackgroundColor','white'); 0162 end 0163 0164 0165 0166 function edit_carte1_3_Callback(hObject, eventdata, handles) 0167 % hObject handle to edit_carte1_3 (see GCBO) 0168 % eventdata reserved - to be defined in a future version of MATLAB 0169 % handles structure with handles and user data (see GUIDATA) 0170 0171 % Hints: get(hObject,'String') returns contents of edit_carte1_3 as text 0172 % str2double(get(hObject,'String')) returns contents of edit_carte1_3 as a double 0173 0174 setdelay(hObject, handles); 0175 0176 % --- Executes during object creation, after setting all properties. 0177 function edit_carte1_3_CreateFcn(hObject, eventdata, handles) 0178 % hObject handle to edit_carte1_3 (see GCBO) 0179 % eventdata reserved - to be defined in a future version of MATLAB 0180 % handles empty - handles not created until after all CreateFcns called 0181 0182 % Hint: edit controls usually have a white background on Windows. 0183 % See ISPC and COMPUTER. 0184 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0185 set(hObject,'BackgroundColor','white'); 0186 end 0187 0188 0189 0190 function edit_carte1_2_Callback(hObject, eventdata, handles) 0191 % hObject handle to edit_carte1_2 (see GCBO) 0192 % eventdata reserved - to be defined in a future version of MATLAB 0193 % handles structure with handles and user data (see GUIDATA) 0194 0195 % Hints: get(hObject,'String') returns contents of edit_carte1_2 as text 0196 % str2double(get(hObject,'String')) returns contents of edit_carte1_2 as a double 0197 0198 setdelay(hObject, handles); 0199 0200 % --- Executes during object creation, after setting all properties. 0201 function edit_carte1_2_CreateFcn(hObject, eventdata, handles) 0202 % hObject handle to edit_carte1_2 (see GCBO) 0203 % eventdata reserved - to be defined in a future version of MATLAB 0204 % handles empty - handles not created until after all CreateFcns called 0205 0206 % Hint: edit controls usually have a white background on Windows. 0207 % See ISPC and COMPUTER. 0208 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0209 set(hObject,'BackgroundColor','white'); 0210 end 0211 0212 0213 0214 function edit_carte1_1_Callback(hObject, eventdata, handles) 0215 % hObject handle to edit_carte1_1 (see GCBO) 0216 % eventdata reserved - to be defined in a future version of MATLAB 0217 % handles structure with handles and user data (see GUIDATA) 0218 0219 % Hints: get(hObject,'String') returns contents of edit_carte1_1 as text 0220 % str2double(get(hObject,'String')) returns contents of edit_carte1_1 as a double 0221 0222 setdelay(hObject, handles); 0223 0224 % --- Executes during object creation, after setting all properties. 0225 function edit_carte1_1_CreateFcn(hObject, eventdata, handles) 0226 % hObject handle to edit_carte1_1 (see GCBO) 0227 % eventdata reserved - to be defined in a future version of MATLAB 0228 % handles empty - handles not created until after all CreateFcns called 0229 0230 % Hint: edit controls usually have a white background on Windows. 0231 % See ISPC and COMPUTER. 0232 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0233 set(hObject,'BackgroundColor','white'); 0234 end 0235 0236 0237 function edit_carte1_0_Callback(hObject, eventdata, handles) 0238 % hObject handle to edit_carte1_0 (see GCBO) 0239 % eventdata reserved - to be defined in a future version of MATLAB 0240 % handles structure with handles and user data (see GUIDATA) 0241 0242 % Hints: get(hObject,'String') returns contents of edit_carte1_0 as text 0243 % str2double(get(hObject,'String')) returns contents of edit_carte1_0 as a double 0244 0245 setdelay(hObject, handles); 0246 0247 % --- Executes during object creation, after setting all properties. 0248 function edit_carte1_0_CreateFcn(hObject, eventdata, handles) 0249 % hObject handle to edit_carte1_0 (see GCBO) 0250 % eventdata reserved - to be defined in a future version of MATLAB 0251 % handles empty - handles not created until after all CreateFcns called 0252 0253 % Hint: edit controls usually have a white background on Windows. 0254 % See ISPC and COMPUTER. 0255 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0256 set(hObject,'BackgroundColor','white'); 0257 end 0258 0259 0260 0261 function edit_carte2_5_Callback(hObject, eventdata, handles) 0262 % hObject handle to edit_carte2_5 (see GCBO) 0263 % eventdata reserved - to be defined in a future version of MATLAB 0264 % handles structure with handles and user data (see GUIDATA) 0265 0266 % Hints: get(hObject,'String') returns contents of edit_carte2_5 as text 0267 % str2double(get(hObject,'String')) returns contents of edit_carte2_5 as a double 0268 0269 setdelay(hObject, handles); 0270 0271 % --- Executes during object creation, after setting all properties. 0272 function edit_carte2_5_CreateFcn(hObject, eventdata, handles) 0273 % hObject handle to edit_carte2_5 (see GCBO) 0274 % eventdata reserved - to be defined in a future version of MATLAB 0275 % handles empty - handles not created until after all CreateFcns called 0276 0277 % Hint: edit controls usually have a white background on Windows. 0278 % See ISPC and COMPUTER. 0279 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0280 set(hObject,'BackgroundColor','white'); 0281 end 0282 0283 0284 0285 function edit_carte2_4_Callback(hObject, eventdata, handles) 0286 % hObject handle to edit_carte2_4 (see GCBO) 0287 % eventdata reserved - to be defined in a future version of MATLAB 0288 % handles structure with handles and user data (see GUIDATA) 0289 0290 % Hints: get(hObject,'String') returns contents of edit_carte2_4 as text 0291 % str2double(get(hObject,'String')) returns contents of edit_carte2_4 as a double 0292 0293 setdelay(hObject, handles); 0294 0295 % --- Executes during object creation, after setting all properties. 0296 function edit_carte2_4_CreateFcn(hObject, eventdata, handles) 0297 % hObject handle to edit_carte2_4 (see GCBO) 0298 % eventdata reserved - to be defined in a future version of MATLAB 0299 % handles empty - handles not created until after all CreateFcns called 0300 0301 % Hint: edit controls usually have a white background on Windows. 0302 % See ISPC and COMPUTER. 0303 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0304 set(hObject,'BackgroundColor','white'); 0305 end 0306 0307 0308 0309 function edit_carte2_3_Callback(hObject, eventdata, handles) 0310 % hObject handle to edit_carte2_3 (see GCBO) 0311 % eventdata reserved - to be defined in a future version of MATLAB 0312 % handles structure with handles and user data (see GUIDATA) 0313 0314 % Hints: get(hObject,'String') returns contents of edit_carte2_3 as text 0315 % str2double(get(hObject,'String')) returns contents of edit_carte2_3 as a double 0316 0317 setdelay(hObject, handles); 0318 0319 % --- Executes during object creation, after setting all properties. 0320 function edit_carte2_3_CreateFcn(hObject, eventdata, handles) 0321 % hObject handle to edit_carte2_3 (see GCBO) 0322 % eventdata reserved - to be defined in a future version of MATLAB 0323 % handles empty - handles not created until after all CreateFcns called 0324 0325 % Hint: edit controls usually have a white background on Windows. 0326 % See ISPC and COMPUTER. 0327 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0328 set(hObject,'BackgroundColor','white'); 0329 end 0330 0331 0332 0333 function edit_carte2_2_Callback(hObject, eventdata, handles) 0334 % hObject handle to edit_carte2_2 (see GCBO) 0335 % eventdata reserved - to be defined in a future version of MATLAB 0336 % handles structure with handles and user data (see GUIDATA) 0337 0338 % Hints: get(hObject,'String') returns contents of edit_carte2_2 as text 0339 % str2double(get(hObject,'String')) returns contents of edit_carte2_2 as a double 0340 0341 setdelay(hObject, handles); 0342 0343 % --- Executes during object creation, after setting all properties. 0344 function edit_carte2_2_CreateFcn(hObject, eventdata, handles) 0345 % hObject handle to edit_carte2_2 (see GCBO) 0346 % eventdata reserved - to be defined in a future version of MATLAB 0347 % handles empty - handles not created until after all CreateFcns called 0348 0349 % Hint: edit controls usually have a white background on Windows. 0350 % See ISPC and COMPUTER. 0351 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0352 set(hObject,'BackgroundColor','white'); 0353 end 0354 0355 0356 0357 function edit_carte2_1_Callback(hObject, eventdata, handles) 0358 % hObject handle to edit_carte2_1 (see GCBO) 0359 % eventdata reserved - to be defined in a future version of MATLAB 0360 % handles structure with handles and user data (see GUIDATA) 0361 0362 % Hints: get(hObject,'String') returns contents of edit_carte2_1 as text 0363 % str2double(get(hObject,'String')) returns contents of edit_carte2_1 as a double 0364 0365 setdelay(hObject, handles); 0366 0367 % --- Executes during object creation, after setting all properties. 0368 function edit_carte2_1_CreateFcn(hObject, eventdata, handles) 0369 % hObject handle to edit_carte2_1 (see GCBO) 0370 % eventdata reserved - to be defined in a future version of MATLAB 0371 % handles empty - handles not created until after all CreateFcns called 0372 0373 % Hint: edit controls usually have a white background on Windows. 0374 % See ISPC and COMPUTER. 0375 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0376 set(hObject,'BackgroundColor','white'); 0377 end 0378 0379 0380 0381 function edit_carte2_0_Callback(hObject, eventdata, handles) 0382 % hObject handle to edit_carte2_0 (see GCBO) 0383 % eventdata reserved - to be defined in a future version of MATLAB 0384 % handles structure with handles and user data (see GUIDATA) 0385 0386 % Hints: get(hObject,'String') returns contents of edit_carte2_0 as text 0387 % str2double(get(hObject,'String')) returns contents of edit_carte2_0 as a double 0388 0389 setdelay(hObject, handles); 0390 0391 % --- Executes during object creation, after setting all properties. 0392 function edit_carte2_0_CreateFcn(hObject, eventdata, handles) 0393 % hObject handle to edit_carte2_0 (see GCBO) 0394 % eventdata reserved - to be defined in a future version of MATLAB 0395 % handles empty - handles not created until after all CreateFcns called 0396 0397 % Hint: edit controls usually have a white background on Windows. 0398 % See ISPC and COMPUTER. 0399 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0400 set(hObject,'BackgroundColor','white'); 0401 end 0402 0403 function edit_carte2_7_Callback(hObject, eventdata, handles) 0404 % hObject handle to edit_carte2_7 (see GCBO) 0405 % eventdata reserved - to be defined in a future version of MATLAB 0406 % handles structure with handles and user data (see GUIDATA) 0407 0408 % Hints: get(hObject,'String') returns contents of edit_carte2_7 as text 0409 % str2double(get(hObject,'String')) returns contents of edit_carte2_7 as a double 0410 0411 setdelay(hObject, handles); 0412 0413 % --- Executes during object creation, after setting all properties. 0414 function edit_carte2_7_CreateFcn(hObject, eventdata, handles) 0415 % hObject handle to edit_carte2_7 (see GCBO) 0416 % eventdata reserved - to be defined in a future version of MATLAB 0417 % handles empty - handles not created until after all CreateFcns called 0418 0419 % Hint: edit controls usually have a white background on Windows. 0420 % See ISPC and COMPUTER. 0421 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0422 set(hObject,'BackgroundColor','white'); 0423 end 0424 0425 0426 0427 function edit_carte2_6_Callback(hObject, eventdata, handles) 0428 % hObject handle to edit_carte2_6 (see GCBO) 0429 % eventdata reserved - to be defined in a future version of MATLAB 0430 % handles structure with handles and user data (see GUIDATA) 0431 0432 % Hints: get(hObject,'String') returns contents of edit_carte2_6 as text 0433 % str2double(get(hObject,'String')) returns contents of edit_carte2_6 as a double 0434 0435 setdelay(hObject, handles); 0436 0437 % --- Executes during object creation, after setting all properties. 0438 function edit_carte2_6_CreateFcn(hObject, eventdata, handles) 0439 % hObject handle to edit_carte2_6 (see GCBO) 0440 % eventdata reserved - to be defined in a future version of MATLAB 0441 % handles empty - handles not created until after all CreateFcns called 0442 0443 % Hint: edit controls usually have a white background on Windows. 0444 % See ISPC and COMPUTER. 0445 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0446 set(hObject,'BackgroundColor','white'); 0447 end 0448 0449 0450 0451 function edit_carte3_5_Callback(hObject, eventdata, handles) 0452 % hObject handle to edit_carte3_5 (see GCBO) 0453 % eventdata reserved - to be defined in a future version of MATLAB 0454 % handles structure with handles and user data (see GUIDATA) 0455 0456 % Hints: get(hObject,'String') returns contents of edit_carte3_5 as text 0457 % str2double(get(hObject,'String')) returns contents of edit_carte3_5 as a double 0458 0459 setdelay(hObject, handles); 0460 0461 % --- Executes during object creation, after setting all properties. 0462 function edit_carte3_5_CreateFcn(hObject, eventdata, handles) 0463 % hObject handle to edit_carte3_5 (see GCBO) 0464 % eventdata reserved - to be defined in a future version of MATLAB 0465 % handles empty - handles not created until after all CreateFcns called 0466 0467 % Hint: edit controls usually have a white background on Windows. 0468 % See ISPC and COMPUTER. 0469 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0470 set(hObject,'BackgroundColor','white'); 0471 end 0472 0473 0474 0475 function edit_carte3_4_Callback(hObject, eventdata, handles) 0476 % hObject handle to edit_carte3_4 (see GCBO) 0477 % eventdata reserved - to be defined in a future version of MATLAB 0478 % handles structure with handles and user data (see GUIDATA) 0479 0480 % Hints: get(hObject,'String') returns contents of edit_carte3_4 as text 0481 % str2double(get(hObject,'String')) returns contents of edit_carte3_4 as a double 0482 0483 setdelay(hObject, handles); 0484 0485 % --- Executes during object creation, after setting all properties. 0486 function edit_carte3_4_CreateFcn(hObject, eventdata, handles) 0487 % hObject handle to edit_carte3_4 (see GCBO) 0488 % eventdata reserved - to be defined in a future version of MATLAB 0489 % handles empty - handles not created until after all CreateFcns called 0490 0491 % Hint: edit controls usually have a white background on Windows. 0492 % See ISPC and COMPUTER. 0493 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0494 set(hObject,'BackgroundColor','white'); 0495 end 0496 0497 0498 0499 function edit_carte3_3_Callback(hObject, eventdata, handles) 0500 % hObject handle to edit_carte3_3 (see GCBO) 0501 % eventdata reserved - to be defined in a future version of MATLAB 0502 % handles structure with handles and user data (see GUIDATA) 0503 0504 % Hints: get(hObject,'String') returns contents of edit_carte3_3 as text 0505 % str2double(get(hObject,'String')) returns contents of edit_carte3_3 as a double 0506 0507 setdelay(hObject, handles); 0508 0509 % --- Executes during object creation, after setting all properties. 0510 function edit_carte3_3_CreateFcn(hObject, eventdata, handles) 0511 % hObject handle to edit_carte3_3 (see GCBO) 0512 % eventdata reserved - to be defined in a future version of MATLAB 0513 % handles empty - handles not created until after all CreateFcns called 0514 0515 % Hint: edit controls usually have a white background on Windows. 0516 % See ISPC and COMPUTER. 0517 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0518 set(hObject,'BackgroundColor','white'); 0519 end 0520 0521 0522 0523 function edit_carte3_2_Callback(hObject, eventdata, handles) 0524 % hObject handle to edit_carte3_2 (see GCBO) 0525 % eventdata reserved - to be defined in a future version of MATLAB 0526 % handles structure with handles and user data (see GUIDATA) 0527 0528 % Hints: get(hObject,'String') returns contents of edit_carte3_2 as text 0529 % str2double(get(hObject,'String')) returns contents of edit_carte3_2 as a double 0530 0531 setdelay(hObject, handles); 0532 0533 % --- Executes during object creation, after setting all properties. 0534 function edit_carte3_2_CreateFcn(hObject, eventdata, handles) 0535 % hObject handle to edit_carte3_2 (see GCBO) 0536 % eventdata reserved - to be defined in a future version of MATLAB 0537 % handles empty - handles not created until after all CreateFcns called 0538 0539 % Hint: edit controls usually have a white background on Windows. 0540 % See ISPC and COMPUTER. 0541 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0542 set(hObject,'BackgroundColor','white'); 0543 end 0544 0545 0546 0547 function edit_carte3_1_Callback(hObject, eventdata, handles) 0548 % hObject handle to edit_carte3_1 (see GCBO) 0549 % eventdata reserved - to be defined in a future version of MATLAB 0550 % handles structure with handles and user data (see GUIDATA) 0551 0552 % Hints: get(hObject,'String') returns contents of edit_carte3_1 as text 0553 % str2double(get(hObject,'String')) returns contents of edit_carte3_1 as a double 0554 setdelay(hObject, handles); 0555 0556 0557 % --- Executes during object creation, after setting all properties. 0558 function edit_carte3_1_CreateFcn(hObject, eventdata, handles) 0559 % hObject handle to edit_carte3_1 (see GCBO) 0560 % eventdata reserved - to be defined in a future version of MATLAB 0561 % handles empty - handles not created until after all CreateFcns called 0562 0563 % Hint: edit controls usually have a white background on Windows. 0564 % See ISPC and COMPUTER. 0565 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0566 set(hObject,'BackgroundColor','white'); 0567 end 0568 0569 0570 function edit_carte3_0_Callback(hObject, eventdata, handles) 0571 % hObject handle to edit_carte3_0 (see GCBO) 0572 % eventdata reserved - to be defined in a future version of MATLAB 0573 % handles structure with handles and user data (see GUIDATA) 0574 0575 % Hints: get(hObject,'String') returns contents of edit_carte3_0 as text 0576 % str2double(get(hObject,'String')) returns contents of edit_carte3_0 as a double 0577 0578 setdelay(hObject, handles); 0579 0580 % --- Executes during object creation, after setting all properties. 0581 function edit_carte3_0_CreateFcn(hObject, eventdata, handles) 0582 % hObject handle to edit_carte3_0 (see GCBO) 0583 % eventdata reserved - to be defined in a future version of MATLAB 0584 % handles empty - handles not created until after all CreateFcns called 0585 0586 % Hint: edit controls usually have a white background on Windows. 0587 % See ISPC and COMPUTER. 0588 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0589 set(hObject,'BackgroundColor','white'); 0590 end 0591 0592 0593 0594 function edit_carte3_7_Callback(hObject, eventdata, handles) 0595 % hObject handle to edit_carte3_7 (see GCBO) 0596 % eventdata reserved - to be defined in a future version of MATLAB 0597 % handles structure with handles and user data (see GUIDATA) 0598 0599 % Hints: get(hObject,'String') returns contents of edit_carte3_7 as text 0600 % str2double(get(hObject,'String')) returns contents of edit_carte3_7 as a double 0601 0602 setdelay(hObject, handles); 0603 0604 % --- Executes during object creation, after setting all properties. 0605 function edit_carte3_7_CreateFcn(hObject, eventdata, handles) 0606 % hObject handle to edit_carte3_7 (see GCBO) 0607 % eventdata reserved - to be defined in a future version of MATLAB 0608 % handles empty - handles not created until after all CreateFcns called 0609 0610 % Hint: edit controls usually have a white background on Windows. 0611 % See ISPC and COMPUTER. 0612 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0613 set(hObject,'BackgroundColor','white'); 0614 end 0615 0616 0617 0618 function edit_carte3_6_Callback(hObject, eventdata, handles) 0619 % hObject handle to edit_carte3_6 (see GCBO) 0620 % eventdata reserved - to be defined in a future version of MATLAB 0621 % handles structure with handles and user data (see GUIDATA) 0622 0623 % Hints: get(hObject,'String') returns contents of edit_carte3_6 as text 0624 % str2double(get(hObject,'String')) returns contents of edit_carte3_6 as a double 0625 0626 0627 % --- Executes during object creation, after setting all properties. 0628 function edit_carte3_6_CreateFcn(hObject, eventdata, handles) 0629 % hObject handle to edit_carte3_6 (see GCBO) 0630 % eventdata reserved - to be defined in a future version of MATLAB 0631 % handles empty - handles not created until after all CreateFcns called 0632 0633 % Hint: edit controls usually have a white background on Windows. 0634 % See ISPC and COMPUTER. 0635 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0636 set(hObject,'BackgroundColor','white'); 0637 end 0638 0639 0640 % --- Executes on button press in pushbutton_acquisition. 0641 function pushbutton_acquisition_Callback(hObject, eventdata, handles) 0642 % hObject handle to pushbutton_acquisition (see GCBO) 0643 % eventdata reserved - to be defined in a future version of MATLAB 0644 % handles structure with handles and user data (see GUIDATA) 0645 0646 % Reads all delays for card #1, 2 0647 handles.delayvalue1 = readattribute(handles.delayname1); 0648 handles.delayvalue2 = readattribute(handles.delayname2); 0649 handles.delayvalue3 = readattribute(handles.delayname3); 0650 handles.enablevalue1 = readattribute(handles.enablename1); 0651 handles.enablevalue2 = readattribute(handles.enablename2); 0652 handles.enablevalue3 = readattribute(handles.enablename3); 0653 handles.enablevalue4 = readattribute(handles.enablename4); 0654 % Reads all division for card #4 0655 handles.divisionvalue4 = readattribute(handles.divisionname4); 0656 0657 % Update handles structure 0658 guidata(hObject, handles); 0659 0660 nb = length(handles.delayvalue1); 0661 0662 % update display for Card1 0663 for k = 1:nb, 0664 set(handles.(['edit_carte1_' num2str(k-1)]),'String',num2str(handles.delayvalue1(k),7)); 0665 set(handles.(['checkbox_carte1_' num2str(k-1)]),'Value',handles.enablevalue1(k)); 0666 end 0667 0668 % update display for Card2 0669 for k = 1:nb, 0670 set(handles.(['edit_carte2_' num2str(k-1)]),'String',num2str(handles.delayvalue2(k),7)); 0671 set(handles.(['checkbox_carte2_' num2str(k-1)]),'Value',handles.enablevalue2(k)); 0672 end 0673 0674 % update display for Card3 0675 for k = 1:nb, 0676 set(handles.(['edit_carte3_' num2str(k-1)]),'String',num2str(handles.delayvalue3(k),7)); 0677 set(handles.(['checkbox_carte3_' num2str(k-1)]),'Value',handles.enablevalue3(k)); 0678 end 0679 0680 % update display for Card4 0681 for k = 1:1, 0682 set(handles.(['edit_div']),'String',num2str(handles.divisionvalue4(k),7)); 0683 set(handles.(['checkbox_div']),'Value',handles.enablevalue4(k)); 0684 end 0685 0686 0687 0688 % get state of the 3 counter cards 0689 set(handles.checkbox_status1,'String',tango_command_inout2(handles.device_carte1,'State')) 0690 set(handles.checkbox_status2,'String',tango_command_inout2(handles.device_carte2,'State')) 0691 set(handles.checkbox_status3,'String',tango_command_inout2(handles.device_carte3,'State')) 0692 set(handles.checkbox_status4,'String',tango_command_inout2(handles.device_carte4,'State')) 0693 0694 0695 % -------------------------------------------------------------------- 0696 function Untitled_1_Callback(hObject, eventdata, handles) 0697 % hObject handle to Untitled_1 (see GCBO) 0698 % eventdata reserved - to be defined in a future version of MATLAB 0699 % handles structure with handles and user data (see GUIDATA) 0700 0701 0702 0703 function edit_carte1_6_Callback(hObject, eventdata, handles) 0704 % hObject handle to edit_carte1_6 (see GCBO) 0705 % eventdata reserved - to be defined in a future version of MATLAB 0706 % handles structure with handles and user data (see GUIDATA) 0707 0708 % Hints: get(hObject,'String') returns contents of edit_carte1_6 as text 0709 % str2double(get(hObject,'String')) returns contents of edit_carte1_6 as a double 0710 0711 0712 % --- Executes during object creation, after setting all properties. 0713 function edit_carte1_6_CreateFcn(hObject, eventdata, handles) 0714 % hObject handle to edit_carte1_6 (see GCBO) 0715 % eventdata reserved - to be defined in a future version of MATLAB 0716 % handles empty - handles not created until after all CreateFcns called 0717 0718 % Hint: edit controls usually have a white background on Windows. 0719 % See ISPC and COMPUTER. 0720 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0721 set(hObject,'BackgroundColor','white'); 0722 end 0723 0724 0725 0726 function edit_carte1_7_Callback(hObject, eventdata, handles) 0727 % hObject handle to edit_carte1_7 (see GCBO) 0728 % eventdata reserved - to be defined in a future version of MATLAB 0729 % handles structure with handles and user data (see GUIDATA) 0730 0731 % Hints: get(hObject,'String') returns contents of edit_carte1_7 as text 0732 % str2double(get(hObject,'String')) returns contents of edit_carte1_7 as a double 0733 0734 setdelay(hObject, handles); 0735 0736 % --- Executes during object creation, after setting all properties. 0737 function edit_carte1_7_CreateFcn(hObject, eventdata, handles) 0738 % hObject handle to edit_carte1_7 (see GCBO) 0739 % eventdata reserved - to be defined in a future version of MATLAB 0740 % handles empty - handles not created until after all CreateFcns called 0741 0742 % Hint: edit controls usually have a white background on Windows. 0743 % See ISPC and COMPUTER. 0744 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0745 set(hObject,'BackgroundColor','white'); 0746 end 0747 0748 0749 % --- Executes on button press in checkbox_carte1_0. 0750 function checkbox_carte1_0_Callback(hObject, eventdata, handles) 0751 % hObject handle to checkbox_carte1_0 (see GCBO) 0752 % eventdata reserved - to be defined in a future version of MATLAB 0753 % handles structure with handles and user data (see GUIDATA) 0754 0755 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_0 0756 0757 setoutput(hObject, handles) 0758 0759 % --- Executes on button press in checkbox_carte1_2. 0760 function checkbox_carte1_2_Callback(hObject, eventdata, handles) 0761 % hObject handle to checkbox_carte1_2 (see GCBO) 0762 % eventdata reserved - to be defined in a future version of MATLAB 0763 % handles structure with handles and user data (see GUIDATA) 0764 0765 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_2 0766 0767 setoutput(hObject, handles) 0768 0769 % --- Executes on button press in checkbox_carte1_3. 0770 function checkbox_carte1_3_Callback(hObject, eventdata, handles) 0771 % hObject handle to checkbox_carte1_3 (see GCBO) 0772 % eventdata reserved - to be defined in a future version of MATLAB 0773 % handles structure with handles and user data (see GUIDATA) 0774 0775 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_3 0776 0777 setoutput(hObject, handles) 0778 0779 % --- Executes on button press in checkbox_carte1_4. 0780 function checkbox_carte1_4_Callback(hObject, eventdata, handles) 0781 % hObject handle to checkbox_carte1_4 (see GCBO) 0782 % eventdata reserved - to be defined in a future version of MATLAB 0783 % handles structure with handles and user data (see GUIDATA) 0784 0785 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_4 0786 0787 setoutput(hObject, handles) 0788 0789 % --- Executes on button press in checkbox_carte1_5. 0790 function checkbox_carte1_5_Callback(hObject, eventdata, handles) 0791 % hObject handle to checkbox_carte1_5 (see GCBO) 0792 % eventdata reserved - to be defined in a future version of MATLAB 0793 % handles structure with handles and user data (see GUIDATA) 0794 0795 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_5 0796 0797 setoutput(hObject, handles) 0798 0799 % --- Executes on button press in checkbox_carte1_6. 0800 function checkbox_carte1_6_Callback(hObject, eventdata, handles) 0801 % hObject handle to checkbox_carte1_6 (see GCBO) 0802 % eventdata reserved - to be defined in a future version of MATLAB 0803 % handles structure with handles and user data (see GUIDATA) 0804 0805 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_6 0806 0807 setoutput(hObject, handles) 0808 0809 % --- Executes on button press in checkbox_carte1_7. 0810 function checkbox_carte1_7_Callback(hObject, eventdata, handles) 0811 % hObject handle to checkbox_carte1_7 (see GCBO) 0812 % eventdata reserved - to be defined in a future version of MATLAB 0813 % handles structure with handles and user data (see GUIDATA) 0814 0815 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_7 0816 0817 setoutput(hObject, handles) 0818 0819 % --- Executes on button press in checkbox_carte1_1. 0820 function checkbox_carte1_1_Callback(hObject, eventdata, handles) 0821 % hObject handle to checkbox_carte1_1 (see GCBO) 0822 % eventdata reserved - to be defined in a future version of MATLAB 0823 % handles structure with handles and user data (see GUIDATA) 0824 0825 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte1_1 0826 0827 setoutput(hObject, handles) 0828 0829 % --- Executes on button press in checkbox_carte2_0. 0830 function checkbox_carte2_0_Callback(hObject, eventdata, handles) 0831 % hObject handle to checkbox_carte2_0 (see GCBO) 0832 % eventdata reserved - to be defined in a future version of MATLAB 0833 % handles structure with handles and user data (see GUIDATA) 0834 0835 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_0 0836 0837 setoutput(hObject, handles) 0838 0839 % --- Executes on button press in checkbox_carte2_2. 0840 function checkbox_carte2_2_Callback(hObject, eventdata, handles) 0841 % hObject handle to checkbox_carte2_2 (see GCBO) 0842 % eventdata reserved - to be defined in a future version of MATLAB 0843 % handles structure with handles and user data (see GUIDATA) 0844 0845 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_2 0846 0847 setoutput(hObject, handles) 0848 0849 % --- Executes on button press in checkbox_carte2_3. 0850 function checkbox_carte2_3_Callback(hObject, eventdata, handles) 0851 % hObject handle to checkbox_carte2_3 (see GCBO) 0852 % eventdata reserved - to be defined in a future version of MATLAB 0853 % handles structure with handles and user data (see GUIDATA) 0854 0855 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_3 0856 0857 setoutput(hObject, handles) 0858 0859 % --- Executes on button press in checkbox_carte2_4. 0860 function checkbox_carte2_4_Callback(hObject, eventdata, handles) 0861 % hObject handle to checkbox_carte2_4 (see GCBO) 0862 % eventdata reserved - to be defined in a future version of MATLAB 0863 % handles structure with handles and user data (see GUIDATA) 0864 0865 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_4 0866 0867 setoutput(hObject, handles) 0868 0869 % --- Executes on button press in checkbox_carte2_5. 0870 function checkbox_carte2_5_Callback(hObject, eventdata, handles) 0871 % hObject handle to checkbox_carte2_5 (see GCBO) 0872 % eventdata reserved - to be defined in a future version of MATLAB 0873 % handles structure with handles and user data (see GUIDATA) 0874 0875 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_5 0876 0877 setoutput(hObject, handles) 0878 0879 % --- Executes on button press in checkbox_carte2_6. 0880 function checkbox_carte2_6_Callback(hObject, eventdata, handles) 0881 % hObject handle to checkbox_carte2_6 (see GCBO) 0882 % eventdata reserved - to be defined in a future version of MATLAB 0883 % handles structure with handles and user data (see GUIDATA) 0884 0885 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_6 0886 0887 setoutput(hObject, handles) 0888 0889 % --- Executes on button press in checkbox_carte2_7. 0890 function checkbox_carte2_7_Callback(hObject, eventdata, handles) 0891 % hObject handle to checkbox_carte2_7 (see GCBO) 0892 % eventdata reserved - to be defined in a future version of MATLAB 0893 % handles structure with handles and user data (see GUIDATA) 0894 0895 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_7 0896 0897 setoutput(hObject, handles) 0898 0899 % --- Executes on button press in checkbox_carte2_1. 0900 function checkbox_carte2_1_Callback(hObject, eventdata, handles) 0901 % hObject handle to checkbox_carte2_1 (see GCBO) 0902 % eventdata reserved - to be defined in a future version of MATLAB 0903 % handles structure with handles and user data (see GUIDATA) 0904 0905 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte2_1 0906 0907 setoutput(hObject, handles) 0908 0909 0910 % --- Executes on button press in checkbox_carte3_0. 0911 function checkbox_carte3_0_Callback(hObject, eventdata, handles) 0912 % hObject handle to checkbox_carte3_0 (see GCBO) 0913 % eventdata reserved - to be defined in a future version of MATLAB 0914 % handles structure with handles and user data (see GUIDATA) 0915 0916 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_0 0917 0918 setoutput(hObject, handles) 0919 0920 0921 % --- Executes on button press in checkbox_carte3_2. 0922 function checkbox_carte3_2_Callback(hObject, eventdata, handles) 0923 % hObject handle to checkbox_carte3_2 (see GCBO) 0924 % eventdata reserved - to be defined in a future version of MATLAB 0925 % handles structure with handles and user data (see GUIDATA) 0926 0927 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_2 0928 0929 setoutput(hObject, handles) 0930 0931 0932 % --- Executes on button press in checkbox_carte3_3. 0933 function checkbox_carte3_3_Callback(hObject, eventdata, handles) 0934 % hObject handle to checkbox_carte3_3 (see GCBO) 0935 % eventdata reserved - to be defined in a future version of MATLAB 0936 % handles structure with handles and user data (see GUIDATA) 0937 0938 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_3 0939 0940 setoutput(hObject, handles) 0941 0942 0943 % --- Executes on button press in checkbox_carte3_4. 0944 function checkbox_carte3_4_Callback(hObject, eventdata, handles) 0945 % hObject handle to checkbox_carte3_4 (see GCBO) 0946 % eventdata reserved - to be defined in a future version of MATLAB 0947 % handles structure with handles and user data (see GUIDATA) 0948 0949 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_4 0950 0951 setoutput(hObject, handles) 0952 0953 0954 % --- Executes on button press in checkbox_carte3_5. 0955 function checkbox_carte3_5_Callback(hObject, eventdata, handles) 0956 % hObject handle to checkbox_carte3_5 (see GCBO) 0957 % eventdata reserved - to be defined in a future version of MATLAB 0958 % handles structure with handles and user data (see GUIDATA) 0959 0960 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_5 0961 0962 setoutput(hObject, handles) 0963 0964 0965 % --- Executes on button press in checkbox_carte3_6. 0966 function checkbox_carte3_6_Callback(hObject, eventdata, handles) 0967 % hObject handle to checkbox_carte3_6 (see GCBO) 0968 % eventdata reserved - to be defined in a future version of MATLAB 0969 % handles structure with handles and user data (see GUIDATA) 0970 0971 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_6 0972 0973 setoutput(hObject, handles) 0974 0975 % --- Executes on button press in checkbox_carte3_7. 0976 function checkbox_carte3_7_Callback(hObject, eventdata, handles) 0977 % hObject handle to checkbox_carte3_7 (see GCBO) 0978 % eventdata reserved - to be defined in a future version of MATLAB 0979 % handles structure with handles and user data (see GUIDATA) 0980 0981 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_7 0982 0983 setoutput(hObject, handles) 0984 0985 % --- Executes on button press in checkbox_carte3_1. 0986 function checkbox_carte3_1_Callback(hObject, eventdata, handles) 0987 % hObject handle to checkbox_carte3_1 (see GCBO) 0988 % eventdata reserved - to be defined in a future version of MATLAB 0989 % handles structure with handles and user data (see GUIDATA) 0990 0991 % Hint: get(hObject,'Value') returns toggle state of checkbox_carte3_1 0992 0993 setoutput(hObject, handles) 0994 0995 % Generic function to set delays 0996 function setdelay(hObject, handles) 0997 0998 val = str2double(get(hObject,'String')); 0999 tag = get(hObject,'Tag'); 1000 id = regexpi(tag,'carte'); 1001 1002 cardnum = tag(id+5); 1003 outputnum = str2double(tag(id+7)); 1004 1005 writeattribute(handles.(['delayname' cardnum])(outputnum+1,:),val); 1006 1007 % Generic function to enable/disable output 1008 function setoutput(hObject, handles) 1009 1010 val = get(hObject,'Value'); 1011 tag = get(hObject,'Tag'); 1012 id = regexpi(tag,'carte'); 1013 1014 cardnum = tag(id+5); 1015 outputnum = str2double(tag(id+7)); 1016 1017 writeattribute(handles.(['enablename' cardnum])(outputnum+1,:),uint8(val)); 1018 1019 % -------------------------------------------------------------------- 1020 function menu_save_Callback(hObject, eventdata, handles) 1021 % hObject handle to menu_save (see GCBO) 1022 % eventdata reserved - to be defined in a future version of MATLAB 1023 % handles structure with handles and user data (see GUIDATA) 1024 1025 delayvalue1 = readattribute(handles.delayname1); 1026 delayvalue2 = readattribute(handles.delayname2); 1027 delayvalue3 = readattribute(handles.delayname3); 1028 enablevalue1 = readattribute(handles.enablename1); 1029 enablevalue2 = readattribute(handles.enablename2); 1030 enablevalue3 = readattribute(handles.enablename3); 1031 1032 FileName = 'synchro'; 1033 DirectoryName = getfamilydata('Directory','Timing'); 1034 FileName = appendtimestamp(FileName, clock); 1035 [FileName, DirectoryName] = uiputfile('*.mat','Save Lattice to ...', [DirectoryName FileName]); 1036 if FileName == 0 1037 fprintf(' File not saved \n'); 1038 return; 1039 end 1040 1041 % Save all data in structure to file 1042 DirStart = pwd; 1043 [DirectoryName, DirectoryErrorFlag] = gotodirectory(DirectoryName); 1044 try 1045 save(FileName, 'delayvalue1', 'delayvalue2', 'delayvalue3',... 1046 'enablevalue1', 'enablevalue2', 'enablevalue3'); 1047 catch 1048 cd(DirStart); 1049 return 1050 end 1051 cd(DirStart); 1052 1053 % -------------------------------------------------------------------- 1054 function menu_load_Callback(hObject, eventdata, handles) 1055 % hObject handle to menu_load (see GCBO) 1056 % eventdata reserved - to be defined in a future version of MATLAB 1057 % handles structure with handles and user data (see GUIDATA) 1058 1059 DirSpec = getfamilydata('Directory','Timing'); %default to Configuration data directory 1060 FileName = []; %no default file 1061 [FileName, DirSpec,FilterIndex]=uigetfile('*.mat','Select Configuration File',[DirSpec FileName]); 1062 FileSpec=[DirSpec FileName]; 1063 1064 try 1065 cnf=load([DirSpec FileName]); %load configuration from archive 1066 catch 1067 return 1068 end 1069 1070 writeattribute(handles.delayname1, cnf.delayvalue1); 1071 writeattribute(handles.delayname2, cnf.delayvalue2); 1072 writeattribute(handles.delayname3, cnf.delayvalue3); 1073 writeattribute(handles.enablename1, cnf.enablevalue1, 'uint8'); 1074 writeattribute(handles.enablename2, cnf.enablevalue2, 'uint8'); 1075 writeattribute(handles.enablename3, cnf.enablevalue3, 'uint8'); 1076 1077 %refresh data in GUI 1078 pushbutton_acquisition_Callback(handles.pushbutton_acquisition,eventdata,handles); 1079 1080 1081 % --- Executes on button press in pushbutton_start. 1082 function pushbutton_start_Callback(hObject, eventdata, handles) 1083 % hObject handle to pushbutton_start (see GCBO) 1084 % eventdata reserved - to be defined in a future version of MATLAB 1085 % handles structure with handles and user data (see GUIDATA) 1086 1087 if get(handles.checkbox_status1,'Value') == 1 1088 tango_command_inout2(handles.device_carte1,'Start'); 1089 end 1090 1091 if get(handles.checkbox_status2,'Value') == 1 1092 tango_command_inout2(handles.device_carte2,'Start'); 1093 end 1094 1095 if get(handles.checkbox_status3,'Value') == 1 1096 tango_command_inout2(handles.device_carte3,'Start'); 1097 end 1098 1099 if get(handles.checkbox_status4,'Value') == 1 1100 tango_command_inout2(handles.device_carte4,'Start'); 1101 end 1102 1103 pushbutton_acquisition_Callback(handles.pushbutton_acquisition, eventdata, handles) 1104 1105 % --- Executes on button press in pushbutton_stop. 1106 function pushbutton_stop_Callback(hObject, eventdata, handles) 1107 % hObject handle to pushbutton_stop (see GCBO) 1108 % eventdata reserved - to be defined in a future version of MATLAB 1109 % handles structure with handles and user data (see GUIDATA) 1110 1111 if get(handles.checkbox_status1,'Value') == 1 1112 tango_command_inout2(handles.device_carte1,'Stop'); 1113 end 1114 1115 if get(handles.checkbox_status2,'Value') == 1 1116 tango_command_inout2(handles.device_carte2,'Stop'); 1117 end 1118 1119 if get(handles.checkbox_status3,'Value') == 1 1120 tango_command_inout2(handles.device_carte3,'Stop'); 1121 end 1122 1123 if get(handles.checkbox_status4,'Value') == 1 1124 tango_command_inout2(handles.device_carte4,'Stop'); 1125 end 1126 1127 pushbutton_acquisition_Callback(handles.pushbutton_acquisition, eventdata, handles) 1128 1129 % --- Executes on button press in checkbox_status1. 1130 function checkbox_status1_Callback(hObject, eventdata, handles) 1131 % hObject handle to checkbox_status1 (see GCBO) 1132 % eventdata reserved - to be defined in a future version of MATLAB 1133 % handles structure with handles and user data (see GUIDATA) 1134 1135 % Hint: get(hObject,'Value') returns toggle state of checkbox_status1 1136 1137 1138 % --- Executes on button press in checkbox_status2. 1139 function checkbox_status2_Callback(hObject, eventdata, handles) 1140 % hObject handle to checkbox_status2 (see GCBO) 1141 % eventdata reserved - to be defined in a future version of MATLAB 1142 % handles structure with handles and user data (see GUIDATA) 1143 1144 % Hint: get(hObject,'Value') returns toggle state of checkbox_status2 1145 1146 1147 % --- Executes on button press in checkbox_status3. 1148 function checkbox_status3_Callback(hObject, eventdata, handles) 1149 % hObject handle to checkbox_status3 (see GCBO) 1150 % eventdata reserved - to be defined in a future version of MATLAB 1151 % handles structure with handles and user data (see GUIDATA) 1152 1153 % Hint: get(hObject,'Value') returns toggle state of checkbox_status3 1154 1155 1156 % --- Executes on button press in pushbutton_reset. 1157 function pushbutton_reset_Callback(hObject, eventdata, handles) 1158 % hObject handle to pushbutton_reset (see GCBO) 1159 % eventdata reserved - to be defined in a future version of MATLAB 1160 % handles structure with handles and user data (see GUIDATA) 1161 1162 cmd = 'Init'; 1163 1164 if get(handles.checkbox_status1,'Value') == 1 1165 tango_command_inout2(handles.device_carte1,cmd); 1166 end 1167 1168 if get(handles.checkbox_status2,'Value') == 1 1169 tango_command_inout2(handles.device_carte2,cmd); 1170 end 1171 1172 if get(handles.checkbox_status3,'Value') == 1 1173 tango_command_inout2(handles.device_carte3,cmd); 1174 end 1175 1176 if get(handles.checkbox_status4,'Value') == 1 1177 tango_command_inout2(handles.device_carte4,cmd); 1178 end 1179 1180 pushbutton_acquisition_Callback(handles.pushbutton_acquisition, eventdata, handles) 1181 1182 1183 1184 function edit_div_Callback(hObject, eventdata, handles) 1185 % hObject handle to edit_div (see GCBO) 1186 % eventdata reserved - to be defined in a future version of MATLAB 1187 % handles structure with handles and user data (see GUIDATA) 1188 1189 % Hints: get(hObject,'String') returns contents of edit_div as text 1190 % str2double(get(hObject,'String')) returns contents of edit_div as a double 1191 1192 val = int32(str2double(get(hObject,'String'))); 1193 if val < 4 1194 warndlg('Not applied: minimum is 4') 1195 else 1196 tango_write_attribute2(handles.device_carte4,['divisionCounter' num2str(0)],val); 1197 end 1198 1199 % --- Executes during object creation, after setting all properties. 1200 function edit_div_CreateFcn(hObject, eventdata, handles) 1201 % hObject handle to edit_div (see GCBO) 1202 % eventdata reserved - to be defined in a future version of MATLAB 1203 % handles empty - handles not created until after all CreateFcns called 1204 1205 % Hint: edit controls usually have a white background on Windows. 1206 % See ISPC and COMPUTER. 1207 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 1208 set(hObject,'BackgroundColor','white'); 1209 end 1210 1211 1212 % --- Executes on button press in checkbox_div. 1213 function checkbox_div_Callback(hObject, eventdata, handles) 1214 % hObject handle to checkbox_div (see GCBO) 1215 % eventdata reserved - to be defined in a future version of MATLAB 1216 % handles structure with handles and user data (see GUIDATA) 1217 1218 % Hint: get(hObject,'Value') returns toggle state of checkbox_div 1219 1220 val = uint8(get(hObject,'Value')); 1221 tango_write_attribute2(handles.device_carte4,['counter' num2str(0) 'Enable'],val); 1222 1223 1224 % --- Executes on button press in checkbox_status4. 1225 function checkbox_status4_Callback(hObject, eventdata, handles) 1226 % hObject handle to checkbox_status4 (see GCBO) 1227 % eventdata reserved - to be defined in a future version of MATLAB 1228 % handles structure with handles and user data (see GUIDATA) 1229 1230 % Hint: get(hObject,'Value') returns toggle state of checkbox_status4 1231 1232