Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Gregory Portmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 3 additions & 2 deletions mml/gotoat.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

ATPATHDirectory = '';
ATVersion = [];
ATVersionDefault = 1.3;

while length(varargin) > 0
if isstruct(varargin{1}) || iscell(varargin{1})
Expand All @@ -36,10 +37,10 @@
if ismac || ispc % Not linking properly on Linux yet!!!
ATVersion = 2.0;
else
ATVersion = 1.3;
ATVersion = ATVersionDefault;
end
else
ATVersion = 1.3;
ATVersion = ATVersionDefault;
end
end

Expand Down
10 changes: 5 additions & 5 deletions mml/setpathasp.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@


if strcmpi(SubMachineName,'StorageRing')
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'StorageRing', 'StorageRing', LinkFlag);
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'StorageRing', 'StorageRing', LinkFlag, '', 1.4);
elseif strcmpi(SubMachineName,'Booster')
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'Booster', 'Booster', LinkFlag);
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'Booster', 'Booster', LinkFlag, '', 1.4);
elseif strcmpi(SubMachineName,'LTB')
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'LTB', 'Transport', LinkFlag);
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'LTB', 'Transport', LinkFlag, '', 1.4);
elseif strcmpi(SubMachineName,'BTS')
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'BTS', 'Transport', LinkFlag);
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'BTS', 'Transport', LinkFlag, '', 1.4);
elseif strcmpi(SubMachineName,'Injector')
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'Injector', 'Booster', LinkFlag);
[MachineName, SubMachineName, LinkFlag, MMLROOT] = setpathmml(Machine, 'Injector', 'Booster', LinkFlag, '', 1.4);
end
13 changes: 10 additions & 3 deletions mml/setpathmml.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
% 3. MachineType - 'StorageRing' {Default}, 'Booster', 'Linac', or 'Transport'
% 4. OnlineLinkMethod - 'LabCA', 'SCA', 'MCA', 'Tango', 'SLC', 'UCODE', ... {Default: 'LabCA'}
% 5. MMLROOT - Directory path to the MML root directory
% 6. ATVersion - Version of AT to use. Choice of 1.3, 1.4 and 2.0.

% Written by Greg Portmann
% Updated by Igor Pinayev


% Inputs: MachineName, SubMachineName, MachineType, LinkFlag, MMLROOT
% Inputs: MachineName, SubMachineName, MachineType, LinkFlag, MMLROOT, ATVersion


% First strip-out the link method
Expand Down Expand Up @@ -127,7 +128,7 @@
switch upper(SubMachineName)
case {'LTB', 'LB', 'BTS', 'BS', 'LT1', 'LT2', 'INJECTOR', 'LINAC', 'GUN', 'PTB'}
MachineType = 'Transport';
case {'BOOSTER', 'BOOSTER RING', 'BR'}
case {'BOOSTER', 'BOOSTERRING', 'BOOSTER RING', 'BR'}
MachineType = 'Booster';
case {'SR', 'STORAGERING', 'STORAGE RING', 'HER', 'LER', '800MEV'}
MachineType = 'StorageRing';
Expand Down Expand Up @@ -197,6 +198,12 @@
MMLROOT = getmmlroot('IgnoreTheAD');
end

% Define AT version to use otherwise the default is 1.3
if length(varargin) >= 5
ATVersion = varargin{5};
else
ATVersion = 1.3;
end

% The path does not needs to be set in Standalone mode
if ~isdeployed_local
Expand Down Expand Up @@ -239,7 +246,7 @@
end

% AT path
setpathat;
setpathat(ATVersion);
% if MatlabVersion >= 9.3 % 2017b (not sure about 2017a)
% if ismac || ispc % Not linking properly on Linux yet!!!
% % AT2.0
Expand Down