Commit a6948601 authored by Nathan Bonnemberger's avatar Nathan Bonnemberger
Browse files

MQTTExecutor: bugged, need adjustment for script eval (?)

parent 74f61020
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,6 +36,7 @@ executor.class = lu.list.itis.dkd.tui.cps.system.executor.JavascriptExecutor
numeric.variable.class = lu.list.itis.dkd.tui.cps.variable.tangible.TangibleNumericalVariable
logic.variable.class = lu.list.itis.dkd.tui.cps.variable.BooleanVariable
spatial.variable.class = lu.list.itis.dkd.tui.cps.variable.SpatialVariable
text.variable.class = lu.list.itis.dkd.tui.cps.variable.TextVariable
# Properties for the Database
sql.connection.url=jdbc:postgresql://localhost/nathan
......
......@@ -9,6 +9,7 @@
</scene>
</scenes>
<objects>
<!-- PositionWidget object -->
<object>
<type>PositionWidget</type>
<name>Placement</name>
......@@ -54,6 +55,8 @@
</corona>
</coronas>
</object>
<!-- SQL object -->
<object>
<type>PositionWidget</type>
<name>SQL</name>
......@@ -98,11 +101,48 @@
</corona>
</coronas>
</object>
<!-- MQTT object -->
<object>
<type>PositionWidget</type>
<name>MQTT</name>
<scaleX>1.0</scaleX>
<scaleY>1.0</scaleY>
<stepXSize>0.1</stepXSize>
<stepYSize>0.1</stepYSize>
<modifyValueOnTranslation>true</modifyValueOnTranslation>
<leftMostBound>0.0</leftMostBound>
<rightMostBound>1.0</rightMostBound>
<downMostBound>1.0</downMostBound>
<upMostBound>0.0</upMostBound>
<handles>
<handle>3</handle>
</handles>
<variable>
<name>mqtt</name>
<type>spatial</type>
<position>
<x>0</x>
<y>0</y>
<z>0</z>
<state>CameraCoordinates</state>
</position>
</variable>
<coronas>
<corona>
<type>Shadow</type>
<handle>3</handle>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
</corona>
</coronas>
</object>
</objects>
<!-- ##### EQUATIONS ######################################################### -->
<system>
<outputs>
<!--outputs for PositionWidget -->
<output> <!-- copy for each of the output variables -->
<name>x</name> <!-- insert output variable name -->
<unit></unit> <!-- unit of the output variable -->
......@@ -115,6 +155,8 @@
<type>numeric</type>
<initial>0</initial>
</output>
<!--outputs for SQL query -->
<output>
<name>Building</name> <!-- result of SQL query -->
<unit></unit>
......@@ -133,8 +175,24 @@
<type>numeric</type>
<initial>0</initial>
</output>
<!--outputs for MQTT query -->
<output>
<name>Payload</name>
<unit></unit>
<type>text</type>
<initial>right</initial>
</output>
<output>
<name>mqttResult</name>
<unit></unit>
<type></type>
<initial></initial>
</output>
</outputs>
<equations>
<!--equations for position query -->
<equation> <!-- copy for each equation -->
<name>x</name> <!-- name of the equation -->
<invoke>pos_x + 0</invoke> <!-- equation -->
......@@ -169,6 +227,8 @@
</result>
</results>
</equation>
<!--equations for SQL query -->
<equation>
<name>changeX</name>
<invoke>BuildingID_x + 0</invoke>
......@@ -195,11 +255,45 @@
<result name="Building" equate="id"/>
</results>
</equation>
<!--equations for MQTT query -->
<equation name="payload">
<parameters>
<parameter> <!-- copy for each of the variables needed in the equation -->
<name>mqtt</name> <!-- insert variable name -->
<unit></unit> <!-- unit of the variable -->
<type>spatial</type>
<initial>100,150,200,ScreenCoordinates</initial>
</parameter>
</parameters>
<invoke>(mqtt_x*100 == 600) ? "right" : "wrong"</invoke>
<results>
<result name="Payload"/>
</results>
</equation>
<!-- MqttExecutor put aside for now, first trying an MqttConditionalCorona -->
<equation name="MQTTTest">
<parameters>
<parameter name="Building"/>
<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 -->
<unit></unit>
<type>text</type>
<initial>/BaseNode/actuator/strip/fullstrip</initial>
</parameter>
</parameters>
<invoke executor="Mqtt">SEND {Payload} TO {Topic}</invoke>
<results>
<result name="mqttResult"/>
</results>
</equation>
</equations>
......
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