Xcos: Bug #9995 fixed - The RELATION_OP box drawn. 66/14566/2
Clément DAVID [Mon, 26 May 2014 09:07:41 +0000 (11:07 +0200)]
      Also the default size of LOGICAL_OP block has been reduced.

Change-Id: I8fab7d4952c2216a03468ac79e3fdfd172ff40c8

scilab/CHANGES_5.5.X
scilab/modules/helptools/images/LOGICAL_OP.png
scilab/modules/helptools/images/RELATIONALOP.png
scilab/modules/scicos_blocks/macros/Misc/LOGICAL_OP.sci
scilab/modules/scicos_blocks/macros/Misc/RELATIONALOP.sci
scilab/modules/xcos/etc/Xcos-style.xml
scilab/modules/xcos/images/palettes/LOGICAL_OP.png
scilab/modules/xcos/images/palettes/RELATIONALOP.png

index 89987be..48f05aa 100644 (file)
@@ -114,6 +114,8 @@ Scilab Bug Fixes
 Xcos Bug Fixes
 ==============
 
+* Bug #9996 fixed - The RELATION_OP box drawn in the work space is not compliant to the programming.
+
 * Bug #11823 fixed - Ctrl+F2 shortcut did not work on a selected block.
 
 * Bug #12718 fixed - Modelica Generic block reshaped the output ports and the label was double-written.
index e93f6de..623f0ac 100644 (file)
Binary files a/scilab/modules/helptools/images/LOGICAL_OP.png and b/scilab/modules/helptools/images/LOGICAL_OP.png differ
index 8e3b9bb..07d64fc 100644 (file)
Binary files a/scilab/modules/helptools/images/RELATIONALOP.png and b/scilab/modules/helptools/images/RELATIONALOP.png differ
index c06c633..bc76864 100644 (file)
@@ -134,6 +134,6 @@ function [x,y,typ]=LOGICAL_OP(job,arg1,arg2)
 
         exprs=[string(nin);string(ipar)]
         gr_i=[]
-        x=standard_define([3 2],model,exprs,gr_i)
+        x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index a4db6e5..3a64aca 100644 (file)
@@ -47,6 +47,7 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
             end
             if (rule<0)|(rule>5) then
                 message("Incorrect operator "+string(rule)+" ; must be 0 to 5.")
+                ok=%f;
             end
             if (Datatype==1) then
                 model.sim=list("relational_op",4)
@@ -74,7 +75,21 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
                 [model,graphics,ok]=set_io(model,graphics,list(in,it),list(out,ot),[],[])
             end
             if ok then
+                if rule == 0 then
+                    label = "==";
+                elseif rule == 1 then
+                    label = "~=";
+                elseif rule == 2 then
+                    label = "&#60;"; // <
+                elseif rule == 3 then
+                    label = "&#8804;"; // <=
+                elseif rule == 4 then
+                    label = "&#61;"; // >
+                elseif rule == 5 then
+                    label = "&#8805;"; // >=
+                end
                 graphics.exprs=exprs;
+                graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
                 model.ipar=[rule],
                 model.nzcross=zcr,
                 model.nmode=zcr,
@@ -85,6 +100,7 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
         end
     case "define" then
         ipar=[2]
+        label="&lt";
         model=scicos_model()
         model.sim=list("relationalop",4)
         model.in=[1;1]
@@ -92,9 +108,9 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
         model.ipar=ipar
         model.blocktype="c"
         model.dep_ut=[%t %f]
-
         exprs=[string(ipar);string(0)]
         gr_i=[]
-        x=standard_define([3 2],model,exprs,gr_i)
+        x=standard_define([2 2],model,exprs,gr_i)
+        x.graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
     end
 endfunction
index 5913814..0d8da05 100644 (file)
         <add as="fillColor" value="white"/>
     </add>
     <add as="RELATIONALOP" extend="blockWithLabel">
-        <!-- FIXME : Show parameters over block  -->
         <add as="displayedLabel" value="Relational&lt;BR&gt;         op : &amp;&lt;"/>
+        <!-- new value for the label defined in the interface function of block -->  
     </add>
     <add as="TEXT_f" extend="Label">
         <!-- <add as="displayedLabel" value="Text"/>  -->
index 42568f0..09f5f4e 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/LOGICAL_OP.png and b/scilab/modules/xcos/images/palettes/LOGICAL_OP.png differ
index 315c7a9..ff2ba4a 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/RELATIONALOP.png and b/scilab/modules/xcos/images/palettes/RELATIONALOP.png differ