* Bug 14749 fixed: Xcos POWBLK_f & EXPBLK_m icons ignored the actual "a" 87/19387/7
Samuel GOUGEON [Fri, 18 Aug 2017 01:33:12 +0000 (03:33 +0200)]
 * http://bugzilla.scilab.org/14749

 * SineVoltage: the icon now displays the frequency
 * Automaton: The number of modes and states are now updated on the icon
 * RELATIONALOP icon improved

Change-Id: I276efdf958900194cf86d7debb2a6a521eea6ff1

12 files changed:
scilab/CHANGES.md
scilab/modules/scicos_blocks/macros/Electrical/SineVoltage.sci
scilab/modules/scicos_blocks/macros/Misc/AUTOMAT.sci
scilab/modules/scicos_blocks/macros/Misc/RELATIONALOP.sci
scilab/modules/scicos_blocks/macros/NonLinear/EXPBLK_m.sci
scilab/modules/scicos_blocks/macros/NonLinear/POWBLK_f.sci
scilab/modules/xcos/etc/Xcos-style.xml
scilab/modules/xcos/images/palettes/AUTOMAT.png
scilab/modules/xcos/images/palettes/EXPBLK_m.png
scilab/modules/xcos/images/palettes/POWBLK_f.png
scilab/modules/xcos/images/palettes/RELATIONALOP.png
scilab/modules/xcos/images/palettes/SineVoltage.png

index bd0e3ce..ce650a0 100644 (file)
@@ -278,6 +278,7 @@ Scilab 5.5.2 is able to open the newly saved files, but the ports have to be rep
 Added to the CVode package, it also benefits from the CVode root finding feature.
 * Added a new link style (`Optimal`) for automatically finding the optimal route.
 * Automatically reposition split blocks for better-looking layout.
+* `EXPBLK_m (a^u)` and `POWBLK_f (u^a)` icons now show the value of the `a` parameter. The `AUTOMAT` icon now shows `Nmodes` and `Nstates` values. The `SineVoltage` icon now shows the frequency value.
 * Block modifications:
   - `INVBLK`: add a divide by zero parameter to ignore the error
   - `PRODUCT`: add a divide by zero parameter to ignore the error
@@ -290,7 +291,7 @@ Added to the CVode package, it also benefits from the CVode root finding feature
   - dynamic palette with the last used blocks
   - zoom using CTRL(+), CTRL(-) and CTRL(mouse wheel)
   - load SVG icons
-* Deleted obsolete WFILE_f block, please use WRITEC_f instead.
+* Deleted obsolete `WFILE_f` block, please use `WRITEC_f` instead.
 
 
 API modification
@@ -427,6 +428,7 @@ Known issues
 * [#14656](http://bugzilla.scilab.org/show_bug.cgi?id=14656): The `matrix` page missed a synopsis for hypermatrix and deserved some improvements.
 * [#14680](http://bugzilla.scilab.org/show_bug.cgi?id=14680): The `<` char in expression was not rendered in the icon of Xcos EXPRESSION block.
 * [#14703](http://bugzilla.scilab.org/show_bug.cgi?id=14703): `clear linspace, type(linspace)` returned 11 instead of 13.
+* [#14749](http://bugzilla.scilab.org/show_bug.cgi?id=14749): The icon of the Xcos `POWBLK_f` and `EXPBLK_m` blocks displayed "u^a" and "a^u" instead of the actual a value.
 * [#14883](http://bugzilla.scilab.org/show_bug.cgi?id=14883): `whereis` did not support builtin functions.
 * [#14886](http://bugzilla.scilab.org/show_bug.cgi?id=14886): `Matplot` save/load failed.
 * [#14896](http://bugzilla.scilab.org/show_bug.cgi?id=14896): Using `set` with multiple properties, only the first one was set.
index 1baa222..b90749b 100644 (file)
@@ -45,6 +45,9 @@ function [x,y,typ]= SineVoltage(job,arg1,arg2)
             graphics.exprs=exprs
             x.graphics=graphics;
             x.model=model
+            // Updating the label:
+            lab = "SineVoltage;displayedLabel=$\mathsf{\substack{"+exprs(1)+"\,V\\ \sim\,"+exprs(3)+"}}$"
+            x.graphics.style = lab;
             break
         end
     case "define" then
@@ -71,8 +74,7 @@ function [x,y,typ]= SineVoltage(job,arg1,arg2)
 
         gr_i=[]
 
-
-        x=standard_define([2 2],model,exprs,gr_i)
+        x=standard_define([2.2 2.2],model,exprs,gr_i)
         x.graphics.in_implicit=["I"]
         x.graphics.out_implicit=["I"]
     end
index 660c160..a430f98 100644 (file)
@@ -160,7 +160,7 @@ function [x,y,typ]=AUTOMAT(job,arg1,arg2)
 
         gr_i=[]
 
-        x=standard_define([4 2],model,exprs,gr_i);
+        x=standard_define([4.7 2.2],model,exprs,gr_i);
     end
 endfunction
 
index 8c0c44b..9951c65 100644 (file)
@@ -78,15 +78,15 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
                 if rule == 0 then
                     label = "==";
                 elseif rule == 1 then
-                    label = "~=";
+                    label = "$\Large\ne$";
                 elseif rule == 2 then
-                    label = "&#60;"; // <
+                    label = "$\Large\lt$"; // <
                 elseif rule == 3 then
-                    label = "&#8804;"; // <=
+                    label = "$\Large\le$"; // <=
                 elseif rule == 4 then
-                    label = "&#62;"; // >
+                    label = "$\Large\gt$"; // >
                 elseif rule == 5 then
-                    label = "&#8805;"; // >=
+                    label = "$\Large\ge$"; // >=
                 end
                 graphics.exprs=exprs;
                 graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
@@ -100,7 +100,7 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
         end
     case "define" then
         ipar=[2]
-        label="&lt";
+        label="$\Large\lt$";
         model=scicos_model()
         model.sim=list("relationalop",4)
         model.in=[1;1]
@@ -111,6 +111,6 @@ function [x,y,typ] = RELATIONALOP(job,arg1,arg2)
         exprs=[string(ipar);string(0)]
         gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
-        x.graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
+        x.graphics.style=["displayedLabel="+label];
     end
 endfunction
index f0059b2..482a1a5 100644 (file)
@@ -45,6 +45,10 @@ function [x,y,typ]=EXPBLK_m(job,arg1,arg2)
                 model.rpar=a;
                 x.graphics=graphics;
                 x.model=model
+                // Updating the label ("%" like in "%e" must be protected):
+                lab = "EXPBLK_m;displayedLabel=" + ..
+                "$\mathsf{{"+strsubst(exprs,"%","{\scriptsize \%\normal }")+"}^{\,\large u}}$"
+                x.graphics.style = lab;
                 break
             end
         end
@@ -63,8 +67,8 @@ function [x,y,typ]=EXPBLK_m(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
 
-        exprs=["%e"]
+        exprs = ["%e"]
         gr_i=[]
-        x=standard_define([2 2],model,exprs,gr_i)
+        x=standard_define([2 2], model, exprs, gr_i)
     end
 endfunction
index f53de9f..d766295 100644 (file)
@@ -49,6 +49,10 @@ function [x,y,typ]=POWBLK_f(job,arg1,arg2)
             model.firing=[] //compatibility
             x.graphics=graphics;
             x.model=model
+            // Updating the label ("%" in exponents like "%e" should be protected):
+            lab = "POWBLK_f;displayedLabel=" + ..
+            "$\mathsf{u^{\,"+strsubst(exprs,"%","{\scriptsize \%\normal }")+"}}$"
+            x.graphics.style = lab;
             break
         end
     case "define" then
index 6038565..ca3b1d1 100644 (file)
     <add as="FROMWSB" extend="blockWithLabel">
         <!-- FIXME: update label from parameters (not as exprs) -->
         <add as="displayedLabel" value="From workspace"/>
+        <!--<add as="displayedLabel" value="$\mathsf{\substack{From workspace\\ \Large %s}}$"/> -->
     </add>
     <!-- CONTINUOUS -->
     <add as="DERIV" extend="blockWithLabel">
     <add as="INTEGRAL_m" extend="Icon">
         <add as="image" value="$SCILAB/modules/xcos/images/blocks/INTEGRAL.svg"/>
         <!--
-                       <add as="displayedLabel" value="&lt;FONT SIZE=&quot;6&quot;&gt;
-                       &#8747; &lt;/FONT&gt;"/>
-               -->
+        <add as="INTEGRAL_m" extend="blockWithLabel">
+            <add as="displayedLabel" value="$%s$"/>
+            <add as="displayedLabel" value="&lt;FONT SIZE=&quot;6&quot;&gt;
+            &#8747; &lt;/FONT&gt;"/>
+        -->
     </add>
     <add as="INTEGRAL" extend="INTEGRAL_m"/>
     <add as="CLSS" extend="blockWithLabel">
                -->
     </add>
     <add as="POWBLK_f" extend="blockWithLabel">
-        <add as="displayedLabel" value="u^a"/>
+        <add as="displayedLabel" value="$\mathsf{u^{%s}}$"/>
     </add>
     <add as="INVBLK" extend="blockWithLabel">
         <add as="displayedLabel" value="1/u"/>
         <add as="displayedLabel" value="A / B"/>
     </add>
     <add as="EXPBLK_m" extend="blockWithLabel">
-        <add as="displayedLabel" value="a^u"/>
+        <add as="displayedLabel" value="$\mathsf{{{\scriptsize \%\normal}e}^{\large\,u}}$"/>
     </add>
     <add as="PROD_f" extend="blockWithLabel">
         <add as="shape" value="ellipse"/>
     </add>
     <add as="MAXMIN" extend="blockWithLabel">
         <add as="displayedLabel" value="MIN / MAX"/>
+        
     </add>
     <add as="ABS_VALUE" extend="blockWithLabel">
         <add as="displayedLabel" value="ABS"/>
     </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"/>
         <add as="displayedLabel" value="%s"/>
     </add>
     <add as="RELATIONALOP" extend="blockWithLabel">
-        <add as="displayedLabel" value="Relational&lt;BR&gt;         op : &amp;&lt;"/>
+        <add as="displayedLabel" value="$\Large\lt$"/>
         <!-- new value for the label defined in the interface function of block -->
     </add>
     <add as="TEXT_f" extend="Label">
     <add as="SineVoltage" extend="blockWithLabel">
         <add as="shape" value="ellipse"/>
         <add as="perimeter" value="ellipsePerimeter"/>
-        <add as="displayedLabel" value="%s V&lt;br/&gt;~"/>
+        <add as="displayedLabel" value="$\mathsf{\substack{%s\,V\vphantom{%s}\\ \sim\,%s}}$"/>
     </add>
     <add as="Switch" extend="Icon">
         <add as="image" value="$SCILAB/modules/xcos/images/blocks/SWITCH.svg"/>
     </add>
     <add as="BPLATFORM" extend="Icon">
         <add as="image" value="$SCILAB/modules/xcos/images/blocks/BPLATFORM.svg"/>
+        
     </add>
     <add as="AUTOMAT" extend="blockWithLabel">
-        <!-- FIXME : Show parameters over block  -->
-        <add as="displayedLabel" value="Automaton&lt;BR&gt;         nM=2, nX=1"/>
+        <add as="displayedLabel" value="$\mathsf{\substack{\large Automaton\\%s\ modes\ |\ \vphantom{%s}%s\ states}}$"/>
     </add>
     <!-- GENERATED BLOCKS -->
     <add as="SPLIT_f" extend="Split"/>
index b372d95..39c3d85 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/AUTOMAT.png and b/scilab/modules/xcos/images/palettes/AUTOMAT.png differ
index 3b7be24..e5bab68 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/EXPBLK_m.png and b/scilab/modules/xcos/images/palettes/EXPBLK_m.png differ
index 70104c7..862185c 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/POWBLK_f.png and b/scilab/modules/xcos/images/palettes/POWBLK_f.png differ
index 6606e1b..d8a4b74 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/RELATIONALOP.png and b/scilab/modules/xcos/images/palettes/RELATIONALOP.png differ
index ce99582..13dac45 100644 (file)
Binary files a/scilab/modules/xcos/images/palettes/SineVoltage.png and b/scilab/modules/xcos/images/palettes/SineVoltage.png differ