source: MML/trunk/machine/SOLEIL/common/synchro/synchro_rafale_mode_tests1.m

Last change on this file was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 32.2 KB
Line 
1function varargout = synchro_mode_tests(varargin)
2% SYNCHRO_MODE_TESTS M-file for synchro_mode_tests.fig
3%      SYNCHRO_MODE_TESTS, by itself, creates a new SYNCHRO_MODE_TESTS or raises the existing
4%      singleton*.
5%
6%      H = SYNCHRO_MODE_TESTS returns the handle to a new SYNCHRO_MODE_TESTS or the handle to
7%      the existing singleton*.
8%
9%      SYNCHRO_MODE_TESTS('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in SYNCHRO_MODE_TESTS.M with the given input arguments.
11%
12%      SYNCHRO_MODE_TESTS('Property','Value',...) creates a new SYNCHRO_MODE_TESTS or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before synchro_mode_tests_OpeningFunction gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to synchro_mode_tests_OpeningFcn via varargin.
17%
18%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
19%      instance to run (singleton)".
20%
21% See also: GUIDE, GUIDATA, GUIHANDLES
22
23% Edit the above text to modify the response to help synchro_mode_tests
24
25% Last Modified by GUIDE v2.5 22-Feb-2007 16:58:02
26
27% Begin initialization code - DO NOT EDIT
28gui_Singleton = 1;
29gui_State = struct('gui_Name',       mfilename, ...
30                   'gui_Singleton',  gui_Singleton, ...
31                   'gui_OpeningFcn', @synchro_mode_tests_OpeningFcn, ...
32                   'gui_OutputFcn',  @synchro_mode_tests_OutputFcn, ...
33                   'gui_LayoutFcn',  [] , ...
34                   'gui_Callback',   []);
35if nargin && ischar(varargin{1})
36    gui_State.gui_Callback = str2func(varargin{1});
37end
38
39if nargout
40    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
41else
42    gui_mainfcn(gui_State, varargin{:});
43end
44% End initialization code - DO NOT EDIT
45
46
47% --- Executes just before synchro_mode_tests is made visible.
48function synchro_mode_tests_OpeningFcn(hObject, eventdata, handles, varargin)
49% This function has no output args, see OutputFcn.
50% hObject    handle to figure
51% eventdata  reserved - to be defined in a future version of MATLAB
52% handles    structure with handles and user data (see GUIDATA)
53% varargin   command line arguments to synchro_mode_tests (see VARARGIN)
54
55
56set(handles.edit_etat, 'String','??');
57% Choose default command line output for synchro_mode_tests
58handles.output = hObject;
59
60% Choix des events
61handles.event0 =int32(0);
62handles.event00=int32(100);  %Spéciale EP
63
64% Update handles structure
65guidata(hObject, handles);
66
67% UIWAIT makes synchro_mode_tests wait for user response (see UIRESUME)
68% uiwait(handles.figure1);
69
70
71% --- Outputs from this function are returned to the command line.
72function varargout = synchro_mode_tests_OutputFcn(hObject, eventdata, handles)
73% varargout  cell array for returning output args (see VARARGOUT);
74% hObject    handle to figure
75% eventdata  reserved - to be defined in a future version of MATLAB
76% handles    structure with handles and user data (see GUIDATA)
77
78% Get default command line output from handles structure
79varargout{1} = handles.output;
80
81
82% --- Executes on button press in pushbutton_linac_3Hz.
83function pushbutton_linac_3Hz_Callback(hObject, eventdata, handles)
84% hObject    handle to pushbutton_linac_3Hz (see GCBO)
85% eventdata  reserved - to be defined in a future version of MATLAB
86% handles    structure with handles and user data (see GUIDATA)
87
88load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
89tout=0.;
90event0=handles.event0;
91
92    % switch to 3Hz
93        event=int32(2) ;% adresse de l'injection
94        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',     event); pause(tout);
95        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',event0); pause(tout);
96        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',   event); pause(tout);
97        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',event); pause(tout);
98        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',     event); pause(tout);
99        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',     event); pause(tout);
100        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',      event); pause(tout);
101        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent', event); pause(tout);
102   % pas d'injection
103        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent', event0); pause(tout);
104        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',    event0);     
105       
106%     % special modulateur
107%         delay=inj_offset+0;
108%         tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareTimeDelay',delay);
109%         %display('ok change soft to 3Hz')
110       
111set(handles.edit_etat, 'String','LINAC = 3Hz');
112
113
114% --- Executes on button press in pushbutton_linac_soft.
115function pushbutton_linac_soft_Callback(hObject, eventdata, handles)
116% hObject    handle to pushbutton_linac_soft (see GCBO)
117% eventdata  reserved - to be defined in a future version of MATLAB
118% handles    structure with handles and user data (see GUIDATA)
119
120load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
121tout=0.;
122event0=handles.event0;
123event00=handles.event00;
124
125% Swap delai 5 et 2
126temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjStepDelay');
127central_inj=temp.value(1);
128temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay');
129central_soft=temp.value(1);
130tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',290010);
131tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',290020);
132   
133    % switch to soft
134        event=int32(5) ;% adresse de l'injection
135        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',      event); pause(tout);
136        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent', event0); pause(tout);
137        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent', event); pause(tout);
138        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',      event); pause(tout);
139        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',      event); pause(tout);
140        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',       event); pause(tout);
141        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',  event); pause(tout);
142   % pas d'injection
143        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent', event0); pause(tout);
144        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',    event0);
145   % Pas d'extraction
146        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',      event0);pause(tout);
147        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',  event0);pause(tout);
148        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event0);pause(tout);
149        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event0);pause(tout);
150        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',    event0);pause(tout);
151        tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',    event0);pause(tout);
152        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',     event0);pause(tout);
153        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',        event0);pause(tout);
154        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',   event0);pause(tout);
155%         arg.svalue={'k1.trig','k2.trig','k3.trig','k4.trig'}; arg.lvalue=int32([1 1 1 1])*event00;
156%         tango_command_inout('ANS-C01/SY/LOCAL.Ainj.1','SetEventsNumbers',arg);% chagement groupé address sans update
157%         tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Update');
158%         
159%         arg.svalue={'sep-p.trig','sep-a.trig'}; arg.lvalue=int32([1 1])*event00;
160%         tango_command_inout('ANS-C01/SY/LOCAL.Ainj.2','SetEventsNumbers',arg);% chagement groupé address sans update
161%         tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.2', 'Update');
162   
163 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjStepDelay',timing.central_soft);
164 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftStepDelay',timing.central_inj);       
165       
166%     % special modulateur
167%         temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');pc=temp.value(1);
168%         temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');soft=temp.value(1);
169%         delay=inj_offset+soft-pc;
170%         tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareTimeDelay',delay);
171%         %display('ok change 3Hz to soft')
172
173set(handles.edit_etat, 'String','LINAC = Soft');
174
175% --- Executes on button press in pushbutton_linac_Off.
176function pushbutton_linac_Off_Callback(hObject, eventdata, handles)
177% hObject    handle to pushbutton_linac_Off (see GCBO)
178% eventdata  reserved - to be defined in a future version of MATLAB
179% handles    structure with handles and user data (see GUIDATA)
180
181load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
182tout=0.;
183event0=handles.event0;
184
185    % switch to Off
186        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',     event0); pause(tout);
187        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',event0); pause(tout);
188        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',   event0); pause(tout);
189        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',event0); pause(tout);
190        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',     event0); pause(tout);
191        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',     event0); pause(tout);
192        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',      event0); pause(tout);
193        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent', event0); pause(tout);
194
195set(handles.edit_etat, 'String','LINAC = Off');
196
197
198% --- Executes on button press in pushbutton_boo_3Hz.
199function pushbutton_boo_3Hz_Callback(hObject, eventdata, handles)
200% hObject    handle to pushbutton_boo_3Hz (see GCBO)
201% eventdata  reserved - to be defined in a future version of MATLAB
202% handles    structure with handles and user data (see GUIDATA)
203load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
204tout=0.;
205event0=handles.event0;
206event00=handles.event00;
207
208    % switch to 3Hz
209        event=int32(2) ;% adresse de l'injection
210        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',        event); pause(tout);
211        %tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event0); pause(tout);
212        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event); pause(tout);
213        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',   event0); pause(tout);
214        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',      event); pause(tout);
215        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
216        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
217        tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event); pause(tout);
218        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event); pause(tout);
219        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',   event); pause(tout);
220        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',        event); pause(tout);
221        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',        event); pause(tout);
222        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',         event); pause(tout);
223        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',    event); pause(tout);
224        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event);pause(tout);
225        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent', event); pause(tout);
226        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',    event);
227        % pas d'extraction
228        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',      event0);pause(tout);
229        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',  event0);pause(tout);
230        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event0);pause(tout);
231        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event0);pause(tout);
232        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',    event0);pause(tout);
233        tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',    event0);pause(tout);
234        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',     event0);pause(tout);
235        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',        event0);pause(tout);
236        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',   event0);pause(tout);
237        arg.svalue={'k1.trig','k2.trig','k3.trig','k4.trig'}; arg.lvalue=int32([1 1 1 1])*event00;
238        tango_command_inout('ANS-C01/SY/LOCAL.Ainj.1','SetEventsNumbers',arg);% chagement groupé address sans update
239        tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Update');
240       
241        arg.svalue={'sep-p.trig','sep-a.trig'}; arg.lvalue=int32([1 1])*event00;
242        tango_command_inout('ANS-C01/SY/LOCAL.Ainj.2','SetEventsNumbers',arg);% chagement groupé address sans update
243        tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.2', 'Update');
244       
245%      % special modulateur
246%         delay=inj_offset+0;
247%         tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareTimeDelay',delay);
248%         display('ok change soft to 3Hz')
249
250set(handles.edit_etat, 'String','LINAC + BOO = 3Hz');
251
252
253% --- Executes on button press in pushbutton_boo_soft.
254function pushbutton_boo_soft_Callback(hObject, eventdata, handles)
255% hObject    handle to pushbutton_boo_soft (see GCBO)
256% eventdata  reserved - to be defined in a future version of MATLAB
257% handles    structure with handles and user data (see GUIDATA)
258load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
259tout=0.;
260event0=handles.event0;
261event00=handles.event00;
262
263    % switch to soft
264        event=int32(5) ;% adresse de l'injection
265        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',        event); pause(tout);
266        %tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event0); pause(tout);
267        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event); pause(tout);
268        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',   event0); pause(tout);
269        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',      int32(1)); pause(tout);
270        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
271        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
272        tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event); pause(tout);
273        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event); pause(tout);
274        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',   event); pause(tout);
275        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',        event); pause(tout);
276        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',        event); pause(tout);
277        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',         event); pause(tout);
278        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',    event); pause(tout);
279        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event);pause(tout);
280        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent', event); pause(tout);
281        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',    event);
282        % Pas d'extraction
283        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',      event0);pause(tout);
284        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',  event0);pause(tout);
285        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event0);pause(tout);
286        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event0);pause(tout);
287        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',    event0);pause(tout);
288        tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',    event0);pause(tout);
289        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',     event0);pause(tout);
290        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',        event0);pause(tout);
291        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',   event0);pause(tout);
292        arg.svalue={'k1.trig','k2.trig','k3.trig','k4.trig'}; arg.lvalue=int32([1 1 1 1])*event00;
293        tango_command_inout('ANS-C01/SY/LOCAL.Ainj.1','SetEventsNumbers',arg);% chagement groupé address sans update
294        tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Update');
295       
296        arg.svalue={'sep-p.trig','sep-a.trig'}; arg.lvalue=int32([1 1])*event00;
297        tango_command_inout('ANS-C01/SY/LOCAL.Ainj.2','SetEventsNumbers',arg);% chagement groupé address sans update
298        tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.2', 'Update');
299
300       
301    % special modulateur
302        temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');pc=temp.value(1);
303        temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');soft=temp.value(1);
304        delay=inj_offset+soft-pc;
305        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareTimeDelay',delay);
306       
307
308set(handles.edit_etat, 'String','LINAC + BOO = Soft');
309
310
311% --- Executes on button press in pushbutton_boo_off.
312function pushbutton_boo_off_Callback(hObject, eventdata, handles)
313% hObject    handle to pushbutton_boo_off (see GCBO)
314% eventdata  reserved - to be defined in a future version of MATLAB
315% handles    structure with handles and user data (see GUIDATA)
316
317load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
318tout=0.;
319event0=handles.event0;
320event00=handles.event00;
321
322    % switch to Off
323        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',        event0); pause(tout);
324        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event0); pause(tout);
325        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',   event0); pause(tout);
326        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',      event0); pause(tout);
327        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event0); pause(tout);
328        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event0); pause(tout);
329        tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event0); pause(tout);
330        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event0); pause(tout);     
331        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',   event0); pause(tout);
332        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',        event0); pause(tout);
333        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',        event0); pause(tout);
334        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',         event0); pause(tout);
335        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',    event0); pause(tout);
336        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event0); pause(tout);
337        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent',event0); pause(tout);
338        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',    event0); pause(tout);
339        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',      event0);pause(tout);
340        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',  event0);pause(tout);
341        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event0);pause(tout);
342        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event0);pause(tout);
343        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',    event0);pause(tout);
344        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',    event0);pause(tout);
345       
346
347set(handles.edit_etat, 'String','LINAC + BOO = Off');
348
349
350% --- Executes on button press in pushbutton_ans_3hz.
351function pushbutton_ans_3hz_Callback(hObject, eventdata, handles)
352% hObject    handle to pushbutton_ans_3hz (see GCBO)
353% eventdata  reserved - to be defined in a future version of MATLAB
354% handles    structure with handles and user data (see GUIDATA)
355load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
356tout=0.;
357event0=handles.event0;
358event00=handles.event00;
359
360%     % switch to 3Hz
361%         event=int32(2) ;% adresse de l'injection
362%         tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',        event); pause(tout);
363%         tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event0); pause(tout);
364%         tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',   event0); pause(tout);
365%         tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',      eint32(1)); pause(tout);
366%         tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
367%         tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
368%         tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event); pause(tout);
369%         tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event); pause(tout);
370%         tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',   event); pause(tout);
371%         tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',        event); pause(tout);
372%         tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',        event); pause(tout);
373%         tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',         event); pause(tout);
374%         tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',    event); pause(tout);
375%         tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event);pause(tout);
376%         tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent', event); pause(tout);
377%         tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',     event);
378%         event=int32(3) ;% adresse de extraction
379%         tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',      event);pause(tout);
380%         tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',  event);pause(tout);
381%         tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event);pause(tout);
382%         tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event);pause(tout);
383%         tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',    event);pause(tout);
384%         tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',    event);pause(tout);
385%         tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',     event);pause(tout);
386%         tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',        event);pause(tout);
387%         tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',   event);pause(tout);
388%         
389%         arg.svalue={'k1.trig','k2.trig','k3.trig','k4.trig'}; arg.lvalue=int32([3 3 3 3]);
390%         tango_command_inout('ANS-C01/SY/LOCAL.Ainj.1','SetEventsNumbers',arg);% chagement groupé address sans update
391%       
392%         arg.svalue={'sep-p.trig','sep-a.trig'}; arg.lvalue=int32([3 3]);
393%         tango_command_inout('ANS-C01/SY/LOCAL.Ainj.2','SetEventsNumbers',arg);% chagement groupé address sans update
394%         
395%         tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent',    event);pause(tout);
396%         tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
397%         tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
398%         tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
399%         tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
400%         tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
401%         tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
402%         tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
403%         tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
404%         tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
405%         tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
406%         tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
407%         tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
408%         tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
409%         tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
410%         tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
411%         tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
412%     
413%     % special modulateur
414%         delay=inj_offset+0;
415%         tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareTimeDelay',delay);
416%         display('ok change soft to 3Hz')
417       
418       % special septum actif boo et ans
419%         r=(1+0.0004);
420%         try
421%             temp=tango_read_attribute2('BOO-C12/EP/AL_SEP_A.Ext','voltage');boo=temp.value(2)*r
422%             tango_write_attribute2('BOO-C12/EP/AL_SEP_A.Ext','voltage',boo);       
423%             temp=tango_read_attribute2('ANS-C01/EP/AL_SEP_A','voltage');ans=temp.value(2)*r
424%             tango_write_attribute2('ANS-C01/EP/AL_SEP_A','voltage',ans); 
425%         catch
426%             display('Erreur ajustement tension septa passif')
427%         end 
428
429
430%display('ok change address')
431
432set(handles.edit_etat, 'String','Aucune Action');
433
434
435% --- Executes on button press in pushbutton_ans_soft.
436function pushbutton_ans_soft_Callback(hObject, eventdata, handles)
437% hObject    handle to pushbutton_ans_soft (see GCBO)
438% eventdata  reserved - to be defined in a future version of MATLAB
439% handles    structure with handles and user data (see GUIDATA)
440load('synchro_offset_lin', 'inj_offset' , 'ext_offset', 'lin_fin');
441tout=0.;
442event0=handles.event0;
443event00=handles.event00;
444
445    % switch to soft
446        event=int32(5) ;% adresse de l'injection
447        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',        event); pause(tout);
448        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'lpmEvent',        event0); pause(tout);
449        tango_write_attribute2('LIN/SY/LOCAL.SPM.1', 'spmLinacEvent',   event0); pause(tout);
450        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareEvent',      int32(1)); pause(tout);
451        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
452        tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
453        tango_write_attribute2('BOO/SY/LOCAL.DG.2', 'bpm-btb.trigEvent',event); pause(tout);
454        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-btc.trigEvent',event); pause(tout);
455        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',   event); pause(tout);
456        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',        event); pause(tout);
457        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',        event); pause(tout);
458        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',         event); pause(tout);
459        tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',    event); pause(tout);
460        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'bpm-onde.trigEvent',event);pause(tout);
461        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent', event); pause(tout);
462        tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',     event);
463 
464        tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',      event);pause(tout);
465        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',  event);pause(tout);
466        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event);pause(tout);
467        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event);pause(tout);
468        tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',    event);pause(tout);
469        tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',    event);pause(tout);
470        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'osc-fctEvent',     event);pause(tout);
471        tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'mrsvEvent',        event);pause(tout);
472        tango_write_attribute2('BOO/SY/LOCAL.DG.3', 'emittanceEvent',   event);pause(tout);
473        arg.svalue={'k1.trig','k2.trig','k3.trig','k4.trig'}; arg.lvalue=int32([5 5 5 5]);
474        tango_command_inout('ANS-C01/SY/LOCAL.Ainj.1','SetEventsNumbers',arg);% chagement groupé addresses sans update
475        tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.1', 'Update');
476       
477        arg.svalue={'sep-p.trig','sep-a.trig'}; arg.lvalue=int32([5 5]);
478        tango_command_inout('ANS-C01/SY/LOCAL.Ainj.2','SetEventsNumbers',arg);% chagement groupé address sans update
479        tango_command_inout2('ANS-C01/SY/LOCAL.Ainj.2', 'Update');
480       
481        tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent',    int32(3));pause(tout);
482        tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
483        tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
484        tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
485        tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
486        tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
487        tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
488        tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
489        tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
490        tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
491        tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
492        tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
493        tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
494        tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
495        tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
496        tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout); 
497        tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);   
498       
499    % special modulateur
500        temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');pc=temp.value(1);
501        temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');soft=temp.value(1);
502        delay=inj_offset+soft-pc;
503        tango_write_attribute2('LIN/SY/LOCAL.LPM.1', 'spareTimeDelay',delay);
504
505       
506%      % special septum actif boo et ans
507%         r=(1-0.0004);
508%         try
509%             temp=tango_read_attribute2('BOO-C12/EP/AL_SEP_A.Ext','voltage');boo=temp.value(2)*r
510%             tango_write_attribute2('BOO-C12/EP/AL_SEP_A.Ext','voltage',boo);       
511%             temp=tango_read_attribute2('ANS-C01/EP/AL_SEP_A','voltage');ans=temp.value(2)*r
512%             tango_write_attribute2('ANS-C01/EP/AL_SEP_A','voltage',ans); 
513%         catch
514%             display('Erreur ajustement tension septa passif')
515%         end 
516       
517
518set(handles.edit_etat, 'String','LINAC + BOO + ANS = Soft');
519
520
521
522
523% --- Executes on button press in pushbutton_ans_off.
524function pushbutton_ans_off_Callback(hObject, eventdata, handles)
525% hObject    handle to pushbutton_ans_off (see GCBO)
526% eventdata  reserved - to be defined in a future version of MATLAB
527% handles    structure with handles and user data (see GUIDATA)
528
529set(handles.edit_etat, 'String','Aucune Action');
530
531function edit_etat_Callback(hObject, eventdata, handles)
532% hObject    handle to edit_etat (see GCBO)
533% eventdata  reserved - to be defined in a future version of MATLAB
534% handles    structure with handles and user data (see GUIDATA)
535
536% Hints: get(hObject,'String') returns contents of edit_etat as text
537%        str2double(get(hObject,'String')) returns contents of edit_etat as a double
538
539
540% --- Executes during object creation, after setting all properties.
541function edit_etat_CreateFcn(hObject, eventdata, handles)
542% hObject    handle to edit_etat (see GCBO)
543% eventdata  reserved - to be defined in a future version of MATLAB
544% handles    empty - handles not created until after all CreateFcns called
545
546% Hint: edit controls usually have a white background on Windows.
547%       See ISPC and COMPUTER.
548if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
549    set(hObject,'BackgroundColor','white');
550end
551
552
Note: See TracBrowser for help on using the repository browser.