1 | function curve = getcyclecurve(varargin) |
---|
2 | %GETCYCLECURVE - Get curve for cycling magnet |
---|
3 | % |
---|
4 | % INPUTS |
---|
5 | % 1. Family or Tango sequencer device name |
---|
6 | % OPTIONAL |
---|
7 | % 2. DEviceListe |
---|
8 | % |
---|
9 | % OUTPUTS |
---|
10 | % 1. curve read from Dserver |
---|
11 | % |
---|
12 | % EXAMPLES |
---|
13 | % 1. getcyclecurve('LT1/tests/currentCH.2'); |
---|
14 | % 2. getcyclecurve('CycleQP'); |
---|
15 | % 3. getcyclecurve('CycleQP',[1 3]); |
---|
16 | % |
---|
17 | % NOTES: |
---|
18 | % 1. Tango specific |
---|
19 | % |
---|
20 | % See Also setcyclecurve, plotcyclingcurve, LT1cycling |
---|
21 | |
---|
22 | % TODO: This just a first shot routine |
---|
23 | |
---|
24 | DeviceList = []; |
---|
25 | |
---|
26 | if isempty(varargin) |
---|
27 | error('At least provide a Family'); |
---|
28 | end |
---|
29 | |
---|
30 | Family = varargin{1}; |
---|
31 | |
---|
32 | if nargin > 1 |
---|
33 | DeviceList = varargin{2}; |
---|
34 | end |
---|
35 | |
---|
36 | [FamilyFlag AO] = isfamily(Family); |
---|
37 | |
---|
38 | if FamilyFlag |
---|
39 | if isempty(DeviceList) |
---|
40 | DeviceList = family2dev(Family); |
---|
41 | end |
---|
42 | DeviceName = family2tangodev(Family, DeviceList); |
---|
43 | for k = 1:size(DeviceName,1) |
---|
44 | val = tango_read_attribute2(DeviceName{k},'sequenceValues'); |
---|
45 | curve{k}.Data(:,1) = val.value; |
---|
46 | val = tango_read_attribute2(DeviceName{k},'waitingTimes'); |
---|
47 | curve{k}.Data(:,2) = val.value; |
---|
48 | curve{k}.DeviceName = DeviceName{k}; |
---|
49 | end |
---|
50 | else |
---|
51 | val = tango_read_attribute2(Family,'sequenceValues'); |
---|
52 | curve(:,1) = val.value; |
---|
53 | val = tango_read_attribute2(Family,'waitingTimes'); |
---|
54 | curve(:,2) = val.value; |
---|
55 | end |
---|