]> rtime.felk.cvut.cz Git - CanFestival-3.git/blobdiff - objdictgen/nodemanager.py
Remove deletion PDO when mapping undefined in export to EDS
[CanFestival-3.git] / objdictgen / nodemanager.py
index 2b29882c08448a14cced9b95286afe4ab54a1901..bbac2b1696c5aecb4c02ad925be8461addc76573 100755 (executable)
@@ -677,7 +677,7 @@ class NodeManager:
             if name == "value":
                 if editor == "map":
                     value = node.GetMapValue(value)
-                    if value:
+                    if value is not None:
                         node.SetEntry(index, subIndex, value)
                 elif editor == "bool":
                     value = value == "True"
@@ -1027,7 +1027,7 @@ class NodeManager:
             editors = []
             values = node.GetEntry(index, compute = False)
             params = node.GetParamsEntry(index)
-            if type(values) == ListType:
+            if isinstance(values, ListType):
                 for i, value in enumerate(values):
                     data.append({"value" : value})
                     data[-1].update(params[i])      
@@ -1042,7 +1042,7 @@ class NodeManager:
                 dic["access"] = AccessType[infos["access"]]
                 dic["save"] = OptionType[dic["save"]]
                 editor = {"subindex" : None, "save" : "option", "callback" : "option", "comment" : "string"}
-                if type(values) == ListType and i == 0:
+                if isinstance(values, ListType) and i == 0:
                     editor["name"] = None
                     editor["type"] = None
                     if 0x1600 <= index <= 0x17FF or 0x1A00 <= index <= 0x1C00: