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