diff --git a/code/classes/SCDclass_expcode.m b/code/classes/SCDclass_expcode.m index 6b46033118703973893781c4d7bd9ebb11e28980..454fbe226ed78e30b852f3b25b56d100620c4e3c 100644 --- a/code/classes/SCDclass_expcode.m +++ b/code/classes/SCDclass_expcode.m @@ -35,12 +35,150 @@ classdef SCDclass_expcode node06 node07 node08 - + end + + methods(Static) + function node = defaultnode(nodenr) + + node01.active = 0; + node01.ncpu = 1; + node01.type = 'std1cpu2015a'; + node01.timing.t_start = -4.5; + node01.timing.t_stop = 3; + node01.timing.dt = 1e-4; + node01.buildcfg.conffile{1} = 'standard'; + node01.buildcfg.initscdbeforecomp = 0; + node01.usewavegen = 0; + node01.datadict='SCD_rtc_01.sldd'; + + node02.active = 0; + node02.ncpu = 4; + node02.type = 'std1cpu2015a'; + node02.timing.t_start = -4.5; + node02.timing.t_stop = 3; + node02.timing.dt = 1e-4; + node02.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; + node02.buildcfg.conffile{1} = 'standard'; + node02.buildcfg.conffile{2} = 'standard'; + node02.buildcfg.conffile{3} = 'standard'; + node02.buildcfg.conffile{4} = 'standard'; + node02.buildcfg.conffile=node02.buildcfg.conffile'; + node02.buildcfg.initscdbeforecomp = 0; + node02.usewavegen = 0; + node02.datadict='SCD_rtc_02.sldd'; + + node03.active = 0; + node03.ncpu = 4; + node03.type = '4cpus2015a'; + node03.timing.t_start = -2.0; + node03.timing.t_stop = 2.75; + node03.timing.dt = 1e-3; + node03.thdwsample = [0 0 0 0]; + node03.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; + node03.buildcfg.conffile{1} = 'standard'; + node03.buildcfg.conffile{2} = 'standard'; + node03.buildcfg.conffile{3} = 'standard'; + node03.buildcfg.conffile{4} = 'standard'; + node03.buildcfg.conffile=node03.buildcfg.conffile'; + node03.buildcfg.initscdbeforecomp = [0 0 0 0]; + node03.usewavegen = 0; + node03.useethcat1 = 0; + node03.datadict='SCD_rtc_03.sldd'; + + node04.active = 0; + node04.ncpu = 4; + node04.type = 'std1cpu2015a'; + node04.timing.t_start = -4.5; + node04.timing.t_stop = 3; + node04.timing.dt = 1e-4; + node04.buildcfg.conffile{1} = 'standard'; + node04.buildcfg.initscdbeforecomp = 0; + node04.usewavegen = 0; + + node05.active = 0; + node05.ncpu = 1; + node05.type = 'std1cpu2015a'; + node05.timing.t_start = -4.5; + node05.timing.t_stop = 3; + node05.timing.dt = 1e-4; + node05.buildcfg.conffile{1} = 'standard'; + node05.buildcfg.initscdbeforecomp = 0; + node05.usewavegen = 0; + + node06.active = 0; + node06.ncpu = 4; + node06.type = '4cpus2015a'; + node06.timing.t_start = 0.0; + node06.timing.t_stop = 2.75; + node06.timing.dt = 1e-3; + node06.thdwsample = [0 0 0 0]; + node06.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; + node06.buildcfg.conffile{1} = 'standard'; + node06.buildcfg.conffile{2} = 'standard'; + node06.buildcfg.conffile{3} = 'standard'; + node06.buildcfg.conffile{4} = 'standard'; + node06.buildcfg.conffile=node06.buildcfg.conffile'; + node06.buildcfg.initscdbeforecomp = [0 0 0 0]; + node06.usewavegen = 0; + node06.datadict='SCD_rtc_06.sldd'; + + + node07.active = 0; + node07.ncpu = 4; + node07.type = '4cpus2015a'; + node07.timing.t_start = -0.5; + node07.timing.t_stop = 2.5; + node07.timing.dt = 1e-3; + node07.thdwsample = [0 0 0 0]; + node07.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; + node07.buildcfg.conffile{1} = 'standard'; + node07.buildcfg.conffile{2} = 'standard'; + node07.buildcfg.conffile{3} = 'standard'; + node07.buildcfg.conffile{4} = 'standard'; + node07.buildcfg.conffile=node07.buildcfg.conffile'; + node07.buildcfg.initscdbeforecomp = [0 0 0 0]; + node07.usewavegen = 0; + node07.datadict='SCD_rtc_07.sldd'; + node08.active = 0; + node08.ncpu = 1; + node08.type = '4cpus2015a'; + node08.timing.t_start = -0.5; + node08.timing.t_stop = 2.5; + node08.timing.dt = 1e-3; + node08.thdwsample = [0 0 0 0]; + node08.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; + node08.buildcfg.conffile{1} = 'standard'; + node08.buildcfg.conffile{2} = 'standard'; + node08.buildcfg.conffile{3} = 'standard'; + node08.buildcfg.conffile{4} = 'standard'; + node08.buildcfg.conffile=node08.buildcfg.conffile'; + node08.buildcfg.initscdbeforecomp = [0 0 0 0]; + node08.usewavegen = 0; + node08.datadict='SCD_rtc_08.sldd'; + + node = eval(sprintf('node%02d',nodenr)); + % general part] + node.wrapper = cell(node.ncpu,1); + node.wrapdatadicts=cell(node.ncpu,1); + node.varalgo = ones(node.ncpu,1); + node.cpuactive = zeros(node.ncpu,1); + for iwrap=1:node.ncpu + node.wrapper{iwrap} = sprintf('SCDwrap_template%02d%02d.slx',nodenr,iwrap); + node.wrapdatadicts{iwrap} = sprintf('SCDwrap_template%02d%02d.sldd',nodenr,iwrap); + end + end + + function build_nodes(compileslx_list) + for mynodeslx = compileslx_list + fprintf(' *** Buiding Node %s ***\n',mynodeslx{1}); + rtwbuild(mynodeslx{1}); + end + end + end methods - function obj=SCDclass_expcode() % All templates constructor @@ -56,16 +194,7 @@ classdef SCDclass_expcode {1:4}; ... {1:4}; ... {1}]; - - -% obj.nodeddlist=cell(6,1); -% obj.nodeddlist{1} = 'SCD_rtc_01.sldd'; -% obj.nodeddlist{2} = 'SCD_rtc_02.sldd'; -% obj.nodeddlist{3} = 'SCD_rtc_03.sldd'; -% obj.nodeddlist{4} = 'SCD_rtc_06.sldd'; -% obj.nodeddlist{5} = 'SCD_rtc_07.sldd'; -% obj.nodeddlist{6} = 'SCD_rtc_08.sldd'; - + obj.algonamelist={}; obj.algoddlist={}; obj.wrapperlist={}; @@ -74,149 +203,9 @@ classdef SCDclass_expcode obj.mdscontainer = SCDclass_mdsobjcontainer; obj.taskcontainer = SCDclass_taskcontainer; - - - obj.node01.active = 0; - obj.node01.type = 'std1cpu2015a'; - obj.node01.timing.t_start = -4.5; - obj.node01.timing.t_stop = 3; - obj.node01.timing.dt = 1e-4; - obj.node01.varalgo = 1; - obj.node01.buildcfg.conffile{1} = 'standard'; - obj.node01.buildcfg.initscdbeforecomp = 0; - obj.node01.usewavegen = 0; - obj.node01.datadict='SCD_rtc_01.sldd'; - obj.node01.wrapdatadicts{1} = 'SCDwrap_template0101.sldd'; - - obj.node02.active = 0; - obj.node02.type = 'std1cpu2015a'; - obj.node02.timing.t_start = -4.5; - obj.node02.timing.t_stop = 3; - obj.node02.timing.dt = 1e-4; - obj.node02.varalgo = [1 1 1 1]; - obj.node02.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; - obj.node02.buildcfg.conffile{1} = 'standard'; - obj.node02.buildcfg.conffile{2} = 'standard'; - obj.node02.buildcfg.conffile{3} = 'standard'; - obj.node02.buildcfg.conffile{4} = 'standard'; - obj.node02.buildcfg.conffile=obj.node02.buildcfg.conffile'; - obj.node02.buildcfg.initscdbeforecomp = 0; - obj.node02.usewavegen = 0; - obj.node02.datadict='SCD_rtc_02.sldd'; - obj.node02.wrapdatadicts{1} = 'SCDwrap_template0201.sldd'; - obj.node02.wrapdatadicts{2} = 'SCDwrap_template0202.sldd'; - obj.node02.wrapdatadicts{3} = 'SCDwrap_template0203.sldd'; - obj.node02.wrapdatadicts{4} = 'SCDwrap_template0204.sldd'; - obj.node02.wrapdatadicts=obj.node02.wrapdatadicts'; - - obj.node03.active = 0; - obj.node03.type = '4cpus2015a'; - obj.node03.timing.t_start = -2.0; - obj.node03.timing.t_stop = 2.75; - obj.node03.timing.dt = 1e-3; - obj.node03.thdwsample = [0 0 0 0]; - obj.node03.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; - obj.node03.varalgo = [1 1 1 1]; - obj.node03.buildcfg.conffile{1} = 'standard'; - obj.node03.buildcfg.conffile{2} = 'standard'; - obj.node03.buildcfg.conffile{3} = 'standard'; - obj.node03.buildcfg.conffile{4} = 'standard'; - obj.node03.buildcfg.conffile=obj.node03.buildcfg.conffile'; - obj.node03.buildcfg.initscdbeforecomp = [0 0 0 0]; - obj.node03.usewavegen = 0; - obj.node03.useethcat1 = 0; - obj.node03.datadict='SCD_rtc_03.sldd'; - obj.node03.wrapdatadicts{1} = 'SCDwrap_template0301.sldd'; - obj.node03.wrapdatadicts{2} = 'SCDwrap_template0302.sldd'; - obj.node03.wrapdatadicts{3} = 'SCDwrap_template0303.sldd'; - obj.node03.wrapdatadicts{4} = 'SCDwrap_template0304.sldd'; - obj.node03.wrapdatadicts=obj.node03.wrapdatadicts'; - - obj.node04.active = 0; - obj.node04.type = 'std1cpu2015a'; - obj.node04.timing.t_start = -4.5; - obj.node04.timing.t_stop = 3; - obj.node04.timing.dt = 1e-4; - obj.node04.varalgo = 1; - obj.node04.buildcfg.conffile{1} = 'standard'; - obj.node04.buildcfg.initscdbeforecomp = 0; - obj.node04.usewavegen = 0; - - obj.node05.active = 0; - obj.node05.type = 'std1cpu2015a'; - obj.node05.timing.t_start = -4.5; - obj.node05.timing.t_stop = 3; - obj.node05.timing.dt = 1e-4; - obj.node05.varalgo = 1; - obj.node05.buildcfg.conffile{1} = 'standard'; - obj.node05.buildcfg.initscdbeforecomp = 0; - obj.node05.usewavegen = 0; - - obj.node06.active = 0; - obj.node06.type = '4cpus2015a'; - obj.node06.timing.t_start = 0.0; - obj.node06.timing.t_stop = 2.75; - obj.node06.timing.dt = 1e-3; - obj.node06.thdwsample = [0 0 0 0]; - obj.node06.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; - obj.node06.varalgo = [1 1 1 1]; - obj.node06.buildcfg.conffile{1} = 'standard'; - obj.node06.buildcfg.conffile{2} = 'standard'; - obj.node06.buildcfg.conffile{3} = 'standard'; - obj.node06.buildcfg.conffile{4} = 'standard'; - obj.node06.buildcfg.conffile=obj.node06.buildcfg.conffile'; - obj.node06.buildcfg.initscdbeforecomp = [0 0 0 0]; - obj.node06.usewavegen = 0; - obj.node06.datadict='SCD_rtc_06.sldd'; - obj.node06.wrapdatadicts{1} = 'SCDwrap_template0601.sldd'; - obj.node06.wrapdatadicts{2} = 'SCDwrap_template0602.sldd'; - obj.node06.wrapdatadicts{3} = 'SCDwrap_template0603.sldd'; - obj.node06.wrapdatadicts{4} = 'SCDwrap_template0604.sldd'; - obj.node06.wrapdatadicts=obj.node06.wrapdatadicts'; - - obj.node07.active = 0; - obj.node07.type = '4cpus2015a'; - obj.node07.timing.t_start = -0.5; - obj.node07.timing.t_stop = 2.5; - obj.node07.timing.dt = 1e-3; - obj.node07.thdwsample = [0 0 0 0]; - obj.node07.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; - obj.node07.varalgo = [1 1 1 1]; - obj.node07.buildcfg.conffile{1} = 'standard'; - obj.node07.buildcfg.conffile{2} = 'standard'; - obj.node07.buildcfg.conffile{3} = 'standard'; - obj.node07.buildcfg.conffile{4} = 'standard'; - obj.node07.buildcfg.conffile=obj.node07.buildcfg.conffile'; - obj.node07.buildcfg.initscdbeforecomp = [0 0 0 0]; - obj.node07.usewavegen = 0; - obj.node07.datadict='SCD_rtc_07.sldd'; - obj.node07.wrapdatadicts{1} = 'SCDwrap_template0701.sldd'; - obj.node07.wrapdatadicts{2} = 'SCDwrap_template0702.sldd'; - obj.node07.wrapdatadicts{3} = 'SCDwrap_template0703.sldd'; - obj.node07.wrapdatadicts{4} = 'SCDwrap_template0704.sldd'; - obj.node07.wrapdatadicts=obj.node07.wrapdatadicts'; - - obj.node08.active = 0; - obj.node08.type = '4cpus2015a'; - obj.node08.timing.t_start = -0.5; - obj.node08.timing.t_stop = 2.5; - obj.node08.timing.dt = 1e-3; - obj.node08.thdwsample = [0 0 0 0]; - obj.node08.thperiod = [1.0000e-03 1.0000e-03 1.0000e-03 1.0000e-03]; - obj.node08.varalgo = [1 1 1 1]; - obj.node08.buildcfg.conffile{1} = 'standard'; - obj.node08.buildcfg.conffile{2} = 'standard'; - obj.node08.buildcfg.conffile{3} = 'standard'; - obj.node08.buildcfg.conffile{4} = 'standard'; - obj.node08.buildcfg.conffile=obj.node08.buildcfg.conffile'; - obj.node08.buildcfg.initscdbeforecomp = [0 0 0 0]; - obj.node08.usewavegen = 0; - obj.node08.datadict='SCD_rtc_08.sldd'; - obj.node08.wrapdatadicts{1} = 'SCDwrap_template0801.sldd'; - - - - + for nodenr = 1:8 + obj.(sprintf('node%02d',nodenr)) = SCDclass_expcode.defaultnode(nodenr); + end end function printinfo(obj) @@ -253,7 +242,7 @@ classdef SCDclass_expcode fprintf('* Configured init scripts: %d (use printinits method for details)\n', numel(obj.stdinits)); end - function obj = addwrapper(obj, node, cpu, varalgo, modelname, varargin) + function obj = addwrapper(obj, node, cpu, varalgo, wrappername, varargin) p=inputParser; checknodes = @(x) ismember(x,obj.activenodes ); @@ -265,7 +254,7 @@ classdef SCDclass_expcode addRequired(p, 'modelname', @(x) ischar(x)); addOptional(p, 'datadictionary', '', @(x) ischar(x)); - parse(p, node, cpu, varalgo, modelname, varargin{:}); + parse(p, node, cpu, varalgo, wrappername, varargin{:}); % In data dcitionary is not specified it is assumed having % the same name than the model @@ -275,7 +264,7 @@ classdef SCDclass_expcode datadictionary=[p.Results.datadictionary '.sldd']; end - % Frist checking for duplicates + % First checking for duplicates if(numel(obj.wrapperlist)>0) wrappernamelist={}; wrapperddnamelist={}; @@ -284,10 +273,17 @@ classdef SCDclass_expcode wrapperddnamelist{end+1}=obj.wrapperlist{ii}{5}; end if(ismember(p.Results.modelname,wrappernamelist) || ismember(p.Results.datadictionary,wrapperddnamelist)) - warning('SCDclass_expcode:addwrapper','wrapper ''%s'' already present, ignoring.',modelname); + warning('SCDclass_expcode:addwrapper','wrapper ''%s'' already present, ignoring.',wrappername); return end end + + %% update node info + nodestr=sprintf('node%02d',node); + obj.(nodestr).varalgo(cpu) = varalgo; + obj.(nodestr).wrapper{cpu} = wrappername; + obj.(nodestr).cpuactive(cpu) = 1; + %% save in wrapper list tempwrapper=cell(10,1); tempwrapper{1}=p.Results.node; @@ -424,6 +420,15 @@ classdef SCDclass_expcode fprintf('Setting up expcode %d, ''%s'', configuring main workspace variables ...\n',obj.maincode,obj.name); obj.buildworkspacesimstruct; obj.buildworkspacetpstruct; + + %% Set Cache Folder for experimental code (avoid conflicts with other tmp files) + CacheFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',... + 'gencodes',sprintf('CacheFolder-%d',obj.maincode)); + fprintf('Setting Simulink Cache folder to %s\n',CacheFolder) + Simulink.fileGenControl('set',... + 'CacheFolder',CacheFolder,... + 'createdir',true); + end function actualize(obj, shot, varargin) @@ -554,13 +559,65 @@ classdef SCDclass_expcode tcv([],[],[],'compile'); tcv([],[],[],'term'); catch ME - tcv([],[],[],'term'); rethrow(ME) end end function sim(obj) sim('tcv') + end + + function open(obj) + open('tcv'); + end + + function build(obj) + fprintf('\n=== Building %s ===\n',obj.name); + + % make list of nodes to compile + compileslx_list = cell(0); + for inode=1:8 + nodeinfo=obj.(sprintf('node%02d',inode)); + for icpu = 1:nodeinfo.ncpu + if nodeinfo.cpuactive(icpu) + compileslx_list = [compileslx_list,... + sprintf('SCD_rtccode_%02d_%02d',inode,icpu)]; %#ok<AGROW> + end + end + end + + if isempty(compileslx_list) + fprintf('No active nodes found, no .slx to compile. Done\n'); + return + end + + % set CodeGen folder for this expcode (allows fast rebuilding) + CodeGenFolder = fullfile(fileparts(mfilename('fullpath')),'..','..',... + 'gencodes',sprintf('CodeGenFolder-%d',obj.maincode)); + + fprintf(' ...Setting code generation folder to %s\n',CodeGenFolder) + Simulink.fileGenControl('set',... + 'CodeGenFolder',CodeGenFolder,... + 'createdir',true); + + % check env variable + assert(~isempty(getenv('RTCCODE_LIBPATH')),'RTCCODE_LIBPATH environment variable needs to be defined to compile'); + + % set configuration settings for compilation + SCDconf_setCODEconf('configurationSettingsCODEicc') + + % Build + try + SCDclass_expcode.build_nodes(compileslx_list); + catch ME + % if fails on first attempt, clear build folder and retry + fprintf(' **** FIRST ATTEMPT BUILDING %s FAILED **** \n',obj.name) + fprintf(' Error message:\n %s\n',getReport(ME)); + fprintf(' Try again clearning build folder\n') + + system(sprintf('rm -rf %s/*',CodeGenFolder)); + SCDclass_expcode.build_nodes(compileslx_list); + end end end @@ -610,7 +667,6 @@ classdef SCDclass_expcode % Looping through every active node for idx_nodedds=1:numel(obj.activenodes) - % Getting data dictionary and required data sources datadictname=eval(sprintf('obj.node%02d.datadict',obj.activenodes(idx_nodedds))); nodedd=Simulink.data.dictionary.open(datadictname); @@ -863,15 +919,11 @@ classdef SCDclass_expcode eval(str); end end - varalgodd.setValue(s); - end - end - - + end diff --git a/code/classes/SCDclass_expcodecontainer.m b/code/classes/SCDclass_expcodecontainer.m index b4456c2b4e0ddc5c0626abac3546006f0b7e81f7..b3e36581fc7843bc45d16de9d432d3e34f611057 100644 --- a/code/classes/SCDclass_expcodecontainer.m +++ b/code/classes/SCDclass_expcodecontainer.m @@ -101,7 +101,7 @@ classdef SCDclass_expcodecontainer function out=getbymaincode(obj,code) if(obj.numexpcodes==0) - error('SCDclass_expcodecontainer.getbymaincode','Expcode container empty!'); + error('SCDclass_expcodecontainer.getbymaincode: %s','Expcode container empty!'); end presentcodes=[]; diff --git a/code/classes/SCDclass_taskmdsloadprevADC.m b/code/classes/SCDclass_taskmdsloadprevADC.m index 8720ad93db03bfeb2e69eb0db7468b2ef2c4ff5e..c3350e4d793bd5cb6bd1a5c5daa300e34f8e581b 100644 --- a/code/classes/SCDclass_taskmdsloadprevADC.m +++ b/code/classes/SCDclass_taskmdsloadprevADC.m @@ -41,7 +41,11 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task switch(obj.node) case 2 - [~,value]=obj.getdataNode02ACQ196(shot); %% Here we need to switch betweeen old and new acquisition unit and tcv standard also + if shot<65113 + [~,value]=obj.getdataNode02ACQ196(shot); %% Here we need to switch betweeen old and new acquisition unit and tcv standard also + else + [~,value]=obj.getdataNode02tst(shot); %% Here we need to switch betweeen old and new acquisition unit and tcv standard also + end end end @@ -121,6 +125,33 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task end end + function [obj, value] = getdataNode02tst(obj, shot) + % TODO: this should go away as soon as we use the official rtc + % tree + mdsopen('rtctst',shot); + T=timeseries; + timebase=mdsvalue('dim_of(\top.tcvrt02.adc.adc_001)'); %% TODO: check with marte + d_time = double(mdsvalueraw( '\top.tcvrt02.params:d_time' ))*1.0e-6; + %timebase = round(timebase.*1/d_time)*d_time-d_time/2; + timebase = round(timebase.*1/d_time)*d_time-d_time/100; + T.Time=timebase; + T.Data=zeros(numel(timebase),192); + if obj.verbose==1 + fprintf('Getting data for bus: ''%s'' (%s, shot %d) ', obj.modelbus, obj.classname, shot); + end + for ii=1:192 + channelstr=sprintf('\\top.tcvrt02.adc.adc_%03d.raw',ii); + T.Data(:,ii)=int16(mdsvalue(channelstr)); + if obj.verbose==1 && mod(ii,4)==0 + fprintf('.'); + end + end + value=T; + if obj.verbose==1 + fprintf('\n'); + end + end + end end diff --git a/tests/test_expcodes.m b/tests/test_expcodes.m index e7e73f1e3f61c559085395c7fca9b962d666cdbf..54b0ef8254ba7fad5293eb5892eadba8686a52f3 100644 --- a/tests/test_expcodes.m +++ b/tests/test_expcodes.m @@ -6,7 +6,6 @@ classdef test_expcodes < matlab.unittest.TestCase end properties(MethodSetupParameter) - %expcode_number = {'1','1005','1006','1010'}; % list of expcodes to test expcode_number = {'1','1005','1010'}; % list of expcodes to test end @@ -32,11 +31,31 @@ classdef test_expcodes < matlab.unittest.TestCase testCase.expcode_obj = getbymaincode(testCase.SCDexps,str2double(expcode_number)); end + function test_expcode_printinfo(testCase) + testCase.expcode_obj.printinfo + end + + function test_expcode_printparameters(testCase) + testCase.expcode_obj.printparameters + end + + function test_expcode_printwavegens(testCase) + testCase.expcode_obj.printwavegens; + end + + function test_expcode_printtasks(testCase) + testCase.expcode_obj.printtasks; + end + + function test_expcode_printinits(testCase) + testCase.expcode_obj.printinits + end + function test_expcode_setup(testCase) fprintf('\n=== Testing callinits for expcode %d: %s === \n',... testCase.expcode_obj.maincode,testCase.expcode_obj.name); testCase.expcode_obj.callinits; - + fprintf('\n=== Testing setup for expcode %d: %s === \n',... testCase.expcode_obj.maincode,testCase.expcode_obj.name); @@ -46,34 +65,15 @@ classdef test_expcodes < matlab.unittest.TestCase end methods(Test) - function test_expcode(testCase) + function test_expcode_compile(testCase) fprintf('\n === Testing Simulink compilation for expcode %d: %s === \n',... testCase.expcode_obj.maincode,testCase.expcode_obj.name); % attempt compiling tcv.slx for this expcode testCase.expcode_obj.compile; % compile tcv.slx with this expcode end - function test_gencode(testCase) - switch testCase.expcode_obj.maincode - case 1010 - - SCDconf_setCODEconf('configurationSettingsCODEicc') - rtwbuild('SCD_rtccode_02_02'); - rtwbuild('SCD_rtccode_02_03'); - otherwise - % do nothing - end + function test_build(testCase) + testCase.expcode_obj.build; end - - function test_compilation(testCase) - expcode_ignore_compile = []; - testCase.assumeTrue(~any(testCase.expcode_obj.maincode == expcode_ignore_compile)) - node_to_compile = 'SCD_rtccode_02_02'; - node_to_compile = 'SCD_rtccode_02_03'; - - load_system(node_to_compile); - SCDconf_setCODEconf; - rtwbuild(node_to_compile); - end end end