source: MML/trunk/machine/SOLEIL/common/cycling/getcyclecurve.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1function 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
24DeviceList = [];
25
26if isempty(varargin)
27    error('At least provide a Family');
28end
29
30Family = varargin{1};
31
32if nargin > 1
33    DeviceList = varargin{2};
34end
35
36[FamilyFlag AO] = isfamily(Family);
37
38if 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
50else
51    val = tango_read_attribute2(Family,'sequenceValues');
52    curve(:,1) = val.value;
53    val = tango_read_attribute2(Family,'waitingTimes');
54    curve(:,2) = val.value;
55end
Note: See TracBrowser for help on using the repository browser.