summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-02-08 12:26:42 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-02-08 12:26:42 (GMT)
commit71a3ca4fd78d7a9cca844e81f29f48b9c36bd4c7 (patch)
tree57a294052ce41ed131f458d4fb083fce3b743ef4 /apps
parent275bf3fd017ca27c021d4c10cc9d3d82fff13922 (diff)
downloaduscxml-71a3ca4fd78d7a9cca844e81f29f48b9c36bd4c7.zip
uscxml-71a3ca4fd78d7a9cca844e81f29f48b9c36bd4c7.tar.gz
uscxml-71a3ca4fd78d7a9cca844e81f29f48b9c36bd4c7.tar.bz2
Fixed history
Diffstat (limited to 'apps')
-rw-r--r--apps/mmi-browser.cpp10
-rw-r--r--apps/samples/vrml-server.scxml46
2 files changed, 53 insertions, 3 deletions
diff --git a/apps/mmi-browser.cpp b/apps/mmi-browser.cpp
index c423871..3ebe153 100644
--- a/apps/mmi-browser.cpp
+++ b/apps/mmi-browser.cpp
@@ -27,6 +27,7 @@ int main(int argc, char** argv) {
printUsageAndExit();
}
+ opterr = 0;
int option;
while ((option = getopt(argc, argv, "l:p:")) != -1) {
switch(option) {
@@ -36,6 +37,8 @@ int main(int argc, char** argv) {
case 'p':
uscxml::Factory::pluginPath = optarg;
break;
+ case '?':
+ break;
default:
printUsageAndExit();
break;
@@ -44,11 +47,12 @@ int main(int argc, char** argv) {
// for (int i = 0; i < argc; i++)
// std::cout << argv[i] << std::endl;
+// std::cout << optind << std::endl;
+
- Factory::getInstance();
-
- Interpreter* interpreter = Interpreter::fromURI(argv[argc - 1]);
+ Interpreter* interpreter = Interpreter::fromURI(argv[optind]);
if (interpreter) {
+ interpreter->setCmdLineOptions(argc, argv);
interpreter->start();
while(interpreter->runOnMainThread(25));
}
diff --git a/apps/samples/vrml-server.scxml b/apps/samples/vrml-server.scxml
new file mode 100644
index 0000000..82560ef
--- /dev/null
+++ b/apps/samples/vrml-server.scxml
@@ -0,0 +1,46 @@
+<scxml datamodel="ecmascript" name="vrml-convert">
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
+ <state id="main">
+ <!-- Stop processing if no vrml-path was given on command line -->
+ <transition target="final" cond="_x['args']['vrml-path'] == undefined || _x['args']['vrml-path'].length == 0">
+ <log expr="'No --vrml-path given'" />
+ </transition>
+
+ <!-- Stop processing if an error occurred -->
+ <transition target="final" event="error">
+ <log expr="'An error occured:'" />
+ <script>dump(_event);</script>
+ </transition>
+
+ <!-- Start the osgconvert invoker to transform 3D files -->
+ <invoke type="osgconvert" id="osgvonvert.osgb">
+ <param name="format" expr="'osgb'" />
+ <param name="destDir" expr="_x['args']['vrml-path'] + '/processed'" />
+ </invoke>
+
+ <!-- Start the directory monitor -->
+ <invoke type="dirmon" id="dirmon.vrml">
+ <param name="dir" expr="_x['args']['vrml-path']" />
+ <param name="recurse" expr="true" />
+ <param name="suffix" expr="'.wrl'" />
+ <param name="reportExisting" expr="true" />
+ <!-- Send every file to the converter -->
+ <finalize>
+ <send target="#_osgvonvert.osgb" event="convert">
+ <param name="file" expr="_event.data.file" />
+ <param name="name" expr="_event.data.file.name" />
+ </send>
+ </finalize>
+ </invoke>
+
+ <!-- Idle here -->
+ <state id="idle">
+ <onentry>
+ <script>
+ dump(_x['args']);
+ </script>
+ </onentry>
+ </state>
+ </state>
+ <state id="final" final="true" />
+</scxml> \ No newline at end of file