diff --git a/classes/SCDclass_mdswgsigsingle.m b/classes/SCDclass_mdswgsigsingle.m index dbe4de9134d20cf8a28f11da32568df8bcbc250d..20f9f9fdfc5848dbda9594d66e0f2a15e68ff81d 100644 --- a/classes/SCDclass_mdswgsigsingle.m +++ b/classes/SCDclass_mdswgsigsingle.m @@ -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);