Scicos_blocks macros: proper object comparison 06/18906/2
Paul Bignier [Wed, 18 Jan 2017 14:47:23 +0000 (15:47 +0100)]
 * diffobjs doesn't work for Xcos objects, tests passed (blocks_set.tst) but results were wrong

Change-Id: Ie2244e9bb642f3174f9d76730d8b3ebcb1d73cbd

scilab/modules/scicos_blocks/macros/Events/MCLOCK_f.sci
scilab/modules/scicos_blocks/macros/Events/freq_div.sci
scilab/modules/scicos_blocks/macros/Misc/EDGE_TRIGGER.sci
scilab/modules/scicos_blocks/macros/Misc/ENDBLK.sci
scilab/modules/scicos_blocks/macros/Sources/FROMWSB.sci
scilab/modules/scicos_blocks/macros/Sources/STEP_FUNCTION.sci
scilab/modules/scicos_blocks/macros/Sources/Sigbuilder.sci

index 66defe9..b5bbd81 100644 (file)
@@ -38,7 +38,7 @@ function [x,y,typ]=MCLOCK_f(job,arg1,arg2)
         spath=list("model","rpar","objs",path)
         xx=arg1(spath)// get the block
         execstr("xxn="+xx.gui+"(''set'',xx)")
-        if diffobjs(xxn,xx)==1 then
+        if or(xxn<>xx) then
             // parameter or states changed
             arg1(spath)=xxn// Update
             newpar(size(newpar)+1)=path// Notify modification
index 4fae5ea..88a12c2 100644 (file)
@@ -75,7 +75,7 @@ function [x,y,typ]=freq_div(job,arg1,arg2)
         end
 
 
-        if diffobjs(xxn,xx) then
+        if or(xxn<>xx) then
             model=xx.model
             model_n=xxn.model
             if ~is_modelica_block(xx) then
index b038860..53903cb 100644 (file)
@@ -46,7 +46,7 @@ function [x,y,typ]=EDGE_TRIGGER(job,arg1,arg2)
             end
             xx=arg1(spath)// get the block
             execstr("xxn="+xx.gui+"(''set'',xx)")
-            if diffobjs(xxn,xx) then
+            if or(xxn<>xx) then
                 model=xx.model
                 model_n=xxn.model
                 if ~is_modelica_block(xx) then
index 7e3ba41..8d7c98e 100644 (file)
@@ -46,7 +46,7 @@ function [x,y,typ]=ENDBLK(job,arg1,arg2)
             end
             xx=arg1(spath)// get the block
             execstr("xxn="+xx.gui+"(''set'',xx)")
-            if diffobjs(xxn,xx)==1 then
+            if or(xxn<>xx) then
                 model=xx.model
                 model_n=xxn.model
                 if ~is_modelica_block(xx) then
index c1d522d..8df2027 100644 (file)
@@ -46,7 +46,7 @@ function [x,y,typ] = FROMWSB(job,arg1,arg2)
             end
             xx=arg1(spath)// get the block
             execstr("xxn="+xx.gui+"(''set'',xx)")
-            if diffobjs(xxn,xx)==1 then
+            if or(xxn<>xx) then
                 model=xx.model
                 model_n=xxn.model
                 if ~is_modelica_block(xx) then
index f622ba9..25238a7 100644 (file)
@@ -46,7 +46,7 @@ function [x,y,typ]=STEP_FUNCTION(job,arg1,arg2)
             xx=arg1(spath)// get the block
             execstr("xxn="+xx.gui+"(''set'',xx)")
 
-            if diffobjs(xxn,xx) then
+            if or(xxn<>xx) then
                 model=xx.model
                 model_n=xxn.model
                 if ~is_modelica_block(xx) then
index c431ddd..30cc164 100644 (file)
@@ -50,7 +50,7 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2)
             end
             xx=arg1(spath) // get the block
             execstr("xxn="+xx.gui+"(''set'',xx)")
-            if diffobjs(xxn,xx) then
+            if or(xxn<>xx) then
                 model=xx.model
                 model_n=xxn.model
                 if ~is_modelica_block(xx) then