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 | |
---|
1 | function [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 | |
---|
20 | if nargin == 0 |
---|
21 | error('Must have at least one input (''Family'')!'); |
---|
22 | end |
---|
23 | |
---|
24 | DeviceListTotal = family2dev(Family); |
---|
25 | |
---|
26 | if nargin == 1 |
---|
27 | DeviceList = DeviceListTotal; |
---|
28 | return |
---|
29 | end |
---|
30 | |
---|
31 | DeviceList = []; |
---|
32 | Index = []; |
---|
33 | for i = 1:size(DeviceListTotal,1) |
---|
34 | if any([Elem]==DeviceListTotal(i,2)) |
---|
35 | DeviceList = [DeviceList; DeviceListTotal(i,:)]; |
---|
36 | Index = [Index; i]; |
---|
37 | end |
---|
38 | end |
---|
39 | |
---|
40 | |
---|
41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.