source: MML/trunk/mml/showmachinedata.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 2.2 KB
Line 
1function showmachinedata(families)
2%SHOWMACHINEDATA - Display setpoints and readbacks for families in AcceleratorObjects
3% showmachinedata(families)
4%
5% INPUTS
6% 1. families can be char or cell array showmachinedata{'Q1'; 'Q2';}
7%
8% Written by Jeff Corbett
9% Modified by Laurent S. Nadolski
10
11
12if nargin == 0
13    families = '';
14end
15
16ad = getad; % gets Accelerator Data
17
18% Prints out current time
19fprintf('%30s\n\n',[ad.Machine ' Accelerator Settings: ' datestr(now,0)]);
20
21if isempty(families)
22    families=getfamilylist;
23elseif ischar(families)
24    families=char(families);   %make sure same length
25elseif iscell(families)
26    families=char(families{:});
27end
28
29for ii = 1:size(families,1)
30    family = deblank(families(ii,:));
31
32    if ~isfamily(family)
33        disp(['   Warning: family not available... ', family]);
34    else
35        if ismemberof(family, 'Magnet')
36
37            DevList     = family2dev(family);
38            %SetpointPV  = char(getfamilydata(family,'Setpoint','TangoNames'));
39            Setpoint    = getsp(family,'hardware');
40            PSetpoint   = hw2physics(family,'Setpoint',Setpoint);
41
42            %MonitorPV   = char(getfamilydata(family,'Monitor','TangoNames'));
43            Monitor     = getam(family,'hardware');
44            PMonitor    = hw2physics(family,'Monitor', Monitor);
45
46
47            %display hardware values
48            fprintf('%s\n',['   Family  DeviceList  HWSetpoint PhysicsSetpoint     HWReadback    PhysicsReadback   SP-MON (HW)   SP-MON (Physics)']);
49            %fprintf('%s\n',['   Family  DeviceList  HWSetpoint PhysicsSetpoint     HWReadback    PhysicsReadback   SP-MON (HW)   SP-MON (Physics)  Setpoint_PV             Monitor_PV']);
50
51            for jj=1:size(DevList,1)
52                fprintf('%8s    [%2d,%d] %14.5f %14.5f %14.5f %14.5f %14.5f %14.5f\n',family,DevList(jj,1),DevList(jj,2),Setpoint(jj),PSetpoint(jj),Monitor(jj),PMonitor(jj),Setpoint(jj)-Monitor(jj),PSetpoint(jj)-PMonitor(jj));
53                %fprintf('%8s    [%2d,%d] %14.5f %14.5f %14.5f %14.5f %14.5f %14.5f %28s %20s\n',family,DevList(jj,1),DevList(jj,2),Setpoint(jj),PSetpoint(jj),Monitor(jj),PMonitor(jj),Setpoint(jj)-Monitor(jj),PSetpoint(jj)-PMonitor(jj),SetpointPV(jj,:),MonitorPV(jj,:));
54            end
55            disp(' ');
56        end
57    end
58end
Note: See TracBrowser for help on using the repository browser.