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