Skip to content
Snippets Groups Projects
Commit efacc5f5 authored by Cristian Galperti's avatar Cristian Galperti
Browse files

tolerate params whose mdsopen fails

parent b04aeb9f
No related branches found
No related tags found
No related merge requests found
......@@ -103,7 +103,7 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
% Not abstract methods common to all child classes
methods
function mdsconnect(obj, shot)
function obj = mdsconnect(obj, shot)
assert(~~exist('mdsconnect','file'),...
'SCD:NoMDS','mdsconnect not found, are the mds matlab tools installed?')
mdsconnect(obj.mdsserver);
......@@ -117,8 +117,26 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
localshot = shot;
end
s=mdsopen(obj.mdstree, localshot);
str=sprintf('SCDclass_mdsparam (%s), failed opening MDS+ tree', obj.modelparam);
assert(s==localshot, str);
openok=true;
if isempty(s)
openok=false;
end
if openok
if ~isnumeric(s) || s~=localshot
openok=false;
end
end
if openok
if s~=localshot
openok=false;
end
end
if ~openok
warning('SCDclass_mdspar:MDSerror','MDS+ tree open error for parameter %s. Actualization skipped.',obj.modelparam);
obj.actualizable=false;
end
%str=sprintf('SCDclass_mdsparam (%s), failed opening MDS+ tree', obj.modelparam);
%assert(s==localshot, str);
end
function obj=setactualizecmds(obj, shot)
......@@ -134,11 +152,11 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
function obj=preactualizecommon(obj, shot)
if(~obj.unlinked)
% Opening the tree
obj.mdsconnect(shot);
% Checking if data can be retrieved, updating get command
obj=obj.mdsconnect(shot);
if ~obj.actualizable, return; end
% Checking if data can be retrieved, updating get command
[obj, obj.value]=obj.getdata(shot);
if ~obj.actualizable, return; end
obj=obj.setactualizecmds(shot);
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment