Commit 5120fe70 authored by Nathan Bonnemberger's avatar Nathan Bonnemberger
Browse files

ConditionalMqtt began

parent a6948601
16:02:22.743 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation x
16:02:22.774 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation y
16:02:22.774 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation changeX
16:02:22.775 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Disabled for equation SQLTest
16:02:22.951 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation payload
16:02:22.951 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Disabled for equation MQTTTest
16:02:23.055 [AWT-EventQueue-0] WARN EquationSystemBuilder - Not all defined outputs are assigned to an equation!
16:02:23.148 [AWT-EventQueue-0] INFO TangibleObjectManager - Enabled cursor property [true]
16:02:23.148 [AWT-EventQueue-0] INFO TangibleObjectManager - Enabled blobs property [true]
16:02:26.148 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:02:28.520 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:02:33.675 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:02:39.608 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:02:42.033 [Thread-1] INFO MqttExecutor - Parameter -> Payload = wrong
16:02:44.442 [Thread-1] INFO MqttExecutor - Parameter -> Topic = /BaseNode/actuator/strip/fullstrip
16:03:59.307 [Thread-1] ERROR Equation - Error while evaluating script SEND {Payload} TO {Topic}
16:04:02.656 [Thread-1] ERROR Equation - Engine threw an exception java.lang.IllegalStateException: No match available
16:04:02.657 [Thread-1] ERROR Equation - Error while retrieving variable Payload
java.lang.NullPointerException: null
at lu.list.itis.dkd.tui.cps.system.Equation.evaluate(Equation.java:138) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.system.LinearEquationSystem.inputChanged(LinearEquationSystem.java:96) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.notifyInputChangeListeners(Variable.java:284) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.setValue(Variable.java:155) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.variable.TextVariable.setValueFromObject(TextVariable.java:111) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.system.executor.JavascriptExecutor.get(JavascriptExecutor.java:87) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.system.Equation.evaluate(Equation.java:134) [classes/:?]
at lu.list.itis.dkd.tui.cps.system.LinearEquationSystem.inputChanged(LinearEquationSystem.java:96) [classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.notifyInputChangeListeners(Variable.java:284) [classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.setValue(Variable.java:155) [classes/:?]
at lu.list.itis.dkd.tui.widget.PositionWidget.updateFromTranslation(PositionWidget.java:249) [classes/:?]
at lu.list.itis.dkd.tui.widget.PositionWidget.actionMove(PositionWidget.java:160) [classes/:?]
at lu.list.itis.dkd.tui.TangibleObjectManager.updateObject(TangibleObjectManager.java:317) [classes/:?]
at lu.list.itis.dkd.tui.adapter.TuioAdapter.updateTangibleObject(TuioAdapter.java:453) [classes/:?]
at lu.list.itis.dkd.tui.adapter.TuioAdapter.updateTuioObject(TuioAdapter.java:425) [classes/:?]
at TUIO.TuioClient.acceptMessage(TuioClient.java:352) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchMessage(OSCPacketDispatcher.java:73) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchPacket(OSCPacketDispatcher.java:49) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchBundle(OSCPacketDispatcher.java:56) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchPacket(OSCPacketDispatcher.java:40) [tuio-1.5.jar:?]
at com.illposed.osc.OSCPortIn.run(OSCPortIn.java:65) [tuio-1.5.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
16:05:46.867 [Thread-1] INFO MqttExecutor - Parameter -> Payload = wrong
16:05:48.627 [Thread-1] INFO MqttExecutor - Parameter -> Topic = /BaseNode/actuator/strip/fullstrip
16:05:57.556 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:06:54.275 [Thread-1] ERROR Equation - Error while evaluating script SEND {Payload} TO {Topic}
16:06:55.543 [Thread-1] ERROR Equation - Engine threw an exception java.lang.IllegalStateException: No match available
16:06:55.544 [Thread-1] ERROR Equation - Error while retrieving variable Payload
java.lang.NullPointerException: null
at lu.list.itis.dkd.tui.cps.system.Equation.evaluate(Equation.java:138) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.system.LinearEquationSystem.inputChanged(LinearEquationSystem.java:96) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.notifyInputChangeListeners(Variable.java:284) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.setValue(Variable.java:155) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.variable.TextVariable.setValueFromObject(TextVariable.java:111) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.system.executor.JavascriptExecutor.get(JavascriptExecutor.java:87) ~[classes/:?]
at lu.list.itis.dkd.tui.cps.system.Equation.evaluate(Equation.java:134) [classes/:?]
at lu.list.itis.dkd.tui.cps.system.LinearEquationSystem.inputChanged(LinearEquationSystem.java:96) [classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.notifyInputChangeListeners(Variable.java:284) [classes/:?]
at lu.list.itis.dkd.tui.cps.variable.Variable.setValue(Variable.java:155) [classes/:?]
at lu.list.itis.dkd.tui.widget.PositionWidget.updateFromTranslation(PositionWidget.java:249) [classes/:?]
at lu.list.itis.dkd.tui.widget.PositionWidget.actionMove(PositionWidget.java:160) [classes/:?]
at lu.list.itis.dkd.tui.TangibleObjectManager.updateObject(TangibleObjectManager.java:317) [classes/:?]
at lu.list.itis.dkd.tui.adapter.TuioAdapter.updateTangibleObject(TuioAdapter.java:453) [classes/:?]
at lu.list.itis.dkd.tui.adapter.TuioAdapter.updateTuioObject(TuioAdapter.java:425) [classes/:?]
at TUIO.TuioClient.acceptMessage(TuioClient.java:352) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchMessage(OSCPacketDispatcher.java:73) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchPacket(OSCPacketDispatcher.java:49) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchBundle(OSCPacketDispatcher.java:56) [tuio-1.5.jar:?]
at com.illposed.osc.utility.OSCPacketDispatcher.dispatchPacket(OSCPacketDispatcher.java:40) [tuio-1.5.jar:?]
at com.illposed.osc.OSCPortIn.run(OSCPortIn.java:65) [tuio-1.5.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
16:07:03.164 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:07:13.282 [AWT-EventQueue-0] INFO JavascriptExecutor - Result Trigger = true
16:07:13.854 [Thread-1] INFO MqttExecutor - Parameter -> Payload = wrong
16:07:14.697 [Thread-1] INFO MqttExecutor - Parameter -> Topic = /BaseNode/actuator/strip/fullstrip
10:12:20.197 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation x
10:12:20.202 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation y
10:12:20.202 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation changeX
10:12:20.202 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Disabled for equation SQLTest
10:12:20.370 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation mqttX
10:12:20.371 [AWT-EventQueue-0] INFO EquationSystemBuilder - Locking of nested Equations is Enabled for equation mqttY
10:12:20.372 [AWT-EventQueue-0] WARN EquationSystemBuilder - Not all defined outputs are assigned to an equation!
10:12:20.466 [AWT-EventQueue-0] INFO TangibleObjectManager - Enabled cursor property [true]
10:12:20.466 [AWT-EventQueue-0] INFO TangibleObjectManager - Enabled blobs property [true]
......@@ -130,10 +130,22 @@
</variable>
<coronas>
<corona>
<type>Shadow</type>
<type>ConditionalMqtt</type>
<handle>3</handle>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
<drawPriority>278</drawPriority> <!-- needs to be different for each corona -->
<rotateWithHandle>false</rotateWithHandle> <!-- if true it rotates with the object -->
<mqtt>
<broker>tcp://localhost</broker>
<port>1883</port>
<userId>tui</userId>
<payload>right</payload>
<topic>/BaseNode/actuator/strip/fullstrip</topic>
</mqtt>
<triggers>
<trigger>mqttX</trigger> <!-- insert each variable you use for the trigger condition -->
<trigger>mqttY</trigger> <!-- insert each variable you use for the trigger condition -->
</triggers>
<triggerCondition>(mqttX &gt; 0.8) &amp;&amp; (mqttY &gt; 0.7)</triggerCondition> <!-- Condition: &gt; &lt; == != &amp;&amp; -->
</corona>
</coronas>
</object>
......@@ -178,16 +190,16 @@
<!--outputs for MQTT query -->
<output>
<name>Payload</name>
<name>mqttX</name>
<unit></unit>
<type>text</type>
<initial>right</initial>
<type>numeric</type>
<initial>0</initial>
</output>
<output>
<name>mqttResult</name>
<name>mqttY</name>
<unit></unit>
<type></type>
<initial></initial>
<type>numeric</type>
<initial>0</initial>
</output>
</outputs>
......@@ -256,45 +268,41 @@
</results>
</equation>
<!--equations for MQTT query -->
<equation name="payload">
<!-- equations for MQTT -->
<equation>
<name>mqttX</name>
<invoke>mqtt_x + 0</invoke>
<parameters>
<parameter> <!-- copy for each of the variables needed in the equation -->
<name>mqtt</name> <!-- insert variable name -->
<unit></unit> <!-- unit of the variable -->
<parameter>
<name>mqtt</name>
<unit></unit>
<type>spatial</type>
<initial>100,150,200,ScreenCoordinates</initial>
<initial>100,100,100,ScreenCoordinates</initial>
</parameter>
</parameters>
<invoke>(mqtt_x*100 == 600) ? "right" : "wrong"</invoke>
<results>
<result name="Payload"/>
<result>
<name>mqttX</name>
</result>
</results>
</equation>
<!-- MqttExecutor put aside for now, first trying an MqttConditionalCorona -->
<equation name="MQTTTest">
</equation>
<equation>
<name>mqttY</name>
<invoke>mqtt_y + 0</invoke>
<parameters>
<parameter>
<name>Payload</name> <!-- variable holding only x parameter of BuildingID variable -->
<unit></unit>
<type>text</type>
<initial>right</initial>
</parameter>
<parameter>
<name>Topic</name> <!-- variable holding only x parameter of BuildingID variable -->
<name>mqtt</name>
<unit></unit>
<type>text</type>
<initial>/BaseNode/actuator/strip/fullstrip</initial>
<type>spatial</type>
<initial>100,100,100,ScreenCoordinates</initial>
</parameter>
</parameters>
<invoke executor="Mqtt">SEND {Payload} TO {Topic}</invoke>
<results>
<result name="mqttResult"/>
<result>
<name>mqttY</name>
</result>
</results>
</equation>
</equation>
</equations>
</system>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment