0001 function varargout = synchro_injecteur2(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 gui_Singleton = 1;
0029 gui_State = struct('gui_Name', mfilename, ...
0030 'gui_Singleton', gui_Singleton, ...
0031 'gui_OpeningFcn', @synchro_injecteur2_OpeningFcn, ...
0032 'gui_OutputFcn', @synchro_injecteur2_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
0045
0046
0047
0048 function synchro_injecteur2_OpeningFcn(hObject, eventdata, handles, varargin)
0049
0050
0051
0052
0053
0054
0055
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
0062 handles.periode = 1.36;
0063 set(handles.periode_edit,'String',num2str(handles.periode));
0064
0065
0066 timer1=timer('StartDelay',1,...
0067 'ExecutionMode','fixedRate','Period',handles.periode,'TasksToExecute',Inf);
0068 timer1.TimerFcn = {@fonction_alex, hObject,eventdata, handles};
0069 setappdata(handles.figure1,'Timer',timer1);
0070
0071
0072 h = uibuttongroup('visible','off','Position',[0.160 0.24 0.10 0.12],...
0073 'Title','','TitlePosition','centertop',...
0074 'BackgroundColor',[1 0.3 0 ]);
0075 u1 = uicontrol('Style','Radio','String','OFF','Tag','radiobutton1',...
0076 'pos',[45 20 40 25],'parent',h,'HandleVisibility','off',...
0077 'BackgroundColor',[1 0.3 0 ]);
0078 u2 = uicontrol('Style','Radio','String','ON','Tag','radiobutton2',...
0079 'pos',[45 50 40 25],'parent',h,'HandleVisibility','off',...
0080 'BackgroundColor',[1 0.3 0 ]);
0081 set(h,'SelectionChangeFcn',...
0082 {@uibuttongroup_SelectionChangeFcn,handles});
0083
0084 handles.off = u1;
0085 handles.on = u2;
0086
0087 set(h,'SelectedObject',u1);
0088 set(h,'Visible','on');
0089
0090
0091 set(handles.figure1,'CloseRequestFcn',{@Closinggui,timer1,handles.figure1});
0092
0093
0094 guidata(hObject, handles);
0095
0096
0097
0098
0099
0100
0101 function varargout = synchro_injecteur2_OutputFcn(hObject, eventdata, handles)
0102
0103
0104
0105
0106
0107
0108 varargout{1} = handles.output;
0109
0110
0111
0112 function alim_dipole_Callback(hObject, eventdata, handles)
0113
0114
0115
0116
0117
0118
0119 h=gcf
0120 delay=str2double(get(hObject,'String'));
0121 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTimeDelay',delay);
0122
0123
0124 function alim_dipole_CreateFcn(hObject, eventdata, handles)
0125
0126
0127
0128
0129
0130
0131 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0132 set(hObject,'BackgroundColor','white');
0133 end
0134
0135
0136 function alim_qf_Callback(hObject, eventdata, handles)
0137
0138
0139
0140
0141
0142
0143
0144 delay=str2double(get(hObject,'String'));
0145 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTimeDelay',delay);
0146
0147
0148 function alim_qf_CreateFcn(hObject, eventdata, handles)
0149
0150
0151
0152
0153
0154
0155 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0156 set(hObject,'BackgroundColor','white');
0157 end
0158
0159
0160
0161 function alim_qd_Callback(hObject, eventdata, handles)
0162
0163
0164
0165
0166
0167
0168
0169 delay=str2double(get(hObject,'String'));
0170 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTimeDelay',delay);
0171
0172
0173 function alim_qd_CreateFcn(hObject, eventdata, handles)
0174
0175
0176
0177
0178
0179
0180 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0181 set(hObject,'BackgroundColor','white');
0182 end
0183
0184
0185
0186 function alim_sf_Callback(hObject, eventdata, handles)
0187
0188
0189
0190
0191
0192
0193
0194 delay=str2double(get(hObject,'String'));
0195 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTimeDelay',delay);
0196
0197
0198 function alim_sf_CreateFcn(hObject, eventdata, handles)
0199
0200
0201
0202
0203
0204
0205 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0206 set(hObject,'BackgroundColor','white');
0207 end
0208
0209
0210
0211 function alim_sd_Callback(hObject, eventdata, handles)
0212
0213
0214
0215
0216
0217
0218
0219 delay=str2double(get(hObject,'String'));
0220 tango_write_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTimeDelay',delay);
0221
0222
0223
0224 function alim_sd_CreateFcn(hObject, eventdata, handles)
0225
0226
0227
0228
0229
0230
0231 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0232 set(hObject,'BackgroundColor','white');
0233 end
0234
0235
0236
0237 function boo_rf_Callback(hObject, eventdata, handles)
0238
0239
0240
0241
0242
0243
0244
0245 delay=str2double(get(hObject,'String'));
0246 tango_write_attribute2('BOO/SY/LOCAL.RF.1', 'rfTimeDelay',delay);
0247
0248
0249 function boo_rf_CreateFcn(hObject, eventdata, handles)
0250
0251
0252
0253
0254
0255
0256 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0257 set(hObject,'BackgroundColor','white');
0258 end
0259
0260
0261
0262 function lin_canon_Callback(hObject, eventdata, handles)
0263
0264
0265
0266
0267
0268
0269 inj_offset=str2double(get(handles.inj_offset,'String'));
0270 delay=str2double(get(hObject,'String'))+inj_offset;
0271 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay',delay);
0272
0273
0274
0275 function lin_canon_CreateFcn(hObject, eventdata, handles)
0276
0277
0278
0279
0280
0281
0282 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0283 set(hObject,'BackgroundColor','white');
0284 end
0285
0286
0287
0288 function lt1_emittance_Callback(hObject, eventdata, handles)
0289
0290
0291
0292
0293
0294
0295 inj_offset=str2double(get(handles.inj_offset,'String'));
0296 delay=str2double(get(hObject,'String'))+inj_offset;
0297 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
0298
0299
0300 function lt1_emittance_CreateFcn(hObject, eventdata, handles)
0301
0302
0303
0304
0305
0306
0307 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0308 set(hObject,'BackgroundColor','white');
0309 end
0310
0311
0312
0313 function lt1_MC1_Callback(hObject, eventdata, handles)
0314
0315
0316
0317
0318
0319
0320 inj_offset=str2double(get(handles.inj_offset,'String'));
0321 delay=str2double(get(hObject,'String'))+inj_offset;
0322 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay',delay);
0323
0324
0325 function lt1_MC1_CreateFcn(hObject, eventdata, handles)
0326
0327
0328
0329
0330
0331
0332 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0333 set(hObject,'BackgroundColor','white');
0334 end
0335
0336
0337
0338 function lt1_MC2_Callback(hObject, eventdata, handles)
0339
0340
0341
0342
0343
0344
0345 inj_offset=str2double(get(handles.inj_offset,'String'));
0346 delay=str2double(get(hObject,'String'))+inj_offset;
0347 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay',delay);
0348
0349
0350 function lt1_MC2_CreateFcn(hObject, eventdata, handles)
0351
0352
0353
0354
0355
0356
0357 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0358 set(hObject,'BackgroundColor','white');
0359 end
0360
0361
0362
0363 function lt1_osc_Callback(hObject, eventdata, handles)
0364
0365
0366
0367
0368
0369
0370 inj_offset=str2double(get(handles.inj_offset,'String'));
0371 delay=str2double(get(hObject,'String'))+inj_offset;
0372 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay',delay);
0373
0374
0375
0376 function lt1_osc_CreateFcn(hObject, eventdata, handles)
0377
0378
0379
0380
0381
0382
0383 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0384 set(hObject,'BackgroundColor','white');
0385 end
0386
0387
0388
0389 function sdc1_Callback(hObject, eventdata, handles)
0390
0391
0392
0393
0394
0395
0396 inj_offset=str2double(get(handles.inj_offset,'String'));
0397 delay=str2double(get(hObject,'String'))+inj_offset;
0398 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay',delay);
0399
0400
0401 function sdc1_CreateFcn(hObject, eventdata, handles)
0402
0403
0404
0405
0406
0407
0408 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0409 set(hObject,'BackgroundColor','white');
0410 end
0411
0412
0413
0414 function boo_inj_septum_Callback(hObject, eventdata, handles)
0415
0416
0417
0418
0419
0420
0421 inj_offset=str2double(get(handles.inj_offset,'String'));
0422 delay=str2double(get(hObject,'String'))+inj_offset;
0423 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay',delay);
0424
0425
0426 function boo_inj_septum_CreateFcn(hObject, eventdata, handles)
0427
0428
0429
0430
0431
0432
0433 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0434 set(hObject,'BackgroundColor','white');
0435 end
0436
0437
0438
0439 function boo_inj_kicker_Callback(hObject, eventdata, handles)
0440
0441
0442
0443
0444
0445
0446 inj_offset=str2double(get(handles.inj_offset,'String'));
0447 delay=str2double(get(hObject,'String'))+inj_offset;
0448 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay',delay);
0449
0450
0451 function boo_inj_kicker_CreateFcn(hObject, eventdata, handles)
0452
0453
0454
0455
0456
0457
0458 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0459 set(hObject,'BackgroundColor','white');
0460 end
0461
0462
0463
0464 function boo_bpm_Callback(hObject, eventdata, handles)
0465
0466
0467
0468
0469
0470
0471
0472 inj_offset=str2double(get(handles.inj_offset,'String'));
0473 delay=str2double(get(hObject,'String'))+inj_offset;
0474 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay',delay);
0475 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigTimeDelay',delay);
0476 tango_write_attribute2('BOO-BTB/SY/LOCAL.DG.1', 'bpm-btb.trigTimeDelay',delay);
0477 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-btc.trigTimeDelay',delay);
0478
0479
0480
0481 function boo_bpm_CreateFcn(hObject, eventdata, handles)
0482
0483
0484
0485
0486
0487
0488 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0489 set(hObject,'BackgroundColor','white');
0490 end
0491
0492
0493
0494 function boo_nod_Callback(hObject, eventdata, handles)
0495
0496
0497
0498
0499
0500
0501 inj_offset=str2double(get(handles.inj_offset,'String'));
0502 delay=str2double(get(hObject,'String'))+inj_offset;
0503 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigTimeDelay',delay);
0504
0505
0506 function boo_nod_CreateFcn(hObject, eventdata, handles)
0507
0508
0509
0510
0511
0512
0513 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0514 set(hObject,'BackgroundColor','white');
0515 end
0516
0517
0518
0519 function boo_dcct_Callback(hObject, eventdata, handles)
0520
0521
0522
0523
0524
0525
0526 inj_offset=str2double(get(handles.inj_offset,'String'));
0527 delay=str2double(get(hObject,'String'))+inj_offset;
0528 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay',delay);
0529
0530
0531 function boo_dcct_CreateFcn(hObject, eventdata, handles)
0532
0533
0534
0535
0536
0537
0538 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0539 set(hObject,'BackgroundColor','white');
0540 end
0541
0542
0543
0544 function boo_hall_Callback(hObject, eventdata, handles)
0545
0546
0547
0548
0549
0550
0551
0552
0553
0554 function boo_hall_CreateFcn(hObject, eventdata, handles)
0555
0556
0557
0558
0559
0560
0561 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0562 set(hObject,'BackgroundColor','white');
0563 end
0564
0565
0566
0567 function pc_address_Callback(hObject, eventdata, handles)
0568
0569
0570
0571
0572
0573
0574
0575 delay=str2double(get(hObject,'String'));
0576 tango_write_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay',delay);
0577
0578
0579 function pc_address_CreateFcn(hObject, eventdata, handles)
0580
0581
0582
0583
0584
0585
0586 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0587 set(hObject,'BackgroundColor','white');
0588 end
0589
0590
0591
0592 function inj_address_Callback(hObject, eventdata, handles)
0593
0594
0595
0596
0597
0598
0599
0600 delay=str2double(get(hObject,'String'));
0601 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',delay);
0602
0603
0604 function inj_address_CreateFcn(hObject, eventdata, handles)
0605
0606
0607
0608
0609
0610
0611 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0612 set(hObject,'BackgroundColor','white');
0613 end
0614
0615
0616
0617 function edit21_Callback(hObject, eventdata, handles)
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627 function edit21_CreateFcn(hObject, eventdata, handles)
0628
0629
0630
0631
0632
0633
0634 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0635 set(hObject,'BackgroundColor','white');
0636 end
0637
0638
0639
0640 function soft_address_Callback(hObject, eventdata, handles)
0641
0642
0643
0644
0645
0646
0647
0648 delay=str2double(get(hObject,'String'));
0649 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',delay);
0650
0651
0652 function soft_address_CreateFcn(hObject, eventdata, handles)
0653
0654
0655
0656
0657
0658
0659 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0660 set(hObject,'BackgroundColor','white');
0661 end
0662
0663
0664
0665 function acquisition1_Callback(hObject, eventdata, handles)
0666
0667
0668
0669
0670 set(handles.inj_offset,'Enable','off');
0671 set(handles.sdc1,'Enable','off');
0672 set(handles.lin_canon,'Enable','off');
0673 set(handles.boo_bpm,'Enable','off');
0674 set(handles.lt1_emittance,'Enable','off');
0675 set(handles.lt1_MC1,'Enable','off');
0676 set(handles.lt1_MC2,'Enable','off');
0677 set(handles.lt1_osc,'Enable','off');
0678 set(handles.boo_dcct,'Enable','off');
0679 set(handles.boo_nod,'Enable','off');
0680 set(handles.boo_inj_septum,'Enable','off');
0681 set(handles.boo_inj_kicker,'Enable','off');
0682 set(handles.alim_dipole,'Enable','off');
0683 set(handles.alim_qf,'Enable','off');
0684 set(handles.alim_qd,'Enable','off');
0685 set(handles.alim_sf,'Enable','off');
0686 set(handles.alim_sd,'Enable','off');
0687 set(handles.boo_rf,'Enable','off');
0688 set(handles.lin_modulateur,'Enable','off');
0689 set(handles.ext_offset,'Enable','off');
0690 set(handles.boo_ext_dof,'Enable','off');
0691 set(handles.boo_ext_sept_p,'Enable','off');
0692 set(handles.boo_ext_sept_a,'Enable','off');
0693 set(handles.boo_ext_kicker,'Enable','off');
0694 set(handles.sdc2,'Enable','off');
0695 set(handles.lt2_emittance,'Enable','off');
0696 set(handles.lt2_osc,'Enable','off');
0697 set(handles.lt2_bpm,'Enable','off');
0698 set(handles.ans_inj_k1,'Enable','off');
0699 set(handles.ans_inj_k2,'Enable','off');
0700 set(handles.ans_inj_k3,'Enable','off');
0701 set(handles.ans_inj_k4,'Enable','off');
0702 set(handles.ans_inj_sept_p,'Enable','off');
0703 set(handles.ans_inj_sept_a,'Enable','off');
0704 set(handles.ans_bpm,'Enable','off');
0705 set(handles.ans_dcct,'Enable','off');
0706
0707
0708
0709 n=1;
0710
0711 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
0712 set(handles.pc_address,'String',num2str(temp.value(n)));
0713
0714 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
0715 set(handles.inj_address,'String',num2str(temp.value(n)));
0716
0717 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
0718 set(handles.soft_address,'String',num2str(temp.value(n)));
0719
0720 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
0721 set(handles.ext_address,'String',num2str(temp.value(n)));
0722
0723
0724 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay');
0725 set(handles.sdc1,'String',num2str(temp.value(n)));
0726
0727 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay');
0728 set(handles.lin_canon,'String',num2str(temp.value(n)));
0729
0730 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay');
0731 set(handles.boo_bpm,'String',num2str(temp.value(n)));
0732
0733 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay');
0734 set(handles.lt1_emittance,'String',num2str(temp.value(n)));
0735
0736 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay');
0737 set(handles.lt1_MC1,'String',num2str(temp.value(n)));
0738
0739 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay');
0740 set(handles.lt1_MC2,'String',num2str(temp.value(n)));
0741
0742 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay');
0743 set(handles.lt1_osc,'String',num2str(temp.value(n)));
0744
0745 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay');
0746 set(handles.boo_dcct,'String',num2str(temp.value(n)));
0747
0748 temp=tango_read_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigTimeDelay');
0749 set(handles.boo_nod,'String',num2str(temp.value(n)));
0750
0751 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay');
0752 set(handles.boo_inj_septum,'String',num2str(temp.value(n)));
0753
0754 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay');
0755 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)));
0756
0757 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTimeDelay');
0758 set(handles.alim_dipole,'String',num2str(temp.value(n)));
0759
0760 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTimeDelay');
0761 set(handles.alim_qf,'String',num2str(temp.value(n)));
0762
0763 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTimeDelay');
0764 set(handles.alim_qd,'String',num2str(temp.value(n)));
0765
0766 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTimeDelay');
0767 set(handles.alim_sf,'String',num2str(temp.value(n)));
0768
0769 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTimeDelay');
0770 set(handles.alim_sd,'String',num2str(temp.value(n)));
0771
0772 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfTimeDelay');
0773 set(handles.boo_rf,'String',num2str(temp.value(n)));
0774
0775 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
0776 set(handles.lin_modulateur,'String',num2str(temp.value(n)));
0777
0778
0779
0780
0781
0782 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay');
0783 set(handles.boo_ext_dof,'String',num2str(temp.value(n)));
0784
0785 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay');
0786 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)));
0787
0788 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay');
0789 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)));
0790
0791 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay');
0792 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)));
0793
0794 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay');
0795 set(handles.sdc2,'String',num2str(temp.value(n)));
0796
0797 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceTimeDelay');
0798 set(handles.lt2_emittance,'String',num2str(temp.value(n)));
0799
0800 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'oscTimeDelay');
0801 set(handles.lt2_osc,'String',num2str(temp.value(n)));
0802
0803 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
0804 set(handles.lt2_bpm,'String',num2str(temp.value(n)));
0805
0806
0807
0808 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay');
0809 set(handles.ans_inj_k1,'String',num2str(temp.value(n)));
0810
0811 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay');
0812 set(handles.ans_inj_k2,'String',num2str(temp.value(n)));
0813
0814 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay');
0815 set(handles.ans_inj_k3,'String',num2str(temp.value(n)));
0816
0817 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay');
0818 set(handles.ans_inj_k4,'String',num2str(temp.value(n)));
0819
0820 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay');
0821 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)));
0822
0823 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay');
0824 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)));
0825
0826 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
0827 set(handles.ans_bpm,'String',num2str(temp.value(n)));
0828
0829 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTimeDelay');
0830 set(handles.ans_dcct,'String',num2str(temp.value(n)));
0831
0832
0833
0834
0835 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
0836 if (temp.value(n)==2)
0837 set(handles.soft_button,'Value',0);
0838 elseif (temp.value(n)==5)
0839 set(handles.soft_button,'Value',1);
0840 end
0841
0842
0843
0844 function acquisition2_Callback(hObject, eventdata, handles)
0845
0846
0847
0848
0849
0850 set(handles.inj_offset,'Enable','on');
0851 set(handles.sdc1,'Enable','on');
0852 set(handles.lin_canon,'Enable','on');
0853 set(handles.boo_bpm,'Enable','on');
0854 set(handles.lt1_emittance,'Enable','on');
0855 set(handles.lt1_MC1,'Enable','on');
0856 set(handles.lt1_MC2,'Enable','on');
0857 set(handles.lt1_osc,'Enable','on');
0858 set(handles.boo_dcct,'Enable','on');
0859 set(handles.boo_nod,'Enable','on');
0860 set(handles.boo_inj_septum,'Enable','on');
0861 set(handles.boo_inj_kicker,'Enable','on');
0862 set(handles.alim_dipole,'Enable','on');
0863 set(handles.alim_qf,'Enable','on');
0864 set(handles.alim_qd,'Enable','on');
0865 set(handles.alim_sf,'Enable','on');
0866 set(handles.alim_sd,'Enable','on');
0867 set(handles.boo_rf,'Enable','on');
0868 set(handles.lin_modulateur,'Enable','on');
0869 set(handles.ext_offset,'Enable','on');
0870 set(handles.boo_ext_dof,'Enable','on');
0871 set(handles.boo_ext_sept_p,'Enable','on');
0872 set(handles.boo_ext_sept_a,'Enable','on');
0873 set(handles.boo_ext_kicker,'Enable','on');
0874 set(handles.sdc2,'Enable','on');
0875 set(handles.lt2_emittance,'Enable','on');
0876 set(handles.lt2_osc,'Enable','on');
0877 set(handles.lt2_bpm,'Enable','on');
0878 set(handles.ans_inj_k1,'Enable','on');
0879 set(handles.ans_inj_k2,'Enable','on');
0880 set(handles.ans_inj_k3,'Enable','on');
0881 set(handles.ans_inj_k4,'Enable','on');
0882 set(handles.ans_inj_sept_p,'Enable','on');
0883 set(handles.ans_inj_sept_a,'Enable','on');
0884 set(handles.ans_bpm,'Enable','on');
0885 set(handles.ans_dcct,'Enable','on');
0886
0887 n=1;
0888
0889 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
0890 set(handles.pc_address,'String',num2str(temp.value(n)));
0891
0892 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
0893 set(handles.inj_address,'String',num2str(temp.value(n)));
0894
0895 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
0896 set(handles.soft_address,'String',num2str(temp.value(n)));
0897 set(handles.soft_address1,'String',num2str(temp.value(n)));
0898
0899 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
0900 set(handles.ext_address,'String',num2str(temp.value(n)));
0901
0902
0903
0904 inj_offset=str2double(get(handles.inj_offset,'String'));
0905
0906 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay');
0907 set(handles.sdc1,'String',num2str(temp.value(n)-inj_offset));
0908
0909 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay');
0910 set(handles.lin_canon,'String',num2str(temp.value(n)-inj_offset));
0911
0912 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay');
0913 set(handles.boo_bpm,'String',num2str(temp.value(n)-inj_offset));
0914
0915 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay');
0916 set(handles.lt1_emittance,'String',num2str(temp.value(n)-inj_offset));
0917
0918 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay');
0919 set(handles.lt1_MC1,'String',num2str(temp.value(n)-inj_offset));
0920
0921 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay');
0922 set(handles.lt1_MC2,'String',num2str(temp.value(n)-inj_offset));
0923
0924 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay');
0925 set(handles.lt1_osc,'String',num2str(temp.value(n)-inj_offset));
0926
0927 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay');
0928 set(handles.boo_dcct,'String',num2str(temp.value(n)-inj_offset));
0929
0930 temp=tango_read_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigTimeDelay');
0931 set(handles.boo_nod,'String',num2str(temp.value(n)-inj_offset));
0932
0933 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay');
0934 set(handles.boo_inj_septum,'String',num2str(temp.value(n)-inj_offset));
0935
0936 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay');
0937 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)-inj_offset));
0938
0939
0940
0941
0942 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpTimeDelay');
0943 set(handles.alim_dipole,'String',num2str(temp.value(n)));
0944
0945 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfTimeDelay');
0946 set(handles.alim_qf,'String',num2str(temp.value(n)));
0947
0948 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdTimeDelay');
0949 set(handles.alim_qd,'String',num2str(temp.value(n)));
0950
0951 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfTimeDelay');
0952 set(handles.alim_sf,'String',num2str(temp.value(n)));
0953
0954 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdTimeDelay');
0955 set(handles.alim_sd,'String',num2str(temp.value(n)));
0956
0957 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfTimeDelay');
0958 set(handles.boo_rf,'String',num2str(temp.value(n)));
0959
0960 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
0961 set(handles.lin_modulateur,'String',num2str(temp.value(n)-inj_offset));
0962
0963
0964
0965 ext_offset=str2double(get(handles.ext_offset,'String'));
0966
0967
0968 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay');
0969 set(handles.boo_ext_dof,'String',num2str(temp.value(n)-ext_offset));
0970
0971 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay');
0972 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)-ext_offset));
0973
0974 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay');
0975 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)-ext_offset));
0976
0977 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay');
0978 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)-ext_offset));
0979
0980 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay');
0981 set(handles.sdc2,'String',num2str(temp.value(n)-ext_offset));
0982
0983 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceTimeDelay');
0984 set(handles.lt2_emittance,'String',num2str(temp.value(n)-ext_offset));
0985
0986 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'oscTimeDelay');
0987 set(handles.lt2_osc,'String',num2str(temp.value(n)-ext_offset));
0988
0989 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
0990 set(handles.lt2_bpm,'String',num2str(temp.value(n)-ext_offset));
0991
0992
0993 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay');
0994 set(handles.ans_inj_k1,'String',num2str(temp.value(n)-ext_offset));
0995
0996 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay');
0997 set(handles.ans_inj_k2,'String',num2str(temp.value(n)-ext_offset));
0998
0999 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay');
1000 set(handles.ans_inj_k3,'String',num2str(temp.value(n)-ext_offset));
1001
1002 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay');
1003 set(handles.ans_inj_k4,'String',num2str(temp.value(n)-ext_offset));
1004
1005 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay');
1006 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)-ext_offset));
1007
1008 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay');
1009 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)-ext_offset));
1010
1011 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay');
1012 set(handles.ans_bpm,'String',num2str(temp.value(n)-ext_offset));
1013
1014 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTimeDelay');
1015 set(handles.ans_dcct,'String',num2str(temp.value(n)-ext_offset));
1016
1017
1018
1019 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
1020 if (temp.value(n)==2)
1021 set(handles.soft_button,'Value',0);
1022 elseif (temp.value(n)==5)
1023 set(handles.soft_button,'Value',1);
1024 end
1025
1026
1027
1028
1029 function soft_button_Callback(hObject, eventdata, handles)
1030
1031
1032
1033
1034
1035
1036 etat=get(hObject,'Value');
1037 tout=0.5;
1038 if (etat==0)
1039 event=int32(2) ;
1040 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',event); pause(tout);
1041 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent',event); pause(tout);
1042 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareEvent',event); pause(tout);
1043 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
1044 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
1045 tango_write_attribute2('BOO-BTB/SY/LOCAL.DG.1', 'bpm-btb.trigEvent',event); pause(tout);
1046 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-btc.trigEvent',event); pause(tout);
1047 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',event); pause(tout);
1048 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',event); pause(tout);
1049 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',event); pause(tout);
1050 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',event); pause(tout);
1051 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',event); pause(tout);
1052 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigEvent',event);pause(tout);
1053 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent',event); pause(tout);
1054 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',event);
1055 event=int32(3) ;
1056 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',event);pause(tout);
1057 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',event);pause(tout);
1058 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event);pause(tout);
1059 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event);pause(tout);
1060 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',event);pause(tout);
1061 tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1062 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'oscEvent',event);pause(tout);
1063 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceEvent',event);pause(tout);
1064 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'emittanceTimeDelay',event);pause(tout);
1065 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigEvent',event);pause(tout);
1066 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigEvent',event);pause(tout);
1067 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigEvent',event);pause(tout);
1068 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigEvent',event);pause(tout);
1069 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigEvent',event);pause(tout);
1070 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigEvent',event);pause(tout);
1071 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent',event);pause(tout);
1072 tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1073 tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1074 tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1075 tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1076 tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1077 tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1078 tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1079 tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1080 tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1081 tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1082 tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1083 tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1084 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1085 tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1086 tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1087 tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1088
1089
1090
1091 inj=str2double(get(handles.inj_address,'String'));
1092 soft=str2double(get(handles.soft_address,'String'));
1093 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1094 delay=temp.value(1)-(soft)+0.00568;
1095 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1096
1097
1098 elseif (etat==1)
1099 event=int32(5) ;
1100 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent',event); pause(tout);
1101 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent',event); pause(tout);
1102 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent',event); pause(tout);
1103 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigEvent',event); pause(tout);
1104 tango_write_attribute2('BOO-BTB/SY/LOCAL.DG.1', 'bpm-btb.trigEvent',event); pause(tout);
1105 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-btc.trigEvent',event); pause(tout);
1106 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent',event); pause(tout);
1107 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event',event); pause(tout);
1108 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event',event); pause(tout);
1109 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent',event); pause(tout);
1110 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent',event); pause(tout);
1111 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigEvent',event);pause(tout);
1112 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent',event); pause(tout);
1113 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent',event);
1114 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent',event);pause(tout);
1115 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent',event);pause(tout);
1116 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent',event);pause(tout);
1117 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent',event);pause(tout);
1118 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent',event);pause(tout);
1119 tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1120 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'oscEvent',event);pause(tout);
1121 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceEvent',event);pause(tout);
1122 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'emittanceTimeDelay',event);pause(tout);
1123 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigEvent',event);pause(tout);
1124 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigEvent',event);pause(tout);
1125 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigEvent',event);pause(tout);
1126 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigEvent',event);pause(tout);
1127 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigEvent',event);pause(tout);
1128 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigEvent',event);pause(tout);
1129 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent',event);pause(tout);
1130 tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent',event);pause(tout);
1131 tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1132 tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1133 tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1134 tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1135 tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1136 tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1137 tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1138 tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1139 tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1140 tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1141 tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1142 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1143 tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1144 tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1145 tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigEvent',event);pause(tout);
1146
1147
1148 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareEvent',int32(1)); pause(tout);
1149 inj=str2double(get(handles.inj_address,'String'));
1150 soft=str2double(get(handles.soft_address,'String'));
1151 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay');
1152 delay=temp.value(1)+(soft);
1153 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1154 end
1155 display('ok change address')
1156
1157
1158
1159 function push_soft_Callback(hObject, eventdata, handles)
1160
1161
1162
1163 disp('ça marche !!')
1164 tango_command_inout('ANS/SY/CENTRAL','FireSoftEvent');
1165
1166
1167
1168 function periode_edit_Callback(hObject, eventdata, handles)
1169
1170
1171
1172
1173
1174
1175
1176 val_multishot = get(handles.on,'Value');
1177
1178 if val_multishot
1179 errordlg('positionner le trigger a OFF !','Attention');
1180 return
1181 else
1182 handles.periode = str2double(get(hObject,'String'));
1183
1184
1185 timer1=timer('StartDelay',1,...
1186 'ExecutionMode','fixedRate','Period',handles.periode,'TasksToExecute',Inf);
1187 timer1.TimerFcn = {@fonction_alex, hObject,eventdata, handles};
1188 setappdata(handles.figure1,'Timer',timer1);
1189
1190
1191 guidata(hObject, handles);
1192 end
1193
1194
1195
1196 function periode_edit_CreateFcn(hObject, eventdata, handles)
1197
1198
1199
1200
1201
1202
1203 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1204 set(hObject,'BackgroundColor','white');
1205 end
1206
1207 function uibuttongroup_SelectionChangeFcn(hObject,eventdata,handles)
1208
1209
1210
1211
1212 timer1 = getappdata(handles.figure1,'Timer');
1213 switch get(get(hObject,'SelectedObject'),'Tag')
1214 case 'radiobutton1'
1215
1216 stop(timer1);
1217
1218 case 'radiobutton2'
1219
1220 start(timer1);
1221
1222 end
1223
1224 function fonction_alex(arg1,arg2,hObject,eventdata,handles)
1225
1226
1227
1228
1229
1230 disp(datestr(clock))
1231 tango_command_inout('ANS/SY/CENTRAL','FireSoftEvent');
1232
1233
1234
1235
1236
1237
1238
1239
1240 function Closinggui(obj, event, handles, figure1)
1241
1242
1243 answer = questdlg('Fermer softsynchro ?',...
1244 'Exit softsynchro',...
1245 'Yes','No','Yes');
1246
1247 switch answer
1248 case 'Yes'
1249 delete(handles);
1250 delete(figure1);
1251 otherwise
1252 disp('Closing aborted')
1253 end
1254
1255
1256
1257
1258 function button_softmoins_Callback(hObject, eventdata, handles)
1259
1260
1261
1262
1263 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1264 step=temp.value(1)-0.52243;
1265 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',step);
1266 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1267 set(handles.soft_address,'String',num2str(temp.value(1)));
1268
1269
1270 function button_softplus_Callback(hObject, eventdata, handles)
1271
1272
1273
1274
1275 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1276 step=temp.value(1)+0.52243;
1277 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',step);
1278 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
1279 set(handles.soft_address,'String',num2str(temp.value(1)));
1280
1281
1282
1283 function button_injmoins_Callback(hObject, eventdata, handles)
1284
1285
1286
1287 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1288 step=temp.value(1)-0.52243;
1289 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',step);
1290 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1291 set(handles.inj_address,'String',num2str(temp.value(1)));
1292
1293
1294 function button_injplus_Callback(hObject, eventdata, handles)
1295
1296
1297
1298
1299 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1300 step=temp.value(1)+0.52243;
1301 tango_write_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay',step);
1302 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
1303 set(handles.inj_address,'String',num2str(temp.value(1)));
1304
1305
1306
1307 function boo_ext_dof_Callback(hObject, eventdata, handles)
1308
1309
1310
1311
1312
1313
1314 ext_offset=str2double(get(handles.ext_offset,'String'));
1315 delay=str2double(get(hObject,'String'))+ext_offset;
1316 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay',delay);
1317
1318
1319 function boo_ext_dof_CreateFcn(hObject, eventdata, handles)
1320
1321
1322
1323
1324
1325
1326 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1327 set(hObject,'BackgroundColor','white');
1328 end
1329
1330
1331
1332 function boo_ext_sept_p_Callback(hObject, eventdata, handles)
1333
1334
1335
1336
1337
1338
1339 ext_offset=str2double(get(handles.ext_offset,'String'));
1340 delay=str2double(get(hObject,'String'))+ext_offset;
1341 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay',delay);
1342
1343
1344 function boo_ext_sept_p_CreateFcn(hObject, eventdata, handles)
1345
1346
1347
1348
1349
1350
1351 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1352 set(hObject,'BackgroundColor','white');
1353 end
1354
1355
1356
1357 function boo_ext_sept_a_Callback(hObject, eventdata, handles)
1358
1359
1360
1361
1362
1363
1364 ext_offset=str2double(get(handles.ext_offset,'String'));
1365 delay=str2double(get(hObject,'String'))+ext_offset;
1366 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay',delay);
1367
1368
1369 function boo_ext_sept_a_CreateFcn(hObject, eventdata, handles)
1370
1371
1372
1373
1374
1375
1376 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1377 set(hObject,'BackgroundColor','white');
1378 end
1379
1380
1381
1382 function boo_ext_kicker_Callback(hObject, eventdata, handles)
1383
1384
1385
1386
1387
1388
1389 ext_offset=str2double(get(handles.ext_offset,'String'));
1390 delay=str2double(get(hObject,'String'))+ext_offset;
1391 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay',delay);
1392
1393
1394
1395 function boo_ext_kicker_CreateFcn(hObject, eventdata, handles)
1396
1397
1398
1399
1400
1401
1402 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1403 set(hObject,'BackgroundColor','white');
1404 end
1405
1406
1407
1408 function ans_inj_sept_p_Callback(hObject, eventdata, handles)
1409
1410
1411
1412
1413
1414
1415
1416 ext_offset=str2double(get(handles.ext_offset,'String'));
1417 delay=str2double(get(hObject,'String'))+ext_offset;
1418 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigTimeDelay',delay);
1419
1420
1421 function ans_inj_sept_p_CreateFcn(hObject, eventdata, handles)
1422
1423
1424
1425
1426
1427
1428 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1429 set(hObject,'BackgroundColor','white');
1430 end
1431
1432
1433
1434 function ans_inj_sept_a_Callback(hObject, eventdata, handles)
1435
1436
1437
1438
1439
1440
1441
1442 ext_offset=str2double(get(handles.ext_offset,'String'));
1443 delay=str2double(get(hObject,'String'))+ext_offset;
1444 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigTimeDelay',delay);
1445
1446
1447 function ans_inj_sept_a_CreateFcn(hObject, eventdata, handles)
1448
1449
1450
1451
1452
1453
1454 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1455 set(hObject,'BackgroundColor','white');
1456 end
1457
1458
1459
1460 function ans_inj_k1_Callback(hObject, eventdata, handles)
1461
1462
1463
1464
1465
1466
1467
1468 ext_offset=str2double(get(handles.ext_offset,'String'));
1469 delay=str2double(get(hObject,'String'))+ext_offset;
1470 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigTimeDelay',delay);
1471
1472
1473
1474
1475 function ans_inj_k1_CreateFcn(hObject, eventdata, handles)
1476
1477
1478
1479
1480
1481
1482 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1483 set(hObject,'BackgroundColor','white');
1484 end
1485
1486
1487
1488 function ans_inj_k2_Callback(hObject, eventdata, handles)
1489
1490
1491
1492
1493
1494
1495
1496 ext_offset=str2double(get(handles.ext_offset,'String'));
1497 delay=str2double(get(hObject,'String'))+ext_offset;
1498 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigTimeDelay',delay);
1499
1500
1501 function ans_inj_k2_CreateFcn(hObject, eventdata, handles)
1502
1503
1504
1505
1506
1507
1508 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1509 set(hObject,'BackgroundColor','white');
1510 end
1511
1512
1513
1514 function ans_inj_k3_Callback(hObject, eventdata, handles)
1515
1516
1517
1518
1519
1520
1521
1522 ext_offset=str2double(get(handles.ext_offset,'String'));
1523 delay=str2double(get(hObject,'String'))+ext_offset;
1524 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigTimeDelay',delay);
1525
1526
1527 function ans_inj_k3_CreateFcn(hObject, eventdata, handles)
1528
1529
1530
1531
1532
1533
1534 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1535 set(hObject,'BackgroundColor','white');
1536 end
1537
1538
1539
1540 function ans_inj_k4_Callback(hObject, eventdata, handles)
1541
1542
1543
1544
1545
1546
1547
1548 ext_offset=str2double(get(handles.ext_offset,'String'));
1549 delay=str2double(get(hObject,'String'))+ext_offset;
1550 tango_write_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigTimeDelay',delay);
1551
1552
1553 function ans_inj_k4_CreateFcn(hObject, eventdata, handles)
1554
1555
1556
1557
1558
1559
1560 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1561 set(hObject,'BackgroundColor','white');
1562 end
1563
1564
1565
1566 function ans_dcct_Callback(hObject, eventdata, handles)
1567
1568
1569
1570
1571
1572
1573
1574 ext_offset=str2double(get(handles.ext_offset,'String'));
1575 delay=str2double(get(hObject,'String'))+ext_offset;
1576 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctTimeDelay',delay);
1577
1578
1579
1580 function ans_dcct_CreateFcn(hObject, eventdata, handles)
1581
1582
1583
1584
1585
1586
1587 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1588 set(hObject,'BackgroundColor','white');
1589 end
1590
1591
1592
1593 function ans_bpm_Callback(hObject, eventdata, handles)
1594
1595
1596
1597
1598
1599
1600
1601 ext_offset=str2double(get(handles.ext_offset,'String'));
1602 delay=str2double(get(hObject,'String'))+ext_offset;
1603 tango_write_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
1604 tango_write_attribute2('ANS-C02/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1605 tango_write_attribute2('ANS-C03/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1606 tango_write_attribute2('ANS-C04/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1607 tango_write_attribute2('ANS-C05/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1608 tango_write_attribute2('ANS-C06/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1609 tango_write_attribute2('ANS-C07/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1610 tango_write_attribute2('ANS-C08/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1611 tango_write_attribute2('ANS-C09/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1612 tango_write_attribute2('ANS-C10/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1613 tango_write_attribute2('ANS-C11/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1614 tango_write_attribute2('ANS-C12/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1615 tango_write_attribute2('ANS-C13/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1616 tango_write_attribute2('ANS-C14/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1617 tango_write_attribute2('ANS-C15/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1618 tango_write_attribute2('ANS-C16/SY/LOCAL.DG.1', 'bpm.trigTimeDelay',delay);
1619
1620
1621
1622
1623 function ans_bpm_CreateFcn(hObject, eventdata, handles)
1624
1625
1626
1627
1628
1629
1630 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1631 set(hObject,'BackgroundColor','white');
1632 end
1633
1634
1635
1636 function ext_address_Callback(hObject, eventdata, handles)
1637
1638
1639
1640
1641
1642
1643
1644
1645 delay=str2double(get(hObject,'String'));
1646 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue',delay);
1647
1648
1649 function ext_address_CreateFcn(hObject, eventdata, handles)
1650
1651
1652
1653
1654
1655
1656 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1657 set(hObject,'BackgroundColor','white');
1658 end
1659
1660
1661
1662 function soft_address1_Callback(hObject, eventdata, handles)
1663
1664
1665
1666
1667
1668
1669
1670 delay=str2double(get(hObject,'String'));
1671 tango_write_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay',delay);
1672
1673
1674 function soft_address1_CreateFcn(hObject, eventdata, handles)
1675
1676
1677
1678
1679
1680
1681 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1682 set(hObject,'BackgroundColor','white');
1683 end
1684
1685
1686
1687 function radiobutton6_Callback(hObject, eventdata, handles)
1688
1689
1690
1691
1692
1693
1694
1695
1696 function pushbutton8_Callback(hObject, eventdata, handles)
1697
1698
1699
1700
1701
1702
1703 function pushbutton9_Callback(hObject, eventdata, handles)
1704
1705
1706
1707
1708
1709
1710 function button_extmoins_Callback(hObject, eventdata, handles)
1711
1712
1713
1714
1715 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
1716 step=temp.value(1)-52*0.52243;
1717 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue',step);
1718 temp=tango_read_attribute2('ANS/SY/CENTRAL','ExtractionOffsetTimeValue');
1719 set(handles.ext_address,'String',num2str(temp.value(1)));
1720
1721
1722 function button_extplus_Callback(hObject, eventdata, handles)
1723
1724
1725
1726
1727 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
1728 step=temp.value(1)+52*0.52243;
1729 tango_write_attribute2('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue',step);
1730 temp=tango_read_attribute2('ANS/SY/CENTRAL','ExtractionOffsetTimeValue');
1731 set(handles.ext_address,'String',num2str(temp.value(1)));
1732
1733 function sdc2_Callback(hObject, eventdata, handles)
1734
1735
1736
1737
1738
1739
1740 ext_offset=str2double(get(handles.ext_offset,'String'));
1741 delay=str2double(get(hObject,'String'))+ext_offset;
1742 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay',delay);
1743
1744
1745 function sdc2_CreateFcn(hObject, eventdata, handles)
1746
1747
1748
1749
1750
1751
1752 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1753 set(hObject,'BackgroundColor','white');
1754 end
1755
1756
1757
1758 function lt2_emittance_Callback(hObject, eventdata, handles)
1759
1760
1761
1762
1763
1764
1765 ext_offset=str2double(get(handles.ext_offset,'String'));
1766 delay=str2double(get(hObject,'String'))+ext_offset;
1767 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
1768 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
1769
1770
1771
1772 function lt2_emittance_CreateFcn(hObject, eventdata, handles)
1773
1774
1775
1776
1777
1778
1779 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1780 set(hObject,'BackgroundColor','white');
1781 end
1782
1783
1784
1785 function lt2_bpm_Callback(hObject, eventdata, handles)
1786
1787
1788
1789
1790
1791
1792 ext_offset=str2double(get(handles.ext_offset,'String'));
1793 delay=str2double(get(hObject,'String'))+ext_offset;
1794 tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
1795
1796
1797 function lt2_bpm_CreateFcn(hObject, eventdata, handles)
1798
1799
1800
1801
1802
1803
1804 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1805 set(hObject,'BackgroundColor','white');
1806 end
1807
1808
1809
1810 function lt2_osc_Callback(hObject, eventdata, handles)
1811
1812
1813
1814
1815
1816
1817 ext_offset=str2double(get(handles.ext_offset,'String'));
1818 delay=str2double(get(hObject,'String'))+ext_offset;
1819 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'oscTimeDelay',delay);
1820
1821
1822 function lt2_osc_CreateFcn(hObject, eventdata, handles)
1823
1824
1825
1826
1827
1828
1829 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1830 set(hObject,'BackgroundColor','white');
1831 end
1832
1833
1834
1835 function lin_modulateur_Callback(hObject, eventdata, handles)
1836
1837
1838
1839
1840
1841
1842 inj_offset=str2double(get(handles.inj_offset,'String'));
1843 delay=str2double(get(hObject,'String'))+inj_offset;
1844 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1845
1846
1847 function lin_modulateur_CreateFcn(hObject, eventdata, handles)
1848
1849
1850
1851
1852
1853
1854 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1855 set(hObject,'BackgroundColor','white');
1856 end
1857
1858
1859
1860 function inj_offset_Callback(hObject, eventdata, handles)
1861
1862
1863
1864
1865
1866
1867
1868 inj_offset=str2double(get(hObject,'String'));
1869 ext_offset=str2double(get(handles.ext_offset,'String'));
1870 save('synchro_offset', 'inj_offset' , 'ext_offset')
1871
1872
1873 delay=str2double(get(handles.lin_canon,'String'))+inj_offset;
1874 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmTimeDelay',delay);
1875
1876 delay=str2double(get(handles.lin_modulateur,'String'))+inj_offset;
1877 tango_write_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareTimeDelay',delay);
1878
1879 delay=str2double(get(handles.sdc1,'String'))+inj_offset;
1880 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'oscTimeDelay',delay);
1881
1882
1883
1884 delay=str2double(get(handles.lt1_MC2,'String'))+inj_offset;
1885 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2TimeDelay',delay);
1886
1887 delay=str2double(get(handles.lt1_MC1,'String'))+inj_offset;
1888 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1TimeDelay',delay);
1889
1890 delay=str2double(get(handles.lt1_emittance,'String'))+inj_offset;
1891 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
1892
1893 delay=str2double(get(handles.lt1_osc,'String'))+inj_offset;
1894 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'oscTimeDelay',delay);
1895
1896
1897
1898 delay=str2double(get(handles.boo_inj_septum,'String'))+inj_offset;
1899 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigTimeDelay',delay);
1900
1901 delay=str2double(get(handles.boo_inj_kicker,'String'))+inj_offset;
1902 tango_write_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigTimeDelay',delay);
1903
1904 delay=str2double(get(handles.boo_bpm,'String'))+inj_offset;
1905 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigTimeDelay',delay);
1906 tango_write_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-btd.trigTimeDelay',delay);
1907 tango_write_attribute2('BOO-BTB/SY/LOCAL.DG.1', 'bpm-btb.trigTimeDelay',delay);
1908 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-btc.trigTimeDelay',delay);
1909
1910
1911 delay=str2double(get(handles.boo_nod,'String'))+inj_offset;
1912 tango_write_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigTimeDelay',delay);
1913
1914 delay=str2double(get(handles.boo_dcct,'String'))+inj_offset;
1915 tango_write_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booTimeDelay',delay);
1916
1917
1918
1919
1920 function inj_offset_CreateFcn(hObject, eventdata, handles)
1921
1922
1923
1924
1925
1926
1927 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1928 set(hObject,'BackgroundColor','white');
1929 end
1930
1931
1932
1933 function ext_offset_Callback(hObject, eventdata, handles)
1934
1935
1936
1937
1938
1939
1940
1941 ext_offset=str2double(get(hObject,'String'));
1942 inj_offset=str2double(get(handles.inj_offset,'String'));
1943 save('synchro_offset', 'inj_offset' , 'ext_offset')
1944
1945
1946 delay=str2double(get(handles.boo_ext_dof,'String'))+ext_offset;
1947 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigTimeDelay',delay);
1948
1949 delay=str2double(get(handles.boo_ext_sept_p,'String'))+ext_offset;
1950 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigTimeDelay',delay);
1951
1952 delay=str2double(get(handles.boo_ext_sept_a,'String'))+ext_offset;
1953 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigTimeDelay',delay);
1954
1955 delay=str2double(get(handles.boo_ext_kicker,'String'))+ext_offset;
1956 tango_write_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigTimeDelay',delay);
1957
1958 delay=str2double(get(handles.sdc2,'String'))+ext_offset;
1959 tango_write_attribute2('ANS/SY/LOCAL.SDC.1', 'spareTimeDelay',delay);
1960
1961
1962 delay=str2double(get(handles.lt2_bpm,'String'))+ext_offset;
1963 tango_write_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigTimeDelay',delay);
1964
1965 delay=str2double(get(handles.lt2_osc,'String'))+ext_offset;
1966 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'oscTimeDelay',delay);
1967
1968 delay=str2double(get(handles.lt2_emittance,'String'))+ext_offset;
1969 tango_write_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceTimeDelay',delay);
1970
1971
1972
1973 function ext_offset_CreateFcn(hObject, eventdata, handles)
1974
1975
1976
1977
1978
1979
1980 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1981 set(hObject,'BackgroundColor','white');
1982 end
1983
1984
1985
1986 function Acquisition_address_Callback(hObject, eventdata, handles)
1987
1988
1989
1990
1991 set(handles.inj_offset,'Enable','off');
1992 set(handles.sdc1,'Enable','off');
1993 set(handles.lin_canon,'Enable','off');
1994 set(handles.boo_bpm,'Enable','off');
1995 set(handles.lt1_emittance,'Enable','off');
1996 set(handles.lt1_MC1,'Enable','off');
1997 set(handles.lt1_MC2,'Enable','off');
1998 set(handles.lt1_osc,'Enable','off');
1999 set(handles.boo_dcct,'Enable','off');
2000 set(handles.boo_nod,'Enable','off');
2001 set(handles.boo_inj_septum,'Enable','off');
2002 set(handles.boo_inj_kicker,'Enable','off');
2003 set(handles.alim_dipole,'Enable','off');
2004 set(handles.alim_qf,'Enable','off');
2005 set(handles.alim_qd,'Enable','off');
2006 set(handles.alim_sf,'Enable','off');
2007 set(handles.alim_sd,'Enable','off');
2008 set(handles.boo_rf,'Enable','off');
2009 set(handles.lin_modulateur,'Enable','off');
2010 set(handles.ext_offset,'Enable','off');
2011 set(handles.boo_ext_dof,'Enable','off');
2012 set(handles.boo_ext_sept_p,'Enable','off');
2013 set(handles.boo_ext_sept_a,'Enable','off');
2014 set(handles.boo_ext_kicker,'Enable','off');
2015 set(handles.sdc2,'Enable','off');
2016 set(handles.lt2_emittance,'Enable','off');
2017 set(handles.lt2_osc,'Enable','off');
2018 set(handles.lt2_bpm,'Enable','off');
2019 set(handles.ans_inj_k1,'Enable','off');
2020 set(handles.ans_inj_k2,'Enable','off');
2021 set(handles.ans_inj_k3,'Enable','off');
2022 set(handles.ans_inj_k4,'Enable','off');
2023 set(handles.ans_inj_sept_p,'Enable','off');
2024 set(handles.ans_inj_sept_a,'Enable','off');
2025 set(handles.ans_bpm,'Enable','off');
2026 set(handles.ans_dcct,'Enable','off');
2027
2028 n=1;
2029
2030 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TPcTimeDelay');
2031 set(handles.pc_address,'String',num2str(temp.value(n)));
2032
2033 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TInjTimeDelay');
2034 set(handles.inj_address,'String',num2str(temp.value(n)));
2035
2036 temp=tango_read_attribute2('ANS/SY/CENTRAL', 'TSoftTimeDelay');
2037 set(handles.soft_address,'String',num2str(temp.value(n)));
2038
2039 temp=tango_read_attribute('ANS/SY/CENTRAL', 'ExtractionOffsetTimeValue');
2040 set(handles.ext_address,'String',num2str(temp.value(n)));
2041
2042
2043 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'oscEvent');
2044 set(handles.sdc1,'String',num2str(temp.value(n)));
2045
2046 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'lpmEvent');
2047 set(handles.lin_canon,'String',num2str(temp.value(n)));
2048
2049 temp=tango_read_attribute2('BOO/SY/LOCAL.DG.1', 'bpm-bta.trigEvent');
2050 set(handles.boo_bpm,'String',num2str(temp.value(n)));
2051
2052 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'emittanceEvent');
2053 set(handles.lt1_emittance,'String',num2str(temp.value(n)));
2054
2055 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.1Event');
2056 set(handles.lt1_MC1,'String',num2str(temp.value(n)));
2057
2058 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'mc.2Event');
2059 set(handles.lt1_MC2,'String',num2str(temp.value(n)));
2060
2061 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'oscEvent');
2062 set(handles.lt1_osc,'String',num2str(temp.value(n)));
2063
2064 temp=tango_read_attribute2('LT1/SY/LOCAL.DG.1', 'dcct-booEvent');
2065 set(handles.boo_dcct,'String',num2str(temp.value(n)));
2066
2067 temp=tango_read_attribute2('BOO-BTC/SY/LOCAL.DG.1', 'bpm-onde.trigEvent');
2068 set(handles.boo_nod,'String',num2str(temp.value(n)));
2069
2070 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'sep-p.trigEvent');
2071 set(handles.boo_inj_septum,'String',num2str(temp.value(n)));
2072
2073 temp=tango_read_attribute2('BOO/SY/LOCAL.Binj.1', 'k.trigEvent');
2074 set(handles.boo_inj_kicker,'String',num2str(temp.value(n)));
2075
2076 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'dpEvent');
2077 set(handles.alim_dipole,'String',num2str(temp.value(n)));
2078
2079 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qfEvent');
2080 set(handles.alim_qf,'String',num2str(temp.value(n)));
2081
2082 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'qdEvent');
2083 set(handles.alim_qd,'String',num2str(temp.value(n)));
2084
2085 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sfEvent');
2086 set(handles.alim_sf,'String',num2str(temp.value(n)));
2087
2088 temp=tango_read_attribute2('BOO/SY/LOCAL.ALIM.1', 'sdEvent');
2089 set(handles.alim_sd,'String',num2str(temp.value(n)));
2090
2091 temp=tango_read_attribute2('BOO/SY/LOCAL.RF.1', 'rfEvent');
2092 set(handles.boo_rf,'String',num2str(temp.value(n)));
2093
2094 temp=tango_read_attribute2('LT1/SY/LOCAL.LINAC.1', 'spareEvent');
2095 set(handles.lin_modulateur,'String',num2str(temp.value(n)));
2096
2097
2098
2099
2100
2101 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'dof.trigEvent');
2102 set(handles.boo_ext_dof,'String',num2str(temp.value(n)));
2103
2104 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-p.trigEvent');
2105 set(handles.boo_ext_sept_p,'String',num2str(temp.value(n)));
2106
2107 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'sep-a.trigEvent');
2108 set(handles.boo_ext_sept_a,'String',num2str(temp.value(n)));
2109
2110 temp=tango_read_attribute2('BOO/SY/LOCAL.Bext.1', 'k.trigEvent');
2111 set(handles.boo_ext_kicker,'String',num2str(temp.value(n)));
2112
2113
2114
2115 temp=tango_read_attribute2('ANS/SY/LOCAL.SDC.1', 'spareEvent');
2116 set(handles.sdc2,'String',num2str(temp.value(n)));
2117
2118 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'emittanceEvent');
2119 set(handles.lt2_emittance,'String',num2str(temp.value(n)));
2120
2121 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.1', 'oscEvent');
2122 set(handles.lt2_osc,'String',num2str(temp.value(n)));
2123
2124 temp=tango_read_attribute2('LT2/SY/LOCAL.DG.2', 'bpm.trigEvent');
2125 set(handles.lt2_bpm,'String',num2str(temp.value(n)));
2126
2127 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k1.trigEvent');
2128 set(handles.ans_inj_k1,'String',num2str(temp.value(n)));
2129
2130 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k2.trigEvent');
2131 set(handles.ans_inj_k2,'String',num2str(temp.value(n)));
2132
2133 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k3.trigEvent');
2134 set(handles.ans_inj_k3,'String',num2str(temp.value(n)));
2135
2136 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.1', 'k4.trigEvent');
2137 set(handles.ans_inj_k4,'String',num2str(temp.value(n)));
2138
2139 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-p.trigEvent');
2140 set(handles.ans_inj_sept_p,'String',num2str(temp.value(n)));
2141
2142 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.Ainj.2', 'sep-a.trigEvent');
2143 set(handles.ans_inj_sept_a,'String',num2str(temp.value(n)));
2144
2145 temp=tango_read_attribute2('ANS-C13/SY/LOCAL.DG.1', 'dcctEvent');
2146 set(handles.ans_dcct,'String',num2str(temp.value(n)));
2147
2148 temp=tango_read_attribute2('ANS-C01/SY/LOCAL.DG.2', 'bpm.trigEvent');
2149 set(handles.ans_bpm,'String',num2str(temp.value(n)));
2150
2151
2152
2153
2154
2155
2156
2157 function button_offinj_moins_Callback(hObject, eventdata, handles)
2158
2159
2160
2161
2162 temp=str2double(get(handles.inj_offset,'String'));
2163 step=temp-52*0.52243;
2164 set(handles.inj_offset,'String',step);
2165 inj_offset_Callback(handles.inj_offset, eventdata, handles);
2166
2167
2168 function button_offinj_plus_Callback(hObject, eventdata, handles)
2169
2170
2171
2172
2173 temp=str2double(get(handles.inj_offset,'String'));
2174 step=temp+52*0.52243;
2175 set(handles.inj_offset,'String',step);
2176 inj_offset_Callback(handles.inj_offset, eventdata, handles);
2177
2178
2179 function button_offext_moins_Callback(hObject, eventdata, handles)
2180
2181
2182
2183
2184 temp=str2double(get(handles.ext_offset,'String'));
2185 step=temp-52*0.52243;
2186 set(handles.ext_offset,'String',step);
2187 ext_offset_Callback(handles.ext_offset, eventdata, handles);
2188
2189
2190 function button_offext_plus_Callback(hObject, eventdata, handles)
2191
2192
2193
2194
2195 temp=str2double(get(handles.ext_offset,'String'));
2196 step=temp+52*0.52243;
2197 set(handles.ext_offset,'String',step);
2198 ext_offset_Callback(handles.ext_offset, eventdata, handles);
2199