diff options
author | deva <deva> | 2008-06-04 11:41:46 +0000 |
---|---|---|
committer | deva <deva> | 2008-06-04 11:41:46 +0000 |
commit | dad77becc53e2f2c3b0880ee4fddd97d69099f94 (patch) | |
tree | 9b7889ef626c226632278bb71d690ced4ab823b1 /server/xml/macros/example.xml | |
parent | 294ed0c031072489f520c90e373b2f24aa16ed8c (diff) |
Modulized the template/course/macro system.
Diffstat (limited to 'server/xml/macros/example.xml')
-rw-r--r-- | server/xml/macros/example.xml | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/server/xml/macros/example.xml b/server/xml/macros/example.xml new file mode 100644 index 0000000..ce6e2c0 --- /dev/null +++ b/server/xml/macros/example.xml @@ -0,0 +1,58 @@ +<?xml version='1.0' encoding='UTF-8'?> +<macro name="example" version="1.0" resume="${linse1}${linse2}"> + <queries> + <query class="lensmeter" ttl="10000" automap="true"/> + </queries> + <maps> + <map name="axis"> + -- 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 + </map> + </maps> + <luaprograms> + <luaprogram name="theanswer"> + fisk = getValue('sphere') + if( tonumber(fisk) == tonumber(value) ) + then + setValue('cyl', value) + return true + else + return false + end + </luaprogram> + </luaprograms> + <window name="mainwindow" + caption="Fundus" + width="500" + height="560" + layout="vbox"> + <frame name="linse_frame" caption="Linser:" layout="vbox"> + <frame name="linse_framea" layout="hbox"> + <label name="a" width="300" 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"/> + </frame> + <frame name="linse_framec" layout="hbox"> + <label name="c" width="300" caption="Cyl:"/> + <lineedit name="cyl" 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"/> + </frame> + </window> +</macro> |