1 | function [ConfigSetpoint, ConfigMonitor, FileName] = getinjectionlattice(varargin) |
---|
2 | %GETINJECTIONLATTICE - Get data from the production lattice file |
---|
3 | % [ConfigSetpoint, ConfigMonitor, FileName] = getinjectionlattice(Field1, Field2, ...) |
---|
4 | % |
---|
5 | % See also getproductionlattice, getmachineconfig, setmachineconfig |
---|
6 | % |
---|
7 | % Written by Greg Portmann |
---|
8 | |
---|
9 | |
---|
10 | % Get the injection file name (full path) |
---|
11 | % AD.OpsData.InjectionFile could have the full path else default to AD.Directory.OpsData |
---|
12 | FileName = getfamilydata('OpsData','InjectionFile'); |
---|
13 | [DirectoryName, FileName, Ext, VerNumber] = fileparts(FileName); |
---|
14 | if isempty(DirectoryName) |
---|
15 | DirectoryName = getfamilydata('Directory', 'OpsData'); |
---|
16 | end |
---|
17 | FileName = fullfile(DirectoryName,[FileName, '.mat']); |
---|
18 | |
---|
19 | |
---|
20 | % Load the lattice |
---|
21 | load(FileName); |
---|
22 | |
---|
23 | |
---|
24 | if nargin > 0 |
---|
25 | for i = 1:length(varargin) |
---|
26 | if isfield(ConfigSetpoint, varargin{i}) |
---|
27 | ConfigSetpoint = ConfigSetpoint.(varargin{i}); |
---|
28 | end |
---|
29 | end |
---|
30 | end |
---|
31 | |
---|
32 | if nargout >= 2 |
---|
33 | if nargin > 0 |
---|
34 | for i = 1:length(varargin) |
---|
35 | if isfield(ConfigMonitor, varargin{i}) |
---|
36 | ConfigMonitor = ConfigMonitor.(varargin{i}); |
---|
37 | end |
---|
38 | end |
---|
39 | end |
---|
40 | end |
---|
41 | |
---|
42 | end |
---|
43 | |
---|