Scicos: fix do_version before simulation 36/17636/2
Clément DAVID [Tue, 5 Jan 2016 15:00:35 +0000 (16:00 +0100)]
Change-Id: I3560d3cabff0135bb80babf8132ec26015fee33c

scilab/modules/scicos/macros/scicos_scicos/%s_i_Text.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/update_scs_m.sci

diff --git a/scilab/modules/scicos/macros/scicos_scicos/%s_i_Text.sci b/scilab/modules/scicos/macros/scicos_scicos/%s_i_Text.sci
new file mode 100644 (file)
index 0000000..0557c76
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos
+//
+//  Copyright (C) 2015 - Scilab Enterprises - Clement David
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See the file ../license.txt
+//
+
+function g=%s_i_Text(i,t,g)
+    // ignore an assignation the empty matrix [] to any field
+    g=g
+endfunction
+
index c0b69f6..7388f60 100644 (file)
@@ -52,7 +52,7 @@ function scs_m_new = update_scs_m(scs_m,version)
 
             sprops = scs_m.props;
             T = getfield(1,scs_m.props);
-            T_txt = [];
+            T_txt = "";
             for j=2:size(T,2)
                 T_txt = T_txt + strsubst(T(1,j),"title","Title") + ...
                 "=" + "sprops." + T(1,j);
@@ -86,7 +86,7 @@ function scs_m_new = update_scs_m(scs_m,version)
                         case "graphics" then
                             ogra  = o.graphics;
                             G     = getfield(1,ogra);
-                            G_txt = [];
+                            G_txt = "";
                             for l=2:size(G,2)
                                 G_txt = G_txt + G(1,l) + ...
                                 "=" + "ogra." + G(1,l);
@@ -103,7 +103,7 @@ function scs_m_new = update_scs_m(scs_m,version)
                         case "model" then
                             omod  = o.model;
                             M     = getfield(1,o.model);
-                            M_txt = [];
+                            M_txt = "";
                             for l=2:size(M,2)
                                 M_txt = M_txt + M(1,l) + ...
                                 "=" + "omod." + M(1,l);
@@ -142,7 +142,7 @@ function scs_m_new = update_scs_m(scs_m,version)
                 case "Link" then
 
                     T     = getfield(1,o);
-                    T_txt = [];
+                    T_txt = "";
                     for k=2:size(T,2)
                         T_txt = T_txt + T(1,k) + ...
                         "=" + "o." + T(1,k);
@@ -161,14 +161,14 @@ function scs_m_new = update_scs_m(scs_m,version)
                     scicos_graphics(),scicos_model()," ","TEXT_f")
 
                     T     = getfield(1,o);
-                    T_txt = [];
+                    T_txt = "";
                     for k=2:size(T,2)
                         select T(k)
                             //*********** graphics **********//
                         case "graphics" then
                             ogra  = o.graphics;
                             G     = getfield(1,ogra);
-                            G_txt = [];
+                            G_txt = "";
                             for l=2:size(G,2)
                                 G_txt = G_txt + G(1,l) + ...
                                 "=" + "ogra." + G(1,l);
@@ -183,24 +183,7 @@ function scs_m_new = update_scs_m(scs_m,version)
 
                             //************* model ***********//
                         case "model" then
-                            omod  = o.model;
-                            M     = getfield(1,o.model);
-                            M_txt = [];
-                            for l=2:size(M,2)
-                                M_txt = M_txt + M(1,l) + ...
-                                "=" + "omod." + M(1,l);
-                                if l<>size(M,2) then
-                                    M_txt = M_txt + ",";
-                                end
-                            end
-                            M_txt = "omod=scicos_model(" + M_txt + ")";
-                            execstr(M_txt)
-                            //******** super block case ********//
-                            if omod.sim=="super"|omod.sim=="csuper" then
-                                rpar=update_scs_m(omod.rpar,version)
-                                omod.rpar=rpar
-                            end
-                            o_new.model = omod;
+                            // ignored by the MVC
                             //*******************************//
 
                             //************* other ***********//