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

Merge branch 'SCDDMmagcontrol' into 'master'

SCD DMmag control and tests

See merge request spc/tcv/scd/rtccode!13
parents 356339a7 9697b993
No related branches found
No related tags found
No related merge requests found
...@@ -15,9 +15,9 @@ classdef SCDclass_algo ...@@ -15,9 +15,9 @@ classdef SCDclass_algo
end end
methods methods
%% Constructor
function obj=SCDclass_algo(name) function obj=SCDclass_algo(name)
%% Constructor
% Empty algorithm constructor % Empty algorithm constructor
obj.modelname=name; obj.modelname=name;
...@@ -63,6 +63,11 @@ classdef SCDclass_algo ...@@ -63,6 +63,11 @@ classdef SCDclass_algo
fprintf('*****************************************************\n'); fprintf('*****************************************************\n');
end end
%% Setup
function setup(obj)
obj.buildworkspacetpstruct;
end
%% General purpose getters %% General purpose getters
function out = getname(obj) function out = getname(obj)
......
...@@ -546,12 +546,12 @@ classdef SCDclass_expcode ...@@ -546,12 +546,12 @@ classdef SCDclass_expcode
function obj = buildworkspacetpstruct(obj) function obj = buildworkspacetpstruct(obj)
% this funtion builds a workspace structures containing % this funtion builds a workspace structures containing
% replicas of all tunable parameters structurea in the data % replicas of all tunable parameters structures in the data
% dictionaries, this structure is the one actually used % dictionaries, this structure is the one actually used
% for loading simulation wavegen data % for loading simulation wavegen data
% It is better not to use directly data dictionaries structures % It is better not to use directly data dictionaries structures
% to avoid flooding dds with big sim data sets (and % to avoid flooding dds with big sim data sets (and
% conseguently the SCD SVN itself % conseguently the rtccode GIT repo itself
dd=SCDconf_getdatadict('tcv.sldd'); dd=SCDconf_getdatadict('tcv.sldd');
......
...@@ -12,6 +12,14 @@ classdef SCDclass_expcodecontainer ...@@ -12,6 +12,14 @@ classdef SCDclass_expcodecontainer
obj.expcodes={}; obj.expcodes={};
end end
function list = getexpcodelist(obj)
% get numerical list of available codes;
list = zeros(1,obj.numexpcodes);
for ii=1:obj.numexpcodes
list(ii) = obj.expcodes{ii}{1};
end
end
function obj=insertexpcode(obj, maincode, definefunction) function obj=insertexpcode(obj, maincode, definefunction)
if(obj.numexpcodes==0) if(obj.numexpcodes==0)
......
function [] = SCDconf_createexpcodes() function SCDexps = SCDconf_createexpcodes()
%% The expcode container, %% The expcode container,
% it contains a list of expcode numbers and function pointers % it contains a list of expcode numbers and function pointers
...@@ -13,9 +13,12 @@ SCDexps=SCDclass_expcodecontainer; ...@@ -13,9 +13,12 @@ SCDexps=SCDclass_expcodecontainer;
SCDexps=SCDexps.insertexpcode(1, @(x) SCDexpcodeconf_template); SCDexps=SCDexps.insertexpcode(1, @(x) SCDexpcodeconf_template);
SCDexps=SCDexps.insertexpcode(1005, @(x) SCDexpcodeconf_tcvstandard02); SCDexps=SCDexps.insertexpcode(1005, @(x) SCDexpcodeconf_tcvstandard02);
SCDexps=SCDexps.insertexpcode(10 , @(x) SCDexpcodeconf_f4eexample); SCDexps=SCDexps.insertexpcode(10 , @(x) SCDexpcodeconf_f4eexample);
SCDexps=SCDexps.insertexpcode(1006, @(x) SCDexpcodeconf_DMmagcontrol);
if nargout == 0
assignin('base','SCDexps',SCDexps); % assign output argument in base
assignin('base','SCDexps',SCDexps);
end
end end
...@@ -303,6 +303,13 @@ ifeq ($(SFCN),0) ...@@ -303,6 +303,13 @@ ifeq ($(SFCN),0)
SYSLIBS += -lm SYSLIBS += -lm
endif endif
# Additional .so for compiling DM controllers, RTWINCLUDEAOT has
# to be set before building, e.g. setenv('RTWINCLUDEAOT','1') from
# the compiling matlab session
ifeq ($(RTWINCLUDEAOT),1)
SYSLIBS += -lexport_aot_model_linux
endif
LIBS = LIBS =
|>START_PRECOMP_LIBRARIES<| |>START_PRECOMP_LIBRARIES<|
ifeq ($(OPT_OPTS),$(DEFAULT_OPT_OPTS)) ifeq ($(OPT_OPTS),$(DEFAULT_OPT_OPTS))
......
classdef test_expcodes < matlab.unittest.TestCase
properties
expcode_obj;
SCDexps;
end
properties(MethodSetupParameter)
expcode_number = {1,1005,1006}; % list of expcodes to test
end
methods(TestClassSetup)
function setup_environment(testCase)
testCase.addTeardown(@cd,pwd);
testCase.addTeardown(@path,path);
basePath = fullfile(fileparts(mfilename('fullpath')),'..');
run(fullfile(basePath,'rtccode_paths'));
% get SCD experimental code object container
testCase.SCDexps = SCDconf_createexpcodes;
end
end
methods(TestMethodSetup)
function setup_expcode(testCase,expcode_number)
% get this expcode object from expcode object container
testCase.expcode_obj = getbymaincode(testCase.SCDexps,expcode_number);
testCase.expcode_obj.setup; % run setup this exp code
end
end
methods(Test)
function test_expcode(testCase)
% attempt compiling tcv.slx for this expcode
try
tcv([],[],[],'compile');
tcv([],[],[],'term');
catch ME
tcv([],[],[],'term');
rethrow(ME)
end
testCase.assertTrue(true); % dummy
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