1 | function 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 | |
---|
12 | if nargin == 0 |
---|
13 | families = ''; |
---|
14 | end |
---|
15 | |
---|
16 | ad = getad; % gets Accelerator Data |
---|
17 | |
---|
18 | % Prints out current time |
---|
19 | fprintf('%30s\n\n',[ad.Machine ' Accelerator Settings: ' datestr(now,0)]); |
---|
20 | |
---|
21 | if isempty(families) |
---|
22 | families=getfamilylist; |
---|
23 | elseif ischar(families) |
---|
24 | families=char(families); %make sure same length |
---|
25 | elseif iscell(families) |
---|
26 | families=char(families{:}); |
---|
27 | end |
---|
28 | |
---|
29 | for 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 |
---|
58 | end |
---|