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 ...@@ -103,7 +103,7 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
% Not abstract methods common to all child classes % Not abstract methods common to all child classes
methods methods
function mdsconnect(obj, shot) function obj = mdsconnect(obj, shot)
assert(~~exist('mdsconnect','file'),... assert(~~exist('mdsconnect','file'),...
'SCD:NoMDS','mdsconnect not found, are the mds matlab tools installed?') 'SCD:NoMDS','mdsconnect not found, are the mds matlab tools installed?')
mdsconnect(obj.mdsserver); mdsconnect(obj.mdsserver);
...@@ -117,8 +117,26 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous ...@@ -117,8 +117,26 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
localshot = shot; localshot = shot;
end end
s=mdsopen(obj.mdstree, localshot); s=mdsopen(obj.mdstree, localshot);
str=sprintf('SCDclass_mdsparam (%s), failed opening MDS+ tree', obj.modelparam); openok=true;
assert(s==localshot, str); 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 end
function obj=setactualizecmds(obj, shot) function obj=setactualizecmds(obj, shot)
...@@ -134,11 +152,11 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous ...@@ -134,11 +152,11 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
function obj=preactualizecommon(obj, shot) function obj=preactualizecommon(obj, shot)
if(~obj.unlinked) if(~obj.unlinked)
% Opening the tree % Opening the tree
obj.mdsconnect(shot); obj=obj.mdsconnect(shot);
% Checking if data can be retrieved, updating get command if ~obj.actualizable, return; end
% Checking if data can be retrieved, updating get command
[obj, obj.value]=obj.getdata(shot); [obj, obj.value]=obj.getdata(shot);
if ~obj.actualizable, return; end if ~obj.actualizable, return; end
obj=obj.setactualizecmds(shot); obj=obj.setactualizecmds(shot);
end end
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