summaryrefslogtreecommitdiff
path: root/server/xml/macros/boelgefront-1.0.xml
blob: 7628f41fe867e6e1ccf0135fec6c20d99f6c2191 (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
<?xml version='1.0' encoding='UTF-8'?>
<macro name="boelgefront" version="1.0">
  <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" 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">
	<frame layout="hbox">
	  <label caption="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"/>
    </frame>
  </widgets>
</macro>