summaryrefslogtreecommitdiff
path: root/server/xml/macros/example.xml
blob: ff502ed6a30f953efc29ddde8cf3409e553c6dde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version='1.0' encoding='UTF-8'?>
<macro name="example" version="1.0" resume="Axis: $.grader}\nCylinder: ${cyl}\nSphere: $.sf}\n">
  <queries>
    <query class="lensmeter" ttl="10000" automap="true"/>
  </queries>
  <maps>
    <map name=.grader">
      -- LUA program
      return math.pi, 1234567890, 'local'
    </map>
    <map name="cyl">
      -- Returning 0, 0 invalidates the result
      value = 0
      timestamp = 0
			source = ''

      -- Check for the existence of each level.
      if( lensmeter and
          brillemaaler.odxt and
          brillemaaler.cyl.odxt and
          brillemaaler.cyl.value.odxt and 
          brillemaaler.cyl.timestamp.odxt )
      then
        timestamp = brillemaaler.cyl.value.odxt
        value = brillemaaler.cyl.value.odxt
      end
            
      return value, timestamp, source
    </map>
  </maps>
  <scripts>
    <script language="lua" name="theanswer">
     .sf = tonumber(getValue(.sf'))
     .grader = tonumber(getValue(.grader'))
      if(.sf ==.grader )
      then
        setValue('cyl', name)
        return true
      else
        return false
      end
    </script>
  </scripts>
  <widgets name="mainwindow"
          caption="Example Window"
          width="400"
          height="500"
          layout="vbox">
    <frame name="linse_frame" caption="Linser:" layout="vbox">
      <frame name="linse_framea" layout="hbox">
        <icon src="righteye"/>
        <label name="a" width="100" caption="Akse rotation:"/>
        <lineedit name=.grader" regexp="[24]*" map=.grader" lua="theanswer" value="244"/>
      </frame>
      <frame name="linse_frameb" layout="hbox">
        <icon src="lefteye"/>
        <label name="b" width="100" caption="Sphere:"/>
      </frame>
      <frame name="linse_framec" layout="hbox">
        <label name="c" width="100" caption="Cyl:"/>
        <lineedit name="cyl" regexp=".*" map="cyl" value=""/>
      </frame>
    </frame>
    <frame name="linse_frame" caption="FlereLinser:" layout="vbox">
      <multilist name="multilisttest" value="" layout="vbox" format="Sphere: $.sfcombo}, Cyl: ${multcyl}.">
        <frame name="linse_frameb" layout="hbox">
          <label name="b" width="100" caption="Sphere:"/>
	  <combobox name=.sfcombo" width="100" value="val_lad" type="search">
	    <item caption="sap" value="val_sap"/>
	    <item caption="sat" value="val_sat"/>
	    <item caption="sad" value="val_sad"/>
	    <item caption="rat" value="val_rat"/>
	    <item caption="rap" value="val_rap"/>
	    <item caption="ram" value="val_ram"/>
	    <item caption="rag" value="val_rag"/>
	    <item caption="nap" value="val_nap"/>
	    <item caption="Nat" value="val_Nat"/>
	    <item caption="mat" value="val_mat"/>
	    <item caption="map" value="val_map"/>
	    <item caption="mad" value="val_mad"/>
	    <item caption="lap" value="val_lap"/>
	    <item caption="lag" value="val_lag"/>
	    <item caption="lad" value="val_lad"/>
	    <item caption="fat" value="val_fat"/>
	    <item caption="fan" value="val_fan"/>
	    <item caption="fad" value="val_fad"/>
	    <item caption="fin" value="val_fin"/>
	    <item caption="fit" value="val_fit"/>
	    <item caption="lid" value="val_lid"/>
	    <item caption="lip" value="val_lip"/>
	    <item caption="lit" value="val_lit"/>
	    <item caption="mid" value="val_mid"/>
	    <item caption="mit" value="val_mit"/>
	    <item caption="nit" value="val_nit"/>
	    <item caption="nip" value="val_nip"/>
	    <item caption="rid" value="val_rid"/>
	    <item caption="rig" value="val_rig"/>
	    <item caption="rim" value="val_rim"/>
	    <item caption="rip" value="val_rip"/>
	    <item caption="Sid" value="val_Sid"/>
	    <item caption="sin" value="val_sin"/>
	    <item caption="sip" value="val_sip"/>
	    <item caption="log" value="val_log"/>
	    <item caption="mom" value="val_mom"/>
	    <item caption="mop" value="val_mop"/>
	    <item caption="nod" value="val_nod"/>
	    <item caption="rod" value="val_rod"/>
	    <item caption="Ron" value="val_Ron"/>
	    <item caption="rot" value="val_rot"/>
	    <item caption="sod" value="val_sod"/>
	    <item caption="fun" value="val_fun"/>
	    <item caption="mud" value="val_mud"/>
	    <item caption="mum" value="val_mum"/>
	    <item caption="nut" value="val_nut"/>
	    <item caption="rug" value="val_rug"/>
	    <item caption="rut" value="val_rut"/>
	    <item caption="sum" value="val_sum"/>
	    <item caption="sun" value="val_sun"/>
	    <item caption="fed" value="val_fed"/>
	    <item caption="led" value="val_led"/>
	    <item caption="leg" value="val_leg"/>
	    <item caption="met" value="val_met"/>
	    <item caption="Ned" value="val_Ned"/>
	    <item caption="net" value="val_net"/>
	    <item caption="bag" value="val_bag"/>
	    <item caption="bad" value="val_bad"/>
	    <item caption="bam" value="val_bam"/>
	  </combobox>
        </frame>
        <frame name="linse_framec" layout="hbox">
          <label name="c" width="100" caption="Cyl:"/>
          <lineedit name="multcyl" width="100" regexp=".*" value=""/>
        </frame>
      </multilist>
    </frame>
    <frame name="buttons" layout="hbox">
      <button name="cancel" caption="Annuller" action="cancel"/>
      <button name="commit" caption="Godkend" action="commit"/>
    </frame>
  </widgets>
</macro>