|
74 | 74 | [show_all, varargin]=getflag(varargin, 'all'); |
75 | 75 | idx=atlocateparam(ring); |
76 | 76 | if isempty(idx) |
77 | | -% t1='Slow access to properties because there is no RingParam element.'; |
78 | | -% t2='Consider adding it with the command: ">> ring=atSetRingProperties(ring)".'; |
79 | | -% warning('AT:NoRingParam', '%s\n%s', t1, t2); |
| 77 | + t1='Slow access to properties because there is no RingParam element.'; |
| 78 | + t2='Consider adding it with the command: ">> ring=atSetRingProperties(ring)".'; |
| 79 | + warning('AT:NoRingParam', '%s\n%s', t1, t2); |
80 | 80 | props=struct(); |
81 | 81 | else |
82 | 82 | props=rmfield(ring{idx},{'Length','Class','PassMethod'}); |
83 | 83 | end |
84 | 84 | if isempty(varargin) |
85 | | - [props,~]=atparamscan(ring,props,'FamName','Energy','Periodicity',... |
86 | | - 'Particle','cell_harmnumber','cavpts'); |
87 | | - props.Particle=atparticle.loadobj(props.Particle); |
88 | | - props.HarmNumber=props.Periodicity*props.cell_harmnumber; |
| 85 | + prmlist = {'FamName','Energy','Periodicity', 'Particle',... |
| 86 | + 'cell_harmnumber', 'HarmNumber','cavpts'}; |
89 | 87 | if show_all |
90 | | - prmlist={'beta', 'gamma', 'BRho', 'rf_frequency', 'rf_voltage', 'rf_timelag',... |
91 | | - 'mcf', 'slip_factor', 'radiation', 'is_6d', 'has_cavity',... |
92 | | - 'Circumference', 'revolution_frequency',... |
93 | | - 'cell_length', 'cell_rf_voltage', 'cell_revolution_frequency'}; |
94 | | - [~,prms]=atparamscan(ring,props,prmlist{:}); |
95 | | - cellfun(@setprop,prmlist,prms); |
| 88 | + prmlist = [prmlist {'beta', 'gamma', 'BRho', 'rf_frequency',... |
| 89 | + 'rf_voltage', 'rf_timelag', 'mcf', 'slip_factor',... |
| 90 | + 'radiation', 'is_6d', 'has_cavity', 'Circumference',... |
| 91 | + 'revolution_frequency', 'cell_length', 'cell_rf_voltage',... |
| 92 | + 'cell_revolution_frequency'}]; |
96 | 93 | end |
| 94 | + [~, prms] = atparamscan(ring, props, prmlist{:}); |
| 95 | + cellfun(@setprop, prmlist, prms); |
97 | 96 | varargout={props,idx}; |
98 | 97 | else |
99 | 98 | [~,varargout]=atparamscan(ring,props,varargin{:}); |
|
0 commit comments