Commit 16f0d29e authored by ncarmignani's avatar ncarmignani

changes in initsoleil for soleil mdt

parent 06d25fed
function InitSoleil(obj)
%SWITCHTOEBSSIMULATOR turns parameters of First2Turns class to EBS
%simulator
%SWITCHTOSoleil turns parameters of RingControl class to Soleil
%
%
%
......@@ -11,7 +10,7 @@ TANGO_HOST=['tango://' getenv('TANGO_HOST') '/'];
%%
obj.MeasurementFolder = pwd;
obj.first_turn_index = 1;
obj.first_turn_index = 7;
%% movable objects (the movable class takes care of max-min limits, calibration, set point reached)
obj.ke = movable(''); % movable('sy/ps-ke/1');
......@@ -29,36 +28,43 @@ setfunction = @(devname,val)setfield(tango.Attribute(devname),'set',val);
%%% change all get and set function
obj.sh = movable([TANGO_HOST 'srmag/hst/all/Strengths'],...
'get_fun',getfunction,'set_fun',setfunction,...
'absolute',true,'limits',[-4e-4 4e-4]);
obj.sv = movable([TANGO_HOST 'srmag/vst/all/Strengths'],...
'get_fun',getfunction,'set_fun',setfunction,...
'absolute',true,'limits',[-4e-4 4e-4]);
% limits can be higher, but they depend on the strengths of the steerers
obj.skew = movable([TANGO_HOST 'srmag/sqp/all/CorrectionStrengths'],...
'get_fun',getfunction,'set_fun',setfunction,...
'absolute',true,'limits',[-1.5e-2 1.5e-2]);
obj.rf = movable([TANGO_HOST 'srrf/master-oscillator/1/Frequency'],...
'get_fun',getfunction,'set_fun',setfunction,...
obj.sh = movable('HCOR',...
'get_fun',@()getam('HCOR','Physics'),...
'set_fun',@(values)setsp('HCOR',values',obj.indHst','Physics'),...
'absolute',true,'limits',[-0.980e-3 0.980e-3]); %%%check limits
obj.sv = movable('VCOR',...
'get_fun',@()getam('VCOR','Physics'),...
'set_fun',@(values)setsp('VCOR',values',obj.indVst','Physics'),...
'absolute',true,'limits',[-.711e-3 .711e-3]);
% empty movable for the skew quads
obj.skew = movable('');
% = movable([TANGO_HOST 'srmag/sqp/all/CorrectionStrengths'],...
% 'get_fun',getfunction,'set_fun',setfunction,...
% 'absolute',true,'limits',[-1.5e-2 1.5e-2]);
obj.rf = movable('RF_freq',...
'get_fun',getfunction,... %%% getRF missing!
'set_fun',@(f_RF_MHz)steprf(f_RF_MHz),...
'absolute',false,'limits',[0.99 1.01]);
%%% we can ignore
obj.quad = movable([TANGO_HOST 'srmag/m-q/all/CorrectionStrengths'],...
'get_fun',getfunction,'set_fun',setfunction);
obj.quad = movable('');
% = movable([TANGO_HOST 'srmag/m-q/all/CorrectionStrengths'],...
% 'get_fun',getfunction,'set_fun',setfunction);
obj.sext = movable([TANGO_HOST 'srmag/m-s/all/CorrectionStrengths'],...
'get_fun',getfunction,'set_fun',setfunction);
obj.sext = movable('');
% = movable([TANGO_HOST 'srmag/m-s/all/CorrectionStrengths'],...
% 'get_fun',getfunction,'set_fun',setfunction);
obj.octu = movable([TANGO_HOST 'srmag/m-o/all/CorrectionStrengths'],...
'get_fun',getfunction,'set_fun',setfunction);
obj.octu = movable('');
% = movable([TANGO_HOST 'srmag/m-o/all/CorrectionStrengths'],...
% 'get_fun',getfunction,'set_fun',setfunction);
obj.initial_coordinates = movable([TANGO_HOST 'sys/ringsimulator/ebs/TbT_InCoord'],...
'get_fun',getfunction,'set_fun',setfunction);
% obj.initial_coordinates = movable([TANGO_HOST 'sys/ringsimulator/ebs/TbT_InCoord'],...
% 'get_fun',getfunction,'set_fun',setfunction);
%% function to measure trajectory, takes as input the class instance.
......@@ -86,9 +92,9 @@ obj.sum_signal_threshold = 0.5e-6; % sum signal below this value is considered n
%% state and enabled disabled for RingControl
% mask of correctors to exclude
obj.status_bpm =@()true(1,320);% @()(arrayfun(@(a)isequal(a,0),tango.Attribute([TANGO_HOST 'srdiag/beam-position/all/All_Status']).value)); % BPM status (0 means no error, so ok)
obj.state_hst =@()true(1,384);% @()(strcmp(tango.Attribute([TANGO_HOST 'srmag/hst/all/CorrectorStates']).value,'Disabled')==0); % H steerer status (ON OFF FAULT,...)
obj.state_vst =@()true(1,288);% @()(strcmp(tango.Attribute([TANGO_HOST 'srmag/vst/all/CorrectorStates']).value,'Disabled')==0); % V steerer status (ON OFF FAULT,...)
obj.status_bpm = @()family2status('BPMx'); % true means on %%% and BPMz?
obj.state_hst =@()family2status('HCOR');
obj.state_vst =@()family2status('VCOR');
% index of correctors to exclude [0,n-1]
obj.orbit_cor_disabled_bpm =@()([]);% @()(tango.Attribute([TANGO_HOST 'sr/beam-orbitcor/svd-h/DisabledBPMsIndex']).value); % H steerer not in orbit correction
......@@ -125,7 +131,11 @@ ring = lattice_SOLEIL_2019();
obj.indBPM = find(atgetcells(ring,'FamName','BPM'))';
obj.indHst = find(atgetcells(ring,'FamName','COR'))'; %%%% check which ones are h and v
%%% should we change with this?
% obj.indHst = family2elem('HCOR')
obj.indVst = find(atgetcells(ring,'FamName','COR'))';
%%% should we change with this?
% obj.indHst = family2elem('VCOR')
obj.indSkew = find(atgetcells(ring,'FamName','SkewQuad'))';
% make sure steerers have KickAngle.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment