Home > machine > Soleil > common > synchro > synchro_injecteur5.m

synchro_injecteur5

PURPOSE ^

SYNCHRO_INJECTEUR5 M-file for synchro_injecteur5.fig

SYNOPSIS ^

function varargout = synchro_injecteur5(varargin)

DESCRIPTION ^

 SYNCHRO_INJECTEUR5 M-file for synchro_injecteur5.fig
      SYNCHRO_INJECTEUR5, by itself, creates a new SYNCHRO_INJECTEUR5 or raises the existing
      singleton*.

      H = SYNCHRO_INJECTEUR5 returns the handle to a new SYNCHRO_INJECTEUR5 or the handle to
      the existing singleton*.

      SYNCHRO_INJECTEUR5('CALLBACK',hObject,eventData,handles,...) calls the local
      function named CALLBACK in SYNCHRO_INJECTEUR5.M with the given input arguments.

      SYNCHRO_INJECTEUR5('Property','Value',...) creates a new SYNCHRO_INJECTEUR5 or raises the
      existing singleton*.  Starting from the left, property value pairs are
      applied to the GUI before synchro_injecteur5_OpeningFunction gets called.  An
      unrecognized property name or invalid value makes property application
      stop.  All inputs are passed to synchro_injecteur5_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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function varargout = synchro_injecteur5(varargin)
0002 % SYNCHRO_INJECTEUR5 M-file for synchro_injecteur5.fig
0003 %      SYNCHRO_INJECTEUR5, by itself, creates a new SYNCHRO_INJECTEUR5 or raises the existing
0004 %      singleton*.
0005 %
0006 %      H = SYNCHRO_INJECTEUR5 returns the handle to a new SYNCHRO_INJECTEUR5 or the handle to
0007 %      the existing singleton*.
0008 %
0009 %      SYNCHRO_INJECTEUR5('CALLBACK',hObject,eventData,handles,...) calls the local
0010 %      function named CALLBACK in SYNCHRO_INJECTEUR5.M with the given input arguments.
0011 %
0012 %      SYNCHRO_INJECTEUR5('Property','Value',...) creates a new SYNCHRO_INJECTEUR5 or raises the
0013 %      existing singleton*.  Starting from the left, property value pairs are
0014 %      applied to the GUI before synchro_injecteur5_OpeningFunction gets called.  An
0015 %      unrecognized property name or invalid value makes property application
0016 %      stop.  All inputs are passed to synchro_injecteur5_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 % Edit the above text to modify the response to help synchro_injecteur5
0024 
0025 % Last Modified by GUIDE v2.5 14-Oct-2006 21:06:26
0026 
0027 % Begin initialization code - DO NOT EDIT
0028 gui_Singleton = 1;
0029 gui_State = struct('gui_Name',       mfilename, ...
0030                    'gui_Singleton',  gui_Singleton, ...
0031                    'gui_OpeningFcn', @synchro_injecteur5_OpeningFcn, ...
0032                    'gui_OutputFcn',  @synchro_injecteur5_OutputFcn, ...
0033                    'gui_LayoutFcn',  [] , ...
0034                    'gui_Callback',   []);
0035 if nargin && ischar(varargin{1})
0036     gui_State.gui_Callback = str2func(varargin{1});
0037 end
0038 
0039 if nargout
0040     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0041 else
0042     gui_mainfcn(gui_State, varargin{:});
0043 end
0044 % End initialization code - DO NOT EDIT
0045 
0046 
0047 % --- Executes just before synchro_injecteur5 is made visible.
0048 function synchro_injecteur5_OpeningFcn(hObject, eventdata, handles, varargin)
0049 % This function has no output args, see OutputFcn.
0050 % hObject    handle to figure
0051 % eventdata  reserved - to be defined in a future version of MATLAB
0052 % handles    structure with handles and user data (see GUIDATA)
0053 % varargin   command line arguments to synchro_injecteur5 (see VARARGIN)
0054 
0055 % Choose default command line output for synchro_injecteur5
0056 handles.output = hObject;
0057 load('synchro_offset', 'inj_offset' , 'ext_offset');
0058 set(handles.inj_offset,'String',num2str(inj_offset));
0059 set(handles.ext_offset,'String',num2str(ext_offset));
0060 
0061 % periode du trigger par defaut = 4/3
0062 handles.periode = 10;
0063 set(handles.periode_edit,'String',num2str(handles.periode));
0064 set(handles.edit_Nshot_soft,'String',num2str(1));
0065 set(handles.edit_laps,'String',1.0);
0066 
0067 %Mode
0068 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcStepDelay');
0069 clk1=temp.value(1);
0070 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay');
0071 clk2=temp.value(1);
0072 jump=int32([0 39 26 13]);
0073 handles.clk_pc  =jump +  int32(clk1);
0074 handles.clk_soft=jump  + int32(clk2);
0075 handles.quart=1;
0076 
0077 handles.mode = 'Mode=???';
0078 set(handles.edit_filling_relecture_tables,'Enable','off');
0079 set(handles.edit_filling_relecture_bunch,'Enable','off');
0080 
0081 set(handles.panel_bpm,'Visible','off');
0082 
0083 % Creates timer Infinite loop
0084 timer1=timer('StartDelay',1,...
0085     'ExecutionMode','fixedRate','Period',handles.periode,'TasksToExecute',Inf);
0086 timer1.TimerFcn = {@fonction_alex, hObject,eventdata, handles};
0087 setappdata(handles.figure1,'Timer',timer1);
0088 
0089 % button group sur on/off timer du trigger
0090 h = uibuttongroup('visible','off','Position',[0.1485 0.29 0.10 0.12],...
0091     'Title','','TitlePosition','centertop',...
0092     'BackgroundColor',[1 0.3 0 ]);
0093 u1 = uicontrol('Style','Radio','String','OFF','Tag','radiobutton1',...
0094     'pos',[45 20 40 25],'parent',h,'HandleVisibility','off',...
0095     'BackgroundColor',[1 0.3 0  ]);
0096 u2 = uicontrol('Style','Radio','String','ON','Tag','radiobutton2',...
0097     'pos',[45 50 40 25],'parent',h,'HandleVisibility','off',...
0098     'BackgroundColor',[1 0.3 0 ]);
0099 set(h,'SelectionChangeFcn',...
0100     {@uibuttongroup_SelectionChangeFcn,handles});
0101 
0102 handles.off = u1;
0103 handles.on = u2;
0104 
0105 set(h,'SelectedObject',u1); 
0106 set(h,'Visible','on');
0107 
0108 %% Set closing gui function
0109 set(handles.figure1,'CloseRequestFcn',{@Closinggui,timer1,handles.figure1});
0110 
0111 
0112 
0113 % Update handles structure
0114 guidata(hObject, handles);
0115 
0116 % UIWAIT makes synchro_injecteur5 wait for user response (see UIRESUME)
0117 % uiwait(handles.figure1);
0118 
0119 
0120 % --- Outputs from this function are returned to the command line.
0121 function varargout = synchro_injecteur5_OutputFcn(hObject, eventdata, handles) 
0122 % varargout  cell array for returning output args (see VARARGOUT);
0123 % hObject    handle to figure
0124 % eventdata  reserved - to be defined in a future version of MATLAB
0125 % handles    structure with handles and user data (see GUIDATA)
0126 
0127 % Get default command line output from handles structure
0128 varargout{1} = handles.output;
0129 
0130 
0131 
0132 function alim_dipole_Callback(hObject, eventdata, handles)
0133 % hObject    handle to alim_dipole (see GCBO)
0134 % eventdata  reserved - to be defined in a future version of MATLAB
0135 % handles    structure with handles and user data (see GUIDATA)
0136 
0137 % Hints: get(hObject,'String') returns contents of alim_dipole as text
0138 %        str2double(get(hObject,'String')) returns contents of alim_dipole as a double
0139 h=gcf
0140 delay=str2double(get(hObject,'String'));
0141 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTimeDelay',delay);
0142 
0143 % --- Executes during object creation, after setting all properties.
0144 function alim_dipole_CreateFcn(hObject, eventdata, handles)
0145 % hObject    handle to alim_dipole (see GCBO)
0146 % eventdata  reserved - to be defined in a future version of MATLAB
0147 % handles    empty - handles not created until after all CreateFcns called
0148 
0149 % Hint: edit controls usually have a white background on Windows.
0150 %       See ISPC and COMPUTER.
0151 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0152     set(hObject,'BackgroundColor','white');
0153 end
0154 
0155 
0156 function alim_qf_Callback(hObject, eventdata, handles)
0157 % hObject    handle to alim_qf (see GCBO)
0158 % eventdata  reserved - to be defined in a future version of MATLAB
0159 % handles    structure with handles and user data (see GUIDATA)
0160 
0161 % Hints: get(hObject,'String') returns contents of alim_qf as text
0162 %        str2double(get(hObject,'String')) returns contents of alim_qf as a double
0163 
0164 delay=str2double(get(hObject,'String'));
0165 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTimeDelay',delay);
0166 
0167 % --- Executes during object creation, after setting all properties.
0168 function alim_qf_CreateFcn(hObject, eventdata, handles)
0169 % hObject    handle to alim_qf (see GCBO)
0170 % eventdata  reserved - to be defined in a future version of MATLAB
0171 % handles    empty - handles not created until after all CreateFcns called
0172 
0173 % Hint: edit controls usually have a white background on Windows.
0174 %       See ISPC and COMPUTER.
0175 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0176     set(hObject,'BackgroundColor','white');
0177 end
0178 
0179 
0180 
0181 function alim_qd_Callback(hObject, eventdata, handles)
0182 % hObject    handle to alim_qd (see GCBO)
0183 % eventdata  reserved - to be defined in a future version of MATLAB
0184 % handles    structure with handles and user data (see GUIDATA)
0185 
0186 % Hints: get(hObject,'String') returns contents of alim_qd as text
0187 %        str2double(get(hObject,'String')) returns contents of alim_qd as a double
0188 get(hObject,'Tag')
0189 delay=str2double(get(hObject,'String'));
0190 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTimeDelay',delay);
0191 
0192 % --- Executes during object creation, after setting all properties.
0193 function alim_qd_CreateFcn(hObject, eventdata, handles)
0194 % hObject    handle to alim_qd (see GCBO)
0195 % eventdata  reserved - to be defined in a future version of MATLAB
0196 % handles    empty - handles not created until after all CreateFcns called
0197 
0198 % Hint: edit controls usually have a white background on Windows.
0199 %       See ISPC and COMPUTER.
0200 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0201     set(hObject,'BackgroundColor','white');
0202 end
0203 
0204 
0205 
0206 function alim_sf_Callback(hObject, eventdata, handles)
0207 % hObject    handle to alim_sf (see GCBO)
0208 % eventdata  reserved - to be defined in a future version of MATLAB
0209 % handles    structure with handles and user data (see GUIDATA)
0210 
0211 % Hints: get(hObject,'String') returns contents of alim_sf as text
0212 %        str2double(get(hObject,'String')) returns contents of alim_sf as a double
0213 
0214 delay=str2double(get(hObject,'String'));
0215 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTimeDelay',delay);
0216 
0217 % --- Executes during object creation, after setting all properties.
0218 function alim_sf_CreateFcn(hObject, eventdata, handles)
0219 % hObject    handle to alim_sf (see GCBO)
0220 % eventdata  reserved - to be defined in a future version of MATLAB
0221 % handles    empty - handles not created until after all CreateFcns called
0222 
0223 % Hint: edit controls usually have a white background on Windows.
0224 %       See ISPC and COMPUTER.
0225 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0226     set(hObject,'BackgroundColor','white');
0227 end
0228 
0229 
0230 
0231 function alim_sd_Callback(hObject, eventdata, handles)
0232 % hObject    handle to alim_sd (see GCBO)
0233 % eventdata  reserved - to be defined in a future version of MATLAB
0234 % handles    structure with handles and user data (see GUIDATA)
0235 
0236 % Hints: get(hObject,'String') returns contents of alim_sd as text
0237 %        str2double(get(hObject,'String')) returns contents of alim_sd as a double
0238 
0239 delay=str2double(get(hObject,'String'));
0240 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTimeDelay',delay);
0241 
0242 
0243 % --- Executes during object creation, after setting all properties.
0244 function alim_sd_CreateFcn(hObject, eventdata, handles)
0245 % hObject    handle to alim_sd (see GCBO)
0246 % eventdata  reserved - to be defined in a future version of MATLAB
0247 % handles    empty - handles not created until after all CreateFcns called
0248 
0249 % Hint: edit controls usually have a white background on Windows.
0250 %       See ISPC and COMPUTER.
0251 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0252     set(hObject,'BackgroundColor','white');
0253 end
0254 
0255 
0256 
0257 function boo_rf_Callback(hObject, eventdata, handles)
0258 % hObject    handle to boo_rf (see GCBO)
0259 % eventdata  reserved - to be defined in a future version of MATLAB
0260 % handles    structure with handles and user data (see GUIDATA)
0261 
0262 % Hints: get(hObject,'String') returns contents of boo_rf as text
0263 %        str2double(get(hObject,'String')) returns contents of boo_rf as a double
0264 
0265 delay=str2double(get(hObject,'String'));
0266 tango_write_attribute2('BOO/SY/LOCAL.RF.1', 'rfTimeDelay',delay);
0267 
0268 % --- Executes during object creation, after setting all properties.
0269 function boo_rf_CreateFcn(hObject, eventdata, handles)
0270 % hObject    handle to boo_rf (see GCBO)
0271 % eventdata  reserved - to be defined in a future version of MATLAB
0272 % handles    empty - handles not created until after all CreateFcns called
0273 
0274 % Hint: edit controls usually have a white background on Windows.
0275 %       See ISPC and COMPUTER.
0276 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0277     set(hObject,'BackgroundColor','white');
0278 end
0279 
0280 
0281 
0282 function lin_canon_Callback(hObject, eventdata, handles)
0283 % hObject    handle to lin_canon (see GCBO)
0284 % eventdata  reserved - to be defined in a future version of MATLAB
0285 % handles    structure with handles and user data (see GUIDATA)
0286 
0287 % Hints: get(hObject,'String') returns contents of lin_canon as text
0288 %        str2double(get(hObject,'String')) returns contents of lin_canon as a double
0289 inj_offset=str2double(get(handles.inj_offset,'String'));
0290 delay=str2double(get(hObject,'String'))+inj_offset;
0291 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay',delay);
0292 
0293 
0294 % --- Executes during object creation, after setting all properties.
0295 function lin_canon_CreateFcn(hObject, eventdata, handles)
0296 % hObject    handle to lin_canon (see GCBO)
0297 % eventdata  reserved - to be defined in a future version of MATLAB
0298 % handles    empty - handles not created until after all CreateFcns called
0299 
0300 % Hint: edit controls usually have a white background on Windows.
0301 %       See ISPC and COMPUTER.
0302 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0303     set(hObject,'BackgroundColor','white');
0304 end
0305 
0306 
0307 
0308 function lt1_emittance_Callback(hObject, eventdata, handles)
0309 % hObject    handle to lt1_emittance (see GCBO)
0310 % eventdata  reserved - to be defined in a future version of MATLAB
0311 % handles    structure with handles and user data (see GUIDATA)
0312 
0313 % Hints: get(hObject,'String') returns contents of lt1_emittance as text
0314 %        str2double(get(hObject,'String')) returns contents of lt1_emittance as a double
0315 inj_offset=str2double(get(handles.inj_offset,'String'));
0316 delay=str2double(get(hObject,'String'))+inj_offset;
0317 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
0318 
0319 % --- Executes during object creation, after setting all properties.
0320 function lt1_emittance_CreateFcn(hObject, eventdata, handles)
0321 % hObject    handle to lt1_emittance (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 lt1_MC1_Callback(hObject, eventdata, handles)
0334 % hObject    handle to lt1_MC1 (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 lt1_MC1 as text
0339 %        str2double(get(hObject,'String')) returns contents of lt1_MC1 as a double
0340 inj_offset=str2double(get(handles.inj_offset,'String'));
0341 delay=str2double(get(hObject,'String'))+inj_offset;
0342 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay',delay);
0343 
0344 % --- Executes during object creation, after setting all properties.
0345 function lt1_MC1_CreateFcn(hObject, eventdata, handles)
0346 % hObject    handle to lt1_MC1 (see GCBO)
0347 % eventdata  reserved - to be defined in a future version of MATLAB
0348 % handles    empty - handles not created until after all CreateFcns called
0349 
0350 % Hint: edit controls usually have a white background on Windows.
0351 %       See ISPC and COMPUTER.
0352 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0353     set(hObject,'BackgroundColor','white');
0354 end
0355 
0356 
0357 
0358 function lt1_MC2_Callback(hObject, eventdata, handles)
0359 % hObject    handle to lt1_MC2 (see GCBO)
0360 % eventdata  reserved - to be defined in a future version of MATLAB
0361 % handles    structure with handles and user data (see GUIDATA)
0362 
0363 % Hints: get(hObject,'String') returns contents of lt1_MC2 as text
0364 %        str2double(get(hObject,'String')) returns contents of lt1_MC2 as a double
0365 inj_offset=str2double(get(handles.inj_offset,'String'));
0366 delay=str2double(get(hObject,'String'))+inj_offset;
0367 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay',delay);
0368 
0369 % --- Executes during object creation, after setting all properties.
0370 function lt1_MC2_CreateFcn(hObject, eventdata, handles)
0371 % hObject    handle to lt1_MC2 (see GCBO)
0372 % eventdata  reserved - to be defined in a future version of MATLAB
0373 % handles    empty - handles not created until after all CreateFcns called
0374 
0375 % Hint: edit controls usually have a white background on Windows.
0376 %       See ISPC and COMPUTER.
0377 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0378     set(hObject,'BackgroundColor','white');
0379 end
0380 
0381 
0382 
0383 function lt1_osc_Callback(hObject, eventdata, handles)
0384 % hObject    handle to lt1_osc (see GCBO)
0385 % eventdata  reserved - to be defined in a future version of MATLAB
0386 % handles    structure with handles and user data (see GUIDATA)
0387 
0388 % Hints: get(hObject,'String') returns contents of lt1_osc as text
0389 %        str2double(get(hObject,'String')) returns contents of lt1_osc as a double
0390 inj_offset=str2double(get(handles.inj_offset,'String'));
0391 delay=str2double(get(hObject,'String'))+inj_offset;
0392 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay',delay);
0393 
0394 
0395 % --- Executes during object creation, after setting all properties.
0396 function lt1_osc_CreateFcn(hObject, eventdata, handles)
0397 % hObject    handle to lt1_osc (see GCBO)
0398 % eventdata  reserved - to be defined in a future version of MATLAB
0399 % handles    empty - handles not created until after all CreateFcns called
0400 
0401 % Hint: edit controls usually have a white background on Windows.
0402 %       See ISPC and COMPUTER.
0403 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0404     set(hObject,'BackgroundColor','white');
0405 end
0406 
0407 
0408 
0409 function sdc1_Callback(hObject, eventdata, handles)
0410 % hObject    handle to sdc1 (see GCBO)
0411 % eventdata  reserved - to be defined in a future version of MATLAB
0412 % handles    structure with handles and user data (see GUIDATA)
0413 
0414 % Hints: get(hObject,'String') returns contents of sdc1 as text
0415 %        str2double(get(hObject,'String')) returns contents of sdc1 as a double
0416 inj_offset=str2double(get(handles.inj_offset,'String'));
0417 delay=str2double(get(hObject,'String'))+inj_offset;
0418 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay',delay);
0419 
0420 % --- Executes during object creation, after setting all properties.
0421 function sdc1_CreateFcn(hObject, eventdata, handles)
0422 % hObject    handle to sdc1 (see GCBO)
0423 % eventdata  reserved - to be defined in a future version of MATLAB
0424 % handles    empty - handles not created until after all CreateFcns called
0425 
0426 % Hint: edit controls usually have a white background on Windows.
0427 %       See ISPC and COMPUTER.
0428 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0429     set(hObject,'BackgroundColor','white');
0430 end
0431 
0432 
0433 
0434 function boo_inj_septum_Callback(hObject, eventdata, handles)
0435 % hObject    handle to boo_inj_septum (see GCBO)
0436 % eventdata  reserved - to be defined in a future version of MATLAB
0437 % handles    structure with handles and user data (see GUIDATA)
0438 
0439 % Hints: get(hObject,'String') returns contents of boo_inj_septum as text
0440 %        str2double(get(hObject,'String')) returns contents of boo_inj_septum as a double
0441 inj_offset=str2double(get(handles.inj_offset,'String'));
0442 delay=str2double(get(hObject,'String'))+inj_offset;
0443 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay',delay);
0444 
0445 % --- Executes during object creation, after setting all properties.
0446 function boo_inj_septum_CreateFcn(hObject, eventdata, handles)
0447 % hObject    handle to boo_inj_septum (see GCBO)
0448 % eventdata  reserved - to be defined in a future version of MATLAB
0449 % handles    empty - handles not created until after all CreateFcns called
0450 
0451 % Hint: edit controls usually have a white background on Windows.
0452 %       See ISPC and COMPUTER.
0453 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0454     set(hObject,'BackgroundColor','white');
0455 end
0456 
0457 
0458 
0459 function boo_inj_kicker_Callback(hObject, eventdata, handles)
0460 % hObject    handle to boo_inj_kicker (see GCBO)
0461 % eventdata  reserved - to be defined in a future version of MATLAB
0462 % handles    structure with handles and user data (see GUIDATA)
0463 
0464 % Hints: get(hObject,'String') returns contents of boo_inj_kicker as text
0465 %        str2double(get(hObject,'String')) returns contents of boo_inj_kicker as a double
0466 inj_offset=str2double(get(handles.inj_offset,'String'));
0467 delay=str2double(get(hObject,'String'))+inj_offset;
0468 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay',delay);
0469 
0470 % --- Executes during object creation, after setting all properties.
0471 function boo_inj_kicker_CreateFcn(hObject, eventdata, handles)
0472 % hObject    handle to boo_inj_kicker (see GCBO)
0473 % eventdata  reserved - to be defined in a future version of MATLAB
0474 % handles    empty - handles not created until after all CreateFcns called
0475 
0476 % Hint: edit controls usually have a white background on Windows.
0477 %       See ISPC and COMPUTER.
0478 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0479     set(hObject,'BackgroundColor','white');
0480 end
0481 
0482 
0483 
0484 function boo_bpm_Callback(hObject, eventdata, handles)
0485 % hObject    handle to boo_bpm (see GCBO)
0486 % eventdata  reserved - to be defined in a future version of MATLAB
0487 % handles    structure with handles and user data (see GUIDATA)
0488 
0489 % Hints: get(hObject,'String') returns contents of boo_bpm as text
0490 %        str2double(get(hObject,'String')) returns contents of boo_bpm as a double
0491 
0492 inj_offset=str2double(get(handles.inj_offset,'String'));
0493 delay=str2double(get(hObject,'String'))+inj_offset;
0494 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay',delay);
0495 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigTimeDelay',delay);
0496 tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigTimeDelay',delay);
0497 tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigTimeDelay',delay);
0498 
0499 
0500 % --- Executes during object creation, after setting all properties.
0501 function boo_bpm_CreateFcn(hObject, eventdata, handles)
0502 % hObject    handle to boo_bpm (see GCBO)
0503 % eventdata  reserved - to be defined in a future version of MATLAB
0504 % handles    empty - handles not created until after all CreateFcns called
0505 
0506 % Hint: edit controls usually have a white background on Windows.
0507 %       See ISPC and COMPUTER.
0508 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0509     set(hObject,'BackgroundColor','white');
0510 end
0511 
0512 
0513 
0514 function boo_nod_Callback(hObject, eventdata, handles)
0515 % hObject    handle to boo_nod (see GCBO)
0516 % eventdata  reserved - to be defined in a future version of MATLAB
0517 % handles    structure with handles and user data (see GUIDATA)
0518 
0519 % Hints: get(hObject,'String') returns contents of boo_nod as text
0520 %        str2double(get(hObject,'String')) returns contents of boo_nod as a double
0521 inj_offset=str2double(get(handles.inj_offset,'String'));
0522 delay=str2double(get(hObject,'String'))+inj_offset;
0523 tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigTimeDelay',delay);
0524 
0525 % --- Executes during object creation, after setting all properties.
0526 function boo_nod_CreateFcn(hObject, eventdata, handles)
0527 % hObject    handle to boo_nod (see GCBO)
0528 % eventdata  reserved - to be defined in a future version of MATLAB
0529 % handles    empty - handles not created until after all CreateFcns called
0530 
0531 % Hint: edit controls usually have a white background on Windows.
0532 %       See ISPC and COMPUTER.
0533 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0534     set(hObject,'BackgroundColor','white');
0535 end
0536 
0537 
0538 
0539 function boo_dcct_Callback(hObject, eventdata, handles)
0540 % hObject    handle to boo_dcct (see GCBO)
0541 % eventdata  reserved - to be defined in a future version of MATLAB
0542 % handles    structure with handles and user data (see GUIDATA)
0543 
0544 % Hints: get(hObject,'String') returns contents of boo_dcct as text
0545 %        str2double(get(hObject,'String')) returns contents of boo_dcct as a double
0546 inj_offset=str2double(get(handles.inj_offset,'String'));
0547 delay=str2double(get(hObject,'String'))+inj_offset;
0548 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay',delay);
0549 
0550 % --- Executes during object creation, after setting all properties.
0551 function boo_dcct_CreateFcn(hObject, eventdata, handles)
0552 % hObject    handle to boo_dcct (see GCBO)
0553 % eventdata  reserved - to be defined in a future version of MATLAB
0554 % handles    empty - handles not created until after all CreateFcns called
0555 
0556 % Hint: edit controls usually have a white background on Windows.
0557 %       See ISPC and COMPUTER.
0558 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0559     set(hObject,'BackgroundColor','white');
0560 end
0561 
0562 
0563 
0564 function boo_hall_Callback(hObject, eventdata, handles)
0565 % hObject    handle to boo_hall (see GCBO)
0566 % eventdata  reserved - to be defined in a future version of MATLAB
0567 % handles    structure with handles and user data (see GUIDATA)
0568 
0569 % Hints: get(hObject,'String') returns contents of boo_hall as text
0570 %        str2double(get(hObject,'String')) returns contents of boo_hall as a double
0571 
0572 
0573 % --- Executes during object creation, after setting all properties.
0574 function boo_hall_CreateFcn(hObject, eventdata, handles)
0575 % hObject    handle to boo_hall (see GCBO)
0576 % eventdata  reserved - to be defined in a future version of MATLAB
0577 % handles    empty - handles not created until after all CreateFcns called
0578 
0579 % Hint: edit controls usually have a white background on Windows.
0580 %       See ISPC and COMPUTER.
0581 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0582     set(hObject,'BackgroundColor','white');
0583 end
0584 
0585 
0586 
0587 function pc_address_Callback(hObject, eventdata, handles)
0588 % hObject    handle to pc_address (see GCBO)
0589 % eventdata  reserved - to be defined in a future version of MATLAB
0590 % handles    structure with handles and user data (see GUIDATA)
0591 
0592 % Hints: get(hObject,'String') returns contents of pc_address as text
0593 %        str2double(get(hObject,'String')) returns contents of pc_address as a double
0594 
0595 delay=str2double(get(hObject,'String'));
0596 tango_write_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay',delay);
0597 
0598 % --- Executes during object creation, after setting all properties.
0599 function pc_address_CreateFcn(hObject, eventdata, handles)
0600 % hObject    handle to pc_address (see GCBO)
0601 % eventdata  reserved - to be defined in a future version of MATLAB
0602 % handles    empty - handles not created until after all CreateFcns called
0603 
0604 % Hint: edit controls usually have a white background on Windows.
0605 %       See ISPC and COMPUTER.
0606 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0607     set(hObject,'BackgroundColor','white');
0608 end
0609 
0610 
0611 
0612 function inj_address_Callback(hObject, eventdata, handles)
0613 % hObject    handle to inj_address (see GCBO)
0614 % eventdata  reserved - to be defined in a future version of MATLAB
0615 % handles    structure with handles and user data (see GUIDATA)
0616 
0617 % Hints: get(hObject,'String') returns contents of inj_address as text
0618 %        str2double(get(hObject,'String')) returns contents of inj_address as a double
0619 
0620 delay=str2double(get(hObject,'String'));
0621 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',delay);
0622 
0623 % --- Executes during object creation, after setting all properties.
0624 function inj_address_CreateFcn(hObject, eventdata, handles)
0625 % hObject    handle to inj_address (see GCBO)
0626 % eventdata  reserved - to be defined in a future version of MATLAB
0627 % handles    empty - handles not created until after all CreateFcns called
0628 
0629 % Hint: edit controls usually have a white background on Windows.
0630 %       See ISPC and COMPUTER.
0631 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0632     set(hObject,'BackgroundColor','white');
0633 end
0634 
0635 
0636 
0637 function edit21_Callback(hObject, eventdata, handles)
0638 % hObject    handle to pc_address (see GCBO)
0639 % eventdata  reserved - to be defined in a future version of MATLAB
0640 % handles    structure with handles and user data (see GUIDATA)
0641 
0642 % Hints: get(hObject,'String') returns contents of pc_address as text
0643 %        str2double(get(hObject,'String')) returns contents of pc_address as a double
0644 
0645 
0646 % --- Executes during object creation, after setting all properties.
0647 function edit21_CreateFcn(hObject, eventdata, handles)
0648 % hObject    handle to pc_address (see GCBO)
0649 % eventdata  reserved - to be defined in a future version of MATLAB
0650 % handles    empty - handles not created until after all CreateFcns called
0651 
0652 % Hint: edit controls usually have a white background on Windows.
0653 %       See ISPC and COMPUTER.
0654 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0655     set(hObject,'BackgroundColor','white');
0656 end
0657 
0658 
0659 
0660 function soft_address_Callback(hObject, eventdata, handles)
0661 % hObject    handle to soft_address (see GCBO)
0662 % eventdata  reserved - to be defined in a future version of MATLAB
0663 % handles    structure with handles and user data (see GUIDATA)
0664 
0665 % Hints: get(hObject,'String') returns contents of soft_address as text
0666 %        str2double(get(hObject,'String')) returns contents of soft_address as a double
0667 
0668 delay=str2double(get(hObject,'String'));
0669 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',delay);
0670 
0671 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay');
0672 clkinj=int32(temp.value(1)+5*52);
0673 clkext=int32(temp.value(1)/52+10);
0674 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjStepDelay',clkinj);
0675 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetClkStepValue',clkext);
0676 
0677 %status soft checked on linac
0678 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
0679 if (temp.value(1)==2)
0680    %
0681 elseif (temp.value(1)==5)
0682     dt=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
0683     inj_offset=str2double(get(handles.inj_offset,'String'));
0684     delay=dt.value(1)+inj_offset;
0685     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
0686     temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
0687     set(handles.lin_modulateur,'String',num2str(temp.value(1)-inj_offset));
0688 end
0689 
0690 % --- Executes during object creation, after setting all properties.
0691 function soft_address_CreateFcn(hObject, eventdata, handles)
0692 % hObject    handle to soft_address (see GCBO)
0693 % eventdata  reserved - to be defined in a future version of MATLAB
0694 % handles    empty - handles not created until after all CreateFcns called
0695 
0696 % Hint: edit controls usually have a white background on Windows.
0697 %       See ISPC and COMPUTER.
0698 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0699     set(hObject,'BackgroundColor','white');
0700 end
0701 
0702 
0703 % --- Executes on button press in acquisition1.
0704 function acquisition1_Callback(hObject, eventdata, handles)
0705 % hObject    handle to acquisition1 (see GCBO)
0706 % eventdata  reserved - to be defined in a future version of MATLAB
0707 % handles    structure with handles and user data (see GUIDATA)
0708 
0709 set(handles.inj_offset,'Enable','off');
0710 set(handles.sdc1,'Enable','off');
0711 set(handles.lin_canon,'Enable','off');
0712 set(handles.boo_bpm,'Enable','off');
0713 set(handles.lt1_emittance,'Enable','off');
0714 set(handles.lt1_MC1,'Enable','off');
0715 set(handles.lt1_MC2,'Enable','off');
0716 set(handles.lt1_osc,'Enable','off');
0717 set(handles.boo_dcct,'Enable','off');
0718 set(handles.boo_nod,'Enable','off');
0719 set(handles.boo_inj_septum,'Enable','off');
0720 set(handles.boo_inj_kicker,'Enable','off');
0721 set(handles.alim_dipole,'Enable','off');
0722 set(handles.alim_qf,'Enable','off');
0723 set(handles.alim_qd,'Enable','off');
0724 set(handles.alim_sf,'Enable','off');
0725 set(handles.alim_sd,'Enable','off');
0726 set(handles.boo_rf,'Enable','off');
0727 set(handles.lin_modulateur,'Enable','off');
0728 set(handles.ext_offset,'Enable','off');
0729 set(handles.boo_ext_dof,'Enable','off');
0730 set(handles.boo_ext_sept_p,'Enable','off');
0731 set(handles.boo_ext_sept_a,'Enable','off');
0732 set(handles.boo_ext_kicker,'Enable','off');
0733 set(handles.sdc2,'Enable','off');
0734 set(handles.lt2_emittance,'Enable','off');
0735 set(handles.lt2_osc,'Enable','off');
0736 set(handles.lt2_bpm,'Enable','off');
0737 set(handles.ans_inj_k1,'Enable','off');
0738 set(handles.ans_inj_k2,'Enable','off');
0739 set(handles.ans_inj_k3,'Enable','off');
0740 set(handles.ans_inj_k4,'Enable','off');
0741 set(handles.ans_inj_sept_p,'Enable','off');
0742 set(handles.ans_inj_sept_a,'Enable','off');
0743 set(handles.ans_bpm,'Enable','off');
0744 set(handles.ans_dcct,'Enable','off');
0745 set(handles.ans_bpm_c01,'Enable','off');
0746 set(handles.ans_bpm_c02,'Enable','off');
0747 set(handles.ans_bpm_c03,'Enable','off');
0748 set(handles.ans_bpm_c04,'Enable','off');
0749 set(handles.ans_bpm_c05,'Enable','off');
0750 set(handles.ans_bpm_c06,'Enable','off');
0751 set(handles.ans_bpm_c07,'Enable','off');
0752 set(handles.ans_bpm_c08,'Enable','off');
0753 set(handles.ans_bpm_c09,'Enable','off');
0754 set(handles.ans_bpm_c10,'Enable','off');
0755 set(handles.ans_bpm_c11,'Enable','off');
0756 set(handles.ans_bpm_c12,'Enable','off');
0757 set(handles.ans_bpm_c13,'Enable','off');
0758 set(handles.ans_bpm_c14,'Enable','off');
0759 set(handles.ans_bpm_c15,'Enable','off');
0760 set(handles.ans_bpm_c16,'Enable','off');
0761 
0762 
0763 n=1;
0764 
0765 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
0766 set(handles.pc_address,'String',num2str(temp.value(n)));
0767 
0768 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
0769 set(handles.inj_address,'String',num2str(temp.value(n)));
0770 
0771 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
0772 set(handles.soft_address,'String',num2str(temp.value(n)));
0773 
0774 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
0775 set(handles.ext_address,'String',num2str(temp.value(n)));
0776 
0777 
0778 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay');
0779 set(handles.sdc1,'String',num2str(temp.value(n)));
0780 
0781 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay');
0782 set(handles.lin_canon,'String',num2str(temp.value(n)));
0783 
0784 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay');
0785 set(handles.boo_bpm,'String',num2str(temp.value(n)));
0786 
0787 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay');
0788 set(handles.lt1_emittance,'String',num2str(temp.value(n)));
0789 
0790 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay');
0791 set(handles.lt1_MC1,'String',num2str(temp.value(n)));
0792 
0793 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay');
0794 set(handles.lt1_MC2,'String',num2str(temp.value(n)));
0795 
0796 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay');
0797 set(handles.lt1_osc,'String',num2str(temp.value(n)));
0798 
0799 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay');
0800 set(handles.boo_dcct,'String',num2str(temp.value(n)));
0801 
0802 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigTimeDelay');
0803 set(handles.boo_nod,'String',num2str(temp.value(n)));
0804 
0805 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay');
0806 set(handles.boo_inj_septum,'String',num2str(temp.value(n)));
0807 
0808 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay');
0809 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)));
0810 
0811 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTimeDelay');
0812 set(handles.alim_dipole,'String',num2str(temp.value(n)));
0813 
0814 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTimeDelay');
0815 set(handles.alim_qf,'String',num2str(temp.value(n)));
0816 
0817 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTimeDelay');
0818 set(handles.alim_qd,'String',num2str(temp.value(n)));
0819 
0820 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTimeDelay');
0821 set(handles.alim_sf,'String',num2str(temp.value(n)));
0822 
0823 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTimeDelay');
0824 set(handles.alim_sd,'String',num2str(temp.value(n)));
0825 
0826 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfTimeDelay');
0827 set(handles.boo_rf,'String',num2str(temp.value(n)));
0828 
0829 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
0830 set(handles.lin_modulateur,'String',num2str(temp.value(n)));
0831 
0832 
0833 
0834 
0835 
0836 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay');
0837 set(handles.boo_ext_dof,'String',num2str(temp.value(n)));
0838 
0839 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay');
0840 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)));
0841 
0842 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay');
0843 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)));
0844 
0845 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay');
0846 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)));
0847 
0848 
0849 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay');
0850 set(handles.sdc2,'String',num2str(temp.value(n)));
0851 
0852 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvTimeDelay');
0853 set(handles.lt2_emittance,'String',num2str(temp.value(n)));
0854 
0855 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctTimeDelay');
0856 set(handles.lt2_osc,'String',num2str(temp.value(n)));
0857 
0858 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
0859 set(handles.lt2_bpm,'String',num2str(temp.value(n)));
0860 
0861 
0862 
0863 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay');
0864 set(handles.ans_inj_k1,'String',num2str(temp.value(n)));
0865 
0866 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay');
0867 set(handles.ans_inj_k2,'String',num2str(temp.value(n)));
0868 
0869 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay');
0870 set(handles.ans_inj_k3,'String',num2str(temp.value(n)));
0871 
0872 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay');
0873 set(handles.ans_inj_k4,'String',num2str(temp.value(n)));
0874 
0875 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay');
0876 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)));
0877 
0878 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay');
0879 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)));
0880 
0881 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTimeDelay');
0882 set(handles.ans_dcct,'String',num2str(temp.value(n)));
0883 
0884 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
0885 set(handles.ans_bpm,'String',num2str(temp.value(n)));
0886 set(handles.ans_bpm_c01,'String',num2str(temp.value(n)));
0887 
0888 
0889 temp=tango_read_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0890 set(handles.ans_bpm_c02,'String',num2str(temp.value(n)));
0891 temp=tango_read_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0892 set(handles.ans_bpm_c03,'String',num2str(temp.value(n)));
0893 temp=tango_read_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0894 set(handles.ans_bpm_c04,'String',num2str(temp.value(n)));
0895 temp=tango_read_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0896 set(handles.ans_bpm_c05,'String',num2str(temp.value(n)));
0897 temp=tango_read_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0898 set(handles.ans_bpm_c06,'String',num2str(temp.value(n)));
0899 temp=tango_read_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0900 set(handles.ans_bpm_c07,'String',num2str(temp.value(n)));
0901 temp=tango_read_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0902 set(handles.ans_bpm_c08,'String',num2str(temp.value(n)));
0903 temp=tango_read_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0904 set(handles.ans_bpm_c09,'String',num2str(temp.value(n)));
0905 temp=tango_read_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0906 set(handles.ans_bpm_c10,'String',num2str(temp.value(n)));
0907 temp=tango_read_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0908 set(handles.ans_bpm_c11,'String',num2str(temp.value(n)));
0909 temp=tango_read_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0910 set(handles.ans_bpm_c12,'String',num2str(temp.value(n)));
0911 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0912 set(handles.ans_bpm_c13,'String',num2str(temp.value(n)));
0913 temp=tango_read_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0914 set(handles.ans_bpm_c14,'String',num2str(temp.value(n)));
0915 temp=tango_read_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0916 set(handles.ans_bpm_c15,'String',num2str(temp.value(n)));
0917 temp=tango_read_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
0918 set(handles.ans_bpm_c16,'String',num2str(temp.value(n)));
0919 
0920 
0921 
0922 %status soft checked on linac
0923 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
0924 if (temp.value(n)==2)
0925     set(handles.soft_button,'Value',0);
0926 elseif (temp.value(n)==5)
0927     set(handles.soft_button,'Value',1);
0928 end
0929 
0930 %status tables
0931 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetClkStepValue');
0932 offset=temp.value(1)*52;
0933 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TablesCurrentDepth');
0934 n=temp.value;
0935 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionDelayTable');
0936 table=temp.value(1:n)-offset;
0937 set(handles.edit_filling_relecture_tables,'String',['T=' , num2str(table)]);  
0938 
0939 
0940 
0941 % --- Executes on button press in acquisition2.
0942 function acquisition2_Callback(hObject, eventdata, handles)
0943 % hObject    handle to acquisition2 (see GCBO)
0944 % eventdata  reserved - to be defined in a future version of MATLAB
0945 % handles    structure with handles and user data (see GUIDATA)
0946 
0947 
0948 set(handles.inj_offset,'Enable','on');
0949 set(handles.sdc1,'Enable','on');
0950 set(handles.lin_canon,'Enable','on');
0951 set(handles.boo_bpm,'Enable','on');
0952 set(handles.lt1_emittance,'Enable','on');
0953 set(handles.lt1_MC1,'Enable','on');
0954 set(handles.lt1_MC2,'Enable','on');
0955 set(handles.lt1_osc,'Enable','on');
0956 set(handles.boo_dcct,'Enable','on');
0957 set(handles.boo_nod,'Enable','on');
0958 set(handles.boo_inj_septum,'Enable','on');
0959 set(handles.boo_inj_kicker,'Enable','on');
0960 set(handles.alim_dipole,'Enable','on');
0961 set(handles.alim_qf,'Enable','on');
0962 set(handles.alim_qd,'Enable','on');
0963 set(handles.alim_sf,'Enable','on');
0964 set(handles.alim_sd,'Enable','on');
0965 set(handles.boo_rf,'Enable','on');
0966 set(handles.lin_modulateur,'Enable','on');
0967 set(handles.ext_offset,'Enable','on');
0968 set(handles.boo_ext_dof,'Enable','on');
0969 set(handles.boo_ext_sept_p,'Enable','on');
0970 set(handles.boo_ext_sept_a,'Enable','on');
0971 set(handles.boo_ext_kicker,'Enable','on');
0972 set(handles.sdc2,'Enable','on');
0973 set(handles.lt2_emittance,'Enable','on');
0974 set(handles.lt2_osc,'Enable','on');
0975 set(handles.lt2_bpm,'Enable','on');
0976 set(handles.ans_inj_k1,'Enable','on');
0977 set(handles.ans_inj_k2,'Enable','on');
0978 set(handles.ans_inj_k3,'Enable','on');
0979 set(handles.ans_inj_k4,'Enable','on');
0980 set(handles.ans_inj_sept_p,'Enable','on');
0981 set(handles.ans_inj_sept_a,'Enable','on');
0982 set(handles.ans_bpm,'Enable','on');
0983 set(handles.ans_dcct,'Enable','on');
0984 set(handles.ans_bpm_c01,'Enable','on');
0985 set(handles.ans_bpm_c02,'Enable','on');
0986 set(handles.ans_bpm_c03,'Enable','on');
0987 set(handles.ans_bpm_c04,'Enable','on');
0988 set(handles.ans_bpm_c05,'Enable','on');
0989 set(handles.ans_bpm_c06,'Enable','on');
0990 set(handles.ans_bpm_c07,'Enable','on');
0991 set(handles.ans_bpm_c08,'Enable','on');
0992 set(handles.ans_bpm_c09,'Enable','on');
0993 set(handles.ans_bpm_c10,'Enable','on');
0994 set(handles.ans_bpm_c11,'Enable','on');
0995 set(handles.ans_bpm_c12,'Enable','on');
0996 set(handles.ans_bpm_c13,'Enable','on');
0997 set(handles.ans_bpm_c14,'Enable','on');
0998 set(handles.ans_bpm_c15,'Enable','on');
0999 set(handles.ans_bpm_c16,'Enable','on');
1000 
1001 
1002 n=1;
1003 
1004 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
1005 set(handles.pc_address,'String',num2str(temp.value(n)));
1006 
1007 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1008 set(handles.inj_address,'String',num2str(temp.value(n)));
1009 
1010 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1011 set(handles.soft_address,'String',num2str(temp.value(n)));
1012 set(handles.soft_address1,'String',num2str(temp.value(n)));
1013 
1014 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
1015 set(handles.ext_address,'String',num2str(temp.value(n)));
1016 
1017 
1018 
1019 inj_offset=str2double(get(handles.inj_offset,'String'));
1020 
1021 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay');
1022 set(handles.sdc1,'String',num2str(temp.value(n)-inj_offset));
1023 
1024 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay');
1025 set(handles.lin_canon,'String',num2str(temp.value(n)-inj_offset));
1026 
1027 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay');
1028 set(handles.boo_bpm,'String',num2str(temp.value(n)-inj_offset));
1029 
1030 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay');
1031 set(handles.lt1_emittance,'String',num2str(temp.value(n)-inj_offset));
1032 
1033 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay');
1034 set(handles.lt1_MC1,'String',num2str(temp.value(n)-inj_offset));
1035 
1036 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay');
1037 set(handles.lt1_MC2,'String',num2str(temp.value(n)-inj_offset));
1038 
1039 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay');
1040 set(handles.lt1_osc,'String',num2str(temp.value(n)-inj_offset));
1041 
1042 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay');
1043 set(handles.boo_dcct,'String',num2str(temp.value(n)-inj_offset));
1044 
1045 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigTimeDelay');
1046 set(handles.boo_nod,'String',num2str(temp.value(n)-inj_offset));
1047 
1048 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay');
1049 set(handles.boo_inj_septum,'String',num2str(temp.value(n)-inj_offset));
1050 
1051 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay');
1052 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)-inj_offset));
1053 
1054 
1055 
1056 
1057 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTimeDelay');
1058 set(handles.alim_dipole,'String',num2str(temp.value(n)));
1059 
1060 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTimeDelay');
1061 set(handles.alim_qf,'String',num2str(temp.value(n)));
1062 
1063 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTimeDelay');
1064 set(handles.alim_qd,'String',num2str(temp.value(n)));
1065 
1066 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTimeDelay');
1067 set(handles.alim_sf,'String',num2str(temp.value(n)));
1068 
1069 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTimeDelay');
1070 set(handles.alim_sd,'String',num2str(temp.value(n)));
1071 
1072 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfTimeDelay');
1073 set(handles.boo_rf,'String',num2str(temp.value(n)));
1074 
1075 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1076 set(handles.lin_modulateur,'String',num2str(temp.value(n)-inj_offset));
1077 
1078 
1079 
1080 ext_offset=str2double(get(handles.ext_offset,'String'));
1081 
1082 
1083 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay');
1084 set(handles.boo_ext_dof,'String',num2str(temp.value(n)-ext_offset));
1085 
1086 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay');
1087 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)-ext_offset));
1088 
1089 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay');
1090 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)-ext_offset));
1091 
1092 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay');
1093 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)-ext_offset));
1094 
1095 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay');
1096 set(handles.sdc2,'String',num2str(temp.value(n)-ext_offset));
1097 
1098 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvTimeDelay');
1099 set(handles.lt2_emittance,'String',num2str(temp.value(n)-ext_offset));
1100 
1101 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctTimeDelay');
1102 set(handles.lt2_osc,'String',num2str(temp.value(n)-ext_offset));
1103 
1104 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
1105 set(handles.lt2_bpm,'String',num2str(temp.value(n)-ext_offset));
1106 
1107 
1108 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay');
1109 set(handles.ans_inj_k1,'String',num2str(temp.value(n)-ext_offset));
1110 
1111 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay');
1112 set(handles.ans_inj_k2,'String',num2str(temp.value(n)-ext_offset));
1113 
1114 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay');
1115 set(handles.ans_inj_k3,'String',num2str(temp.value(n)-ext_offset));
1116 
1117 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay');
1118 set(handles.ans_inj_k4,'String',num2str(temp.value(n)-ext_offset));
1119 
1120 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay');
1121 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)-ext_offset));
1122 
1123 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay');
1124 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)-ext_offset));
1125 
1126 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTimeDelay');
1127 set(handles.ans_dcct,'String',num2str(temp.value(n)-ext_offset));
1128 
1129 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
1130 set(handles.ans_bpm,'String',num2str(temp.value(n)-ext_offset));
1131 set(handles.ans_bpm_c01,'String',num2str(temp.value(n)-ext_offset));
1132 temp=tango_read_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1133 set(handles.ans_bpm_c02,'String',num2str(temp.value(n)-ext_offset));
1134 temp=tango_read_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1135 set(handles.ans_bpm_c03,'String',num2str(temp.value(n)-ext_offset));
1136 temp=tango_read_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1137 set(handles.ans_bpm_c04,'String',num2str(temp.value(n)-ext_offset));
1138 temp=tango_read_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1139 set(handles.ans_bpm_c05,'String',num2str(temp.value(n)-ext_offset));
1140 temp=tango_read_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1141 set(handles.ans_bpm_c06,'String',num2str(temp.value(n)-ext_offset));
1142 temp=tango_read_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1143 set(handles.ans_bpm_c07,'String',num2str(temp.value(n)-ext_offset));
1144 temp=tango_read_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1145 set(handles.ans_bpm_c08,'String',num2str(temp.value(n)-ext_offset));
1146 temp=tango_read_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1147 set(handles.ans_bpm_c09,'String',num2str(temp.value(n)-ext_offset));
1148 temp=tango_read_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1149 set(handles.ans_bpm_c10,'String',num2str(temp.value(n)-ext_offset));
1150 temp=tango_read_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1151 set(handles.ans_bpm_c11,'String',num2str(temp.value(n)-ext_offset));
1152 temp=tango_read_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1153 set(handles.ans_bpm_c12,'String',num2str(temp.value(n)-ext_offset));
1154 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1155 set(handles.ans_bpm_c13,'String',num2str(temp.value(n)-ext_offset));
1156 temp=tango_read_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1157 set(handles.ans_bpm_c14,'String',num2str(temp.value(n)-ext_offset));
1158 temp=tango_read_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1159 set(handles.ans_bpm_c15,'String',num2str(temp.value(n)-ext_offset));
1160 temp=tango_read_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigTimeDelay');
1161 set(handles.ans_bpm_c16,'String',num2str(temp.value(n)-ext_offset));
1162 
1163 %status soft checked on linac
1164 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
1165 if (temp.value(n)==2)
1166     set(handles.soft_button,'Value',0);
1167 elseif (temp.value(n)==5)
1168     set(handles.soft_button,'Value',1);
1169 end
1170 
1171 %status tables
1172 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetClkStepValue');
1173 offset=temp.value(1)*52;
1174 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TablesCurrentDepth');
1175 n=temp.value;
1176 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionDelayTable');
1177 table=temp.value(1:n);
1178 set(handles.edit_filling_relecture_tables,'String',[num2str(table)]);  
1179 
1180 % --- Executes on button press in soft_button.
1181 function soft_button_Callback(hObject, eventdata, handles)
1182 % hObject    handle to soft_button (see GCBO)
1183 % eventdata  reserved - to be defined in a future version of MATLAB
1184 % handles    structure with handles and user data (see GUIDATA)
1185 
1186 % Hint: get(hObject,'Value') returns toggle state of soft_button
1187 
1188 etat=get(hObject,'Value');
1189 tout=0.;
1190 if (etat==0)
1191     event=int32(2) ;% adresse de l'injection
1192        
1193 
1194     tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',event); pause(tout);
1195     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent',int32(0)); pause(tout);
1196     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareEvent',event); pause(tout);
1197     tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
1198     tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
1199     tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event); pause(tout);
1200     tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event); pause(tout); 
1201     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',event); pause(tout);
1202     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',event); pause(tout);
1203     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',event); pause(tout);
1204     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',event); pause(tout);
1205     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',event); pause(tout);
1206     tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event);pause(tout);
1207     tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent',event); pause(tout);
1208     tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',event);
1209     tango_command_inout2('BOO/SY/LOCAL.Binj.1',  'Reset');  
1210     event=int32(3) ;% adresse de l'extraction
1211     tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',event);pause(tout);
1212     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',event);pause(tout);
1213     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event);pause(tout);
1214     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event);pause(tout);
1215     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',event);pause(tout);
1216     tango_command_inout2('BOO/SY/LOCAL.Bext.1',  'Reset');
1217     tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1218     tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',event);pause(tout);
1219     tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',event);pause(tout);
1220     tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',event);pause(tout);
1221     tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Reset');
1222     
1223     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigEvent',event);pause(tout);
1224     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigEvent',event);pause(tout);
1225     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigEvent',event);pause(tout);
1226     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigEvent',event);pause(tout);
1227     tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Reset');
1228        
1229     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigEvent',event);pause(tout);
1230     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigEvent',event);pause(tout);
1231     tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.2',  'Reset');
1232     %tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent',event);pause(tout);
1233     tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1234     tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1235     tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1236     tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1237     tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1238     tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1239     tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1240     tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1241     tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1242     tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1243     tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1244     tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1245     tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1246     tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1247     tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1248     tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1249     
1250 
1251     % special modulateur
1252     inj=str2double(get(handles.inj_address,'String'));
1253     soft=str2double(get(handles.soft_address,'String'));
1254     temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1255     delay=temp.value(1)-(soft)+0.00568;
1256     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1257     
1258     
1259 elseif (etat==1)
1260     event=int32(5) ;% adresse de l'injection
1261     tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',event); pause(tout);
1262     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent',event); pause(tout);
1263     tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
1264     tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
1265     tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event); pause(tout);
1266     tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event); pause(tout);     
1267     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',event); pause(tout);
1268     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',event); pause(tout);
1269     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',event); pause(tout);
1270     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',event); pause(tout);
1271     tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',event); pause(tout);
1272     tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event);pause(tout);
1273     tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent',event); pause(tout);
1274     tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',event);
1275     tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',event);pause(tout);
1276     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',event);pause(tout);
1277     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event);pause(tout);
1278     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event);pause(tout);
1279     tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',event);pause(tout);
1280     tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1281     tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',event);pause(tout);
1282     tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',event);pause(tout);
1283     tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',event);pause(tout);
1284     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigEvent',event);pause(tout);
1285     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigEvent',event);pause(tout);
1286     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigEvent',event);pause(tout);
1287     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigEvent',event);pause(tout);
1288     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigEvent',event);pause(tout);
1289     tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigEvent',event);pause(tout);
1290     %tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent',event);pause(tout);
1291     tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1292     tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1293     tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1294     tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1295     tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1296     tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1297     tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1298     tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1299     tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1300     tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1301     tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1302     tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1303     tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1304     tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1305     tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);  
1306     tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);     
1307     
1308     % special modulateur
1309     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareEvent',int32(1)); pause(tout);
1310     inj=str2double(get(handles.inj_address,'String'));
1311     soft=str2double(get(handles.soft_address,'String'));
1312     temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1313     delay=temp.value(1)+(soft);
1314     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1315     start_soft
1316 end
1317 display('ok change address')
1318 
1319 
1320 % --- Executes on button press in push_soft.
1321 function push_soft_Callback(hObject, eventdata, handles)
1322 % hObject    handle to push_soft (see GCBO)
1323 % eventdata  reserved - to be defined in a future version of MATLAB
1324 % handles    structure with handles and user data (see GUIDATA)
1325 
1326 set(hObject,'Enable','Off')
1327 
1328 bouton=get(handles.soft_button,'Value');
1329 mode=get(handles.listbox_fillingmode,'Value');
1330 [clk_pc,clk_soft]=fix_quart;
1331 handles.clk_pc =clk_pc;
1332 handles.clk_soft=clk_soft;
1333 
1334 dt=1.5;
1335 temp=tango_read_attribute2('ANS-C03/DG/DCCT','current');anscur0=temp.value;
1336 q1=0;
1337 q2=0;
1338 n=0;
1339 
1340 if (bouton==1)
1341     modeinj='Injection soft';
1342     fprintf('%s   %s  Remplissage = %d\n',datestr(clock),modeinj,mode);
1343     boucle=int16(str2double(get(handles.edit_Nshot_soft,'String')));
1344     if (mode<=4)
1345         for k=1:boucle
1346             i=int16(mode);
1347             clk1=handles.clk_pc(i);
1348             clk2=handles.clk_soft(i);
1349             tango_write_attribute2('ANS/SY/CENTRAL', 'TPcStepDelay',clk1);
1350             tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay',clk2);
1351             tango_command_inout('ANS/SY/CENTRAL','FireSoftEvent');
1352             pause(dt)
1353             [q1,q2,n]=getcharge(q1,q2,n);
1354         end
1355     elseif (mode>4)&&(mode<=7)
1356         for k=1:boucle
1357             for i=1:(mode-3)
1358                 clk1=handles.clk_pc(i);
1359                 clk2=handles.clk_soft(i);
1360                 tango_write_attribute2('ANS/SY/CENTRAL', 'TPcStepDelay',clk1);
1361                 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay',clk2);
1362                 tango_command_inout('ANS/SY/CENTRAL','FireSoftEvent');
1363                 pause(dt)
1364                 [q1,q2,n]=getcharge(q1,q2,n);
1365             end
1366         end    
1367     elseif (mode==8)   
1368         for k=1:boucle
1369             clk1=handles.clk_pc(1);
1370             clk2=handles.clk_soft(1);
1371             bunch=1 + (0:12)*32;
1372             [dtour,dpaquet]=bucketnumber(bunch);    
1373             clk_pc  =int32(dtour) +  int32(clk1);
1374             clk_soft=int32(dtour)  + int32(clk2);
1375             for i=1:13
1376                 tango_write_attribute2('ANS/SY/CENTRAL', 'TPcStepDelay',clk_pc(i));
1377                 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay',clk_soft(i));
1378                 tango_command_inout('ANS/SY/CENTRAL','FireSoftEvent');
1379                 pause(dt)
1380                 [q1,q2,n]=getcharge(q1,q2,n);
1381             end
1382         end    
1383     end
1384     clk1=handles.clk_pc(1);
1385     clk2=handles.clk_soft(1);
1386     tango_write_attribute2('ANS/SY/CENTRAL', 'TPcStepDelay',clk1);
1387     tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay',clk2);
1388     
1389     pause(1);
1390     temp=tango_read_attribute2('ANS-C03/DG/DCCT','current');anscur=temp.value;
1391     dcur=anscur-anscur0;
1392     r1=0;
1393     if (q1~=0)
1394        r1=int16(q2/q1*100); 
1395     end
1396     r2=0;
1397     if (q2~=0)
1398        r2=int16(dcur/q2*0.524*416/184*100);
1399     end
1400     if     (r1<0)
1401         r1=0;
1402     elseif(r1>100)
1403         r1=100;
1404     end
1405     if    (r2<0)
1406         r2=0;
1407     elseif(r2>100)
1408         r2=100;
1409     end
1410     q1=q1/n;
1411     q2=q2/n;  
1412 
1413     set(handles.edit_qlt1,'String',num2str(q1,'%5.2f'));
1414     set(handles.edit_iboo,'String',num2str(q2/0.524,'%5.2f'));
1415     set(handles.edit_dians,'String',num2str(dcur/n,'%5.2f'));
1416     set(handles.edit_rboo,'String',num2str(r1));
1417     set(handles.edit_rans,'String',num2str(r2));
1418     set(handles.edit_cycle,'String',num2str(n,'%g'));
1419     set(handles.edit_dians1,'String',num2str(dcur,'%5.2f'));
1420     set(handles.edit_courant_total,'String', num2str(anscur,'%5.2f'));
1421     
1422     
1423 elseif(bouton==0)
1424     modeinj='Injection 3 Hz';
1425     laps=str2double(get(handles.edit_laps,'String'));
1426     fprintf('%s   %s  Remplissage = %d\n',datestr(clock),modeinj,mode);
1427     start_3Hz
1428     pause(laps)
1429     stop_3Hz
1430     
1431     pause(1);
1432     temp=tango_read_attribute2('ANS-C03/DG/DCCT','current');anscur=temp.value;
1433     dcur=anscur-anscur0;
1434     n=int16(laps/0.340);
1435     
1436     set(handles.edit_qlt1,'String','--');
1437     set(handles.edit_iboo,'String','--');
1438     set(handles.edit_dians,'String','--');
1439     set(handles.edit_rboo,'String','--');
1440     set(handles.edit_rans,'String','--');
1441     set(handles.edit_cycle,'String',num2str(n,'%g'));
1442     set(handles.edit_dians1,'String',num2str(dcur,'%5.2f'));
1443     set(handles.edit_courant_total,'String', num2str(anscur,'%5.2f'));
1444 
1445 end
1446 
1447 
1448 
1449 set(hObject,'Enable','On');
1450 
1451 
1452 function periode_edit_Callback(hObject, eventdata, handles)
1453 % hObject    handle to periode_edit (see GCBO)
1454 % eventdata  reserved - to be defined in a future version of MATLAB
1455 % handles    structure with handles and user data (see GUIDATA)
1456 
1457 % Hints: get(hObject,'String') returns contents of periode_edit as text
1458 %        str2double(get(hObject,'String')) returns contents of periode_edit as a double
1459 
1460 val_multishot = get(handles.on,'Value');
1461 
1462 if val_multishot
1463     errordlg('positionner le trigger a OFF !','Attention');
1464     return
1465 else
1466     handles.periode = str2double(get(hObject,'String'));
1467 
1468     % change timer Infinite loop
1469     timer1=timer('StartDelay',1,...
1470         'ExecutionMode','fixedRate','Period',handles.periode,'TasksToExecute',Inf);
1471     timer1.TimerFcn = {@fonction_alex, hObject,eventdata, handles};
1472     setappdata(handles.figure1,'Timer',timer1);
1473 
1474     % Update handles structure
1475     guidata(hObject, handles);
1476 end
1477 
1478 
1479 % --- Executes during object creation, after setting all properties.
1480 function periode_edit_CreateFcn(hObject, eventdata, handles)
1481 % hObject    handle to periode_edit (see GCBO)
1482 % eventdata  reserved - to be defined in a future version of MATLAB
1483 % handles    empty - handles not created until after all CreateFcns called
1484 
1485 % Hint: edit controls usually have a white background on Windows.
1486 %       See ISPC and COMPUTER.
1487 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1488     set(hObject,'BackgroundColor','white');
1489 end
1490 
1491 function uibuttongroup_SelectionChangeFcn(hObject,eventdata,handles)
1492 
1493 % hObject    handle to uipanel1 (see GCBO)
1494 % eventdata  reserved - to be defined in a future version of MATLAB
1495 % handles    structure with handles and user data (see GUIDATA)
1496 
1497 timer1 = getappdata(handles.figure1,'Timer');
1498 switch get(get(hObject,'SelectedObject'),'Tag')  % Get Tag of selected object
1499     case 'radiobutton1'
1500         % démarrage du trigger
1501         stop(timer1);
1502        set(handles.push_soft,'Enable','On');
1503        
1504     case 'radiobutton2'
1505         % stop du trigger
1506         set(handles.push_soft,'Enable','Off');
1507         start(timer1);
1508         
1509 end
1510 
1511 function fonction_alex(arg1,arg2,hObject,eventdata,handles)
1512 % hObject    handle to uipanel1 (see GCBO)
1513 % eventdata  reserved - to be defined in a future version of MATLAB
1514 % handles    structure with handles and user data (see GUIDATA)
1515 
1516 push_soft_Callback(hObject,eventdata,handles)
1517 
1518 
1519 
1520 
1521 
1522 %% What to do before closing the application
1523 function Closinggui(obj, event, handles, figure1)
1524 
1525 % Get default command line output from handles structure
1526 answer = questdlg('Fermer softsynchro ?',...
1527     'Exit softsynchro',...
1528     'Yes','No','Yes');
1529 
1530 switch answer
1531     case 'Yes'           
1532         delete(handles); %Delete Timer
1533         delete(figure1); %Close gui
1534     otherwise
1535         disp('Closing aborted')
1536 end
1537 
1538 
1539 
1540 % --- Executes on button press in button_softmoins.
1541 function button_softmoins_Callback(hObject, eventdata, handles)
1542 % hObject    handle to button_softmoins (see GCBO)
1543 % eventdata  reserved - to be defined in a future version of MATLAB
1544 % handles    structure with handles and user data (see GUIDATA)
1545 
1546 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1547 step=temp.value(1)-51*0.52243;
1548 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',step);
1549 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1550 set(handles.soft_address,'String',num2str(temp.value(1)));
1551 
1552 % decale adress inj et extract d'une super-periode
1553 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay');
1554 clkinj=int32(temp.value(1)+5*52);
1555 clkext=int32(temp.value(1)/52+10);
1556 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjStepDelay',clkinj);
1557 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetClkStepValue',clkext);
1558 
1559 %status soft checked on linac
1560 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
1561 if (temp.value(1)==2)
1562    %
1563 elseif (temp.value(1)==5)
1564     dt=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1565     inj_offset=str2double(get(handles.inj_offset,'String'));
1566     delay=dt.value(1)+inj_offset;
1567     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1568     temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1569     set(handles.lin_modulateur,'String',num2str(temp.value(1)-inj_offset));
1570 end
1571 
1572 % --- Executes on button press in button_softplus.
1573 function button_softplus_Callback(hObject, eventdata, handles)
1574 % hObject    handle to button_softplus (see GCBO)
1575 % eventdata  reserved - to be defined in a future version of MATLAB
1576 % handles    structure with handles and user data (see GUIDATA)
1577 
1578 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1579 step=temp.value(1)+52*0.52243;
1580 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',step);
1581 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1582 set(handles.soft_address,'String',num2str(temp.value(1)));
1583 
1584 % dcale adress inj et extract d'une super-periode
1585 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay');
1586 clkinj=int32(temp.value(1)+5*52);
1587 clkext=int32(temp.value(1)/52+10);
1588 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjStepDelay',clkinj);
1589 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetClkStepValue',clkext);
1590 
1591 %status soft checked on linac
1592 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
1593 if (temp.value(1)==2)
1594    %
1595 elseif (temp.value(1)==5)
1596     dt=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1597     inj_offset=str2double(get(handles.inj_offset,'String'));
1598     delay=dt.value(1)+inj_offset;
1599     tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1600     temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1601     set(handles.lin_modulateur,'String',num2str(temp.value(1)-inj_offset));
1602 end
1603 
1604 % --- Executes on button press in button_injmoins.
1605 function button_injmoins_Callback(hObject, eventdata, handles)
1606 % hObject    handle to button_injmoins (see GCBO)
1607 % eventdata  reserved - to be defined in a future version of MATLAB
1608 % handles    structure with handles and user data (see GUIDATA)
1609 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1610 step=temp.value(1)-51*0.52243;
1611 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',step);
1612 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1613 set(handles.inj_address,'String',num2str(temp.value(1)));
1614 
1615 
1616 
1617 % --- Executes on button press in button_injplus.
1618 function button_injplus_Callback(hObject, eventdata, handles)
1619 % hObject    handle to button_injplus (see GCBO)
1620 % eventdata  reserved - to be defined in a future version of MATLAB
1621 % handles    structure with handles and user data (see GUIDATA)
1622 
1623 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1624 step=temp.value(1)+52*0.52243;
1625 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',step);
1626 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1627 set(handles.inj_address,'String',num2str(temp.value(1)));
1628 
1629 
1630 
1631 function boo_ext_dof_Callback(hObject, eventdata, handles)
1632 % hObject    handle to boo_ext_dof (see GCBO)
1633 % eventdata  reserved - to be defined in a future version of MATLAB
1634 % handles    structure with handles and user data (see GUIDATA)
1635 
1636 % Hints: get(hObject,'String') returns contents of boo_ext_dof as text
1637 %        str2double(get(hObject,'String')) returns contents of boo_ext_dof as a double
1638 ext_offset=str2double(get(handles.ext_offset,'String'));
1639 delay=str2double(get(hObject,'String'))+ext_offset;
1640 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay',delay);
1641 
1642 % --- Executes during object creation, after setting all properties.
1643 function boo_ext_dof_CreateFcn(hObject, eventdata, handles)
1644 % hObject    handle to boo_ext_dof (see GCBO)
1645 % eventdata  reserved - to be defined in a future version of MATLAB
1646 % handles    empty - handles not created until after all CreateFcns called
1647 
1648 % Hint: edit controls usually have a white background on Windows.
1649 %       See ISPC and COMPUTER.
1650 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1651     set(hObject,'BackgroundColor','white');
1652 end
1653 
1654 
1655 
1656 function boo_ext_sept_p_Callback(hObject, eventdata, handles)
1657 % hObject    handle to boo_ext_sept_p (see GCBO)
1658 % eventdata  reserved - to be defined in a future version of MATLAB
1659 % handles    structure with handles and user data (see GUIDATA)
1660 
1661 % Hints: get(hObject,'String') returns contents of boo_ext_sept_p as text
1662 %        str2double(get(hObject,'String')) returns contents of boo_ext_sept_p as a double
1663 ext_offset=str2double(get(handles.ext_offset,'String'));
1664 delay=str2double(get(hObject,'String'))+ext_offset;
1665 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay',delay);
1666 
1667 % --- Executes during object creation, after setting all properties.
1668 function boo_ext_sept_p_CreateFcn(hObject, eventdata, handles)
1669 % hObject    handle to boo_ext_sept_p (see GCBO)
1670 % eventdata  reserved - to be defined in a future version of MATLAB
1671 % handles    empty - handles not created until after all CreateFcns called
1672 
1673 % Hint: edit controls usually have a white background on Windows.
1674 %       See ISPC and COMPUTER.
1675 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1676     set(hObject,'BackgroundColor','white');
1677 end
1678 
1679 
1680 
1681 function boo_ext_sept_a_Callback(hObject, eventdata, handles)
1682 % hObject    handle to boo_ext_sept_a (see GCBO)
1683 % eventdata  reserved - to be defined in a future version of MATLAB
1684 % handles    structure with handles and user data (see GUIDATA)
1685 
1686 % Hints: get(hObject,'String') returns contents of boo_ext_sept_a as text
1687 %        str2double(get(hObject,'String')) returns contents of boo_ext_sept_a as a double
1688 ext_offset=str2double(get(handles.ext_offset,'String'));
1689 delay=str2double(get(hObject,'String'))+ext_offset;
1690 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay',delay);
1691 
1692 % --- Executes during object creation, after setting all properties.
1693 function boo_ext_sept_a_CreateFcn(hObject, eventdata, handles)
1694 % hObject    handle to boo_ext_sept_a (see GCBO)
1695 % eventdata  reserved - to be defined in a future version of MATLAB
1696 % handles    empty - handles not created until after all CreateFcns called
1697 
1698 % Hint: edit controls usually have a white background on Windows.
1699 %       See ISPC and COMPUTER.
1700 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1701     set(hObject,'BackgroundColor','white');
1702 end
1703 
1704 
1705 
1706 function boo_ext_kicker_Callback(hObject, eventdata, handles)
1707 % hObject    handle to boo_ext_kicker (see GCBO)
1708 % eventdata  reserved - to be defined in a future version of MATLAB
1709 % handles    structure with handles and user data (see GUIDATA)
1710 
1711 % Hints: get(hObject,'String') returns contents of boo_ext_kicker as text
1712 %        str2double(get(hObject,'String')) returns contents of boo_ext_kicker as a double
1713 ext_offset=str2double(get(handles.ext_offset,'String'));
1714 delay=str2double(get(hObject,'String'))+ext_offset;
1715 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay',delay);
1716 
1717 
1718 % --- Executes during object creation, after setting all properties.
1719 function boo_ext_kicker_CreateFcn(hObject, eventdata, handles)
1720 % hObject    handle to boo_ext_kicker (see GCBO)
1721 % eventdata  reserved - to be defined in a future version of MATLAB
1722 % handles    empty - handles not created until after all CreateFcns called
1723 
1724 % Hint: edit controls usually have a white background on Windows.
1725 %       See ISPC and COMPUTER.
1726 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1727     set(hObject,'BackgroundColor','white');
1728 end
1729 
1730 
1731 
1732 function ans_inj_sept_p_Callback(hObject, eventdata, handles)
1733 % hObject    handle to ans_inj_sept_p (see GCBO)
1734 % eventdata  reserved - to be defined in a future version of MATLAB
1735 % handles    structure with handles and user data (see GUIDATA)
1736 
1737 % Hints: get(hObject,'String') returns contents of ans_inj_sept_p as text
1738 %        str2double(get(hObject,'String')) returns contents of ans_inj_sept_p as a double
1739 
1740 ext_offset=str2double(get(handles.ext_offset,'String'));
1741 delay=str2double(get(hObject,'String'))+ext_offset;
1742 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay',delay);
1743 
1744 % --- Executes during object creation, after setting all properties.
1745 function ans_inj_sept_p_CreateFcn(hObject, eventdata, handles)
1746 % hObject    handle to ans_inj_sept_p (see GCBO)
1747 % eventdata  reserved - to be defined in a future version of MATLAB
1748 % handles    empty - handles not created until after all CreateFcns called
1749 
1750 % Hint: edit controls usually have a white background on Windows.
1751 %       See ISPC and COMPUTER.
1752 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1753     set(hObject,'BackgroundColor','white');
1754 end
1755 
1756 
1757 
1758 function ans_inj_sept_a_Callback(hObject, eventdata, handles)
1759 % hObject    handle to ans_inj_sept_a (see GCBO)
1760 % eventdata  reserved - to be defined in a future version of MATLAB
1761 % handles    structure with handles and user data (see GUIDATA)
1762 
1763 % Hints: get(hObject,'String') returns contents of ans_inj_sept_a as text
1764 %        str2double(get(hObject,'String')) returns contents of ans_inj_sept_a as a double
1765 
1766 ext_offset=str2double(get(handles.ext_offset,'String'));
1767 delay=str2double(get(hObject,'String'))+ext_offset;
1768 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay',delay);
1769 
1770 % --- Executes during object creation, after setting all properties.
1771 function ans_inj_sept_a_CreateFcn(hObject, eventdata, handles)
1772 % hObject    handle to ans_inj_sept_a (see GCBO)
1773 % eventdata  reserved - to be defined in a future version of MATLAB
1774 % handles    empty - handles not created until after all CreateFcns called
1775 
1776 % Hint: edit controls usually have a white background on Windows.
1777 %       See ISPC and COMPUTER.
1778 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1779     set(hObject,'BackgroundColor','white');
1780 end
1781 
1782 
1783 
1784 function ans_inj_k1_Callback(hObject, eventdata, handles)
1785 % hObject    handle to ans_inj_k1 (see GCBO)
1786 % eventdata  reserved - to be defined in a future version of MATLAB
1787 % handles    structure with handles and user data (see GUIDATA)
1788 
1789 % Hints: get(hObject,'String') returns contents of ans_inj_k1 as text
1790 %        str2double(get(hObject,'String')) returns contents of ans_inj_k1 as a double
1791 
1792 ext_offset=str2double(get(handles.ext_offset,'String'));
1793 delay=str2double(get(hObject,'String'))+ext_offset;
1794 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay',delay);
1795 
1796 
1797 
1798 % --- Executes during object creation, after setting all properties.
1799 function ans_inj_k1_CreateFcn(hObject, eventdata, handles)
1800 % hObject    handle to ans_inj_k1 (see GCBO)
1801 % eventdata  reserved - to be defined in a future version of MATLAB
1802 % handles    empty - handles not created until after all CreateFcns called
1803 
1804 % Hint: edit controls usually have a white background on Windows.
1805 %       See ISPC and COMPUTER.
1806 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1807     set(hObject,'BackgroundColor','white');
1808 end
1809 
1810 
1811 
1812 function ans_inj_k2_Callback(hObject, eventdata, handles)
1813 % hObject    handle to ans_inj_k2 (see GCBO)
1814 % eventdata  reserved - to be defined in a future version of MATLAB
1815 % handles    structure with handles and user data (see GUIDATA)
1816 
1817 % Hints: get(hObject,'String') returns contents of ans_inj_k2 as text
1818 %        str2double(get(hObject,'String')) returns contents of ans_inj_k2 as a double
1819 
1820 ext_offset=str2double(get(handles.ext_offset,'String'));
1821 delay=str2double(get(hObject,'String'))+ext_offset;
1822 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay',delay);
1823 
1824 % --- Executes during object creation, after setting all properties.
1825 function ans_inj_k2_CreateFcn(hObject, eventdata, handles)
1826 % hObject    handle to ans_inj_k2 (see GCBO)
1827 % eventdata  reserved - to be defined in a future version of MATLAB
1828 % handles    empty - handles not created until after all CreateFcns called
1829 
1830 % Hint: edit controls usually have a white background on Windows.
1831 %       See ISPC and COMPUTER.
1832 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1833     set(hObject,'BackgroundColor','white');
1834 end
1835 
1836 
1837 
1838 function ans_inj_k3_Callback(hObject, eventdata, handles)
1839 % hObject    handle to ans_inj_k3 (see GCBO)
1840 % eventdata  reserved - to be defined in a future version of MATLAB
1841 % handles    structure with handles and user data (see GUIDATA)
1842 
1843 % Hints: get(hObject,'String') returns contents of ans_inj_k3 as text
1844 %        str2double(get(hObject,'String')) returns contents of ans_inj_k3 as a double
1845 
1846 ext_offset=str2double(get(handles.ext_offset,'String'));
1847 delay=str2double(get(hObject,'String'))+ext_offset;
1848 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay',delay);
1849 
1850 % --- Executes during object creation, after setting all properties.
1851 function ans_inj_k3_CreateFcn(hObject, eventdata, handles)
1852 % hObject    handle to ans_inj_k3 (see GCBO)
1853 % eventdata  reserved - to be defined in a future version of MATLAB
1854 % handles    empty - handles not created until after all CreateFcns called
1855 
1856 % Hint: edit controls usually have a white background on Windows.
1857 %       See ISPC and COMPUTER.
1858 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1859     set(hObject,'BackgroundColor','white');
1860 end
1861 
1862 
1863 
1864 function ans_inj_k4_Callback(hObject, eventdata, handles)
1865 % hObject    handle to ans_inj_k4 (see GCBO)
1866 % eventdata  reserved - to be defined in a future version of MATLAB
1867 % handles    structure with handles and user data (see GUIDATA)
1868 
1869 % Hints: get(hObject,'String') returns contents of ans_inj_k4 as text
1870 %        str2double(get(hObject,'String')) returns contents of ans_inj_k4 as a double
1871 
1872 ext_offset=str2double(get(handles.ext_offset,'String'));
1873 delay=str2double(get(hObject,'String'))+ext_offset;
1874 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay',delay);
1875 
1876 % --- Executes during object creation, after setting all properties.
1877 function ans_inj_k4_CreateFcn(hObject, eventdata, handles)
1878 % hObject    handle to ans_inj_k4 (see GCBO)
1879 % eventdata  reserved - to be defined in a future version of MATLAB
1880 % handles    empty - handles not created until after all CreateFcns called
1881 
1882 % Hint: edit controls usually have a white background on Windows.
1883 %       See ISPC and COMPUTER.
1884 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1885     set(hObject,'BackgroundColor','white');
1886 end
1887 
1888 
1889 
1890 function ans_dcct_Callback(hObject, eventdata, handles)
1891 % hObject    handle to ans_dcct (see GCBO)
1892 % eventdata  reserved - to be defined in a future version of MATLAB
1893 % handles    structure with handles and user data (see GUIDATA)
1894 
1895 % Hints: get(hObject,'String') returns contents of ans_dcct as text
1896 %        str2double(get(hObject,'String')) returns contents of ans_dcct as a double
1897 
1898 ext_offset=str2double(get(handles.ext_offset,'String'));
1899 delay=str2double(get(hObject,'String'))+ext_offset;
1900 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTimeDelay',delay);
1901 
1902 
1903 % --- Executes during object creation, after setting all properties.
1904 function ans_dcct_CreateFcn(hObject, eventdata, handles)
1905 % hObject    handle to ans_dcct (see GCBO)
1906 % eventdata  reserved - to be defined in a future version of MATLAB
1907 % handles    empty - handles not created until after all CreateFcns called
1908 
1909 % Hint: edit controls usually have a white background on Windows.
1910 %       See ISPC and COMPUTER.
1911 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1912     set(hObject,'BackgroundColor','white');
1913 end
1914 
1915 
1916 
1917 function ans_bpm_Callback(hObject, eventdata, handles)
1918 % hObject    handle to ans_bpm (see GCBO)
1919 % eventdata  reserved - to be defined in a future version of MATLAB
1920 % handles    structure with handles and user data (see GUIDATA)
1921 
1922 % Hints: get(hObject,'String') returns contents of ans_bpm as text
1923 %        str2double(get(hObject,'String')) returns contents of ans_bpm as a double
1924 
1925 ext_offset=str2double(get(handles.ext_offset,'String'));
1926 delay=str2double(get(hObject,'String'))+ext_offset;
1927 tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
1928 tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1929 tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1930 tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1931 tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1932 tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1933 tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1934 tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1935 tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1936 tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1937 tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1938 tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1939 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1940 tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1941 tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1942 tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1943 
1944 
1945 
1946 % --- Executes during object creation, after setting all properties.
1947 function ans_bpm_CreateFcn(hObject, eventdata, handles)
1948 % hObject    handle to ans_bpm (see GCBO)
1949 % eventdata  reserved - to be defined in a future version of MATLAB
1950 % handles    empty - handles not created until after all CreateFcns called
1951 
1952 % Hint: edit controls usually have a white background on Windows.
1953 %       See ISPC and COMPUTER.
1954 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1955     set(hObject,'BackgroundColor','white');
1956 end
1957 
1958 
1959 
1960 function ext_address_Callback(hObject, eventdata, handles)
1961 % hObject    handle to ext_address (see GCBO)
1962 % eventdata  reserved - to be defined in a future version of MATLAB
1963 % handles    structure with handles and user data (see GUIDATA)
1964 
1965 % Hints: get(hObject,'String') returns contents of ext_address as text
1966 %        str2double(get(hObject,'String')) returns contents of ext_address as a double
1967 %'ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue'
1968 
1969 delay=str2double(get(hObject,'String'));
1970 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue',delay);
1971 
1972 % --- Executes during object creation, after setting all properties.
1973 function ext_address_CreateFcn(hObject, eventdata, handles)
1974 % hObject    handle to ext_address (see GCBO)
1975 % eventdata  reserved - to be defined in a future version of MATLAB
1976 % handles    empty - handles not created until after all CreateFcns called
1977 
1978 % Hint: edit controls usually have a white background on Windows.
1979 %       See ISPC and COMPUTER.
1980 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1981     set(hObject,'BackgroundColor','white');
1982 end
1983 
1984 
1985 
1986 function soft_address1_Callback(hObject, eventdata, handles)
1987 % hObject    handle to soft_address1 (see GCBO)
1988 % eventdata  reserved - to be defined in a future version of MATLAB
1989 % handles    structure with handles and user data (see GUIDATA)
1990 
1991 % Hints: get(hObject,'String') returns contents of soft_address1 as text
1992 %        str2double(get(hObject,'String')) returns contents of soft_address1 as a double
1993 
1994 
1995 
1996 % --- Executes during object creation, after setting all properties.
1997 function soft_address1_CreateFcn(hObject, eventdata, handles)
1998 % hObject    handle to soft_address1 (see GCBO)
1999 % eventdata  reserved - to be defined in a future version of MATLAB
2000 % handles    empty - handles not created until after all CreateFcns called
2001 
2002 % Hint: edit controls usually have a white background on Windows.
2003 %       See ISPC and COMPUTER.
2004 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2005     set(hObject,'BackgroundColor','white');
2006 end
2007 
2008 
2009 % --- Executes on button press in radiobutton6.
2010 function radiobutton6_Callback(hObject, eventdata, handles)
2011 % hObject    handle to radiobutton6 (see GCBO)
2012 % eventdata  reserved - to be defined in a future version of MATLAB
2013 % handles    structure with handles and user data (see GUIDATA)
2014 
2015 % Hint: get(hObject,'Value') returns toggle state of radiobutton6
2016 
2017 
2018 % --- Executes on button press in pushbutton8.
2019 function pushbutton8_Callback(hObject, eventdata, handles)
2020 % hObject    handle to pushbutton8 (see GCBO)
2021 % eventdata  reserved - to be defined in a future version of MATLAB
2022 % handles    structure with handles and user data (see GUIDATA)
2023 
2024 
2025 % --- Executes on button press in pushbutton9.
2026 function pushbutton9_Callback(hObject, eventdata, handles)
2027 % hObject    handle to pushbutton9 (see GCBO)
2028 % eventdata  reserved - to be defined in a future version of MATLAB
2029 % handles    structure with handles and user data (see GUIDATA)
2030 
2031 
2032 % --- Executes on button press in button_extmoins.
2033 function button_extmoins_Callback(hObject, eventdata, handles)
2034 % hObject    handle to button_extmoins (see GCBO)
2035 % eventdata  reserved - to be defined in a future version of MATLAB
2036 % handles    structure with handles and user data (see GUIDATA)
2037 
2038 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
2039 step=temp.value(1)-52*0.52243;
2040 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue',step);
2041 temp=tango_read_attribute2('ANS/SY/CENTRAL','ExtractionOffsetTimeValue');
2042 set(handles.ext_address,'String',num2str(temp.value(1)));
2043 
2044 % --- Executes on button press in button_extplus.
2045 function button_extplus_Callback(hObject, eventdata, handles)
2046 % hObject    handle to button_extplus (see GCBO)
2047 % eventdata  reserved - to be defined in a future version of MATLAB
2048 % handles    structure with handles and user data (see GUIDATA)
2049 
2050 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
2051 step=temp.value(1)+52*0.52243;
2052 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue',step);
2053 temp=tango_read_attribute2('ANS/SY/CENTRAL','ExtractionOffsetTimeValue');
2054 set(handles.ext_address,'String',num2str(temp.value(1)));
2055 
2056 function sdc2_Callback(hObject, eventdata, handles)
2057 % hObject    handle to sdc2 (see GCBO)
2058 % eventdata  reserved - to be defined in a future version of MATLAB
2059 % handles    structure with handles and user data (see GUIDATA)
2060 
2061 % Hints: get(hObject,'String') returns contents of sdc2 as text
2062 %        str2double(get(hObject,'String')) returns contents of sdc2 as a double
2063 ext_offset=str2double(get(handles.ext_offset,'String'));
2064 delay=str2double(get(hObject,'String'))+ext_offset;
2065 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay',delay);
2066 
2067 % --- Executes during object creation, after setting all properties.
2068 function sdc2_CreateFcn(hObject, eventdata, handles)
2069 % hObject    handle to sdc2 (see GCBO)
2070 % eventdata  reserved - to be defined in a future version of MATLAB
2071 % handles    empty - handles not created until after all CreateFcns called
2072 
2073 % Hint: edit controls usually have a white background on Windows.
2074 %       See ISPC and COMPUTER.
2075 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2076     set(hObject,'BackgroundColor','white');
2077 end
2078 
2079 
2080 
2081 function lt2_emittance_Callback(hObject, eventdata, handles)
2082 % hObject    handle to lt2_emittance (see GCBO)
2083 % eventdata  reserved - to be defined in a future version of MATLAB
2084 % handles    structure with handles and user data (see GUIDATA)
2085 
2086 % Hints: get(hObject,'String') returns contents of lt2_emittance as text
2087 %        str2double(get(hObject,'String')) returns contents of lt2_emittance as a double
2088 ext_offset=str2double(get(handles.ext_offset,'String'));
2089 delay=str2double(get(hObject,'String'))+ext_offset;
2090 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvTimeDelay',delay);
2091 tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceTimeDelay',delay);
2092 
2093 
2094 % --- Executes during object creation, after setting all properties.
2095 function lt2_emittance_CreateFcn(hObject, eventdata, handles)
2096 % hObject    handle to lt2_emittance (see GCBO)
2097 % eventdata  reserved - to be defined in a future version of MATLAB
2098 % handles    empty - handles not created until after all CreateFcns called
2099 
2100 % Hint: edit controls usually have a white background on Windows.
2101 %       See ISPC and COMPUTER.
2102 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2103     set(hObject,'BackgroundColor','white');
2104 end
2105 
2106 
2107 
2108 function lt2_bpm_Callback(hObject, eventdata, handles)
2109 % hObject    handle to lt2_bpm (see GCBO)
2110 % eventdata  reserved - to be defined in a future version of MATLAB
2111 % handles    structure with handles and user data (see GUIDATA)
2112 
2113 % Hints: get(hObject,'String') returns contents of lt2_bpm as text
2114 %        str2double(get(hObject,'String')) returns contents of lt2_bpm as a double
2115 ext_offset=str2double(get(handles.ext_offset,'String'));
2116 delay=str2double(get(hObject,'String'))+ext_offset;
2117 tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
2118 
2119 % --- Executes during object creation, after setting all properties.
2120 function lt2_bpm_CreateFcn(hObject, eventdata, handles)
2121 % hObject    handle to lt2_bpm (see GCBO)
2122 % eventdata  reserved - to be defined in a future version of MATLAB
2123 % handles    empty - handles not created until after all CreateFcns called
2124 
2125 % Hint: edit controls usually have a white background on Windows.
2126 %       See ISPC and COMPUTER.
2127 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2128     set(hObject,'BackgroundColor','white');
2129 end
2130 
2131 
2132 
2133 function lt2_osc_Callback(hObject, eventdata, handles)
2134 % hObject    handle to lt2_osc (see GCBO)
2135 % eventdata  reserved - to be defined in a future version of MATLAB
2136 % handles    structure with handles and user data (see GUIDATA)
2137 
2138 % Hints: get(hObject,'String') returns contents of lt2_osc as text
2139 %        str2double(get(hObject,'String')) returns contents of lt2_osc as a double
2140 ext_offset=str2double(get(handles.ext_offset,'String'));
2141 delay=str2double(get(hObject,'String'))+ext_offset;
2142 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctTimeDelay',delay);
2143 
2144 % --- Executes during object creation, after setting all properties.
2145 function lt2_osc_CreateFcn(hObject, eventdata, handles)
2146 % hObject    handle to lt2_osc (see GCBO)
2147 % eventdata  reserved - to be defined in a future version of MATLAB
2148 % handles    empty - handles not created until after all CreateFcns called
2149 
2150 % Hint: edit controls usually have a white background on Windows.
2151 %       See ISPC and COMPUTER.
2152 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2153     set(hObject,'BackgroundColor','white');
2154 end
2155 
2156 
2157 
2158 function lin_modulateur_Callback(hObject, eventdata, handles)
2159 % hObject    handle to lin_modulateur (see GCBO)
2160 % eventdata  reserved - to be defined in a future version of MATLAB
2161 % handles    structure with handles and user data (see GUIDATA)
2162 
2163 % Hints: get(hObject,'String') returns contents of lin_modulateur as text
2164 %        str2double(get(hObject,'String')) returns contents of lin_modulateur as a double
2165 inj_offset=str2double(get(handles.inj_offset,'String'));
2166 delay=str2double(get(hObject,'String'))+inj_offset;
2167 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
2168 
2169 % --- Executes during object creation, after setting all properties.
2170 function lin_modulateur_CreateFcn(hObject, eventdata, handles)
2171 % hObject    handle to lin_modulateur (see GCBO)
2172 % eventdata  reserved - to be defined in a future version of MATLAB
2173 % handles    empty - handles not created until after all CreateFcns called
2174 
2175 % Hint: edit controls usually have a white background on Windows.
2176 %       See ISPC and COMPUTER.
2177 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2178     set(hObject,'BackgroundColor','white');
2179 end
2180 
2181 
2182 
2183 function inj_offset_Callback(hObject, eventdata, handles)
2184 % hObject    handle to inj_offset (see GCBO)
2185 % eventdata  reserved - to be defined in a future version of MATLAB
2186 % handles    structure with handles and user data (see GUIDATA)
2187 
2188 % Hints: get(hObject,'String') returns contents of inj_offset as text
2189 %        str2double(get(hObject,'String')) returns contents of inj_offset as a double
2190 
2191 inj_offset=str2double(get(hObject,'String'));
2192 ext_offset=str2double(get(handles.ext_offset,'String'));
2193 save('synchro_offset', 'inj_offset' , 'ext_offset')
2194 
2195 %LIN
2196 delay=str2double(get(handles.lin_canon,'String'))+inj_offset;
2197 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay',delay);
2198 
2199 delay=str2double(get(handles.lin_modulateur,'String'))+inj_offset;
2200 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
2201 
2202 delay=str2double(get(handles.sdc1,'String'))+inj_offset;
2203 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay',delay);
2204 
2205 
2206 % LT1
2207 delay=str2double(get(handles.lt1_MC2,'String'))+inj_offset;
2208 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay',delay);
2209 
2210 delay=str2double(get(handles.lt1_MC1,'String'))+inj_offset;
2211 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay',delay);
2212 
2213 delay=str2double(get(handles.lt1_emittance,'String'))+inj_offset;
2214 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
2215 
2216 delay=str2double(get(handles.lt1_osc,'String'))+inj_offset;
2217 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay',delay);
2218 
2219 
2220 % BOO
2221 delay=str2double(get(handles.boo_inj_septum,'String'))+inj_offset;
2222 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay',delay);
2223 
2224 delay=str2double(get(handles.boo_inj_kicker,'String'))+inj_offset;
2225 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay',delay);
2226 
2227 delay=str2double(get(handles.boo_bpm,'String'))+inj_offset;
2228 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay',delay);
2229 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigTimeDelay',delay);
2230 tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigTimeDelay',delay);
2231 tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigTimeDelay',delay);
2232 
2233 
2234 delay=str2double(get(handles.boo_nod,'String'))+inj_offset;
2235 tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigTimeDelay',delay);
2236 
2237 delay=str2double(get(handles.boo_dcct,'String'))+inj_offset;
2238 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay',delay);
2239 
2240 
2241 
2242 % --- Executes during object creation, after setting all properties.
2243 function inj_offset_CreateFcn(hObject, eventdata, handles)
2244 % hObject    handle to inj_offset (see GCBO)
2245 % eventdata  reserved - to be defined in a future version of MATLAB
2246 % handles    empty - handles not created until after all CreateFcns called
2247 
2248 % Hint: edit controls usually have a white background on Windows.
2249 %       See ISPC and COMPUTER.
2250 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2251     set(hObject,'BackgroundColor','white');
2252 end
2253 
2254 
2255 
2256 function ext_offset_Callback(hObject, eventdata, handles)
2257 % hObject    handle to ext_offset (see GCBO)
2258 % eventdata  reserved - to be defined in a future version of MATLAB
2259 % handles    structure with handles and user data (see GUIDATA)
2260 
2261 % Hints: get(hObject,'String') returns contents of ext_offset as text
2262 %        str2double(get(hObject,'String')) returns contents of ext_offset as a double
2263 
2264 ext_offset=str2double(get(hObject,'String'));
2265 inj_offset=str2double(get(handles.inj_offset,'String'));
2266 save('synchro_offset', 'inj_offset' , 'ext_offset')
2267 
2268 %BOO
2269 delay=str2double(get(handles.boo_ext_dof,'String'))+ext_offset;
2270 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay',delay);
2271 
2272 delay=str2double(get(handles.boo_ext_sept_p,'String'))+ext_offset;
2273 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay',delay);
2274 
2275 delay=str2double(get(handles.boo_ext_sept_a,'String'))+ext_offset;
2276 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay',delay);
2277 
2278 delay=str2double(get(handles.boo_ext_kicker,'String'))+ext_offset;
2279 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay',delay);
2280 
2281 delay=str2double(get(handles.sdc2,'String'))+ext_offset;
2282 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay',delay);
2283 
2284 %LT2
2285 delay=str2double(get(handles.lt2_bpm,'String'))+ext_offset;
2286 tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
2287 
2288 delay=str2double(get(handles.lt2_osc,'String'))+ext_offset;
2289 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctTimeDelay',delay);
2290 
2291 delay=str2double(get(handles.lt2_emittance,'String'))+ext_offset;
2292 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvTimeDelay',delay);
2293 
2294 %ANS
2295 
2296 delay=str2double(get(handles.ans_inj_sept_a,'String'))+ext_offset;
2297 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay',delay);
2298 
2299 delay=str2double(get(handles.ans_inj_sept_p,'String'))+ext_offset;
2300 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay',delay);
2301 
2302 delay=str2double(get(handles.ans_inj_k1,'String'))+ext_offset;
2303 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay',delay);
2304 
2305 delay=str2double(get(handles.ans_inj_k2,'String'))+ext_offset;
2306 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay',delay);
2307 
2308 delay=str2double(get(handles.ans_inj_k3,'String'))+ext_offset;
2309 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay',delay);
2310 
2311 delay=str2double(get(handles.ans_inj_k4,'String'))+ext_offset;
2312 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay',delay);
2313 
2314 
2315 
2316 % --- Executes during object creation, after setting all properties.
2317 function ext_offset_CreateFcn(hObject, eventdata, handles)
2318 % hObject    handle to ext_offset (see GCBO)
2319 % eventdata  reserved - to be defined in a future version of MATLAB
2320 % handles    empty - handles not created until after all CreateFcns called
2321 
2322 % Hint: edit controls usually have a white background on Windows.
2323 %       See ISPC and COMPUTER.
2324 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2325     set(hObject,'BackgroundColor','white');
2326 end
2327 
2328 
2329 % --- Executes on button press in Acquisition_address.
2330 function Acquisition_address_Callback(hObject, eventdata, handles)
2331 % hObject    handle to Acquisition_address (see GCBO)
2332 % eventdata  reserved - to be defined in a future version of MATLAB
2333 % handles    structure with handles and user data (see GUIDATA)
2334 
2335 set(handles.inj_offset,'Enable','off');
2336 set(handles.sdc1,'Enable','off');
2337 set(handles.lin_canon,'Enable','off');
2338 set(handles.boo_bpm,'Enable','off');
2339 set(handles.lt1_emittance,'Enable','off');
2340 set(handles.lt1_MC1,'Enable','off');
2341 set(handles.lt1_MC2,'Enable','off');
2342 set(handles.lt1_osc,'Enable','off');
2343 set(handles.boo_dcct,'Enable','off');
2344 set(handles.boo_nod,'Enable','off');
2345 set(handles.boo_inj_septum,'Enable','off');
2346 set(handles.boo_inj_kicker,'Enable','off');
2347 set(handles.alim_dipole,'Enable','off');
2348 set(handles.alim_qf,'Enable','off');
2349 set(handles.alim_qd,'Enable','off');
2350 set(handles.alim_sf,'Enable','off');
2351 set(handles.alim_sd,'Enable','off');
2352 set(handles.boo_rf,'Enable','off');
2353 set(handles.lin_modulateur,'Enable','off');
2354 set(handles.ext_offset,'Enable','off');
2355 set(handles.boo_ext_dof,'Enable','off');
2356 set(handles.boo_ext_sept_p,'Enable','off');
2357 set(handles.boo_ext_sept_a,'Enable','off');
2358 set(handles.boo_ext_kicker,'Enable','off');
2359 set(handles.sdc2,'Enable','off');
2360 set(handles.lt2_emittance,'Enable','off');
2361 set(handles.lt2_osc,'Enable','off');
2362 set(handles.lt2_bpm,'Enable','off');
2363 set(handles.ans_inj_k1,'Enable','off');
2364 set(handles.ans_inj_k2,'Enable','off');
2365 set(handles.ans_inj_k3,'Enable','off');
2366 set(handles.ans_inj_k4,'Enable','off');
2367 set(handles.ans_inj_sept_p,'Enable','off');
2368 set(handles.ans_inj_sept_a,'Enable','off');
2369 set(handles.ans_bpm,'Enable','off');
2370 set(handles.ans_dcct,'Enable','off');
2371 set(handles.ans_bpm_c01,'Enable','off');
2372 set(handles.ans_bpm_c02,'Enable','off');
2373 set(handles.ans_bpm_c03,'Enable','off');
2374 set(handles.ans_bpm_c04,'Enable','off');
2375 set(handles.ans_bpm_c05,'Enable','off');
2376 set(handles.ans_bpm_c06,'Enable','off');
2377 set(handles.ans_bpm_c07,'Enable','off');
2378 set(handles.ans_bpm_c08,'Enable','off');
2379 set(handles.ans_bpm_c09,'Enable','off');
2380 set(handles.ans_bpm_c10,'Enable','off');
2381 set(handles.ans_bpm_c11,'Enable','off');
2382 set(handles.ans_bpm_c12,'Enable','off');
2383 set(handles.ans_bpm_c13,'Enable','off');
2384 set(handles.ans_bpm_c14,'Enable','off');
2385 set(handles.ans_bpm_c15,'Enable','off');
2386 set(handles.ans_bpm_c16,'Enable','off');
2387 
2388 n=1;
2389 
2390 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
2391 set(handles.pc_address,'String',num2str(temp.value(n)));
2392 
2393 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
2394 set(handles.inj_address,'String',num2str(temp.value(n)));
2395 
2396 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
2397 set(handles.soft_address,'String',num2str(temp.value(n)));
2398 
2399 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
2400 set(handles.ext_address,'String',num2str(temp.value(n)));
2401 
2402 
2403 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent');
2404 set(handles.sdc1,'String',num2str(temp.value(n)));
2405 
2406 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
2407 set(handles.lin_canon,'String',num2str(temp.value(n)));
2408 
2409 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent');
2410 set(handles.boo_bpm,'String',num2str(temp.value(n)));
2411 
2412 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent');
2413 set(handles.lt1_emittance,'String',num2str(temp.value(n)));
2414 
2415 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event');
2416 set(handles.lt1_MC1,'String',num2str(temp.value(n)));
2417 
2418 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event');
2419 set(handles.lt1_MC2,'String',num2str(temp.value(n)));
2420 
2421 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent');
2422 set(handles.lt1_osc,'String',num2str(temp.value(n)));
2423 
2424 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent');
2425 set(handles.boo_dcct,'String',num2str(temp.value(n)));
2426 
2427 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent');
2428 set(handles.boo_nod,'String',num2str(temp.value(n)));
2429 
2430 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent');
2431 set(handles.boo_inj_septum,'String',num2str(temp.value(n)));
2432 
2433 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent');
2434 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)));
2435 
2436 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpEvent');
2437 set(handles.alim_dipole,'String',num2str(temp.value(n)));
2438 
2439 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfEvent');
2440 set(handles.alim_qf,'String',num2str(temp.value(n)));
2441 
2442 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdEvent');
2443 set(handles.alim_qd,'String',num2str(temp.value(n)));
2444 
2445 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfEvent');
2446 set(handles.alim_sf,'String',num2str(temp.value(n)));
2447 
2448 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdEvent');
2449 set(handles.alim_sd,'String',num2str(temp.value(n)));
2450 
2451 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfEvent');
2452 set(handles.boo_rf,'String',num2str(temp.value(n)));
2453 
2454 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareEvent');
2455 set(handles.lin_modulateur,'String',num2str(temp.value(n)));
2456 
2457 
2458 
2459 
2460 
2461 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent');
2462 set(handles.boo_ext_dof,'String',num2str(temp.value(n)));
2463 
2464 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent');
2465 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)));
2466 
2467 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent');
2468 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)));
2469 
2470 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent');
2471 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)));
2472 
2473 
2474 
2475 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent');
2476 set(handles.sdc2,'String',num2str(temp.value(n)));
2477 
2478 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent');
2479 set(handles.lt2_emittance,'String',num2str(temp.value(n)));
2480 
2481 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent');
2482 set(handles.lt2_osc,'String',num2str(temp.value(n)));
2483 
2484 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent');
2485 set(handles.lt2_bpm,'String',num2str(temp.value(n)));
2486 
2487 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigEvent');
2488 set(handles.ans_inj_k1,'String',num2str(temp.value(n)));
2489 
2490 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigEvent');
2491 set(handles.ans_inj_k2,'String',num2str(temp.value(n)));
2492 
2493 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigEvent');
2494 set(handles.ans_inj_k3,'String',num2str(temp.value(n)));
2495 
2496 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigEvent');
2497 set(handles.ans_inj_k4,'String',num2str(temp.value(n)));
2498 
2499 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigEvent');
2500 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)));
2501 
2502 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigEvent');
2503 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)));
2504 
2505 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent');
2506 set(handles.ans_dcct,'String',num2str(temp.value(n)));
2507 
2508 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent');
2509 set(handles.ans_bpm,'String',num2str(temp.value(n)));
2510 set(handles.ans_bpm_c01,'String',num2str(temp.value(n)));
2511 
2512 temp=tango_read_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent');
2513 set(handles.ans_bpm_c02,'String',num2str(temp.value(n)));
2514 temp=tango_read_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent');
2515 set(handles.ans_bpm_c03,'String',num2str(temp.value(n)));
2516 temp=tango_read_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent');
2517 set(handles.ans_bpm_c04,'String',num2str(temp.value(n)));
2518 temp=tango_read_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent');
2519 set(handles.ans_bpm_c05,'String',num2str(temp.value(n)));
2520 temp=tango_read_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent');
2521 set(handles.ans_bpm_c06,'String',num2str(temp.value(n)));
2522 temp=tango_read_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent');
2523 set(handles.ans_bpm_c07,'String',num2str(temp.value(n)));
2524 temp=tango_read_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent');
2525 set(handles.ans_bpm_c08,'String',num2str(temp.value(n)));
2526 temp=tango_read_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent');
2527 set(handles.ans_bpm_c09,'String',num2str(temp.value(n)));
2528 temp=tango_read_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent');
2529 set(handles.ans_bpm_c10,'String',num2str(temp.value(n)));
2530 temp=tango_read_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent');
2531 set(handles.ans_bpm_c11,'String',num2str(temp.value(n)));
2532 temp=tango_read_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent');
2533 set(handles.ans_bpm_c12,'String',num2str(temp.value(n)));
2534 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent');
2535 set(handles.ans_bpm_c13,'String',num2str(temp.value(n)));
2536 temp=tango_read_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent');
2537 set(handles.ans_bpm_c14,'String',num2str(temp.value(n)));
2538 temp=tango_read_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent');
2539 set(handles.ans_bpm_c15,'String',num2str(temp.value(n)));
2540 temp=tango_read_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent');
2541 set(handles.ans_bpm_c16,'String',num2str(temp.value(n)));
2542 
2543 
2544 
2545 % --- Executes on button press in button_offinj_moins.
2546 function button_offinj_moins_Callback(hObject, eventdata, handles)
2547 % hObject    handle to button_offinj_moins (see GCBO)
2548 % eventdata  reserved - to be defined in a future version of MATLAB
2549 % handles    structure with handles and user data (see GUIDATA)
2550 
2551 temp=str2double(get(handles.inj_offset,'String'));
2552 step=temp-52*0.52243;
2553 set(handles.inj_offset,'String',step);
2554 inj_offset_Callback(handles.inj_offset, eventdata, handles);
2555 
2556 % --- Executes on button press in button_offinj_plus.
2557 function button_offinj_plus_Callback(hObject, eventdata, handles)
2558 % hObject    handle to button_offinj_plus (see GCBO)
2559 % eventdata  reserved - to be defined in a future version of MATLAB
2560 % handles    structure with handles and user data (see GUIDATA)
2561 
2562 temp=str2double(get(handles.inj_offset,'String'));
2563 step=temp+52*0.52243;
2564 set(handles.inj_offset,'String',step);
2565 inj_offset_Callback(handles.inj_offset, eventdata, handles);
2566 
2567 % --- Executes on button press in button_offext_moins.
2568 function button_offext_moins_Callback(hObject, eventdata, handles)
2569 % hObject    handle to button_offext_moins (see GCBO)
2570 % eventdata  reserved - to be defined in a future version of MATLAB
2571 % handles    structure with handles and user data (see GUIDATA)
2572 
2573 temp=str2double(get(handles.ext_offset,'String'));
2574 step=temp-52*0.52243;
2575 set(handles.ext_offset,'String',step);
2576 ext_offset_Callback(handles.ext_offset, eventdata, handles);
2577 
2578 % --- Executes on button press in button_offext_plus.
2579 function button_offext_plus_Callback(hObject, eventdata, handles)
2580 % hObject    handle to button_offext_plus (see GCBO)
2581 % eventdata  reserved - to be defined in a future version of MATLAB
2582 % handles    structure with handles and user data (see GUIDATA)
2583 
2584 temp=str2double(get(handles.ext_offset,'String'));
2585 step=temp+52*0.52243;
2586 set(handles.ext_offset,'String',step);
2587 ext_offset_Callback(handles.ext_offset, eventdata, handles);
2588 
2589 
2590 % --- Executes on button press in button_bpm.
2591 function button_bpm_Callback(hObject, eventdata, handles)
2592 % hObject    handle to button_bpm (see GCBO)
2593 % eventdata  reserved - to be defined in a future version of MATLAB
2594 % handles    structure with handles and user data (see GUIDATA)
2595 
2596 % Hint: get(hObject,'Value') returns toggle state of button_bpm
2597 
2598 bpm=get(hObject,'Value');
2599 
2600 if (bpm==0)
2601    set(handles.panel_bpm,'Visible','off');
2602 elseif (bpm==1)
2603     set(handles.panel_bpm,'Visible','on');
2604 end
2605 
2606 
2607 
2608 function ans_bpm_c01_Callback(hObject, eventdata, handles)
2609 % hObject    handle to ans_bpm_c01 (see GCBO)
2610 % eventdata  reserved - to be defined in a future version of MATLAB
2611 % handles    structure with handles and user data (see GUIDATA)
2612 
2613 % Hints: get(hObject,'String') returns contents of ans_bpm_c01 as text
2614 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c01 as a double
2615 
2616 ext_offset=str2double(get(handles.ext_offset,'String'));
2617 delay=str2double(get(hObject,'String'))+ext_offset;
2618 tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
2619 
2620 % --- Executes during object creation, after setting all properties.
2621 function ans_bpm_c01_CreateFcn(hObject, eventdata, handles)
2622 % hObject    handle to ans_bpm_c01 (see GCBO)
2623 % eventdata  reserved - to be defined in a future version of MATLAB
2624 % handles    empty - handles not created until after all CreateFcns called
2625 
2626 % Hint: edit controls usually have a white background on Windows.
2627 %       See ISPC and COMPUTER.
2628 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2629     set(hObject,'BackgroundColor','white');
2630 end
2631 
2632 
2633 function ans_bpm_c02_Callback(hObject, eventdata, handles)
2634 % hObject    handle to ans_bpm_c02 (see GCBO)
2635 % eventdata  reserved - to be defined in a future version of MATLAB
2636 % handles    structure with handles and user data (see GUIDATA)
2637 
2638 % Hints: get(hObject,'String') returns contents of ans_bpm_c02 as text
2639 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c02 as a double
2640 ext_offset=str2double(get(handles.ext_offset,'String'));
2641 delay=str2double(get(hObject,'String'))+ext_offset;
2642 tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2643 
2644 
2645 % --- Executes during object creation, after setting all properties.
2646 function ans_bpm_c02_CreateFcn(hObject, eventdata, handles)
2647 % hObject    handle to ans_bpm_c02 (see GCBO)
2648 % eventdata  reserved - to be defined in a future version of MATLAB
2649 % handles    empty - handles not created until after all CreateFcns called
2650 
2651 % Hint: edit controls usually have a white background on Windows.
2652 %       See ISPC and COMPUTER.
2653 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2654     set(hObject,'BackgroundColor','white');
2655 end
2656 
2657 
2658 
2659 function ans_bpm_c03_Callback(hObject, eventdata, handles)
2660 % hObject    handle to ans_bpm_c03 (see GCBO)
2661 % eventdata  reserved - to be defined in a future version of MATLAB
2662 % handles    structure with handles and user data (see GUIDATA)
2663 
2664 % Hints: get(hObject,'String') returns contents of ans_bpm_c03 as text
2665 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c03 as a double
2666 ext_offset=str2double(get(handles.ext_offset,'String'));
2667 delay=str2double(get(hObject,'String'))+ext_offset;
2668 tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2669 
2670 
2671 % --- Executes during object creation, after setting all properties.
2672 function ans_bpm_c03_CreateFcn(hObject, eventdata, handles)
2673 % hObject    handle to ans_bpm_c03 (see GCBO)
2674 % eventdata  reserved - to be defined in a future version of MATLAB
2675 % handles    empty - handles not created until after all CreateFcns called
2676 
2677 % Hint: edit controls usually have a white background on Windows.
2678 %       See ISPC and COMPUTER.
2679 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2680     set(hObject,'BackgroundColor','white');
2681 end
2682 
2683 
2684 
2685 function ans_bpm_c04_Callback(hObject, eventdata, handles)
2686 % hObject    handle to ans_bpm_c04 (see GCBO)
2687 % eventdata  reserved - to be defined in a future version of MATLAB
2688 % handles    structure with handles and user data (see GUIDATA)
2689 
2690 % Hints: get(hObject,'String') returns contents of ans_bpm_c04 as text
2691 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c04 as a double
2692 ext_offset=str2double(get(handles.ext_offset,'String'));
2693 delay=str2double(get(hObject,'String'))+ext_offset;
2694 tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2695 
2696 
2697 % --- Executes during object creation, after setting all properties.
2698 function ans_bpm_c04_CreateFcn(hObject, eventdata, handles)
2699 % hObject    handle to ans_bpm_c04 (see GCBO)
2700 % eventdata  reserved - to be defined in a future version of MATLAB
2701 % handles    empty - handles not created until after all CreateFcns called
2702 
2703 % Hint: edit controls usually have a white background on Windows.
2704 %       See ISPC and COMPUTER.
2705 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2706     set(hObject,'BackgroundColor','white');
2707 end
2708 
2709 
2710 
2711 function ans_bpm_c05_Callback(hObject, eventdata, handles)
2712 % hObject    handle to ans_bpm_c05 (see GCBO)
2713 % eventdata  reserved - to be defined in a future version of MATLAB
2714 % handles    structure with handles and user data (see GUIDATA)
2715 
2716 % Hints: get(hObject,'String') returns contents of ans_bpm_c05 as text
2717 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c05 as a double
2718 ext_offset=str2double(get(handles.ext_offset,'String'));
2719 delay=str2double(get(hObject,'String'))+ext_offset;
2720 tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2721 
2722 
2723 % --- Executes during object creation, after setting all properties.
2724 function ans_bpm_c05_CreateFcn(hObject, eventdata, handles)
2725 % hObject    handle to ans_bpm_c05 (see GCBO)
2726 % eventdata  reserved - to be defined in a future version of MATLAB
2727 % handles    empty - handles not created until after all CreateFcns called
2728 
2729 % Hint: edit controls usually have a white background on Windows.
2730 %       See ISPC and COMPUTER.
2731 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2732     set(hObject,'BackgroundColor','white');
2733 end
2734 
2735 
2736 
2737 function ans_bpm_c06_Callback(hObject, eventdata, handles)
2738 % hObject    handle to ans_bpm_c06 (see GCBO)
2739 % eventdata  reserved - to be defined in a future version of MATLAB
2740 % handles    structure with handles and user data (see GUIDATA)
2741 
2742 % Hints: get(hObject,'String') returns contents of ans_bpm_c06 as text
2743 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c06 as a double
2744 ext_offset=str2double(get(handles.ext_offset,'String'));
2745 delay=str2double(get(hObject,'String'))+ext_offset;
2746 tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2747 
2748 
2749 % --- Executes during object creation, after setting all properties.
2750 function ans_bpm_c06_CreateFcn(hObject, eventdata, handles)
2751 % hObject    handle to ans_bpm_c06 (see GCBO)
2752 % eventdata  reserved - to be defined in a future version of MATLAB
2753 % handles    empty - handles not created until after all CreateFcns called
2754 
2755 % Hint: edit controls usually have a white background on Windows.
2756 %       See ISPC and COMPUTER.
2757 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2758     set(hObject,'BackgroundColor','white');
2759 end
2760 
2761 
2762 
2763 function ans_bpm_c07_Callback(hObject, eventdata, handles)
2764 % hObject    handle to ans_bpm_c07 (see GCBO)
2765 % eventdata  reserved - to be defined in a future version of MATLAB
2766 % handles    structure with handles and user data (see GUIDATA)
2767 
2768 % Hints: get(hObject,'String') returns contents of ans_bpm_c07 as text
2769 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c07 as a double
2770 ext_offset=str2double(get(handles.ext_offset,'String'));
2771 delay=str2double(get(hObject,'String'))+ext_offset;
2772 tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2773 
2774 
2775 % --- Executes during object creation, after setting all properties.
2776 function ans_bpm_c07_CreateFcn(hObject, eventdata, handles)
2777 % hObject    handle to ans_bpm_c07 (see GCBO)
2778 % eventdata  reserved - to be defined in a future version of MATLAB
2779 % handles    empty - handles not created until after all CreateFcns called
2780 
2781 % Hint: edit controls usually have a white background on Windows.
2782 %       See ISPC and COMPUTER.
2783 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2784     set(hObject,'BackgroundColor','white');
2785 end
2786 
2787 
2788 
2789 function ans_bpm_c08_Callback(hObject, eventdata, handles)
2790 % hObject    handle to ans_bpm_c08 (see GCBO)
2791 % eventdata  reserved - to be defined in a future version of MATLAB
2792 % handles    structure with handles and user data (see GUIDATA)
2793 
2794 % Hints: get(hObject,'String') returns contents of ans_bpm_c08 as text
2795 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c08 as a double
2796 ext_offset=str2double(get(handles.ext_offset,'String'));
2797 delay=str2double(get(hObject,'String'))+ext_offset;
2798 tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2799 
2800 
2801 % --- Executes during object creation, after setting all properties.
2802 function ans_bpm_c08_CreateFcn(hObject, eventdata, handles)
2803 % hObject    handle to ans_bpm_c08 (see GCBO)
2804 % eventdata  reserved - to be defined in a future version of MATLAB
2805 % handles    empty - handles not created until after all CreateFcns called
2806 
2807 % Hint: edit controls usually have a white background on Windows.
2808 %       See ISPC and COMPUTER.
2809 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2810     set(hObject,'BackgroundColor','white');
2811 end
2812 
2813 
2814 
2815 function ans_bpm_c09_Callback(hObject, eventdata, handles)
2816 % hObject    handle to ans_bpm_c09 (see GCBO)
2817 % eventdata  reserved - to be defined in a future version of MATLAB
2818 % handles    structure with handles and user data (see GUIDATA)
2819 
2820 % Hints: get(hObject,'String') returns contents of ans_bpm_c09 as text
2821 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c09 as a double
2822 ext_offset=str2double(get(handles.ext_offset,'String'));
2823 delay=str2double(get(hObject,'String'))+ext_offset;
2824 tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2825 
2826 
2827 % --- Executes during object creation, after setting all properties.
2828 function ans_bpm_c09_CreateFcn(hObject, eventdata, handles)
2829 % hObject    handle to ans_bpm_c09 (see GCBO)
2830 % eventdata  reserved - to be defined in a future version of MATLAB
2831 % handles    empty - handles not created until after all CreateFcns called
2832 
2833 % Hint: edit controls usually have a white background on Windows.
2834 %       See ISPC and COMPUTER.
2835 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2836     set(hObject,'BackgroundColor','white');
2837 end
2838 
2839 
2840 
2841 function ans_bpm_c10_Callback(hObject, eventdata, handles)
2842 % hObject    handle to ans_bpm_c10 (see GCBO)
2843 % eventdata  reserved - to be defined in a future version of MATLAB
2844 % handles    structure with handles and user data (see GUIDATA)
2845 
2846 % Hints: get(hObject,'String') returns contents of ans_bpm_c10 as text
2847 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c10 as a double
2848 ext_offset=str2double(get(handles.ext_offset,'String'));
2849 delay=str2double(get(hObject,'String'))+ext_offset;
2850 tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2851 
2852 
2853 % --- Executes during object creation, after setting all properties.
2854 function ans_bpm_c10_CreateFcn(hObject, eventdata, handles)
2855 % hObject    handle to ans_bpm_c10 (see GCBO)
2856 % eventdata  reserved - to be defined in a future version of MATLAB
2857 % handles    empty - handles not created until after all CreateFcns called
2858 
2859 % Hint: edit controls usually have a white background on Windows.
2860 %       See ISPC and COMPUTER.
2861 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2862     set(hObject,'BackgroundColor','white');
2863 end
2864 
2865 
2866 
2867 function ans_bpm_c11_Callback(hObject, eventdata, handles)
2868 % hObject    handle to ans_bpm_c11 (see GCBO)
2869 % eventdata  reserved - to be defined in a future version of MATLAB
2870 % handles    structure with handles and user data (see GUIDATA)
2871 
2872 % Hints: get(hObject,'String') returns contents of ans_bpm_c11 as text
2873 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c11 as a double
2874 ext_offset=str2double(get(handles.ext_offset,'String'));
2875 delay=str2double(get(hObject,'String'))+ext_offset;
2876 tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2877 
2878 
2879 % --- Executes during object creation, after setting all properties.
2880 function ans_bpm_c11_CreateFcn(hObject, eventdata, handles)
2881 % hObject    handle to ans_bpm_c11 (see GCBO)
2882 % eventdata  reserved - to be defined in a future version of MATLAB
2883 % handles    empty - handles not created until after all CreateFcns called
2884 
2885 % Hint: edit controls usually have a white background on Windows.
2886 %       See ISPC and COMPUTER.
2887 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2888     set(hObject,'BackgroundColor','white');
2889 end
2890 
2891 
2892 
2893 function ans_bpm_c12_Callback(hObject, eventdata, handles)
2894 % hObject    handle to ans_bpm_c12 (see GCBO)
2895 % eventdata  reserved - to be defined in a future version of MATLAB
2896 % handles    structure with handles and user data (see GUIDATA)
2897 
2898 % Hints: get(hObject,'String') returns contents of ans_bpm_c12 as text
2899 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c12 as a double
2900 ext_offset=str2double(get(handles.ext_offset,'String'));
2901 delay=str2double(get(hObject,'String'))+ext_offset;
2902 tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2903 
2904 
2905 % --- Executes during object creation, after setting all properties.
2906 function ans_bpm_c12_CreateFcn(hObject, eventdata, handles)
2907 % hObject    handle to ans_bpm_c12 (see GCBO)
2908 % eventdata  reserved - to be defined in a future version of MATLAB
2909 % handles    empty - handles not created until after all CreateFcns called
2910 
2911 % Hint: edit controls usually have a white background on Windows.
2912 %       See ISPC and COMPUTER.
2913 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2914     set(hObject,'BackgroundColor','white');
2915 end
2916 
2917 
2918 
2919 function ans_bpm_c13_Callback(hObject, eventdata, handles)
2920 % hObject    handle to ans_bpm_c13 (see GCBO)
2921 % eventdata  reserved - to be defined in a future version of MATLAB
2922 % handles    structure with handles and user data (see GUIDATA)
2923 
2924 % Hints: get(hObject,'String') returns contents of ans_bpm_c13 as text
2925 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c13 as a double
2926 ext_offset=str2double(get(handles.ext_offset,'String'));
2927 delay=str2double(get(hObject,'String'))+ext_offset;
2928 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2929 
2930 
2931 % --- Executes during object creation, after setting all properties.
2932 function ans_bpm_c13_CreateFcn(hObject, eventdata, handles)
2933 % hObject    handle to ans_bpm_c13 (see GCBO)
2934 % eventdata  reserved - to be defined in a future version of MATLAB
2935 % handles    empty - handles not created until after all CreateFcns called
2936 
2937 % Hint: edit controls usually have a white background on Windows.
2938 %       See ISPC and COMPUTER.
2939 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2940     set(hObject,'BackgroundColor','white');
2941 end
2942 
2943 
2944 
2945 function ans_bpm_c14_Callback(hObject, eventdata, handles)
2946 % hObject    handle to ans_bpm_c14 (see GCBO)
2947 % eventdata  reserved - to be defined in a future version of MATLAB
2948 % handles    structure with handles and user data (see GUIDATA)
2949 
2950 % Hints: get(hObject,'String') returns contents of ans_bpm_c14 as text
2951 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c14 as a double
2952 ext_offset=str2double(get(handles.ext_offset,'String'));
2953 delay=str2double(get(hObject,'String'))+ext_offset;
2954 tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2955 
2956 
2957 % --- Executes during object creation, after setting all properties.
2958 function ans_bpm_c14_CreateFcn(hObject, eventdata, handles)
2959 % hObject    handle to ans_bpm_c14 (see GCBO)
2960 % eventdata  reserved - to be defined in a future version of MATLAB
2961 % handles    empty - handles not created until after all CreateFcns called
2962 
2963 % Hint: edit controls usually have a white background on Windows.
2964 %       See ISPC and COMPUTER.
2965 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2966     set(hObject,'BackgroundColor','white');
2967 end
2968 
2969 
2970 
2971 function ans_bpm_c15_Callback(hObject, eventdata, handles)
2972 % hObject    handle to ans_bpm_c15 (see GCBO)
2973 % eventdata  reserved - to be defined in a future version of MATLAB
2974 % handles    structure with handles and user data (see GUIDATA)
2975 
2976 % Hints: get(hObject,'String') returns contents of ans_bpm_c15 as text
2977 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c15 as a double
2978 ext_offset=str2double(get(handles.ext_offset,'String'));
2979 delay=str2double(get(hObject,'String'))+ext_offset;
2980 tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
2981 
2982 
2983 % --- Executes during object creation, after setting all properties.
2984 function ans_bpm_c15_CreateFcn(hObject, eventdata, handles)
2985 % hObject    handle to ans_bpm_c15 (see GCBO)
2986 % eventdata  reserved - to be defined in a future version of MATLAB
2987 % handles    empty - handles not created until after all CreateFcns called
2988 
2989 % Hint: edit controls usually have a white background on Windows.
2990 %       See ISPC and COMPUTER.
2991 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
2992     set(hObject,'BackgroundColor','white');
2993 end
2994 
2995 
2996 
2997 function ans_bpm_c16_Callback(hObject, eventdata, handles)
2998 % hObject    handle to ans_bpm_c16 (see GCBO)
2999 % eventdata  reserved - to be defined in a future version of MATLAB
3000 % handles    structure with handles and user data (see GUIDATA)
3001 
3002 % Hints: get(hObject,'String') returns contents of ans_bpm_c16 as text
3003 %        str2double(get(hObject,'String')) returns contents of ans_bpm_c16 as a double
3004 ext_offset=str2double(get(handles.ext_offset,'String'));
3005 delay=str2double(get(hObject,'String'))+ext_offset;
3006 tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
3007 
3008 
3009 % --- Executes during object creation, after setting all properties.
3010 function ans_bpm_c16_CreateFcn(hObject, eventdata, handles)
3011 % hObject    handle to ans_bpm_c16 (see GCBO)
3012 % eventdata  reserved - to be defined in a future version of MATLAB
3013 % handles    empty - handles not created until after all CreateFcns called
3014 
3015 % Hint: edit controls usually have a white background on Windows.
3016 %       See ISPC and COMPUTER.
3017 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3018     set(hObject,'BackgroundColor','white');
3019 end
3020 
3021 
3022 
3023 function edit_filling_relecture_tables_Callback(hObject, eventdata, handles)
3024 % hObject    handle to edit_filling_relecture_tables (see GCBO)
3025 % eventdata  reserved - to be defined in a future version of MATLAB
3026 % handles    structure with handles and user data (see GUIDATA)
3027 
3028 % Hints: get(hObject,'String') returns contents of edit_filling_relecture_tables as text
3029 %        str2double(get(hObject,'String')) returns contents of edit_filling_relecture_tables as a double
3030 
3031 
3032 % --- Executes during object creation, after setting all properties.
3033 function edit_filling_relecture_tables_CreateFcn(hObject, eventdata, handles)
3034 % hObject    handle to edit_filling_relecture_tables (see GCBO)
3035 % eventdata  reserved - to be defined in a future version of MATLAB
3036 % handles    empty - handles not created until after all CreateFcns called
3037 
3038 % Hint: edit controls usually have a white background on Windows.
3039 %       See ISPC and COMPUTER.
3040 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3041     set(hObject,'BackgroundColor','white');
3042 end
3043 
3044 
3045 
3046 function edit72_Callback(hObject, eventdata, handles)
3047 % hObject    handle to edit72 (see GCBO)
3048 % eventdata  reserved - to be defined in a future version of MATLAB
3049 % handles    structure with handles and user data (see GUIDATA)
3050 
3051 % Hints: get(hObject,'String') returns contents of edit72 as text
3052 %        str2double(get(hObject,'String')) returns contents of edit72 as a double
3053 
3054 
3055 % --- Executes during object creation, after setting all properties.
3056 function edit72_CreateFcn(hObject, eventdata, handles)
3057 % hObject    handle to edit72 (see GCBO)
3058 % eventdata  reserved - to be defined in a future version of MATLAB
3059 % handles    empty - handles not created until after all CreateFcns called
3060 
3061 % Hint: edit controls usually have a white background on Windows.
3062 %       See ISPC and COMPUTER.
3063 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3064     set(hObject,'BackgroundColor','white');
3065 end
3066 
3067 
3068 
3069 function edit_filling_relecture_bunch_Callback(hObject, eventdata, handles)
3070 % hObject    handle to edit_filling_relecture_bunch (see GCBO)
3071 % eventdata  reserved - to be defined in a future version of MATLAB
3072 % handles    structure with handles and user data (see GUIDATA)
3073 
3074 % Hints: get(hObject,'String') returns contents of edit_filling_relecture_bunch as text
3075 %        str2double(get(hObject,'String')) returns contents of edit_filling_relecture_bunch as a double
3076 
3077 
3078 % --- Executes during object creation, after setting all properties.
3079 function edit_filling_relecture_bunch_CreateFcn(hObject, eventdata, handles)
3080 % hObject    handle to edit_filling_relecture_bunch (see GCBO)
3081 % eventdata  reserved - to be defined in a future version of MATLAB
3082 % handles    empty - handles not created until after all CreateFcns called
3083 
3084 % Hint: edit controls usually have a white background on Windows.
3085 %       See ISPC and COMPUTER.
3086 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3087     set(hObject,'BackgroundColor','white');
3088 end
3089 
3090 
3091 
3092 function edit_filling_entrer_bunch_Callback(hObject, eventdata, handles)
3093 % hObject    handle to edit_filling_entrer_bunch (see GCBO)
3094 % eventdata  reserved - to be defined in a future version of MATLAB
3095 % handles    structure with handles and user data (see GUIDATA)
3096 
3097 % Hints: get(hObject,'String') returns contents of edit_filling_entrer_bunch as text
3098 %        str2double(get(hObject,'String')) returns contents of edit_filling_entrer_bunch as a double
3099 
3100 
3101 % --- Executes during object creation, after setting all properties.
3102 function edit_filling_entrer_bunch_CreateFcn(hObject, eventdata, handles)
3103 % hObject    handle to edit_filling_entrer_bunch (see GCBO)
3104 % eventdata  reserved - to be defined in a future version of MATLAB
3105 % handles    empty - handles not created until after all CreateFcns called
3106 
3107 % Hint: edit controls usually have a white background on Windows.
3108 %       See ISPC and COMPUTER.
3109 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3110     set(hObject,'BackgroundColor','white');
3111 end
3112 
3113 
3114 % --- Executes on button press in button_update.
3115 function button_update_Callback(hObject, eventdata, handles)
3116 % hObject    handle to button_update (see GCBO)
3117 % eventdata  reserved - to be defined in a future version of MATLAB
3118 % handles    structure with handles and user data (see GUIDATA)
3119 
3120 fprintf('*****Update des 16 cartes locales******\n')
3121 r=tango_command_inout2('ANS/SY/LOCAL.SDC.1',  'Update');retour_update('ANS/SY/LOCAL.SDC.1',r);
3122 r=tango_command_inout2('LT1/SY/LOCAL.LINAC.1','Update');retour_update('LT1/SY/LOCAL.LINAC.1',r);
3123 
3124 r=tango_command_inout2('BOO/SY/LOCAL.Binj.1',  'Update');    retour_update('BOO/SY/LOCAL.Binj.1',r);
3125 r=tango_command_inout2('BOO/SY/LOCAL.Alim.1',  'Update'); retour_update('BOO/SY/LOCAL.Alim.1',r);
3126 r=tango_command_inout2('BOO/SY/LOCAL.DG.3', 'Update');retour_update('BOO/SY/LOCAL.DG.3',r);
3127 r=tango_command_inout2('BOO/SY/LOCAL.Bext.1',  'Update');retour_update('BOO/SY/LOCAL.Bext.1',r);
3128 
3129 r=tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Update');retour_update('ANS-C01/SY/LOCAL.Ainj.1',r);
3130 r=tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.2',  'Update');retour_update('ANS-C01/SY/LOCAL.Ainj.2',r);
3131 r=tango_command_inout2('ANS-C01/SY/LOCAL.DG.2',  'Update');retour_update('ANS-C01/SY/LOCAL.DG.2',r);
3132 r=tango_command_inout2('ANS-C03/SY/LOCAL.DG.1',  'Update');retour_update('ANS-C03/SY/LOCAL.DG.1',r);
3133 r=tango_command_inout2('ANS-C05/SY/LOCAL.DG.1',  'Update');retour_update('ANS-C05/SY/LOCAL.DG.1',r);
3134 r=tango_command_inout2('ANS-C07/SY/LOCAL.DG.1', 'Update');retour_update('ANS-C07/SY/LOCAL.DG.1',r);
3135 r=tango_command_inout2('ANS-C09/SY/LOCAL.DG.1',  'Update');retour_update('ANS-C09/SY/LOCAL.DG.1',r);
3136 r=tango_command_inout2('ANS-C11/SY/LOCAL.DG.1', 'Update');retour_update('ANS-C11/SY/LOCAL.DG.1',r);
3137 r=tango_command_inout2('ANS-C13/SY/LOCAL.DG.1',  'Update');retour_update('ANS-C13/SY/LOCAL.DG.1',r);
3138 r=tango_command_inout2('ANS-C15/SY/LOCAL.DG.1',  'Update'); retour_update('ANS-C15/SY/LOCAL.DG.1',r);
3139 fprintf('**************************************\n')
3140 %retour_command=vect
3141 %fprintf('16 zéro = OK : %d\n',vect)
3142 
3143 % --- Executes on button press in button_trigstatus.
3144 function button_trigstatus_Callback(hObject, eventdata, handles)
3145 % hObject    handle to button_trigstatus (see GCBO)
3146 % eventdata  reserved - to be defined in a future version of MATLAB
3147 % handles    structure with handles and user data (see GUIDATA)
3148 
3149 set(handles.inj_offset,'Enable','off');
3150 set(handles.sdc1,'Enable','off');
3151 set(handles.lin_canon,'Enable','off');
3152 set(handles.boo_bpm,'Enable','off');
3153 set(handles.lt1_emittance,'Enable','off');
3154 set(handles.lt1_MC1,'Enable','off');
3155 set(handles.lt1_MC2,'Enable','off');
3156 set(handles.lt1_osc,'Enable','off');
3157 set(handles.boo_dcct,'Enable','off');
3158 set(handles.boo_nod,'Enable','off');
3159 set(handles.boo_inj_septum,'Enable','off');
3160 set(handles.boo_inj_kicker,'Enable','off');
3161 set(handles.alim_dipole,'Enable','off');
3162 set(handles.alim_qf,'Enable','off');
3163 set(handles.alim_qd,'Enable','off');
3164 set(handles.alim_sf,'Enable','off');
3165 set(handles.alim_sd,'Enable','off');
3166 set(handles.boo_rf,'Enable','off');
3167 set(handles.lin_modulateur,'Enable','off');
3168 set(handles.ext_offset,'Enable','off');
3169 set(handles.boo_ext_dof,'Enable','off');
3170 set(handles.boo_ext_sept_p,'Enable','off');
3171 set(handles.boo_ext_sept_a,'Enable','off');
3172 set(handles.boo_ext_kicker,'Enable','off');
3173 set(handles.sdc2,'Enable','off');
3174 set(handles.lt2_emittance,'Enable','off');
3175 set(handles.lt2_osc,'Enable','off');
3176 set(handles.lt2_bpm,'Enable','off');
3177 set(handles.ans_inj_k1,'Enable','off');
3178 set(handles.ans_inj_k2,'Enable','off');
3179 set(handles.ans_inj_k3,'Enable','off');
3180 set(handles.ans_inj_k4,'Enable','off');
3181 set(handles.ans_inj_sept_p,'Enable','off');
3182 set(handles.ans_inj_sept_a,'Enable','off');
3183 set(handles.ans_bpm,'Enable','off');
3184 set(handles.ans_dcct,'Enable','off');
3185 set(handles.ans_bpm_c01,'Enable','off');
3186 set(handles.ans_bpm_c02,'Enable','off');
3187 set(handles.ans_bpm_c03,'Enable','off');
3188 set(handles.ans_bpm_c04,'Enable','off');
3189 set(handles.ans_bpm_c05,'Enable','off');
3190 set(handles.ans_bpm_c06,'Enable','off');
3191 set(handles.ans_bpm_c07,'Enable','off');
3192 set(handles.ans_bpm_c08,'Enable','off');
3193 set(handles.ans_bpm_c09,'Enable','off');
3194 set(handles.ans_bpm_c10,'Enable','off');
3195 set(handles.ans_bpm_c11,'Enable','off');
3196 set(handles.ans_bpm_c12,'Enable','off');
3197 set(handles.ans_bpm_c13,'Enable','off');
3198 set(handles.ans_bpm_c14,'Enable','off');
3199 set(handles.ans_bpm_c15,'Enable','off');
3200 set(handles.ans_bpm_c16,'Enable','off');
3201 
3202 
3203 n=1;
3204 
3205 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
3206 set(handles.pc_address,'String',num2str(temp.value(n)));
3207 
3208 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
3209 set(handles.inj_address,'String',num2str(temp.value(n)));
3210 
3211 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
3212 set(handles.soft_address,'String',num2str(temp.value(n)));
3213 
3214 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
3215 set(handles.ext_address,'String',num2str(temp.value(n)));
3216 
3217 
3218 
3219 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTrigStatus');
3220 set(handles.sdc1,'String',num2str(temp.value(n)));
3221 
3222 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTrigStatus');
3223 set(handles.lin_canon,'String',num2str(temp.value(n)));
3224 
3225 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTrigStatus');
3226 set(handles.boo_bpm,'String',num2str(temp.value(n)));
3227 
3228 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTrigStatus');
3229 set(handles.lt1_emittance,'String',num2str(temp.value(n)));
3230 
3231 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TrigStatus');
3232 set(handles.lt1_MC1,'String',num2str(temp.value(n)));
3233 
3234 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TrigStatus');
3235 set(handles.lt1_MC2,'String',num2str(temp.value(n)));
3236 
3237 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscTrigStatus');
3238 set(handles.lt1_osc,'String',num2str(temp.value(n)));
3239 
3240 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTrigStatus');
3241 set(handles.boo_dcct,'String',num2str(temp.value(n)));
3242 
3243 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigTrigStatus');
3244 set(handles.boo_nod,'String',num2str(temp.value(n)));
3245 
3246 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTrigStatus');
3247 set(handles.boo_inj_septum,'String',num2str(temp.value(n)));
3248 
3249 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTrigStatus');
3250 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)));
3251 
3252 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTrigStatus');
3253 set(handles.alim_dipole,'String',num2str(temp.value(n)));
3254 
3255 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTrigStatus');
3256 set(handles.alim_qf,'String',num2str(temp.value(n)));
3257 
3258 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTrigStatus');
3259 set(handles.alim_qd,'String',num2str(temp.value(n)));
3260 
3261 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTrigStatus');
3262 set(handles.alim_sf,'String',num2str(temp.value(n)));
3263 
3264 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTrigStatus');
3265 set(handles.alim_sd,'String',num2str(temp.value(n)));
3266 
3267 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfTrigStatus');
3268 set(handles.boo_rf,'String',num2str(temp.value(n)));
3269 
3270 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTrigStatus');
3271 set(handles.lin_modulateur,'String',num2str(temp.value(n)));
3272 
3273 
3274 
3275 
3276 
3277 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTrigStatus');
3278 set(handles.boo_ext_dof,'String',num2str(temp.value(n)));
3279 
3280 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTrigStatus');
3281 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)));
3282 
3283 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTrigStatus');
3284 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)));
3285 
3286 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTrigStatus');
3287 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)));
3288 
3289 
3290 
3291 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTrigStatus');
3292 set(handles.sdc2,'String',num2str(temp.value(n)));
3293 
3294 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvTrigStatus');
3295 set(handles.lt2_emittance,'String',num2str(temp.value(n)));
3296 
3297 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctTrigStatus');
3298 set(handles.lt2_osc,'String',num2str(temp.value(n)));
3299 
3300 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTrigStatus');
3301 set(handles.lt2_bpm,'String',num2str(temp.value(n)));
3302 
3303 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTrigStatus');
3304 set(handles.ans_inj_k1,'String',num2str(temp.value(n)));
3305 
3306 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTrigStatus');
3307 set(handles.ans_inj_k2,'String',num2str(temp.value(n)));
3308 
3309 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTrigStatus');
3310 set(handles.ans_inj_k3,'String',num2str(temp.value(n)));
3311 
3312 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTrigStatus');
3313 set(handles.ans_inj_k4,'String',num2str(temp.value(n)));
3314 
3315 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTrigStatus');
3316 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)));
3317 
3318 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTrigStatus');
3319 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)));
3320 
3321 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTrigStatus');
3322 set(handles.ans_dcct,'String',num2str(temp.value(n)));
3323 
3324 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTrigStatus');
3325 set(handles.ans_bpm,'String',num2str(temp.value(n)));
3326 set(handles.ans_bpm_c01,'String',num2str(temp.value(n)));
3327 
3328 temp=tango_read_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3329 set(handles.ans_bpm_c02,'String',num2str(temp.value(n)));
3330 temp=tango_read_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3331 set(handles.ans_bpm_c03,'String',num2str(temp.value(n)));
3332 temp=tango_read_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3333 set(handles.ans_bpm_c04,'String',num2str(temp.value(n)));
3334 temp=tango_read_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3335 set(handles.ans_bpm_c05,'String',num2str(temp.value(n)));
3336 temp=tango_read_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3337 set(handles.ans_bpm_c06,'String',num2str(temp.value(n)));
3338 temp=tango_read_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3339 set(handles.ans_bpm_c07,'String',num2str(temp.value(n)));
3340 temp=tango_read_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3341 set(handles.ans_bpm_c08,'String',num2str(temp.value(n)));
3342 temp=tango_read_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3343 set(handles.ans_bpm_c09,'String',num2str(temp.value(n)));
3344 temp=tango_read_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3345 set(handles.ans_bpm_c10,'String',num2str(temp.value(n)));
3346 temp=tango_read_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3347 set(handles.ans_bpm_c11,'String',num2str(temp.value(n)));
3348 temp=tango_read_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3349 set(handles.ans_bpm_c12,'String',num2str(temp.value(n)));
3350 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3351 set(handles.ans_bpm_c13,'String',num2str(temp.value(n)));
3352 temp=tango_read_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3353 set(handles.ans_bpm_c14,'String',num2str(temp.value(n)));
3354 temp=tango_read_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3355 set(handles.ans_bpm_c15,'String',num2str(temp.value(n)));
3356 temp=tango_read_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigTrigStatus');
3357 set(handles.ans_bpm_c16,'String',num2str(temp.value(n)));
3358 
3359 
3360 
3361 % --- Executes on button press in togglebutton2.
3362 function togglebutton2_Callback(hObject, eventdata, handles)
3363 % hObject    handle to togglebutton2 (see GCBO)
3364 % eventdata  reserved - to be defined in a future version of MATLAB
3365 % handles    structure with handles and user data (see GUIDATA)
3366 
3367 % Hint: get(hObject,'Value') returns toggle state of togglebutton2
3368 
3369 
3370 % --- Executes on selection change in listbox_fillingmode.
3371 function listbox_fillingmode_Callback(hObject, eventdata, handles)
3372 % hObject    handle to listbox_fillingmode (see GCBO)
3373 % eventdata  reserved - to be defined in a future version of MATLAB
3374 % handles    structure with handles and user data (see GUIDATA)
3375 
3376 % Hints: contents = get(hObject,'String') returns listbox_fillingmode contents as cell array
3377 %        contents{get(hObject,'Value')} returns selected item from listbox_fillingmode
3378 pattern=get(hObject,'String');
3379 mode=get(hObject,'Value');
3380 fprintf('***************************************************\n')
3381 fprintf('Mode de remplissage sélectionné : %s\n',pattern{mode})
3382 fprintf('***************************************************\n')
3383 
3384 % Prépare les tables pour le 3 Hz
3385 
3386 quart=[1 105 209 313];
3387 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetClkStepValue');
3388 offset=temp.value(1)*52;
3389 
3390 if (mode<=4)
3391     bunch=quart(mode);
3392 elseif (mode>4)&&(mode<=7)
3393     bunch=quart(1:(mode-3));
3394 elseif (mode==8)   
3395     dbunch=4*8;
3396     bunch=(0:12)*dbunch;
3397 end
3398 
3399 [dtour,dpaquet]=bucketnumber(bunch);
3400 table=int32([length(bunch) dtour dpaquet]);
3401 tango_command_inout('ANS/SY/CENTRAL','SetTables',table);
3402 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TablesCurrentDepth');
3403 n=temp.value;
3404 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionDelayTable');
3405 table=temp.value(1:n);
3406 set(handles.edit_filling_relecture_tables,'String',[num2str(table)]);
3407 set(handles.edit_filling_relecture_bunch, 'String',[num2str(bunch)]);
3408 
3409 guidata(hObject, handles);
3410 
3411 % --- Executes during object creation, after setting all properties.
3412 function listbox_fillingmode_CreateFcn(hObject, eventdata, handles)
3413 % hObject    handle to listbox_fillingmode (see GCBO)
3414 % eventdata  reserved - to be defined in a future version of MATLAB
3415 % handles    empty - handles not created until after all CreateFcns called
3416 
3417 % Hint: listbox controls usually have a white background on Windows.
3418 %       See ISPC and COMPUTER.
3419 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3420     set(hObject,'BackgroundColor','white');
3421 end
3422 
3423 
3424 % --- Executes on button press in button_fix.
3425 function button_fix_Callback(hObject, eventdata, handles)
3426 % hObject    handle to button_fix (see GCBO)
3427 % eventdata  reserved - to be defined in a future version of MATLAB
3428 % handles    structure with handles and user data (see GUIDATA)
3429 
3430 [clk_pc,clk_soft]=fix_quart;
3431 handles.clk_pc  =clk_pc;
3432 handles.clk_soft=clk_soft;
3433 
3434 % n=1;
3435 % temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcStepDelay');
3436 % clk1=temp.value(n);
3437 % temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay');
3438 % clk2=temp.value(n);
3439 %
3440 % jump=int32([0 39 26 13]);
3441 % handles.clk_pc  =jump +  int32(clk1);
3442 % handles.clk_soft=jump  + int32(clk2);
3443 
3444 guidata(hObject, handles);
3445 
3446 
3447 
3448 function edit_Nshot_soft_Callback(hObject, eventdata, handles)
3449 % hObject    handle to edit_Nshot_soft (see GCBO)
3450 % eventdata  reserved - to be defined in a future version of MATLAB
3451 % handles    structure with handles and user data (see GUIDATA)
3452 
3453 % Hints: get(hObject,'String') returns contents of edit_Nshot_soft as text
3454 %        str2double(get(hObject,'String')) returns contents of edit_Nshot_soft as a double
3455 
3456 
3457 % --- Executes during object creation, after setting all properties.
3458 function edit_Nshot_soft_CreateFcn(hObject, eventdata, handles)
3459 % hObject    handle to edit_Nshot_soft (see GCBO)
3460 % eventdata  reserved - to be defined in a future version of MATLAB
3461 % handles    empty - handles not created until after all CreateFcns called
3462 
3463 % Hint: edit controls usually have a white background on Windows.
3464 %       See ISPC and COMPUTER.
3465 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3466     set(hObject,'BackgroundColor','white');
3467 end
3468 
3469 
3470 
3471 function edit_laps_Callback(hObject, eventdata, handles)
3472 % hObject    handle to edit_laps (see GCBO)
3473 % eventdata  reserved - to be defined in a future version of MATLAB
3474 % handles    structure with handles and user data (see GUIDATA)
3475 
3476 % Hints: get(hObject,'String') returns contents of edit_laps as text
3477 %        str2double(get(hObject,'String')) returns contents of edit_laps as a double
3478 
3479 
3480 % --- Executes during object creation, after setting all properties.
3481 function edit_laps_CreateFcn(hObject, eventdata, handles)
3482 % hObject    handle to edit_laps (see GCBO)
3483 % eventdata  reserved - to be defined in a future version of MATLAB
3484 % handles    empty - handles not created until after all CreateFcns called
3485 
3486 % Hint: edit controls usually have a white background on Windows.
3487 %       See ISPC and COMPUTER.
3488 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3489     set(hObject,'BackgroundColor','white');
3490 end
3491 
3492 
3493 
3494 function edit_qlt1_Callback(hObject, eventdata, handles)
3495 % hObject    handle to edit_qlt1 (see GCBO)
3496 % eventdata  reserved - to be defined in a future version of MATLAB
3497 % handles    structure with handles and user data (see GUIDATA)
3498 
3499 % Hints: get(hObject,'String') returns contents of edit_qlt1 as text
3500 %        str2double(get(hObject,'String')) returns contents of edit_qlt1 as a double
3501 
3502 
3503 % --- Executes during object creation, after setting all properties.
3504 function edit_qlt1_CreateFcn(hObject, eventdata, handles)
3505 % hObject    handle to edit_qlt1 (see GCBO)
3506 % eventdata  reserved - to be defined in a future version of MATLAB
3507 % handles    empty - handles not created until after all CreateFcns called
3508 
3509 % Hint: edit controls usually have a white background on Windows.
3510 %       See ISPC and COMPUTER.
3511 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3512     set(hObject,'BackgroundColor','white');
3513 end
3514 
3515 
3516 
3517 function edit_iboo_Callback(hObject, eventdata, handles)
3518 % hObject    handle to edit_iboo (see GCBO)
3519 % eventdata  reserved - to be defined in a future version of MATLAB
3520 % handles    structure with handles and user data (see GUIDATA)
3521 
3522 % Hints: get(hObject,'String') returns contents of edit_iboo as text
3523 %        str2double(get(hObject,'String')) returns contents of edit_iboo as a double
3524 
3525 
3526 % --- Executes during object creation, after setting all properties.
3527 function edit_iboo_CreateFcn(hObject, eventdata, handles)
3528 % hObject    handle to edit_iboo (see GCBO)
3529 % eventdata  reserved - to be defined in a future version of MATLAB
3530 % handles    empty - handles not created until after all CreateFcns called
3531 
3532 % Hint: edit controls usually have a white background on Windows.
3533 %       See ISPC and COMPUTER.
3534 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3535     set(hObject,'BackgroundColor','white');
3536 end
3537 
3538 
3539 
3540 function edit_dians_Callback(hObject, eventdata, handles)
3541 % hObject    handle to edit_dians (see GCBO)
3542 % eventdata  reserved - to be defined in a future version of MATLAB
3543 % handles    structure with handles and user data (see GUIDATA)
3544 
3545 % Hints: get(hObject,'String') returns contents of edit_dians as text
3546 %        str2double(get(hObject,'String')) returns contents of edit_dians as a double
3547 
3548 
3549 % --- Executes during object creation, after setting all properties.
3550 function edit_dians_CreateFcn(hObject, eventdata, handles)
3551 % hObject    handle to edit_dians (see GCBO)
3552 % eventdata  reserved - to be defined in a future version of MATLAB
3553 % handles    empty - handles not created until after all CreateFcns called
3554 
3555 % Hint: edit controls usually have a white background on Windows.
3556 %       See ISPC and COMPUTER.
3557 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3558     set(hObject,'BackgroundColor','white');
3559 end
3560 
3561 
3562 
3563 function edit_rlt1_Callback(hObject, eventdata, handles)
3564 % hObject    handle to edit_rlt1 (see GCBO)
3565 % eventdata  reserved - to be defined in a future version of MATLAB
3566 % handles    structure with handles and user data (see GUIDATA)
3567 
3568 % Hints: get(hObject,'String') returns contents of edit_rlt1 as text
3569 %        str2double(get(hObject,'String')) returns contents of edit_rlt1 as a double
3570 
3571 
3572 % --- Executes during object creation, after setting all properties.
3573 function edit_rlt1_CreateFcn(hObject, eventdata, handles)
3574 % hObject    handle to edit_rlt1 (see GCBO)
3575 % eventdata  reserved - to be defined in a future version of MATLAB
3576 % handles    empty - handles not created until after all CreateFcns called
3577 
3578 % Hint: edit controls usually have a white background on Windows.
3579 %       See ISPC and COMPUTER.
3580 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3581     set(hObject,'BackgroundColor','white');
3582 end
3583 
3584 
3585 
3586 function edit_rboo_Callback(hObject, eventdata, handles)
3587 % hObject    handle to edit_rboo (see GCBO)
3588 % eventdata  reserved - to be defined in a future version of MATLAB
3589 % handles    structure with handles and user data (see GUIDATA)
3590 
3591 % Hints: get(hObject,'String') returns contents of edit_rboo as text
3592 %        str2double(get(hObject,'String')) returns contents of edit_rboo as a double
3593 
3594 
3595 % --- Executes during object creation, after setting all properties.
3596 function edit_rboo_CreateFcn(hObject, eventdata, handles)
3597 % hObject    handle to edit_rboo (see GCBO)
3598 % eventdata  reserved - to be defined in a future version of MATLAB
3599 % handles    empty - handles not created until after all CreateFcns called
3600 
3601 % Hint: edit controls usually have a white background on Windows.
3602 %       See ISPC and COMPUTER.
3603 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3604     set(hObject,'BackgroundColor','white');
3605 end
3606 
3607 
3608 
3609 function edit_rans_Callback(hObject, eventdata, handles)
3610 % hObject    handle to edit_rans (see GCBO)
3611 % eventdata  reserved - to be defined in a future version of MATLAB
3612 % handles    structure with handles and user data (see GUIDATA)
3613 
3614 % Hints: get(hObject,'String') returns contents of edit_rans as text
3615 %        str2double(get(hObject,'String')) returns contents of edit_rans as a double
3616 
3617 
3618 % --- Executes during object creation, after setting all properties.
3619 function edit_rans_CreateFcn(hObject, eventdata, handles)
3620 % hObject    handle to edit_rans (see GCBO)
3621 % eventdata  reserved - to be defined in a future version of MATLAB
3622 % handles    empty - handles not created until after all CreateFcns called
3623 
3624 % Hint: edit controls usually have a white background on Windows.
3625 %       See ISPC and COMPUTER.
3626 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3627     set(hObject,'BackgroundColor','white');
3628 end
3629 
3630 
3631 
3632 function edit_dians1_Callback(hObject, eventdata, handles)
3633 % hObject    handle to edit_dians1 (see GCBO)
3634 % eventdata  reserved - to be defined in a future version of MATLAB
3635 % handles    structure with handles and user data (see GUIDATA)
3636 
3637 % Hints: get(hObject,'String') returns contents of edit_dians1 as text
3638 %        str2double(get(hObject,'String')) returns contents of edit_dians1 as a double
3639 
3640 
3641 % --- Executes during object creation, after setting all properties.
3642 function edit_dians1_CreateFcn(hObject, eventdata, handles)
3643 % hObject    handle to edit_dians1 (see GCBO)
3644 % eventdata  reserved - to be defined in a future version of MATLAB
3645 % handles    empty - handles not created until after all CreateFcns called
3646 
3647 % Hint: edit controls usually have a white background on Windows.
3648 %       See ISPC and COMPUTER.
3649 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3650     set(hObject,'BackgroundColor','white');
3651 end
3652 
3653 
3654 
3655 function edit_cycle_Callback(hObject, eventdata, handles)
3656 % hObject    handle to edit_cycle (see GCBO)
3657 % eventdata  reserved - to be defined in a future version of MATLAB
3658 % handles    structure with handles and user data (see GUIDATA)
3659 
3660 % Hints: get(hObject,'String') returns contents of edit_cycle as text
3661 %        str2double(get(hObject,'String')) returns contents of edit_cycle as a double
3662 
3663 
3664 % --- Executes during object creation, after setting all properties.
3665 function edit_cycle_CreateFcn(hObject, eventdata, handles)
3666 % hObject    handle to edit_cycle (see GCBO)
3667 % eventdata  reserved - to be defined in a future version of MATLAB
3668 % handles    empty - handles not created until after all CreateFcns called
3669 
3670 % Hint: edit controls usually have a white background on Windows.
3671 %       See ISPC and COMPUTER.
3672 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3673     set(hObject,'BackgroundColor','white');
3674 end
3675 
3676 
3677 
3678 function edit_courant_total_Callback(hObject, eventdata, handles)
3679 % hObject    handle to edit_courant_total (see GCBO)
3680 % eventdata  reserved - to be defined in a future version of MATLAB
3681 % handles    structure with handles and user data (see GUIDATA)
3682 
3683 % Hints: get(hObject,'String') returns contents of edit_courant_total as text
3684 %        str2double(get(hObject,'String')) returns contents of edit_courant_total as a double
3685 
3686 
3687 % --- Executes during object creation, after setting all properties.
3688 function edit_courant_total_CreateFcn(hObject, eventdata, handles)
3689 % hObject    handle to edit_courant_total (see GCBO)
3690 % eventdata  reserved - to be defined in a future version of MATLAB
3691 % handles    empty - handles not created until after all CreateFcns called
3692 
3693 % Hint: edit controls usually have a white background on Windows.
3694 %       See ISPC and COMPUTER.
3695 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
3696     set(hObject,'BackgroundColor','white');
3697 end
3698 
3699

Generated on Mon 21-May-2007 15:35:27 by m2html © 2003