From 70a5707419bd01f3814bdba654ef6d45670325fe Mon Sep 17 00:00:00 2001
From: Cristian Galperti <cristian.galperti@epfl.ch>
Date: Tue, 16 Jul 2019 09:41:39 +0200
Subject: [PATCH] tcv02standard outputs crosschecks with MARTe begun

At this stage we begun running tcv02standard in MARTe
in i9 (tcvrt02b) machine and to compare results
with the simulation
---
 code/classes/SCDclass_mdswgsigarray1.m | 24 ++++++++++++++++++++++++
 code/functions/SCDconf_setCODEconf.m   | 13 +++++++++++++
 code/functions/SCDconf_setSIMconf.m    | 15 +++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 code/functions/SCDconf_setCODEconf.m
 create mode 100644 code/functions/SCDconf_setSIMconf.m

diff --git a/code/classes/SCDclass_mdswgsigarray1.m b/code/classes/SCDclass_mdswgsigarray1.m
index 1d58fc6..e91c740 100644
--- a/code/classes/SCDclass_mdswgsigarray1.m
+++ b/code/classes/SCDclass_mdswgsigarray1.m
@@ -141,6 +141,30 @@ classdef SCDclass_mdswgsigarray1 < SCDclass_mdswg
             entrystring=obj.genMARTe2entrycommon(shot);
             entrystring=[entrystring ' StartIdx=' num2str(obj.srcstartidx) ' StopIdx=' num2str(obj.srcstopidx) ' }'];
         end
+        
+        
+        
+%  *         S_uint8 = {
+%  *             NodeName = "S_uint8" // node of the tree node
+%  *             Type = "uint8" //Can be any of the node supported types
+%  *             NumberOfElements = 32
+%  *             DataManagement = 0 //could be 0, 1 or 2
+%  *             HoleManagement = 1 //could be 0 or 1
+%  *         }
+        function expentries = genMARTe2entryexpanded(obj, shot)
+            %entrystring=obj.genMARTe2entrycommon(shot);
+            
+            expentries='';
+            for ii=obj.srcstartidx:obj.srcstopidx
+               expandedtdi = sprintf(obj.tdiexpr, ii);
+               martename=expandedtdi;
+               sigentry=sprintf(' %s={ NodeName=%s Type=float32 NumberOfElements=1 DataManagement=0 HoleManagement=1 }\n',martename, expandedtdi); 
+               expentries=[expentries sigentry]; 
+            end                   
+        end
+        
+        
+        
     end
 end
 
diff --git a/code/functions/SCDconf_setCODEconf.m b/code/functions/SCDconf_setCODEconf.m
new file mode 100644
index 0000000..e639553
--- /dev/null
+++ b/code/functions/SCDconf_setCODEconf.m
@@ -0,0 +1,13 @@
+% Sets the code generation configuration settings on all the models
+
+function [] = SCDconf_setCODEconf()
+    disp('Setting configurationSettings = configurationSettingsCODE at tcv level ...');
+    d=Simulink.data.dictionary.open('tcv.sldd');
+    dd=getSection(d, 'Configurations');
+    activeconf=dd.getEntry('configurationSettings');
+    codeconf=dd.getEntry('configurationSettingsCODE');
+    configurationSettings=codeconf.getValue;
+    configurationSettings.Name='configurationSettings';
+    activeconf.deleteEntry;
+    dd.addEntry('configurationSettings',configurationSettings);
+end
\ No newline at end of file
diff --git a/code/functions/SCDconf_setSIMconf.m b/code/functions/SCDconf_setSIMconf.m
new file mode 100644
index 0000000..f9c76f2
--- /dev/null
+++ b/code/functions/SCDconf_setSIMconf.m
@@ -0,0 +1,15 @@
+% Sets the simulation configuration settings on all the models
+
+function [] = SCDconf_setSIMconf()
+    disp('Setting configurationSettings = configurationSettingsSIM at tcv level ...');
+    d=Simulink.data.dictionary.open('tcv.sldd');
+    dd=getSection(d, 'Configurations');
+    activeconf=dd.getEntry('configurationSettings');
+    simconf=dd.getEntry('configurationSettingsSIM');
+    configurationSettings=simconf.getValue;
+    configurationSettings.Name='configurationSettings';
+    activeconf.deleteEntry;
+    dd.addEntry('configurationSettings',configurationSettings);
+end
+
+    
\ No newline at end of file
-- 
GitLab