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

localshot behaviour added

parent 1fd0c933
No related branches found
No related tags found
No related merge requests found
......@@ -34,40 +34,44 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg
function actualizedata(obj, shot)
try
mdsconnect(obj.mdsserver);
mdsopen(obj.mdstree, shot);
mdsconnect(obj, shot);
targetfullexpansion=[obj.wavegenbasestruct,'.',obj.wavegentarget];
if obj.verbose==1
if obj.overrideshot == 1
localshot = obj.overrideshotn;
else
localshot = shot;
end
fprintf('Actualizing wavegen: ''%s'' [%d] <- ''%s'' (%s, shot %d)\n', ...
targetfullexpansion, obj.destidx, ...
obj.tdiexpr, ...
obj.classname, shot);
obj.classname, localshot);
end
value=obj.getdata();
value=obj.getdata();
baseparam=obj.wavegenbasestruct; % name of base workspace structure
structparam=obj.wavegentarget; % name of target field
wgentryval = evalin('base',baseparam); % structure of wavegen in base workspace
assert(isfield(wgentryval,structparam),...
'Wavegen field %s does not exist in target structure %s. ',structparam,baseparam)
'Wavegen field %s does not exist in target structure %s. ',structparam,baseparam)
% assign field from wavegen entry value
ddtssamples=numel(wgentryval.(structparam).Time);
if ddtssamples~=numel(value.Time)
% the dd timeseries has different dims w.r.t. the signals
% to be loaded, we have to load the timeseries as it is
wgentryval.(structparam)=value;
% the dd timeseries has different dims w.r.t. the signals
% to be loaded, we have to load the timeseries as it is
wgentryval.(structparam)=value;
else
% the dd timeseries has the same size than the signals
% to be loaded, we can do a partial loading
wgentryval.(structparam).Time=value.Time;
wgentryval.(structparam).Data(:,obj.destidx)=value.Data;
end
% the dd timeseries has the same size than the signals
% to be loaded, we can do a partial loading
wgentryval.(structparam).Time=value.Time;
wgentryval.(structparam).Data(:,obj.destidx)=value.Data;
end
assignin('base','temp',wgentryval);
assigncmd=sprintf('%s=temp;',baseparam);
evalin('base',assigncmd);
......
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