source: MML/trunk/mml/getinjectionlattice.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: 1.1 KB
Line 
1function [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
12FileName = getfamilydata('OpsData','InjectionFile');
13[DirectoryName, FileName, Ext, VerNumber] = fileparts(FileName);
14if isempty(DirectoryName)
15    DirectoryName = getfamilydata('Directory', 'OpsData');
16end
17FileName = fullfile(DirectoryName,[FileName, '.mat']);
18
19
20% Load the lattice
21load(FileName);
22
23
24if nargin > 0
25    for i = 1:length(varargin)
26        if isfield(ConfigSetpoint, varargin{i})
27            ConfigSetpoint = ConfigSetpoint.(varargin{i});
28        end
29    end
30end
31
32if nargout >= 2
33if nargin > 0
34    for i = 1:length(varargin)
35        if isfield(ConfigMonitor, varargin{i})
36            ConfigMonitor = ConfigMonitor.(varargin{i});
37        end
38    end
39end
40end
41
42end
43
Note: See TracBrowser for help on using the repository browser.