source: MML/trunk/machine/SOLEIL/common/synchro/synchro_rafale_mode_tests.m @ 17

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