* Bug 15457 fixed: CONVERT & TrigFun blocks icons were static 41/19841/4
Samuel GOUGEON [Sun, 11 Mar 2018 01:23:23 +0000 (02:23 +0100)]
  http://bugzilla.scilab.org/15457

  + Both icons are now square, to be pivotable

Change-Id: I40a636c2b9295ebf49a67d1fd9d828cdcfe4cd5c

scilab/CHANGES.md
scilab/modules/helptools/images/CONVERT.png
scilab/modules/helptools/images/TrigFun.png
scilab/modules/scicos_blocks/macros/IntegerOp/CONVERT.sci
scilab/modules/scicos_blocks/macros/NonLinear/TrigFun.sci
scilab/modules/xcos/etc/Xcos-style.xml
scilab/modules/xcos/images/palettes/CONVERT.png
scilab/modules/xcos/images/palettes/TrigFun.png

index 49ef9d3..6de1e9c 100644 (file)
@@ -478,6 +478,7 @@ Known issues
 * [#15450](http://bugzilla.scilab.org/show_bug.cgi?id=15450): Scilab's compilation did not support the ppc64le architecture.
 * [#15453](http://bugzilla.scilab.org/show_bug.cgi?id=15453): Scilab's compilation needed HOME to be writable.
 * [#15454](http://bugzilla.scilab.org/show_bug.cgi?id=15454): Hundreds of typos fixed all over the code: occured => occured, formated => formatted, an other => another, setted => set, retrived => retrieved ..
+* [#15457](http://bugzilla.scilab.org/show_bug.cgi?id=15457): The icon of the "Trigo functions" and "CONVERT" Xcos blocks was not updated according to actual input parameters.
 * [#15464](http://bugzilla.scilab.org/show_bug.cgi?id=15464): Xcos C-blocks could not link dlls on Windows.
 * [#15484](http://bugzilla.scilab.org/show_bug.cgi?id=15484): On Windows, `isdir("w:")`, `isdir("w:/")`, and `isdir("w:\")` returned %T whenever the W: drive does not exist.
 * [#15489](http://bugzilla.scilab.org/show_bug.cgi?id=15489): Help pages of `covStart`, `covStop`, `covWrite` and `covMerge` were not built for the fr, ja, pt and ru languages, and were unreachable from a session in non `en_US` language.
index 3a00a8e..55ead30 100644 (file)
Binary files a/scilab/modules/helptools/images/CONVERT.png and b/scilab/modules/helptools/images/CONVERT.png differ
index 6cee69d..7ca6c63 100644 (file)
Binary files a/scilab/modules/helptools/images/TrigFun.png and b/scilab/modules/helptools/images/TrigFun.png differ
index 20de79a..2410f7a 100644 (file)
@@ -1,6 +1,7 @@
 //  Scicos
 //
 //  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
+//  Copyright (C) 2018 - Samuel GOUGEON
 //
 // 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
@@ -381,6 +382,12 @@ function [x,y,typ]=CONVERT(job,arg1,arg2)
             end
             if ok then
                 graphics.exprs=exprs
+                // Updating the block's label to display actual I/O types
+                // 1|2:double  3:int32  4:int16  5:int8  6:uint32  7:uint16  8:uint8
+                t = ["decim." "decim." "int32" "int16" "int8" "uint32" "uint16" "uint8"];
+                label = "$\scriptsize \mathsf{\substack{CONVERT\\\\\ \!" + ..
+                  t(evstr(exprs(1)))+"\\\Rightarrow\\"+t(evstr(exprs(2)))+"}}$"
+                graphics.style = "CONVERT;displayedLabel="+label;
                 x.graphics=graphics;
                 x.model=model
                 break
@@ -405,6 +412,6 @@ function [x,y,typ]=CONVERT(job,arg1,arg2)
 
         exprs=[sci2exp(1);sci2exp(3);sci2exp(0)]
         gr_i=[]
-        x=standard_define([3 2],model, exprs,gr_i)
+        x=standard_define([2 2],model, exprs,gr_i)
     end
 endfunction
index a9c1600..ca33cea 100644 (file)
@@ -1,6 +1,7 @@
 //  Scicos
 //
 //  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
+//  Copyright (C) 2018 - Samuel GOUGEON
 //
 // 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
@@ -44,11 +45,15 @@ function [x,y,typ]=TrigFun(job,arg1,arg2)
             else
                 graphics.exprs=exprs
                 execstr("model.sim=list(''"+fun+"_blk'',4)")
-                x.graphics=graphics;
                 x.model=model
+                //label = "$\mathsf{\tiny\begin{array}{ccc}sin\!\!&\!\!cos\!\!&\!\!tan\\asin\!\!&\!\!acos\!\!&\!\!atan\\\multicolumn{3}{c}{\normalsize "+exprs+"}\\sinh\!\!&\!\!cosh\!\!&\!\!tanh\\\!asinh\!\!\!&\!\!acosh\!\!\!&\!\!atanh \end{array}}$";    // @ middle
+                label = "$\mathsf{\tiny\begin{array}{ccc}sin\!\!&\!\!cos\!\!&\!\!tan\\asin\!\!&\!\!acos\!\!&\!\!atan\\sinh\!\!&\!\!cosh\!\!&\!\!tanh\\\!asinh\!\!\!&\!\!acosh\!\!\!&\!\!atanh\\&&\\\multicolumn{3}{c}{\normalsize "+exprs+"}\end{array}}$"; // @ bottom
+                graphics.style = "TrigFun;displayedLabel="+label;
+                x.graphics=graphics;
                 break
             end
         end
+
     case "define" then
         model=scicos_model()
         model.sim=list("sin_blk",4)
@@ -58,6 +63,6 @@ function [x,y,typ]=TrigFun(job,arg1,arg2)
         model.dep_ut=[%t %f]
         exprs="sin"
         gr_i=[]
-        x=standard_define([4 2],model,exprs,gr_i)
+        x=standard_define([3 3],model,exprs,gr_i)
     end
 endfunction
index 79d261a..f5161e0 100644 (file)
                -->
     </add>
     <add as="TrigFun" extend="blockWithLabel">
-        <add as="displayedLabel" value="Trig function"/>
+        <add as="displayedLabel" value="$\mathsf{\tiny\begin{array}{ccc}sin\!\!&amp;\!\!cos\!\!&amp;\!\!tan\\asin\!\!&amp;\!\!acos\!\!&amp;\!\!atan\\sinh\!\!&amp;\!\!cosh\!\!&amp;\!\!tanh\\\!asinh\!\!\!&amp;\!\!acosh\!\!\!&amp;\!\!atanh\\&amp;&amp;\\\multicolumn{3}{c}{\normalsize sin}\end{array}}$"/>
     </add>
     <add as="PRODUCT" extend="Icon">
         <add as="image" value="$SCILAB/modules/xcos/images/blocks/PRODUCT.svg"/>
         <add as="displayedLabel" value="Set bit %2$s"/>
     </add>
     <add as="CONVERT" extend="blockWithLabel">
-        <!-- FIXME: update label from parameters -->
-        <add as="displayedLabel" value="Convert to"/>
+        <add as="displayedLabel" value="$\scriptsize \mathsf{\substack{CONVERT\\\\\ \!decim.\\\Rightarrow\\uint32}}$"/>
     </add>
     <add as="EXTRACTBITS" extend="blockWithLabel">
         <add as="displayedLabel" value="Extract Bits %2$s"/>
     </add>
     <add as="M_freq" extend="blockWithLabel">
         <add as="displayedLabel" value="Multiple&lt;BR&gt;         frequency"/>
-        
     </add>
     <add as="ANDBLK" extend="Icon">
         <add as="image" value="$SCILAB/modules/xcos/images/blocks/ANDBLK.svg"/>
index 3a00a8e..55ead30 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/CONVERT.png and b/scilab/modules/xcos/images/palettes/CONVERT.png differ
index 6cee69d..7ca6c63 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/TrigFun.png and b/scilab/modules/xcos/images/palettes/TrigFun.png differ