From dad77becc53e2f2c3b0880ee4fddd97d69099f94 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 4 Jun 2008 11:41:46 +0000 Subject: Modulized the template/course/macro system. --- server/xml/macros/.cvsignore | 2 ++ server/xml/macros/Makefile.am | 7 ++++++ server/xml/macros/example.xml | 58 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 server/xml/macros/.cvsignore create mode 100644 server/xml/macros/Makefile.am create mode 100644 server/xml/macros/example.xml (limited to 'server/xml/macros') diff --git a/server/xml/macros/.cvsignore b/server/xml/macros/.cvsignore new file mode 100644 index 0000000..3dda729 --- /dev/null +++ b/server/xml/macros/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/server/xml/macros/Makefile.am b/server/xml/macros/Makefile.am new file mode 100644 index 0000000..8056e2a --- /dev/null +++ b/server/xml/macros/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = \ + example.xml + +xmldir = $(datadir)/xml/macros + +xml_DATA = \ + example.xml 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 @@ + + + + + + + + -- LUA program + return math.pi, 1234567890 + + + -- LUA program + right_axis = 0 + if( lensmeter.right.axis ) right_axis = lensmeter.right.axis.value + return right_axis, lensmeter.right.sphere.timestamp + + + -- LUA program + return lensmeter.right.cyl.value, lensmeter.right.cyl.timestamp + + + + + fisk = getValue('sphere') + if( tonumber(fisk) == tonumber(value) ) + then + setValue('cyl', value) + return true + else + return false + end + + + + + +