Switch

UI Object for a switch. The switch can be connected to a parameter of a module and will set that parameter to 1 when the switch is on. When the switch off, the parameter is set to 0. Normally, the parameter should initially be set to 0 in the module.

Example XML definition

  <object
    class="Switch" 
    module="MY_MODULE"
    parameter="p"
    x="0"
    y="0" 
  />

Attributes

Attribute Description Default
class must be "Switch"  
title title of the button module.parameter
x placement of the object  
y placement of the object  
w width of the object 1
h height of the object 1
module name of the module where the parameter will be controlled  
parameter name of the paramater to control  
select index of the element of the parameter if array or matrix [0,0]
min value when switch is off 0
max malue when switch is on 1
Attributes without default values must be specified except where described above.

Author

Christian Balkenius
Lund University Cognitive Science
christian.balkenius@lucs.lu.se

Files

Button.js