diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-29 09:52:14 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-29 09:52:14 (GMT) |
commit | 442204d0f510cb033cb75a542b010f4f90cbd2a3 (patch) | |
tree | a243159f780aa77d53d2523a0dea7a365613ae21 /test | |
parent | afda86c8ba1f2ce3dc89a56bf9bccc62c52ff240 (diff) | |
download | uscxml-442204d0f510cb033cb75a542b010f4f90cbd2a3.zip uscxml-442204d0f510cb033cb75a542b010f4f90cbd2a3.tar.gz uscxml-442204d0f510cb033cb75a542b010f4f90cbd2a3.tar.bz2 |
Some bug-fixes and enhancements to build-process
Diffstat (limited to 'test')
-rw-r--r-- | test/samples/uscxml/applications/SpatialMapTicker.java | 8 | ||||
-rw-r--r-- | test/samples/uscxml/applications/click.wav | bin | 0 -> 5058 bytes | |||
-rw-r--r-- | test/samples/uscxml/applications/spoken-map-ticker.scxml | 39 | ||||
-rw-r--r-- | test/samples/uscxml/applications/spoken-map-ticker.xhtml | 8 | ||||
-rw-r--r-- | test/samples/uscxml/test-performance.scxml | 2 | ||||
-rw-r--r-- | test/samples/uscxml/test-spatial-audio.scxml | 15 |
6 files changed, 47 insertions, 25 deletions
diff --git a/test/samples/uscxml/applications/SpatialMapTicker.java b/test/samples/uscxml/applications/SpatialMapTicker.java index 5ccb0a2..8d2a5f1 100644 --- a/test/samples/uscxml/applications/SpatialMapTicker.java +++ b/test/samples/uscxml/applications/SpatialMapTicker.java @@ -109,10 +109,10 @@ public class SpatialMapTicker { private void run() { messages.add(new SensorMessage("Oil pressure threshold exceeded")); - messages.add(new SensorMessage("Error #245 in diagnostics unit")); + messages.add(new SensorMessage("Equipment is on fire")); messages.add(new SensorMessage("Error #32 in diagnostics unit")); - messages.add(new SensorMessage("Error #81 in diagnostics unit")); - messages.add(new SensorMessage("Error #15 in diagnostics unit")); + messages.add(new SensorMessage("Unauthorized startup")); + messages.add(new SensorMessage("Tire pressure too low")); messages.add(new SensorMessage("Error #145 in diagnostics unit")); messages.add(new SensorMessage("Unit was moved out of construction site area")); messages.add(new SensorMessage("Hydraulic pressure exceeding safety limits")); @@ -122,7 +122,7 @@ public class SpatialMapTicker { while (true) { try { - Thread.sleep((long) (Math.random() * 1000) + 200); + Thread.sleep((long) (Math.random() * 300) + 100); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/test/samples/uscxml/applications/click.wav b/test/samples/uscxml/applications/click.wav Binary files differnew file mode 100644 index 0000000..e11b0b7 --- /dev/null +++ b/test/samples/uscxml/applications/click.wav diff --git a/test/samples/uscxml/applications/spoken-map-ticker.scxml b/test/samples/uscxml/applications/spoken-map-ticker.scxml index 926cd6c..5a1c0b2 100644 --- a/test/samples/uscxml/applications/spoken-map-ticker.scxml +++ b/test/samples/uscxml/applications/spoken-map-ticker.scxml @@ -1,4 +1,4 @@ -<scxml datamodel="ecmascript" name="comet-test" +<scxml datamodel="ecmascript" name="mapticker" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:vxml="http://www.w3.org/2001/vxml" xmlns="http://www.w3.org/2005/07/scxml"> @@ -6,6 +6,9 @@ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" /> <state id="start"> + <!-- + Invoke an external HTML browser + --> <invoke type="xhtml" id="xhtml1"> <content src="spoken-map-ticker.xhtml" /> <finalize> @@ -13,42 +16,52 @@ </finalize> </invoke> + <!-- + Invoke a VoiceXML browser + --> <invoke type="vxml" id="vxml" /> + <!-- + Invoke a uMundo component for pub/sub ticker subscription + --> <invoke type="umundo" id="umundo"> <param name="channel" expr="'map/tick'" /> <finalize> - <script>dump(_event);</script> + <!-- <script>dump(_event);</script> --> </finalize> </invoke> - <invoke type="openal" id="audio"> - <!-- <param name="maxX" expr="180" /> - <param name="maxY" expr="18" /> - <param name="maxZ" expr="85" /> --> - </invoke> + <invoke type="openal" id="audio"></invoke> <state id="idle"> - <transition target="idle" event="map.center"> + <!-- + Map in XHTML invoker was moved -> update OpenAL listener position + --> + <transition event="map.center" target="idle"> <send event="move.listener" target="#_audio"> <param name="x" expr="_event.data.lon" /> - <param name="y" expr="18 - _event.data.zoom" /> - <!-- <param name="y" expr="0" /> --> + <param name="y" expr="1" /> <param name="z" expr="_event.data.lat" /> - </send> </transition> + + <!-- + Ticker message was received + -> Send to XHTML invoker to display + -> Play clicking noise from respective direction + -> Speak content if severity exceeds a given threshold + --> <transition target="idle" event="umundo.rcvd"> <send target="#_xhtml1"> <content>${_event.data}</content> </send> <send target="#_audio" event="play" delay="0ms"> - <param name="src" expr="'../audio/click.wav'" /> + <param name="src" expr="'click.wav'" /> <param name="x" expr="_event.data.lon" /> <param name="y" expr="0" /> <param name="z" expr="_event.data.lat" /> </send> - + <if cond="_event.data.message && _event.data.severity > 8"> <send target="#_vxml"> <content> diff --git a/test/samples/uscxml/applications/spoken-map-ticker.xhtml b/test/samples/uscxml/applications/spoken-map-ticker.xhtml index 98df9ea..ace8724 100644 --- a/test/samples/uscxml/applications/spoken-map-ticker.xhtml +++ b/test/samples/uscxml/applications/spoken-map-ticker.xhtml @@ -68,7 +68,7 @@ markers[message.id].feature.popupContentHTML = "<h3>" + message.id + "</h3>" + message.html; } - if (message.lastMsg && message.lastMsg.length > 0) { + if (message.message && message.message.length > 0) { var messageDiv = $("#message")[0]; if (message.timeStamp > lastUpdateTime + 3000) { var timeRuler = document.createElement("div"); @@ -82,7 +82,11 @@ console.log(lastUpdateTime); var messagePara = document.createElement("p"); - messagePara.innerHTML += message.lastMsg; // + messageDiv.innerHTML; + if (message.severity > 7) { + messagePara.setAttribute("style", "color:red; font-weight:bold;"); + } + messagePara.innerHTML += message.message; // + messageDiv.innerHTML; + messageDiv.appendChild(messagePara); messagePara.addEventListener("mousedown", function() { var marker = markers[message.id].marker; diff --git a/test/samples/uscxml/test-performance.scxml b/test/samples/uscxml/test-performance.scxml index 4d2d4c4..a102a18 100644 --- a/test/samples/uscxml/test-performance.scxml +++ b/test/samples/uscxml/test-performance.scxml @@ -1,6 +1,6 @@ <scxml datamodel="ecmascript"> <datamodel> - <data id="iterations">10000</data> + <data id="iterations">1000</data> </datamodel> <state id="start"> <transition target="loop" /> diff --git a/test/samples/uscxml/test-spatial-audio.scxml b/test/samples/uscxml/test-spatial-audio.scxml index d960533..66d06f4 100644 --- a/test/samples/uscxml/test-spatial-audio.scxml +++ b/test/samples/uscxml/test-spatial-audio.scxml @@ -17,7 +17,7 @@ <initial> <transition target="ready" /> </initial> - <invoke type="http://www.smartvortex.eu/mmi/spatial-audio/" src="audio/click.wav" id="spatial-audio.id1"> + <invoke type="openal" id="spatial-audio.id1"> <!-- Explicitly set the start position of an audio source. Keep in mind that the coordinate system is the same as in OpenGL: @@ -31,7 +31,7 @@ <param name="y" expr="0" /> <param name="z" expr="0" /> </invoke> - <invoke type="http://www.smartvortex.eu/mmi/spatial-audio/" src="audio/click.wav" id="spatial-audio.id2"> + <invoke type="openal" id="spatial-audio.id2"> <!-- Set position on a circle. Unit for circle is "deg" in clockwise order with 0 being directly in front, @@ -44,7 +44,9 @@ <state id="ready"> <onentry> <!-- trigger transition in 1 second --> - <send event="spatial-audio.play" delay="1s" /> + <send event="spatial-audio.play" delay="1s"> + <param name="src" expr="'audio/click.wav'" /> + </send> <log expr="'Ready'" /> </onentry> <transition target="click" event="spatial-audio.play" /> @@ -52,15 +54,18 @@ </state> <state id="click"> <onentry> - <send target="#_spatial-audio.id1" event="play" delay="0ms" /> + <send target="#_spatial-audio.id1" event="play"> + <param name="src" expr="'audio/click.wav'" /> + </send> <!-- move position of audio 2 in a circle --> <send target="#_spatial-audio.id2" event="play" delay="200ms"> + <param name="src" expr="'audio/click.wav'" /> <param name="circle" expr="spatialAudio.id2.degree + 'deg'" /> </send> <log expr="'Clicking'" /> - <script>spatialAudio.id2.degree += 10;</script> + <script>spatialAudio.id2.degree += 90;</script> </onentry> <transition target="ready" /> </state> |