[Xcos] New Self-Switch Block. 26/5126/6
Bruno JOFRET [Tue, 4 Oct 2011 10:22:40 +0000 (12:22 +0200)]
Change-Id: I9ce468a1b975b3ac92db5121940e76950eb5ad1d

19 files changed:
scilab/modules/scicos_blocks/Makefile.am
scilab/modules/scicos_blocks/Makefile.in
scilab/modules/scicos_blocks/blocks/SELF_SWITCH.h5 [new file with mode: 0644]
scilab/modules/scicos_blocks/macros/Branching/SELF_SWITCH.sci [new file with mode: 0644]
scilab/modules/xcos/Makefile.am
scilab/modules/xcos/Makefile.in
scilab/modules/xcos/etc/Xcos-style.xml
scilab/modules/xcos/etc/palettes.xml
scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.png [new file with mode: 0644]
scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.xcos [new file with mode: 0644]
scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.png [new file with mode: 0644]
scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.xcos [new file with mode: 0644]
scilab/modules/xcos/help/en_US/palettes/Signalrouting_pal/SELF_SWITCH.xml [new file with mode: 0644]
scilab/modules/xcos/images/blocks/SELF_SWITCH.svg [new file with mode: 0644]
scilab/modules/xcos/images/blocks/Self_Switch_off.svg [new file with mode: 0644]
scilab/modules/xcos/images/blocks/Self_Switch_on.svg [new file with mode: 0644]
scilab/modules/xcos/images/palettes/SELF_SWITCH.png [new file with mode: 0644]
scilab/modules/xcos/images/palettes/SELF_SWITCH_off.png [new file with mode: 0644]
scilab/modules/xcos/images/palettes/SELF_SWITCH_on.png [new file with mode: 0644]

index 1654db1..366d9c7 100644 (file)
@@ -9,7 +9,7 @@
 
 pkglib_LTLIBRARIES = libsciscicos_blocks.la
 
-libsciscicos_blocks_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(RT_LIB) 
+libsciscicos_blocks_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(RT_LIB)
 
 #### Target ######
 modulename=scicos_blocks
@@ -467,7 +467,7 @@ $(top_builddir)/modules/scicos_blocks/build/CPPblocknames:Makefile.am $(SCICOS_B
        @for file in $(SCICOS_BLOCKS_CPP_SOURCES); do echo $$file |sed  's|.*/\([0-9A-Za-z_-]*\)\.cpp|\1|' ;done > $(top_builddir)/modules/scicos_blocks/build/CPPblocknames
 
 $(top_builddir)/modules/scicos_blocks/build/Fblocknames: Makefile.am $(SCICOS_BLOCKS_FORTRAN_SOURCES)
-       @echo "-- Generates build/Fblocknames --" 
+       @echo "-- Generates build/Fblocknames --"
        @if test ! -d build; then mkdir $(top_builddir)/modules/scicos_blocks/build; fi
 # Get the filename, strip the extension and put into a file
        @for file in $(SCICOS_BLOCKS_FORTRAN_SOURCES); do echo $$file |sed  's|.*/\([0-9A-Za-z_-]*\)\.f|\1|';done > $(top_builddir)/modules/scicos_blocks/build/Fblocknames
@@ -477,7 +477,7 @@ includes/blocks.h: $(top_builddir)/modules/scicos_blocks/build/Cblocknames $(top
        @if test ! -d $(top_builddir)/modules/scicos_blocks/includes/; then \
                mkdir $(top_builddir)/modules/scicos_blocks/includes/; \
        fi
-       @$(top_srcdir)/modules/scicos_blocks/src/scripts/GenBlocks.sh $(top_builddir)/modules/scicos_blocks/build/Fblocknames $(top_builddir)/modules/scicos_blocks/build/Cblocknames $(top_builddir)/modules/scicos_blocks/build/CPPblocknames $(top_builddir)/modules/scicos_blocks/includes/blocks.h 
+       @$(top_srcdir)/modules/scicos_blocks/src/scripts/GenBlocks.sh $(top_builddir)/modules/scicos_blocks/build/Fblocknames $(top_builddir)/modules/scicos_blocks/build/Cblocknames $(top_builddir)/modules/scicos_blocks/build/CPPblocknames $(top_builddir)/modules/scicos_blocks/includes/blocks.h
 
 CLEANFILES=$(top_srcdir)/modules/scicos_blocks/includes/blocks.h \
        $(top_srcdir)/modules/scicos_blocks/build/Cblocknames \
@@ -490,7 +490,7 @@ CLEANFILES=$(top_srcdir)/modules/scicos_blocks/includes/blocks.h \
 
 #### scicos_blocks : Conf files ####
 libsciscicos_blocks_la_rootdir = $(mydatadir)
-libsciscicos_blocks_la_root_DATA =  license.txt 
+libsciscicos_blocks_la_root_DATA =  license.txt
 
 #### scicos_blocks : init scripts ####
 libsciscicos_blocks_la_etcdir = $(mydatadir)/etc
@@ -719,6 +719,7 @@ blocks/SUPER_f.h5 \
 blocks/SWITCH2_m.h5 \
 blocks/SWITCH_f.h5 \
 blocks/Switch.h5 \
+blocks/SELF_SWITCH.h5 \
 blocks/TANBLK_f.h5 \
 blocks/TCLSS.h5 \
 blocks/TEXT_f.h5 \
index da4712f..662250f 100644 (file)
@@ -887,7 +887,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 pkglib_LTLIBRARIES = libsciscicos_blocks.la
-libsciscicos_blocks_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(RT_LIB) 
+libsciscicos_blocks_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(RT_LIB)
 
 #### Target ######
 modulename = scicos_blocks
@@ -1396,7 +1396,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
 
 #### scicos_blocks : Conf files ####
 @XCOS_TRUE@libsciscicos_blocks_la_rootdir = $(mydatadir)
-@XCOS_TRUE@libsciscicos_blocks_la_root_DATA = license.txt 
+@XCOS_TRUE@libsciscicos_blocks_la_root_DATA = license.txt
 
 #### scicos_blocks : init scripts ####
 @XCOS_TRUE@libsciscicos_blocks_la_etcdir = $(mydatadir)/etc
@@ -1624,6 +1624,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
 @XCOS_TRUE@blocks/SWITCH2_m.h5 \
 @XCOS_TRUE@blocks/SWITCH_f.h5 \
 @XCOS_TRUE@blocks/Switch.h5 \
+@XCOS_TRUE@blocks/SELF_SWITCH.h5 \
 @XCOS_TRUE@blocks/TANBLK_f.h5 \
 @XCOS_TRUE@blocks/TCLSS.h5 \
 @XCOS_TRUE@blocks/TEXT_f.h5 \
@@ -5035,7 +5036,7 @@ distclean-local:
 @XCOS_TRUE@    @for file in $(SCICOS_BLOCKS_CPP_SOURCES); do echo $$file |sed  's|.*/\([0-9A-Za-z_-]*\)\.cpp|\1|' ;done > $(top_builddir)/modules/scicos_blocks/build/CPPblocknames
 
 @XCOS_TRUE@$(top_builddir)/modules/scicos_blocks/build/Fblocknames: Makefile.am $(SCICOS_BLOCKS_FORTRAN_SOURCES)
-@XCOS_TRUE@    @echo "-- Generates build/Fblocknames --" 
+@XCOS_TRUE@    @echo "-- Generates build/Fblocknames --"
 @XCOS_TRUE@    @if test ! -d build; then mkdir $(top_builddir)/modules/scicos_blocks/build; fi
 # Get the filename, strip the extension and put into a file
 @XCOS_TRUE@    @for file in $(SCICOS_BLOCKS_FORTRAN_SOURCES); do echo $$file |sed  's|.*/\([0-9A-Za-z_-]*\)\.f|\1|';done > $(top_builddir)/modules/scicos_blocks/build/Fblocknames
@@ -5045,7 +5046,7 @@ distclean-local:
 @XCOS_TRUE@    @if test ! -d $(top_builddir)/modules/scicos_blocks/includes/; then \
 @XCOS_TRUE@            mkdir $(top_builddir)/modules/scicos_blocks/includes/; \
 @XCOS_TRUE@    fi
-@XCOS_TRUE@    @$(top_srcdir)/modules/scicos_blocks/src/scripts/GenBlocks.sh $(top_builddir)/modules/scicos_blocks/build/Fblocknames $(top_builddir)/modules/scicos_blocks/build/Cblocknames $(top_builddir)/modules/scicos_blocks/build/CPPblocknames $(top_builddir)/modules/scicos_blocks/includes/blocks.h 
+@XCOS_TRUE@    @$(top_srcdir)/modules/scicos_blocks/src/scripts/GenBlocks.sh $(top_builddir)/modules/scicos_blocks/build/Fblocknames $(top_builddir)/modules/scicos_blocks/build/Cblocknames $(top_builddir)/modules/scicos_blocks/build/CPPblocknames $(top_builddir)/modules/scicos_blocks/includes/blocks.h
 
 .NOTPARALLEL: build/Fblocknames build/Cblocknames
 
diff --git a/scilab/modules/scicos_blocks/blocks/SELF_SWITCH.h5 b/scilab/modules/scicos_blocks/blocks/SELF_SWITCH.h5
new file mode 100644 (file)
index 0000000..9973c0e
Binary files /dev/null and b/scilab/modules/scicos_blocks/blocks/SELF_SWITCH.h5 differ
diff --git a/scilab/modules/scicos_blocks/macros/Branching/SELF_SWITCH.sci b/scilab/modules/scicos_blocks/macros/Branching/SELF_SWITCH.sci
new file mode 100644 (file)
index 0000000..ce36ab0
--- /dev/null
@@ -0,0 +1,91 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+//
+//
+function [x,y,typ]=SELF_SWITCH(job,arg1,arg2)
+function diagram = genSwitchInnerDiagram(stateOpen)
+  diagram = scicos_diagram();
+// Input forward
+  diagram.objs(1) = IN_f("define");
+  diagram.objs(1).graphics.pout = 5;
+
+// Output's forward
+  diagram.objs(2)=OUT_f("define");
+  diagram.objs(2).graphics.pin = 7;
+
+  diagram.objs(3)=CONST_m("define");
+  diagram.objs(3).graphics.pout = 6;
+  diagram.objs(3).graphics.exprs = "0";
+  diagram.objs(3).model.rpar = 0;
+
+  diagram.objs(4)=SWITCH_f("define");
+  diagram.objs(4).graphics.pin = [5 6]
+  diagram.objs(4).graphics.pout = 7
+  if stateOpen == %t
+    diagram.objs(4).model.ipar = 1;
+    diagram.objs(4).graphics.exprs = ["2";"2"];
+  else
+    diagram.objs(4).model.ipar = 0;
+    diagram.objs(4).graphics.exprs = ["2";"1"];
+  end
+
+// IN_f <-> SWITCH_f
+  diagram.objs(5) = scicos_link(xx=[0, 0], yy=[0, 0], from=[1, 1], to=[4, 1]);
+// CONST_m <-> SWITCH_f
+  diagram.objs(6) = scicos_link(xx=[0, 0], yy=[0, 0], from=[3, 1], to=[4, 2]);
+// SWITCH_f <-> OUT_f
+  diagram.objs(7) = scicos_link(xx=[0, 0], yy=[0, 0], from=[4, 1], to=[2, 1]);
+endfunction
+select job
+ case 'plot' then
+  standard_draw(arg1)
+ case 'getinputs' then
+  [x,y,typ]=standard_inputs(arg1)
+ case 'getoutputs' then
+  [x,y,typ]=standard_outputs(arg1)
+ case 'getorigin' then
+  [x,y]=standard_origin(arg1)
+ case 'set' then
+  x = arg1;
+  stateOpen = x.model.opar(1);
+  x.model.rpar = genSwitchInnerDiagram(~stateOpen);
+  x.model.opar = list(~stateOpen);
+  y = 0;
+  typ=list();
+  if stateOpen == %f
+      x.graphics.style="SELF_SWITCH_OFF"
+  else
+      x.graphics.style="SELF_SWITCH_ON"
+  end
+
+ case "define"
+// By default SWITCH is open
+  stateOpen = %t;
+  x = scicos_block()
+  x.gui='SELF_SWITCH'
+  x.graphics.sz=[2,2]
+  x.graphics.gr_i=list('xstringb(orig(1),orig(2),''CUT'',sz(1),s"+...
+                       "z(2),''fill'')',8)
+  x.graphics.pin=0
+  x.graphics.pout=0
+  x.model.sim='csuper'
+  x.model.in = 1
+  x.model.out = 1
+  x.model.blocktype='h'
+  x.model.dep_ut=[%f %f]
+  x.model.rpar = genSwitchInnerDiagram(stateOpen);
+  x.model.opar = list(stateOpen);
+  x.graphics.in_implicit=["E"]
+  x.graphics.in_style=""
+  x.graphics.out_implicit=["E"];
+  x.graphics.out_style=""
+  x.graphics.style="SELF_SWITCH_OFF"
+end
+endfunction
index d1d291c..384974f 100644 (file)
@@ -171,6 +171,9 @@ images/blocks/STEP_FUNCTION.svg \
 images/blocks/SUM.svg \
 images/blocks/SUPER.svg \
 images/blocks/SWITCH.svg \
+images/blocks/SELF_SWITCH.svg \
+images/blocks/Self_Switch_on.svg \
+images/blocks/Self_Switch_off.svg \
 images/blocks/VanneReglante.svg \
 images/blocks/VariableResistor.svg \
 images/blocks/VoltageSensor.svg \
@@ -380,6 +383,9 @@ images/palettes/SUPER_f.png \
 images/palettes/SWITCH2_m.png \
 images/palettes/SWITCH_f.png \
 images/palettes/Switch.png \
+images/palettes/SELF_SWITCH.png \
+images/palettes/SELF_SWITCH_on.png \
+images/palettes/SELF_SWITCH_off.png \
 images/palettes/TANBLK_f.png \
 images/palettes/TCLSS.png \
 images/palettes/TEXT_f.png \
index 9db491a..d7032f0 100644 (file)
@@ -577,6 +577,9 @@ images/blocks/STEP_FUNCTION.svg \
 images/blocks/SUM.svg \
 images/blocks/SUPER.svg \
 images/blocks/SWITCH.svg \
+images/blocks/SELF_SWITCH.svg \
+images/blocks/Self_Switch_on.svg \
+images/blocks/Self_Switch_off.svg \
 images/blocks/VanneReglante.svg \
 images/blocks/VariableResistor.svg \
 images/blocks/VoltageSensor.svg \
@@ -786,6 +789,9 @@ images/palettes/SUPER_f.png \
 images/palettes/SWITCH2_m.png \
 images/palettes/SWITCH_f.png \
 images/palettes/Switch.png \
+images/palettes/SELF_SWITCH.png \
+images/palettes/SELF_SWITCH_on.png \
+images/palettes/SELF_SWITCH_off.png \
 images/palettes/TANBLK_f.png \
 images/palettes/TCLSS.png \
 images/palettes/TEXT_f.png \
index 0745e8a..037b26d 100644 (file)
     <add as="image" value="$SCILAB/modules/xcos/images/blocks/DSCOPE.svg"/>
   </add>
   <!-- SIGNAL ROUTING -->
+  <add as="SELF_SWITCH_ON" extend="Icon">
+    <add as="image" value="$SCILAB/modules/xcos/images/blocks/Self_Switch_on.svg"/>
+  </add>
+  <add as="SELF_SWITCH_OFF" extend="Icon">
+    <add as="image" value="$SCILAB/modules/xcos/images/blocks/Self_Switch_off.svg"/>
+  </add>
   <add as="ISELECT_m" extend="blockWithLabel">
     <add as="displayedLabel" value="Selector"/>
   </add>
index 9275cee..53c9f93 100644 (file)
         <data variable="SCI" path="/modules/scicos_blocks/blocks/SWITCH_f.h5"/>
         <icon variable="SCI" path="/modules/xcos/images/palettes/SWITCH_f.png"/>
       </block>
+      <block name="SELF_SWITCH">
+        <data variable="SCI" path="/modules/scicos_blocks/blocks/SELF_SWITCH.h5"/>
+        <icon variable="SCI" path="/modules/xcos/images/palettes/SELF_SWITCH.png"/>
+      </block>
     </node>
     <node xsi:type="PreLoaded" enable="true" name="Signal Processing">
       <block name="QUANT_f">
diff --git a/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.png b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.png
new file mode 100644 (file)
index 0000000..de89387
Binary files /dev/null and b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.png differ
diff --git a/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.xcos b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.xcos
new file mode 100644 (file)
index 0000000..13716f2
Binary files /dev/null and b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.xcos differ
diff --git a/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.png b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.png
new file mode 100644 (file)
index 0000000..b9f2e15
Binary files /dev/null and b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.png differ
diff --git a/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.xcos b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.xcos
new file mode 100644 (file)
index 0000000..531a71f
Binary files /dev/null and b/scilab/modules/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.xcos differ
diff --git a/scilab/modules/xcos/help/en_US/palettes/Signalrouting_pal/SELF_SWITCH.xml b/scilab/modules/xcos/help/en_US/palettes/Signalrouting_pal/SELF_SWITCH.xml
new file mode 100644 (file)
index 0000000..d7d3fe9
--- /dev/null
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="SELF_SWITCH">
+  <refnamediv>
+    <refname>SELF_SWITCH</refname>
+    <refpurpose>Switch</refpurpose>
+  </refnamediv>
+  <refsection>
+    <title>Block Screenshot</title>
+    <para>
+      <inlinemediaobject>
+        <imageobject>
+          <imagedata fileref="../../../../images/palettes/SELF_SWITCH_on.png" align="center" valign="middle"/>
+        </imageobject>
+        <imageobject>
+          <imagedata fileref="../../../../images/palettes/SELF_SWITCH_off.png" align="center" valign="middle"/>
+        </imageobject>
+      </inlinemediaobject>
+    </para>
+  </refsection>
+  <refsection id="Contents_SELF_SWITCH">
+    <title>Contents</title>
+    <itemizedlist>
+      <listitem>
+        <para>
+          <link linkend="SELF_SWITCH">Switch</link>
+        </para>
+      </listitem>
+      <listitem>
+        <itemizedlist>
+          <listitem>
+            <para>
+              <xref linkend="Palette_SELF_SWITCH">Palette</xref>
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <xref linkend="Description_SELF_SWITCH">Description</xref>
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <xref linkend="Defaultproperties_SELF_SWITCH">Default properties</xref>
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <xref linkend="Interfacingfunction_SELF_SWITCH">Interfacing function</xref>
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <xref linkend="Computationalfunction_SELF_SWITCH">Computational function</xref>
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <xref linkend="Example_SELF_SWITCH">Authors</xref>
+            </para>
+          </listitem>
+        </itemizedlist>
+      </listitem>
+    </itemizedlist>
+  </refsection>
+  <refsection id="Palette_SELF_SWITCH">
+    <title>Palette</title>
+    <itemizedlist>
+      <listitem>
+        <para>
+          <link linkend="Signalrouting_pal">Signal routing palette</link>
+        </para>
+      </listitem>
+    </itemizedlist>
+  </refsection>
+  <refsection id="Description_SELF_SWITCH">
+    <title>Description</title>
+    <para>
+      This is an Automatic Switch Block. Double Click on it to invert it's state (on/off).
+    </para>
+  </refsection>
+  <refsection id="Defaultproperties_SELF_SWITCH">
+    <title>Default properties</title>
+    <itemizedlist>
+      <listitem>
+        <para><emphasis role="bold">always active:</emphasis> yes</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">direct-feedthrough:</emphasis> yes</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">zero-crossing:</emphasis> no</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">mode:</emphasis> no</para>
+      </listitem>
+      <listitem>
+        <para>
+          <emphasis role="bold">regular inputs:</emphasis>
+        </para>
+        <para>
+          <emphasis role="bold">- port 1 : size [1,1] / type 1</emphasis>
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          <emphasis role="bold">regular outputs:</emphasis>
+        </para>
+        <para>
+          <emphasis role="bold">- port 1 : size [1,1] / type 1</emphasis>
+        </para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">number/sizes of activation inputs:</emphasis> 0</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">number/sizes of activation outputs:</emphasis> 0</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">continuous-time state:</emphasis> no</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">discrete-time state:</emphasis> no</para>
+      </listitem>
+      <listitem>
+        <para><emphasis role="bold">object discrete-time state:</emphasis> no</para>
+      </listitem>
+      <listitem>
+        <para>
+          <emphasis role="bold">name of computational function:</emphasis>
+          <emphasis role="italic">csuper</emphasis>
+        </para>
+      </listitem>
+    </itemizedlist>
+  </refsection>
+  <refsection id="Interfacingfunction_SELF_SWITCH">
+    <title>Interfacing function</title>
+    <itemizedlist>
+      <listitem>
+        <para> SCI/modules/scicos_blocks/macros/Branching/SELF_SWITCH.sci</para>
+      </listitem>
+    </itemizedlist>
+  </refsection>
+  <refsection id="Computationalfunction_SELF_SWITCH">
+    <title>Computational function</title>
+    <itemizedlist>
+      <listitem>
+        <para> SELF_SWITCH is a SuperBLock.</para>
+      </listitem>
+    </itemizedlist>
+  </refsection>
+  <refsection id="Example_SELF_SWITCH">
+    <title>Examples</title>
+    <para>
+      <link type="scilab" linkend="scilab.xcos/xcos/examples/signalrouting_pal/SELF_SWITCH_on_Example.xcos">
+        <inlinemediaobject>
+          <imageobject>
+            <imagedata align="center" fileref="../../../../examples/signalrouting_pal/SELF_SWITCH_on_Example.png" valign="middle"/>
+          </imageobject>
+        </inlinemediaobject>
+      </link>
+    </para>
+    <para>
+      <link type="scilab" linkend="scilab.xcos/xcos/examples/signalrouting_pal/SELF_SWITCH_off_Example.xcos">
+        <inlinemediaobject>
+          <imageobject>
+            <imagedata align="center" fileref="../../../../examples/signalrouting_pal/SELF_SWITCH_off_Example.png" valign="middle"/>
+          </imageobject>
+        </inlinemediaobject>
+      </link>
+    </para>
+  </refsection>
+</refentry>
diff --git a/scilab/modules/xcos/images/blocks/SELF_SWITCH.svg b/scilab/modules/xcos/images/blocks/SELF_SWITCH.svg
new file mode 100644 (file)
index 0000000..0344da7
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="40" stroke="#000" xmlns="http://www.w3.org/2000/svg" version="1.1" height="40">
+ <g id="base" stroke-linejoin="round" stroke-linecap="round" stroke-width="2px" fill="none">
+  <path d="M2,30h9l16-10"/>
+  <path d="M30,30h8"/>
+ </g>
+ <g id="command">
+  <polygon fill-opacity="0.1" width="1px" points="18,5,22,5,20,10" fill="#000"/>
+  <path stroke-width="1px" stroke-dasharray="1,1" d="M20,10v28"/>
+ </g>
+</svg>
diff --git a/scilab/modules/xcos/images/blocks/Self_Switch_off.svg b/scilab/modules/xcos/images/blocks/Self_Switch_off.svg
new file mode 100644 (file)
index 0000000..7efd219
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\r
+<svg version="1.1"\r
+        id="svg11300" inkscape:version="0.46" inkscape:export-ydpi="90.000000" inkscape:export-xdpi="90.000000" sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/actions" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:version="0.32" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:docname="system-shutdown.svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:export-filename="/home/jimmac/Desktop/wi-fi.png" xmlns:svg="http://www.w3.org/2000/svg"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="80px" height="79.583px"\r
+        viewBox="-10.667 -16.583 80 79.583" enable-background="new -10.667 -16.583 80 79.583" xml:space="preserve">\r
+<defs>\r
+       \r
+       \r
+               <inkscape:perspective  sodipodi:type="inkscape:persp3d" inkscape:persp3d-origin="24 : 16 : 1" inkscape:vp_z="48 : 24 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 24 : 1" id="perspective62">\r
+               </inkscape:perspective>\r
+</defs>\r
+<sodipodi:namedview  stroke="#ef2929" fill="#fce94f" pagecolor="#ffffff" bordercolor="#666666" borderopacity="0.25490196" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1" inkscape:cx="-112.52652" inkscape:cy="17.878701" inkscape:current-layer="layer1" showgrid="false" inkscape:grid-bbox="true" inkscape:document-units="px" inkscape:showpageshadow="false" inkscape:window-width="872" inkscape:window-height="754" inkscape:window-x="268" inkscape:window-y="94" id="base">\r
+       </sodipodi:namedview>\r
+<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer">\r
+       \r
+               <radialGradient id="rect11518_1_" cx="81.7412" cy="193.0215" r="39.4779" gradientTransform="matrix(1.9951 0 0 -1.8554 -133.6792 406.2393)" gradientUnits="userSpaceOnUse">\r
+               <stop  offset="0" style="stop-color:#FBFBFB"/>\r
+               <stop  offset="1" style="stop-color:#DCDCDC"/>\r
+       </radialGradient>\r
+       \r
+               <path id="rect11518" fill="url(#rect11518_1_)" stroke="#9B9B9B" stroke-width="1" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M1.372-14.864h56.053c5.795,0,10.489,4.696,10.489,10.489v55.77c0,5.793-4.694,10.49-10.489,10.49H1.372\r
+               c-5.792,0-10.488-4.697-10.488-10.49v-55.77C-9.116-10.168-4.42-14.864,1.372-14.864z"/>\r
+       <path id="rect11528" fill="none" stroke="#FFFFFF" stroke-width="1" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M1.316-12.877h56.167c4.504,0,8.158,3.653,8.158,8.158v56.331c0,4.506-3.654,8.156-8.158,8.156H1.316\r
+               c-4.506,0-8.158-3.65-8.158-8.156V-4.72C-6.842-9.225-3.19-12.877,1.316-12.877z"/>\r
+       \r
+               <linearGradient id="rect11592_1_" gradientUnits="userSpaceOnUse" x1="225.0801" y1="55.1973" x2="225.0801" y2="-19.6924" gradientTransform="matrix(0.9843 0 0 -0.9579 -192.1539 34.693)">\r
+               <stop  offset="0" style="stop-color:#FBFBFB"/>\r
+               <stop  offset="1" style="stop-color:#DCDCDC"/>\r
+       </linearGradient>\r
+       <linearGradient id="rect11592_2_" gradientUnits="userSpaceOnUse" x1="-62.2075" y1="440.248" x2="-50.5009" y2="410.248">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="1" style="stop-color:#D1D1D1"/>\r
+       </linearGradient>\r
+       \r
+               <path id="rect11592" fill="url(#rect11592_1_)" stroke="url(#rect11592_2_)" stroke-width="1" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M10.496-7.356h37.807c2.441,0,4.418,1.978,4.418,4.419v54.048c0,2.441-1.977,4.42-4.418,4.42H10.496\r
+               c-2.44,0-4.418-1.979-4.418-4.42V-2.937C6.078-5.378,8.056-7.356,10.496-7.356z"/>\r
+       \r
+               <radialGradient id="rect7580_1_" cx="57.7598" cy="201.8398" r="11.5878" gradientTransform="matrix(2.4079 0 0 -1.8611 -109.6827 418.4173)" gradientUnits="userSpaceOnUse">\r
+               <stop  offset="0" style="stop-color:#525252"/>\r
+               <stop  offset="1" style="stop-color:#000000"/>\r
+       </radialGradient>\r
+       <linearGradient id="rect7580_2_" gradientUnits="userSpaceOnUse" x1="-50.7026" y1="415.7471" x2="-57.8541" y2="428.1275">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="1" style="stop-color:#D1D1D1"/>\r
+       </linearGradient>\r
+       \r
+               <path id="rect7580" fill="url(#rect7580_1_)" stroke="url(#rect7580_2_)" stroke-width="1" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M21.151,4.841h17.175c1.69,0,3.06,1.37,3.06,3.06v34.073c0,1.689-1.369,3.059-3.06,3.059H21.151c-1.689,0-3.059-1.369-3.059-3.059\r
+               V7.901C18.092,6.211,19.462,4.841,21.151,4.841z"/>\r
+       <path id="rect7626" fill="#8A8A8A" stroke="#595959" stroke-width="1" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M20.979,13.725V9.506c0-1.127,0.913-2.039,2.04-2.039h13.171c1.127,0,2.039,0.912,2.039,2.039v4.219\r
+               c0,1.125-0.912,2.041-2.039,2.041H23.019C21.892,15.766,20.979,14.85,20.979,13.725z"/>\r
+       \r
+               <linearGradient id="rect7594_1_" gradientUnits="userSpaceOnUse" x1="205.0234" y1="-85.3086" x2="205.0234" y2="-40.8807" gradientTransform="matrix(1.0592 0 0 0.8081 -187.5606 80.1279)">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="0.4602" style="stop-color:#E3E3E3"/>\r
+               <stop  offset="0.6197" style="stop-color:#DADADA;stop-opacity:0.6706"/>\r
+               <stop  offset="1" style="stop-color:#D1D1D1;stop-opacity:0.3429"/>\r
+       </linearGradient>\r
+       <radialGradient id="rect7594_2_" cx="-57.8164" cy="419.5859" r="4.4775" gradientUnits="userSpaceOnUse">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="0.2159" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="0.5" style="stop-color:#838383"/>\r
+               <stop  offset="1" style="stop-color:#838383;stop-opacity:0"/>\r
+       </radialGradient>\r
+       \r
+               <path id="rect7594" fill="url(#rect7594_1_)" stroke="url(#rect7594_2_)" stroke-width="1" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M21.037,40.96V13.955c0-0.939,0.76-1.699,1.699-1.699h13.738c0.938,0,1.699,0.76,1.699,1.699V40.96\r
+               c0,0.938-0.761,1.699-1.699,1.699H22.736C21.797,42.659,21.037,41.898,21.037,40.96z"/>\r
+</g>\r
+<text transform="matrix(1 0 0 1 40.252 54.958)" font-family="'MyriadPro-Regular'" font-size="21.1506">off</text>\r
+</svg>\r
diff --git a/scilab/modules/xcos/images/blocks/Self_Switch_on.svg b/scilab/modules/xcos/images/blocks/Self_Switch_on.svg
new file mode 100644 (file)
index 0000000..3579357
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)  -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\r
+<svg version="1.1"\r
+        id="svg11300" inkscape:version="0.46" inkscape:export-ydpi="90.000000" inkscape:export-xdpi="90.000000" sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/actions" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:version="0.32" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:docname="system-shutdown.svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:export-filename="/home/jimmac/Desktop/wi-fi.png" xmlns:svg="http://www.w3.org/2000/svg"\r
+        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="80px" height="79.583px"\r
+        viewBox="0 0 80 79.583" enable-background="new 0 0 80 79.583" xml:space="preserve">\r
+<defs>\r
+       \r
+       \r
+               <inkscape:perspective  sodipodi:type="inkscape:persp3d" inkscape:persp3d-origin="24 : 16 : 1" inkscape:vp_z="48 : 24 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 24 : 1" id="perspective62">\r
+               </inkscape:perspective>\r
+</defs>\r
+<sodipodi:namedview  stroke="#ef2929" fill="#fce94f" pagecolor="#ffffff" bordercolor="#666666" borderopacity="0.25490196" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1" inkscape:cx="-112.52652" inkscape:cy="17.878701" inkscape:current-layer="layer1" showgrid="false" inkscape:grid-bbox="true" inkscape:document-units="px" inkscape:showpageshadow="false" inkscape:window-width="872" inkscape:window-height="754" inkscape:window-x="268" inkscape:window-y="94" id="base">\r
+       </sodipodi:namedview>\r
+<g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer">\r
+       \r
+               <radialGradient id="rect11518_1_" cx="212.9746" cy="-226.6719" r="39.4809" gradientTransform="matrix(1.9951 0 0 -1.8554 -384.1325 -356.1771)" gradientUnits="userSpaceOnUse">\r
+               <stop  offset="0" style="stop-color:#FBFBFB"/>\r
+               <stop  offset="1" style="stop-color:#DCDCDC"/>\r
+       </radialGradient>\r
+       <path id="rect11518" fill="url(#rect11518_1_)" stroke="#9B9B9B" stroke-linejoin="bevel" stroke-miterlimit="10" d="M12.747,1.417\r
+               H68.8c5.796,0,10.489,4.696,10.489,10.489v55.77c0,5.793-4.693,10.49-10.489,10.49H12.747c-5.792,0-10.488-4.697-10.488-10.49\r
+               v-55.77C2.259,6.113,6.955,1.417,12.747,1.417z"/>\r
+       <path id="rect11528" fill="none" stroke="#FFFFFF" stroke-linejoin="bevel" stroke-miterlimit="10" d="M12.691,3.404h56.167\r
+               c4.504,0,8.158,3.653,8.158,8.158v56.331c0,4.506-3.654,8.156-8.158,8.156H12.691c-4.506,0-8.158-3.65-8.158-8.156V11.562\r
+               C4.533,7.056,8.185,3.404,12.691,3.404z"/>\r
+       \r
+               <linearGradient id="rect11592_1_" gradientUnits="userSpaceOnUse" x1="627.2578" y1="-757.7251" x2="627.2578" y2="-832.617" gradientTransform="matrix(0.9843 0 0 -0.9579 -576.6366 -727.7244)">\r
+               <stop  offset="0" style="stop-color:#FBFBFB"/>\r
+               <stop  offset="1" style="stop-color:#DCDCDC"/>\r
+       </linearGradient>\r
+       <linearGradient id="rect11592_2_" gradientUnits="userSpaceOnUse" x1="-194.8071" y1="440.2476" x2="-183.1005" y2="410.2476">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="1" style="stop-color:#D1D1D1"/>\r
+       </linearGradient>\r
+       <path id="rect11592" fill="url(#rect11592_1_)" stroke="url(#rect11592_2_)" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M21.871,8.925h37.807c2.441,0,4.418,1.978,4.418,4.419v54.048c0,2.44-1.977,4.421-4.418,4.421H21.871\r
+               c-2.44,0-4.418-1.98-4.418-4.421V13.344C17.453,10.903,19.431,8.925,21.871,8.925z"/>\r
+       \r
+               <radialGradient id="rect7580_1_" cx="143.7637" cy="-216.5679" r="11.5867" gradientTransform="matrix(2.4079 0 0 -1.8611 -305.3967 -343.9993)" gradientUnits="userSpaceOnUse">\r
+               <stop  offset="0" style="stop-color:#525252"/>\r
+               <stop  offset="1" style="stop-color:#000000"/>\r
+       </radialGradient>\r
+       <linearGradient id="rect7580_2_" gradientUnits="userSpaceOnUse" x1="-183.3022" y1="415.7476" x2="-190.4538" y2="428.128">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="1" style="stop-color:#D1D1D1"/>\r
+       </linearGradient>\r
+       <path id="rect7580" fill="url(#rect7580_1_)" stroke="url(#rect7580_2_)" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M32.526,21.122h17.175c1.689,0,3.061,1.37,3.061,3.06v34.072c0,1.688-1.369,3.061-3.061,3.061H32.526\r
+               c-1.689,0-3.059-1.369-3.059-3.061V24.182C29.467,22.492,30.837,21.122,32.526,21.122z"/>\r
+       <path id="rect7626" fill="#8A8A8A" stroke="#595959" stroke-linejoin="bevel" stroke-miterlimit="10" d="M34.394,50.64h13.17\r
+               c1.127,0,2.039,0.916,2.039,2.041v4.22c0,1.127-0.912,2.039-2.039,2.039h-13.17c-1.127,0-2.04-0.912-2.04-2.039v-4.22\r
+               C32.354,51.556,33.267,50.64,34.394,50.64z"/>\r
+       \r
+               <linearGradient id="rect7594_1_" gradientUnits="userSpaceOnUse" x1="569.3838" y1="-1048.9258" x2="569.3838" y2="-1004.4979" gradientTransform="matrix(1.0592 0 0 -0.8081 -562.1112 -792.4204)">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="0.4602" style="stop-color:#E3E3E3"/>\r
+               <stop  offset="0.6197" style="stop-color:#DADADA;stop-opacity:0.6706"/>\r
+               <stop  offset="1" style="stop-color:#D1D1D1;stop-opacity:0.3429"/>\r
+       </linearGradient>\r
+       <radialGradient id="rect7594_2_" cx="-190.416" cy="419.5854" r="4.4775" gradientUnits="userSpaceOnUse">\r
+               <stop  offset="0" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="0.2159" style="stop-color:#FFFFFF"/>\r
+               <stop  offset="0.5" style="stop-color:#838383"/>\r
+               <stop  offset="1" style="stop-color:#838383;stop-opacity:0"/>\r
+       </radialGradient>\r
+       <path id="rect7594" fill="url(#rect7594_1_)" stroke="url(#rect7594_2_)" stroke-linejoin="bevel" stroke-miterlimit="10" d="\r
+               M34.111,23.747H47.85c0.938,0,1.698,0.761,1.698,1.699v27.006c0,0.938-0.761,1.698-1.698,1.698H34.111\r
+               c-0.939,0-1.699-0.761-1.699-1.698V25.446C32.412,24.508,33.172,23.747,34.111,23.747z"/>\r
+</g>\r
+<text transform="matrix(1 0 0 1 51.543 21.1235)" font-family="'MyriadPro-Regular'" font-size="21.1506">on</text>\r
+</svg>\r
diff --git a/scilab/modules/xcos/images/palettes/SELF_SWITCH.png b/scilab/modules/xcos/images/palettes/SELF_SWITCH.png
new file mode 100644 (file)
index 0000000..7a8c530
Binary files /dev/null and b/scilab/modules/xcos/images/palettes/SELF_SWITCH.png differ
diff --git a/scilab/modules/xcos/images/palettes/SELF_SWITCH_off.png b/scilab/modules/xcos/images/palettes/SELF_SWITCH_off.png
new file mode 100644 (file)
index 0000000..7a8c530
Binary files /dev/null and b/scilab/modules/xcos/images/palettes/SELF_SWITCH_off.png differ
diff --git a/scilab/modules/xcos/images/palettes/SELF_SWITCH_on.png b/scilab/modules/xcos/images/palettes/SELF_SWITCH_on.png
new file mode 100644 (file)
index 0000000..df7f4cc
Binary files /dev/null and b/scilab/modules/xcos/images/palettes/SELF_SWITCH_on.png differ