Skip to content

Commit

Permalink
Fix a regression bug in AtGetRingProperties (#701)
Browse files Browse the repository at this point in the history
* fix missing 'cavpts' in ring parameters
  • Loading branch information
lfarv authored Nov 20, 2023
1 parent dd325a4 commit 8d628bf
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions atmat/lattice/atGetRingProperties.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,25 @@
[show_all, varargin]=getflag(varargin, 'all');
idx=atlocateparam(ring);
if isempty(idx)
% t1='Slow access to properties because there is no RingParam element.';
% t2='Consider adding it with the command: ">> ring=atSetRingProperties(ring)".';
% warning('AT:NoRingParam', '%s\n%s', t1, t2);
t1='Slow access to properties because there is no RingParam element.';
t2='Consider adding it with the command: ">> ring=atSetRingProperties(ring)".';
warning('AT:NoRingParam', '%s\n%s', t1, t2);
props=struct();
else
props=rmfield(ring{idx},{'Length','Class','PassMethod'});
end
if isempty(varargin)
[props,~]=atparamscan(ring,props,'FamName','Energy','Periodicity',...
'Particle','cell_harmnumber','cavpts');
props.Particle=atparticle.loadobj(props.Particle);
props.HarmNumber=props.Periodicity*props.cell_harmnumber;
prmlist = {'FamName','Energy','Periodicity', 'Particle',...
'cell_harmnumber', 'HarmNumber','cavpts'};
if show_all
prmlist={'beta', 'gamma', 'BRho', 'rf_frequency', 'rf_voltage', 'rf_timelag',...
'mcf', 'slip_factor', 'radiation', 'is_6d', 'has_cavity',...
'Circumference', 'revolution_frequency',...
'cell_length', 'cell_rf_voltage', 'cell_revolution_frequency'};
[~,prms]=atparamscan(ring,props,prmlist{:});
cellfun(@setprop,prmlist,prms);
prmlist = [prmlist {'beta', 'gamma', 'BRho', 'rf_frequency',...
'rf_voltage', 'rf_timelag', 'mcf', 'slip_factor',...
'radiation', 'is_6d', 'has_cavity', 'Circumference',...
'revolution_frequency', 'cell_length', 'cell_rf_voltage',...
'cell_revolution_frequency'}];
end
[~, prms] = atparamscan(ring, props, prmlist{:});
cellfun(@setprop, prmlist, prms);
varargout={props,idx};
else
[~,varargout]=atparamscan(ring,props,varargin{:});
Expand Down

0 comments on commit 8d628bf

Please sign in to comment.