source: MML/trunk/mml/builddevlist.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: 834 bytes
Line 
1function [DeviceList, Index] = builddevlist(Family, Elem) 
2%BUILDDEVLIST - Make a full device list from devices in one sector
3%  [DeviceList, Index] = builddevlist(Family, Elem)
4%
5%  INPUTS
6%  1. Family - Family name
7%  2. Elem - Element number in sector {Default: all}
8%
9%  OUPUTS
10%  1. DeviceList
11%  2. Index
12%
13%
14%  NOTES
15%  1. DeviceList and Index are the device list and index w.r.t. family2dev(Family)
16
17
18%  Written by Gregory J. Portmann
19
20if nargin == 0
21   error('Must have at least one input (''Family'')!');
22end
23
24DeviceListTotal = family2dev(Family);
25
26if nargin == 1
27    DeviceList = DeviceListTotal;
28    return
29end
30
31DeviceList = [];
32Index = [];
33for i = 1:size(DeviceListTotal,1)
34    if any([Elem]==DeviceListTotal(i,2))
35        DeviceList = [DeviceList; DeviceListTotal(i,:)];
36        Index = [Index; i];
37    end
38end
39
40
41
Note: See TracBrowser for help on using the repository browser.