diff options
Diffstat (limited to 'server/xml/macros')
-rw-r--r-- | server/xml/macros/example.xml | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/server/xml/macros/example.xml b/server/xml/macros/example.xml index ce6e2c0..635dea2 100644 --- a/server/xml/macros/example.xml +++ b/server/xml/macros/example.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='UTF-8'?> -<macro name="example" version="1.0" resume="${linse1}${linse2}"> +<macro name="example" version="1.0" resume="Axis: ${axis}\nCylinder: ${cyl}\nSphere: ${sphere}\n"> <queries> <query class="lensmeter" ttl="10000" automap="true"/> </queries> @@ -8,12 +8,6 @@ -- LUA program return math.pi, 1234567890 </map> - <map name="right.axis" uses="lensmeter, lensmeter.right.axis"> - -- LUA program - right_axis = 0 - if( lensmeter.right.axis ) right_axis = lensmeter.right.axis.value - return right_axis, lensmeter.right.sphere.timestamp - </map> <map name="cyl"> -- LUA program return lensmeter.right.cyl.value, lensmeter.right.cyl.timestamp @@ -21,10 +15,11 @@ </maps> <luaprograms> <luaprogram name="theanswer"> - fisk = getValue('sphere') - if( tonumber(fisk) == tonumber(value) ) + sphere = tonumber(getValue('sphere')) + axis = tonumber(getValue('axis')) + if( sphere == axis ) then - setValue('cyl', value) + setValue('cyl', name) return true else return false @@ -32,24 +27,38 @@ </luaprogram> </luaprograms> <window name="mainwindow" - caption="Fundus" - width="500" - height="560" + caption="Example Window" + width="300" + height="400" layout="vbox"> <frame name="linse_frame" caption="Linser:" layout="vbox"> <frame name="linse_framea" layout="hbox"> - <label name="a" width="300" caption="Akse rotation:"/> + <label name="a" width="100" caption="Akse rotation:"/> <lineedit name="axis" regexp="[24]*" map="axis" lua="theanswer" value="244"/> </frame> <frame name="linse_frameb" layout="hbox"> - <label name="b" width="300" caption="Sphere:"/> - <lineedit name="sphere" regexp="[24]*" map="sphere" value="42"/> + <label name="b" width="100" caption="Sphere:"/> + <lineedit name="sphere" regexp="[24]*" lua="theanswer" value="42"/> </frame> <frame name="linse_framec" layout="hbox"> - <label name="c" width="300" caption="Cyl:"/> + <label name="c" width="100" caption="Cyl:"/> <lineedit name="cyl" regexp="[24]*" map="cyl" value=""/> </frame> </frame> + <frame name="linse_frame" caption="FlereLinser:" layout="vbox"> + <frame name="linse_framea" layout="hbox"> + <label name="a" width="100" caption="Akse rotation2:"/> + <lineedit name="axis2" regexp="[24]*" map="axis" lua="theanswer" value="244"/> + </frame> + <frame name="linse_frameb" layout="hbox"> + <label name="b" width="100" caption="Sphere2:"/> + <lineedit name="sphere2" regexp="[24]*" lua="theanswer" value="42"/> + </frame> + <frame name="linse_framec" layout="hbox"> + <label name="c" width="100" caption="Cyl2:"/> + <lineedit name="cyl2" regexp="[24]*" map="cyl" value=""/> + </frame> + </frame> <frame name="buttons" layout="hbox"> <button name="cancel" caption="Annuller" action="cancel"/> <button name="commit" caption="Godkend" action="commit"/> |