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

Merge remote-tracking branch 'origin/operation' into feature/addrtmhd

parents 33e9de25 25c96d25
No related branches found
No related tags found
No related merge requests found
......@@ -196,10 +196,13 @@ classdef SCDclass_mdsobjcontainer
end
function printMARTe2parconfig(obj, shot)
marteparlist=[];
switch obj.modeltogenerate
case 'all'
iorder = getParamsServerTreeOrder(obj); % order entries following mdsserver, mdstree order
prevServer = ''; % init
prevServer = ''; % init
prevTree = ''; % init
% Header for MDS for loader
%loaderStr = sprintf('\n\n+MDSParameters = {\n Class=MDSObjLoader\n Shot=%d\n',shot);
......@@ -210,18 +213,21 @@ classdef SCDclass_mdsobjcontainer
mymdsparam = obj.mdsparams(iorder(ii));
currentServer = mymdsparam.getMDSserver;
currentTree = mymdsparam.getMDStree;
% generate header for MDSsource if necessary
if ~strcmp(currentServer,prevServer) %if a new server needs to be opened
if ~strcmp(currentServer,prevServer) || ~strcmp(currentTree,prevTree) %if a new server needs to be opened
if ii~=1, fprintf(' }\n'), end % close bracket for previous one
% print new source header
fprintf("%s\n",mymdsparam.genMARTe2MDSsourcestr);
end
prevServer = currentServer;
prevTree = currentTree;
% generate data source entry
str = mymdsparam.genMARTe2entry(shot);
fprintf(" %s\n",str);
marteparlist=[marteparlist; {mymdsparam.gettargetparammarte}];
end
fprintf(" }\n}\n\n");
......@@ -230,9 +236,18 @@ classdef SCDclass_mdsobjcontainer
if(strcmp(obj.modeltogenerate,obj.mdsparams(ii).getmodelname))
str=obj.mdsparams(ii).genMARTe2entry(shot);
fprintf(" %s\n",str);
marteparlist=[marteparlist; {obj.mdsparams(ii).gettargetparammarte}];
end
end
end
% Now check for MARTe parameters names unicity
for ii=2:numel(marteparlist)
for jj=1:ii-1
if strcmp(marteparlist(ii), marteparlist(jj))
fprintf("WARNING: found identical MARTe par. names here: %s", marteparlist(ii));
end
end
end
end
function iorder = getParamsServerTreeOrder(obj)
......
......@@ -267,7 +267,7 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
entrystring = sprintf('+%-50s = { Class=%-30s Path=%-40s',obj.gettargetparammarte,obj.marteclassname,obj.genMARTe2MDStdiexpression);
end
function str = genMARTe2MDSsourcestr(obj)
%str = sprintf(' +MDSSource = {\n Class=SPCMDSSource\n Server=%s\n Tree=%s',obj.mdsserver,obj.mdstree);
str = sprintf(' +Connection_%s_%s = {\n Class=MDSObjConnection\n Server=%s\n Tree=%s',obj.mdsserver,obj.mdstree,obj.mdsserver,obj.mdstree);
......
classdef SCDclass_mdsparmatrixbool < SCDclass_mdspar
% A constant 2D matrix logical (bool) MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparmatrixbool(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParMatrixBool';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=logical(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj,shot)
[obj,value]=obj.getdatacommon(shot);
value=single(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
end
end
classdef SCDclass_mdsparscalarbool < SCDclass_mdspar
% A constant boolean MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparscalarbool(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParScalarBool';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=logical(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj, shot)
[obj,value]=obj.getdatacommon(shot);
value=uint8(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
end
end
classdef SCDclass_mdsparvectorbool < SCDclass_mdspar
% A constant vector boolean MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparvectorbool(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParVectorBool';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=logical(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj, shot)
[obj,value]=obj.getdatacommon(shot);
value=uint8(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
end
end
......@@ -189,6 +189,7 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
d_time = double(mdsvalueraw(['\top.' mdsnodename '.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;
timebase = timebase + d_time; % this fits perfectly sim/rt data on 68072
T.Time=timebase;
T.Data=zeros(numel(timebase),192);
datamatrix=zeros(numel(timebase),192);
......
......@@ -15,6 +15,7 @@ SCDexps=SCDexps.insertexpcode(1005, @(x) SCDexpcodeconf_tcvstandard02);
SCDexps=SCDexps.insertexpcode(10 , @(x) SCDexpcodeconf_f4eexample);
SCDexps=SCDexps.insertexpcode(1006, @(x) SCDexpcodeconf_DMmagcontrol);
SCDexps=SCDexps.insertexpcode(1007, @(x) SCDexpcodeconf_genmagcontrol);
SCDexps=SCDexps.insertexpcode(1008, @(x) SCDexpcodeconf_detachcontrol);
SCDexps=SCDexps.insertexpcode(1010, @(x) SCDexpcodeconf_integrated);
SCDexps=SCDexps.insertexpcode(2025, @(x) SCDexpcodeconf_LIUQEtester);
......
......@@ -7,7 +7,7 @@ classdef test_expcodes < matlab.unittest.TestCase
end
properties(ClassSetupParameter)
expcode = {'1','1005','1006','1007'}; % list of expcodes to test
expcode = {'1','1005','1007'}; % list of expcodes to test
end
methods(TestClassSetup)
......@@ -76,7 +76,9 @@ classdef test_expcodes < matlab.unittest.TestCase
function test_expcode_compile_nodes(testCase)
% compile each node separately first
testCase.assumeFalse(testCase.expcode_obj.maincode==1006,'Skipping compile tests for 1006 which requires library')
%testCase.assumeFalse(testCase.expcode_obj.maincode==1006,'Skipping compile tests for 1006 which requires library')
%testCase.assumeFalse(testCase.expcode_obj.maincode==1007,'Skipping compile tests for 1007 which requires library')
for inode = 1:numel(testCase.expcode_obj.nodes)
node = testCase.expcode_obj.nodes(inode);
......@@ -91,7 +93,7 @@ classdef test_expcodes < matlab.unittest.TestCase
end
function test_expcode_sim(testCase)
testCase.assumeFalse(testCase.expcode_obj.maincode==1006,'Skipping compile tests for 1006 which requires library')
%testCase.assumeFalse(testCase.expcode_obj.maincode==1006,'Skipping compile tests for 1006 which requires library')
fprintf('\n === Testing Simulink simulation of tcv.slx for expcode %d: === \n',testCase.expcode_obj.maincode)
testCase.expcode_obj.sim; % simulate whole tcv.slx with this expcode
......@@ -99,7 +101,9 @@ classdef test_expcodes < matlab.unittest.TestCase
function test_build(testCase)
testCase.assumeFalse(testCase.expcode_obj.maincode==1006,'Skipping build tests for 1006 which requires library')
%testCase.assumeFalse(testCase.expcode_obj.maincode==1006,'Skipping build tests for 1006 which requires library')
testCase.assumeFalse(testCase.expcode_obj.maincode==1007,'Skipping build tests for 1007 which requires library')
testCase.expcode_obj.build;
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