summaryrefslogtreecommitdiff
path: root/server/xml/macros/boelgefront-1.0.xml
diff options
context:
space:
mode:
Diffstat (limited to 'server/xml/macros/boelgefront-1.0.xml')
-rw-r--r--server/xml/macros/boelgefront-1.0.xml72
1 files changed, 67 insertions, 5 deletions
diff --git a/server/xml/macros/boelgefront-1.0.xml b/server/xml/macros/boelgefront-1.0.xml
index f198167..7628f41 100644
--- a/server/xml/macros/boelgefront-1.0.xml
+++ b/server/xml/macros/boelgefront-1.0.xml
@@ -1,25 +1,87 @@
<?xml version='1.0' encoding='UTF-8'?>
<macro name="boelgefront" version="1.0">
- <resume language="pracro">Bølgefront: ${boelgefront}</resume>
+ <resume language="lua">
+ out = ''
+ out = out .. 'Bølgefront: ' .. getValue('boelgefront') .. '\n'
+ if ( getValue('boelgefront') == 'Udført' )
+ then
+ out = out .. 'Aberration: ' .. getValue('boelgefront.aberration') .. ' my\n'
+ out = out .. 'Pupilstørrelse: ' .. getValue('boelgefront.pupilstoerrelse') .. ' mm\n'
+ end
+ return out
+ </resume>
<queries>
</queries>
<maps>
</maps>
<scripts>
+ <script language="lua" name="extras_check">
+ if ( getValue('boelgefront') == 'Udført' )
+ then
+ enable('extras')
+ else
+ disable('extras')
+ end
+ return true
+ </script>
+ <script language="lua" name="gt0.1lt0.5">
+ if(value == '')
+ then
+ return false
+ end
+
+ value = string.gsub(value, ',', '.')
+ if(tonumber(value) &gt;= 0.1 and tonumber(value) &lt;= 0.5)
+ then
+ return true
+ else
+ return false
+ end
+ </script>
+ <script language="lua" name="gt2lt9">
+ if(value == '')
+ then
+ return false
+ end
+
+ value = string.gsub(value, ',', '.')
+ if(tonumber(value) &gt;= 2 and tonumber(value) &lt;= 9)
+ then
+ return true
+ else
+ return false
+ end
+ </script>
</scripts>
<widgets caption="Bølgefront" layout="vbox">
- <altcombobox name="boelgefront" value="Ikke udført" layout="vbox">
+ <altcombobox name="boelgefront" value="Ikke udført" layout="vbox" script="extras_check">
<item caption="Udført" value="Udført"/>
<item caption="Ikke udført" value="Ikke udført"/>
- <altitem caption="Andet" value="andet" innerwidget="boelgefront_andet">
+ <altitem caption="Andet" value="andet" innerwidget="boelgefront.andet">
<frame layout="hbox">
<label caption="Andet:"/>
- <lineedit name="boelgefront_andet"/>
+ <lineedit name="boelgefront.andet"/>
</frame>
</altitem>
</altcombobox>
-
+
+ <frame name="extras" layout="hbox">
+ <frame layout="vbox">
+ <label caption="Aberration:"/>
+ <label caption="Pupilstørrelse:"/>
+ </frame>
+ <frame layout="vbox">
+ <lineedit name="boelgefront.aberration" script="gt0.1lt0.5" regexp="\d{1,2},\d{2}"/>
+ <lineedit name="boelgefront.pupilstoerrelse" script="gt2lt9" regexp="\d{1,2},\d{1}"/>
+ </frame>
+ <frame layout="vbox">
+ <label caption="my"/>
+ <label caption="mm"/>
+ </frame>
+ <spacer/>
+ </frame>
+
<frame layout="hbox">
<spacer/>
<button caption="Gem" action="commit"/>