1 | function [ConfigSetpoint, ConfigMonitor, FileName] = getproductionlattice(varargin) |
---|
2 | % GETPRODUCTIONLATTICE - Read the Golden lattice from file GoldenLattice |
---|
3 | % |
---|
4 | % [ConfigSetpoint, ConfigMonitor, FileName] = getproductionlattice(Field1, Field2, ...) |
---|
5 | % |
---|
6 | % INPUTS |
---|
7 | % 1. Family - Selected families (Default: All) |
---|
8 | % |
---|
9 | % OUTPUTS |
---|
10 | % 1. ConfigSetpoint - Set value structure |
---|
11 | % 2. ConfigMonitor - Monitor value structure |
---|
12 | % |
---|
13 | % See Also configgui, getinjectionlattice, getmachineconfig, |
---|
14 | % setmachineconfig |
---|
15 | |
---|
16 | % |
---|
17 | % Written by Gregory J. Portmann. |
---|
18 | |
---|
19 | % Get the production file name (full path) |
---|
20 | % AD.OpsData.LatticeFile could have the full path else default to AD.Directory.OpsData |
---|
21 | |
---|
22 | FileName = getfamilydata('OpsData','LatticeFile'); |
---|
23 | [DirectoryName, FileName, Ext, VerNumber] = fileparts(FileName); |
---|
24 | if isempty(DirectoryName) |
---|
25 | DirectoryName = getfamilydata('Directory', 'OpsData'); |
---|
26 | end |
---|
27 | FileName = fullfile(DirectoryName,[FileName, '.mat']); |
---|
28 | |
---|
29 | |
---|
30 | % Load the lattice |
---|
31 | load(FileName); |
---|
32 | |
---|
33 | % Loop for keeping only asked family set values |
---|
34 | if nargin > 0 |
---|
35 | for i = 1:length(varargin) |
---|
36 | if isfield(ConfigSetpoint, varargin{i}) |
---|
37 | ConfigSetpoint = ConfigSetpoint.(varargin{i}); |
---|
38 | end |
---|
39 | end |
---|
40 | end |
---|
41 | |
---|
42 | % Loop for keeping only asked family Monitor values |
---|
43 | |
---|
44 | if nargout >= 2 |
---|
45 | if nargin > 0 |
---|
46 | for i = 1:length(varargin) |
---|
47 | if isfield(ConfigMonitor, varargin{i}) |
---|
48 | ConfigMonitor = ConfigMonitor.(varargin{i}); |
---|
49 | end |
---|
50 | end |
---|
51 | end |
---|
52 | end |
---|