mqtt/client.py
changeset 4010 3779356cca8f
parent 4009 51272fe96999
child 4012 6337c9c2c379
--- a/mqtt/client.py	Fri Aug 30 11:54:36 2024 +0200
+++ b/mqtt/client.py	Fri Aug 30 15:17:03 2024 +0200
@@ -29,7 +29,11 @@
         self.Controler.GetCTRoot().logger.write(msg)
 
     def CreateMQTTClient_UI(self, parent):
-        return MQTTClientPanel(parent, self.Controler.GetModelData(), self.Log, self.Controler.GetConfig)
+        return MQTTClientPanel(
+            parent,
+            self.Controler.GetModelData(),
+            self.Log,
+            self.Controler.GetTypes)
 
 class MQTTClient(object):
     XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
@@ -86,6 +90,10 @@
     def GetModelData(self):
         return self.modeldata
 
+    def GetTypes(self):
+        datatype_candidates = self.GetCTRoot().GetDataTypes()
+        return datatype_candidates
+
     def GetConfig(self):
         def cfg(path): 
             try:
@@ -194,3 +202,9 @@
                 "location": ".".join([str(i) for i in current_location]) + ".x",
                 "children": children}
 
+
+    def CTNGlobalInstances(self):
+        location_str = "_".join(map(str, self.GetCurrentLocation()))
+        return [("MQTT_HAPPY_"+location_str, "DINT", "")]
+
+