1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of family2dev</title> |
---|
6 | <meta name="keywords" content="family2dev"> |
---|
7 | <meta name="description" content="FAMILY2DEV - Return the device list for a family"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../index.html">Home</a> > <a href="index.html">mml</a> > family2dev.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for mml <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>family2dev |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
24 | <div class="box"><strong>FAMILY2DEV - Return the device list for a family</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function DeviceList = family2dev(Family, varargin); </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">FAMILY2DEV - Return the device list for a family |
---|
31 | DeviceList = family2dev(FamilyName, StatusFlag, PowerSupplyFlag) |
---|
32 | DeviceList = family2dev(FamilyName, Field, StatusFlag, PowerSupplyFlag) |
---|
33 | |
---|
34 | INPUTS |
---|
35 | 1. Family - Family name (ex., 'BEND', 'QFA', 'SF', 'SD', 'HCM', 'VCM', etc.) |
---|
36 | Data Structure (only the FamilyName field is used) |
---|
37 | Accelerator Object (only the FamilyName field is used) |
---|
38 | Cell Array |
---|
39 | 2. Field - Option field input only effects the PowerSupplyFlag |
---|
40 | 3. StatusFlag - 0 return all devices |
---|
41 | 1 return only devices with good status {Default} |
---|
42 | |
---|
43 | 4. PowerSupplyFlag - 0 return all devices {Default} |
---|
44 | 1 return only unique channel names (like, power supplies for a magnet) |
---|
45 | |
---|
46 | OUTPUTS |
---|
47 | 1. DeviceList - Device list corresponding to the Family |
---|
48 | Empty if not found |
---|
49 | |
---|
50 | See Also dev2family, <a href="family2common.html" class="code" title="function [CommonNames, ErrorFlag] = family2common(Family, DeviceList)">family2common</a>, <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>, <a href="family2handle.html" class="code" title="function [Handles, ErrorFlag] = family2handle(Family, Field, DeviceList);">family2handle</a> |
---|
51 | <a href="family2status.html" class="code" title="function [S, IndexList] = family2status(Family, DeviceList)">family2status</a>, <a href="family2tol.html" class="code" title="function [Data, ErrorFlag] = family2tol(varargin)">family2tol</a>, <a href="family2units.html" class="code" title="function [Units, UnitsString] = family2units(varargin)">family2units</a>, family2tango</pre></div> |
---|
52 | |
---|
53 | <!-- crossreference --> |
---|
54 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
55 | This function calls: |
---|
56 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
57 | <li><a href="family2channel.html" class="code" title="function [ChannelNames, ErrorFlag] = family2channel(varargin);">family2channel</a> FAMILY2CHANNEL - Converts the family name to a channel name</li><li><a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a> FAMILY2DEV - Return the device list for a family</li><li><a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a> GETFAMILYDATA - Gets data associated with the accelerator control</li></ul> |
---|
58 | This function is called by: |
---|
59 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
60 | <li><a href="amp2mm.html" class="code" title="function mm = amp2mm(CMfamily, Amps, CMDevList, varargin)">amp2mm</a> AMPS2MM - Returns the maximum millimeter orbit change per change in corrector</li><li><a href="builddevlist.html" class="code" title="function [DeviceList, Index] = builddevlist(Family, Elem)">builddevlist</a> BUILDDEVLIST - Make a full device list from devices in one sector</li><li><a href="checklimits.html" class="code" title="function [LimitFlag, LimitList] = checklimits(varargin)">checklimits</a> CHECKLIMITS - Checks if the setpoint will exceed a limit</li><li><a href="family2channel.html" class="code" title="function [ChannelNames, ErrorFlag] = family2channel(varargin);">family2channel</a> FAMILY2CHANNEL - Converts the family name to a channel name</li><li><a href="family2common.html" class="code" title="function [CommonNames, ErrorFlag] = family2common(Family, DeviceList)">family2common</a> FAMILY2COMMON - Convert a family name, device list to a common name list</li><li><a href="family2datastruct.html" class="code" title="function [DataStruct, ErrorFlag] = family2datastruct(varargin)">family2datastruct</a> FAMILY2DATASTRUCTURE - Returns a datastructure corresponding to a Family</li><li><a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a> FAMILY2DEV - Return the device list for a family</li><li><a href="family2handle.html" class="code" title="function [Handles, ErrorFlag] = family2handle(Family, Field, DeviceList);">family2handle</a> [Handles, ErrorFlag] = family2handle(Family, Field, DeviceList)</li><li><a href="family2status.html" class="code" title="function [S, IndexList] = family2status(Family, DeviceList)">family2status</a> FAMILY2STATUS - Returns the device status</li><li><a href="findrf1.html" class="code" title="function [DeltaRF, RFnew, frf] = findrf1(DeltaRF, BPMFamily, BPMList, FileName)">findrf1</a> FINDRF1 - Finds the RF frequency that minimizes the horizonal dispersion</li><li><a href="getbpm.html" class="code" title="function [BPM1, BPM2, FileName]=getbpm(varargin);">getbpm</a> GETBPM - Returns the horizontal and vertical orbit</li><li><a href="getbpmresp.html" class="code" title="function [S, FileName] = getbpmresp(varargin)">getbpmresp</a> GETBPMRESP - Returns the BPM response matrix in the horizontal and vertical planes</li><li><a href="getdisp.html" class="code" title="function [Data, FileName] = getdisp(varargin)">getdisp</a> GETDISP - Returns the dispersion for a family (from file)</li><li><a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a> GETFAMILYDATA - Gets data associated with the accelerator control</li><li><a href="getgolden.html" class="code" title="function Data = getgolden(varargin)">getgolden</a> GETGOLDEN - Returns the golden values for a family</li><li><a href="getlist.html" class="code" title="function DeviceList = getlist(varargin)">getlist</a> GETLIST - Returns Device List for a Family</li><li><a href="getnumberofsectors.html" class="code" title="function N = getnumberofsectors">getnumberofsectors</a> GETNUMBEROFSECTORS - Number of sectors in the lattice</li><li><a href="getphysdata.html" class="code" title="function [Data, iNotFound] = getphysdata(Family, Field, DeviceList)">getphysdata</a> GETPHYSDATA - Gets physics data</li><li><a href="getpv.html" class="code" title="function [AM, tout, DataTime, ErrorFlag] = getpv(varargin)">getpv</a> GETPV - Returns a variable from the online system or the model</li><li><a href="getsigma.html" class="code" title="function [Data, FileName] = getsigma(varargin)">getsigma</a> GETSIGMA - Return the standard deviation in the monitor for a family</li><li><a href="getspos.html" class="code" title="function S = getspos(Family, DeviceList)">getspos</a> GETSPOS - Returns the longitudinal position in meters</li><li><a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a> HW2PHYSICS - Converts from 'Hardware' units to 'Physics' units</li><li><a href="inputparsingffd.html" class="code" title="function [Family, Field, DeviceList, UnitsFlag, ModelFlag] = inputparsingffd(varargin)">inputparsingffd</a> INPUTPARSINGFFD - Parses the typical input line of Family, Field, DeviceList</li><li><a href="makebump.html" class="code" title="function OCS = makebump(varargin)">makebump</a> MAKEBUMP - Creates and orbit correction structure (OCS) usable by setorbit</li><li><a href="measbpmresp.html" class="code" title="function [Rmat, OutputFileName] = measbpmresp(varargin)">measbpmresp</a> MEASBPMRESP - Measures the BPM response matrix in the horizontal and vertical planes</li><li><a href="measbpmresplinearity.html" class="code" title="function measbpmresplinearity(CMFamily, mm, CMDeviceList, XAxisFlag)">measbpmresplinearity</a> MEASBPMRESPLINEARITY - Compute BPMlinearity</li><li><a href="measrespmat.html" class="code" title="function S = measrespmat(varargin)">measrespmat</a> MEASRESPMAT - Measure a response matrix</li><li><a href="mm2amp.html" class="code" title="function Amps = mm2amp(CMfamily, mm, CMDevList, varargin)">mm2amp</a> MM2AMPS - Returns the change in corrector need for a maximum orbit change</li><li><a href="physics2hw.html" class="code" title="function S = physics2hw(Family, Field, value, DeviceList, Energy)">physics2hw</a> PHYSICS2HW - Converts from 'Physics' units to 'Hardware' units</li><li><a href="plotgoldenorbit.html" class="code" title="function plotgoldenorbit(varargin)">plotgoldenorbit</a> PLOTGOLDENORBIT - Plots the golden orbit</li><li><a href="plotoffsetorbit.html" class="code" title="function plotoffsetorbit(varargin)">plotoffsetorbit</a> PLOTOFFSETORBIT - Plots the offset orbit</li><li><a href="plotorbit.html" class="code" title="function plotorbit(varargin)">plotorbit</a> PLOTORBIT - Plot the present orbit w.r.t. the golden or offset orbit</li><li><a href="quad2bpm.html" class="code" title="function [BPMFamilyOutput, BPMDevOutput, DeltaSpos, PhaseAdvance] = quad2bpm(QUADFamily, QUADDev, LocationFlag)">quad2bpm</a> QUAD2BPM - Returns the nearest BPM to the specified quadrupole</li><li><a href="quadcenterinit.html" class="code" title="function QMS = quadcenterinit(QuadFamily, QuadDev, QuadPlane)">quadcenterinit</a> QMS = quadcenterinit(Family, Device, QuadPlane)</li><li><a href="quadplotall.html" class="code" title="function [Xnew, Ynew, BPMxFamily, QUADxFamily, BPMyFamily, QUADyFamily, DateMatX, DateMatY] = quadplotall(DirName, PlotFlag)">quadplotall</a> QUADPLOTALL - Collect the date from a quadrupole center run.</li><li><a href="raw2real.html" class="code" title="function DataOut = raw2real(varargin)">raw2real</a> RAW2REAL - Converts raw control system data to calibrated values</li><li><a href="real2raw.html" class="code" title="function DataOut = real2raw(varargin)">real2raw</a> REAL2RAW - Converts "real" data (calibrated values) to control system data</li><li><a href="rmgolden.html" class="code" title="function Data = rmgolden(varargin)">rmgolden</a> RMGOLDEN - Remove the golden values for data set</li><li><a href="rmoffset.html" class="code" title="function Data = rmoffset(varargin)">rmoffset</a> RMOFFSET - Remove the offset values for data set</li><li><a href="scanorbit.html" class="code" title="function scanorbit(Family, DeviceList1, DeviceList2)">scanorbit</a> SCANORBIT - Scans 2 correctors 90 degrees out of phase</li><li><a href="setfamilydata.html" class="code" title="function setfamilydata(Data, Family, Field1, Field2, DeviceList)">setfamilydata</a> SETFAMILYDATA - Sets data associated with accelerator control</li><li><a href="setorbit.html" class="code" title="function [OCS, OCS0, V, S, ErrorFlag] = setorbit(varargin)">setorbit</a> SETORBIT - Orbit correction function</li><li><a href="setorbitbump.html" class="code" title="function [OCS, OCS0, V, S, ErrorFlag] = setorbitbump(varargin)">setorbitbump</a> SETORBITBUMP - Local bump program (uses setorbit)</li><li><a href="setpv.html" class="code" title="function ErrorFlag = setpv(varargin)">setpv</a> SETPV - Setpoint change of the online system or model</li><li><a href="sext2bpm.html" class="code" title="function [BPMFamilyOutput, BPMDevOutput, DeltaSpos] = sext2bpm(SEXTFamily, SEXTDev)">sext2bpm</a> SEXT2BPM - Returns the nearest BPM to the specified sextupole</li><li><a href="showmachinedata.html" class="code" title="function showmachinedata(families)">showmachinedata</a> SHOWMACHINEDATA - Display setpoints and readbacks for families in AcceleratorObjects</li></ul> |
---|
61 | <!-- crossreference --> |
---|
62 | |
---|
63 | |
---|
64 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
65 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function DeviceList = family2dev(Family, varargin);</a> |
---|
66 | 0002 <span class="comment">%FAMILY2DEV - Return the device list for a family</span> |
---|
67 | 0003 <span class="comment">% DeviceList = family2dev(FamilyName, StatusFlag, PowerSupplyFlag)</span> |
---|
68 | 0004 <span class="comment">% DeviceList = family2dev(FamilyName, Field, StatusFlag, PowerSupplyFlag)</span> |
---|
69 | 0005 <span class="comment">%</span> |
---|
70 | 0006 <span class="comment">% INPUTS</span> |
---|
71 | 0007 <span class="comment">% 1. Family - Family name (ex., 'BEND', 'QFA', 'SF', 'SD', 'HCM', 'VCM', etc.)</span> |
---|
72 | 0008 <span class="comment">% Data Structure (only the FamilyName field is used)</span> |
---|
73 | 0009 <span class="comment">% Accelerator Object (only the FamilyName field is used)</span> |
---|
74 | 0010 <span class="comment">% Cell Array</span> |
---|
75 | 0011 <span class="comment">% 2. Field - Option field input only effects the PowerSupplyFlag</span> |
---|
76 | 0012 <span class="comment">% 3. StatusFlag - 0 return all devices</span> |
---|
77 | 0013 <span class="comment">% 1 return only devices with good status {Default}</span> |
---|
78 | 0014 <span class="comment">%</span> |
---|
79 | 0015 <span class="comment">% 4. PowerSupplyFlag - 0 return all devices {Default}</span> |
---|
80 | 0016 <span class="comment">% 1 return only unique channel names (like, power supplies for a magnet)</span> |
---|
81 | 0017 <span class="comment">%</span> |
---|
82 | 0018 <span class="comment">% OUTPUTS</span> |
---|
83 | 0019 <span class="comment">% 1. DeviceList - Device list corresponding to the Family</span> |
---|
84 | 0020 <span class="comment">% Empty if not found</span> |
---|
85 | 0021 <span class="comment">%</span> |
---|
86 | 0022 <span class="comment">% See Also dev2family, family2common, family2dev, family2handle</span> |
---|
87 | 0023 <span class="comment">% family2status, family2tol, family2units, family2tango</span> |
---|
88 | 0024 |
---|
89 | 0025 <span class="comment">%</span> |
---|
90 | 0026 <span class="comment">% Written by Gregory J. Portmann</span> |
---|
91 | 0027 |
---|
92 | 0028 <span class="keyword">if</span> nargin == 0 |
---|
93 | 0029 error(<span class="string">'Must have at least one input.'</span>); |
---|
94 | 0030 <span class="keyword">end</span> |
---|
95 | 0031 |
---|
96 | 0032 |
---|
97 | 0033 <span class="comment">% Look for a field input</span> |
---|
98 | 0034 Field = <span class="string">''</span>; |
---|
99 | 0035 <span class="keyword">if</span> length(varargin) >= 1 |
---|
100 | 0036 <span class="keyword">if</span> ischar(varargin{1}) |
---|
101 | 0037 Field = varargin{1}; |
---|
102 | 0038 varargin(1) = []; |
---|
103 | 0039 <span class="keyword">end</span> |
---|
104 | 0040 <span class="keyword">end</span> |
---|
105 | 0041 |
---|
106 | 0042 |
---|
107 | 0043 <span class="comment">% StatusFlag</span> |
---|
108 | 0044 <span class="keyword">if</span> length(varargin) >= 1 |
---|
109 | 0045 StatusFlag = varargin{1}; |
---|
110 | 0046 <span class="keyword">else</span> |
---|
111 | 0047 <span class="comment">% This choice changes the default behavior for the entire middle layer !!!!</span> |
---|
112 | 0048 StatusFlag = 1; <span class="comment">% Only return good status devices</span> |
---|
113 | 0049 <span class="keyword">end</span> |
---|
114 | 0050 |
---|
115 | 0051 |
---|
116 | 0052 <span class="comment">% PowerSupplyFlag</span> |
---|
117 | 0053 <span class="keyword">if</span> length(varargin) >= 2 |
---|
118 | 0054 PowerSupplyFlag = varargin{2}; |
---|
119 | 0055 <span class="keyword">else</span> |
---|
120 | 0056 PowerSupplyFlag = 0; |
---|
121 | 0057 <span class="keyword">end</span> |
---|
122 | 0058 |
---|
123 | 0059 |
---|
124 | 0060 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span> |
---|
125 | 0061 <span class="comment">% Cell Array Inputs %</span> |
---|
126 | 0062 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span> |
---|
127 | 0063 <span class="keyword">if</span> iscell(Family) |
---|
128 | 0064 <span class="keyword">for</span> i = 1:length(Family) |
---|
129 | 0065 <span class="keyword">if</span> iscell(StatusFlag) & iscell(PowerSupplyFlag) |
---|
130 | 0066 DeviceList{i} = <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(Family{i}, StatusFlag{i}, PowerSupplyFlag{i}); |
---|
131 | 0067 <span class="keyword">elseif</span> iscell(StatusFlag) |
---|
132 | 0068 DeviceList{i} = <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(Family{i}, StatusFlag{i}, PowerSupplyFlag); |
---|
133 | 0069 <span class="keyword">elseif</span> iscell(PowerSupplyFlag) |
---|
134 | 0070 DeviceList{i} = <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(Family{i}, StatusFlag, PowerSupplyFlag{i}); |
---|
135 | 0071 <span class="keyword">else</span> |
---|
136 | 0072 DeviceList{i} = <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(Family{i}, StatusFlag, PowerSupplyFlag); |
---|
137 | 0073 <span class="keyword">end</span> |
---|
138 | 0074 <span class="keyword">end</span> |
---|
139 | 0075 <span class="keyword">return</span> |
---|
140 | 0076 <span class="keyword">end</span> |
---|
141 | 0077 |
---|
142 | 0078 |
---|
143 | 0079 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span> |
---|
144 | 0080 <span class="comment">% Family or data structure inputs beyond this point %</span> |
---|
145 | 0081 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span> |
---|
146 | 0082 <span class="keyword">if</span> isstruct(Family) |
---|
147 | 0083 <span class="comment">% Structures can be an accelerator object or a data structure (as returned by getpv)</span> |
---|
148 | 0084 <span class="keyword">if</span> isfield(Family, <span class="string">'FamilyName'</span>) |
---|
149 | 0085 <span class="comment">% Data structure</span> |
---|
150 | 0086 Family = Family.FamilyName; |
---|
151 | 0087 <span class="keyword">else</span> |
---|
152 | 0088 error(<span class="string">'Family input of unknown type'</span>); |
---|
153 | 0089 <span class="keyword">end</span> |
---|
154 | 0090 <span class="keyword">end</span> |
---|
155 | 0091 |
---|
156 | 0092 |
---|
157 | 0093 [DeviceList, ErrorFlag] = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(Family, <span class="string">'DeviceList'</span>); |
---|
158 | 0094 <span class="keyword">if</span> isempty(DeviceList) |
---|
159 | 0095 error(sprintf(<span class="string">'%s family not found'</span>, Family)); |
---|
160 | 0096 <span class="keyword">end</span> |
---|
161 | 0097 |
---|
162 | 0098 |
---|
163 | 0099 <span class="keyword">if</span> StatusFlag |
---|
164 | 0100 Status = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(Family, <span class="string">'Status'</span>, DeviceList); |
---|
165 | 0101 <span class="keyword">if</span> isempty(Status) |
---|
166 | 0102 fprintf(<span class="string">' WARNING: Status field not in the AO, hence ignored.\n'</span>); |
---|
167 | 0103 <span class="keyword">else</span> |
---|
168 | 0104 DeviceList = DeviceList(find(Status),:); |
---|
169 | 0105 <span class="keyword">end</span> |
---|
170 | 0106 <span class="keyword">end</span> |
---|
171 | 0107 |
---|
172 | 0108 |
---|
173 | 0109 <span class="keyword">if</span> PowerSupplyFlag |
---|
174 | 0110 <span class="comment">% There can be multiple channel names due to "ganged" power supplies</span> |
---|
175 | 0111 <span class="keyword">if</span> isempty(Field) |
---|
176 | 0112 ChannelNames0 = <a href="family2channel.html" class="code" title="function [ChannelNames, ErrorFlag] = family2channel(varargin);">family2channel</a>(Family, DeviceList); |
---|
177 | 0113 <span class="keyword">else</span> |
---|
178 | 0114 ChannelNames0 = <a href="family2channel.html" class="code" title="function [ChannelNames, ErrorFlag] = family2channel(varargin);">family2channel</a>(Family, Field, DeviceList); |
---|
179 | 0115 <span class="keyword">end</span> |
---|
180 | 0116 [ChannelNames, ii, jj] = unique(ChannelNames0, <span class="string">'rows'</span>); |
---|
181 | 0117 |
---|
182 | 0118 <span class="keyword">if</span> length(ii) ~= size(ChannelNames0,1) |
---|
183 | 0119 <span class="comment">% Remove ' ' (' ' should always be the first row)</span> |
---|
184 | 0120 <span class="keyword">if</span> isempty(deblank(ChannelNames(1,:))) |
---|
185 | 0121 ii(1) = []; |
---|
186 | 0122 jj(jj==1) = []; |
---|
187 | 0123 jj = jj - 1; |
---|
188 | 0124 <span class="keyword">end</span> |
---|
189 | 0125 |
---|
190 | 0126 ChannelNames = ChannelNames0(ii,:); |
---|
191 | 0127 |
---|
192 | 0128 <span class="comment">% Unique does a sort and keeps the last device.</span> |
---|
193 | 0129 |
---|
194 | 0130 <span class="comment">% Remove the sort</span> |
---|
195 | 0131 jjtmp = jj; |
---|
196 | 0132 <span class="keyword">for</span> i = 1:max(jj) |
---|
197 | 0133 iDev(i) = jjtmp(1); |
---|
198 | 0134 jjtmp(jjtmp==jjtmp(1)) = []; |
---|
199 | 0135 <span class="keyword">end</span> |
---|
200 | 0136 ChannelNames = ChannelNames(iDev,:); |
---|
201 | 0137 |
---|
202 | 0138 <span class="comment">% Find the first device with that name</span> |
---|
203 | 0139 i = findrowindex(ChannelNames, ChannelNames0); |
---|
204 | 0140 DeviceList = DeviceList(i,:); |
---|
205 | 0141 <span class="keyword">else</span> |
---|
206 | 0142 <span class="comment">% Remove ' ' (' ' should always be the first row)</span> |
---|
207 | 0143 <span class="keyword">if</span> isempty(deblank(ChannelNames(1,:))) |
---|
208 | 0144 iBlank = find(jj==1); |
---|
209 | 0145 DeviceList(iBlank,:) = []; |
---|
210 | 0146 <span class="keyword">end</span> |
---|
211 | 0147 <span class="keyword">end</span> |
---|
212 | 0148 <span class="keyword">end</span> |
---|
213 | 0149 |
---|
214 | 0150 |
---|
215 | 0151 <span class="comment">% if nargin >= 2</span> |
---|
216 | 0152 <span class="comment">% if varargin{1}</span> |
---|
217 | 0153 <span class="comment">% Status = getfamilydata(Family, 'Status', DeviceList);</span> |
---|
218 | 0154 <span class="comment">% if isempty(Status)</span> |
---|
219 | 0155 <span class="comment">% fprintf(' WARNING: Status field not in the AO, hence ignored.\n');</span> |
---|
220 | 0156 <span class="comment">% else</span> |
---|
221 | 0157 <span class="comment">% DeviceList = DeviceList(find(Status),:);</span> |
---|
222 | 0158 <span class="comment">% end</span> |
---|
223 | 0159 <span class="comment">% end</span> |
---|
224 | 0160 <span class="comment">% end</span> |
---|
225 | 0161 |
---|
226 | 0162</pre></div> |
---|
227 | <hr><address>Generated on Mon 21-May-2007 15:29:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
228 | </body> |
---|
229 | </html> |
---|