source: MML/trunk/mml/getproductionlattice.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.4 KB
Line 
1function [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
22FileName = getfamilydata('OpsData','LatticeFile');
23[DirectoryName, FileName, Ext, VerNumber] = fileparts(FileName);
24if isempty(DirectoryName)
25    DirectoryName = getfamilydata('Directory', 'OpsData');
26end
27FileName = fullfile(DirectoryName,[FileName, '.mat']);
28
29
30% Load the lattice
31load(FileName);
32
33% Loop for keeping only asked family set values
34if nargin > 0
35    for i = 1:length(varargin)
36        if isfield(ConfigSetpoint, varargin{i})
37            ConfigSetpoint = ConfigSetpoint.(varargin{i});
38        end
39    end
40end
41
42% Loop for keeping only asked family Monitor values
43
44if nargout >= 2
45if nargin > 0
46    for i = 1:length(varargin)
47        if isfield(ConfigMonitor, varargin{i})
48            ConfigMonitor = ConfigMonitor.(varargin{i});
49        end
50    end
51end
52end
Note: See TracBrowser for help on using the repository browser.