wiki:rp_xml_ele_number
Last modified 23 months ago Last modified on 06/15/13 03:21:10

<number>

A number object represents a real value with an optional system of units:

  <number id="temperature">
    <about>
      <label>Ambient temperature</label>
      <description>This is the temperature in the environment around the device.</description>
    </about>
    <units>K</units>
    <min>50K</min>
    <max>1000K</max>
    <default>300K</default>
    <preset>
      <value>300K</value>
      <label>300K (room temperature)</label>
    </preset>
    <preset>
      <value>77K</value>
      <label>77K (liquid nitrogen)</label>
    </preset>
  </number>

The <preset> values appear in a drop-down menu controlled by the little triangle button to the right of the number.


  <number id="vsweep">
    <about>
      <label>Voltage Sweep +/-</label>
      <description>This determines the voltage sweep used to obtain results from the model.</description>
      <icon>
R0lGODlhGgASAKEBAAAAAP///////////yH+FUNyZWF0ZWQgd2l0aCBUaGUgR0lNUAAh+QQBCgAB
ACwAAAAAGgASAAACLoyPqcvtD8CRj8VZrYw8h/tRn2eA4Eiaosa1qttC1EmW81qrtbYvdG8DCodE
RQEAOw==
      </icon>
    </about>
    <units>V</units>
    <min>0V</min>
    <max>10V</max>
    <default>4V</default>
    <color>purple</color>
  </number>

The <icon> entry is a base64-encoded GIF file. On Linux systems, use the mimencode program to create this text representation for the GIF image.

You can see working code in the zoo of examples in the number example or on the hub in the directory /apps/rappture/examples/zoo/number.