Fixed import and export of EDS files
authorLaurent Bessard
Wed, 06 Mar 2013 23:50:35 +0100
changeset 776 30ced15f996f
parent 775 c8df14b3a388
child 777 bbbfd27c1bd1
child 778 9edaa9d21cf9
Fixed import and export of EDS files
objdictgen/eds_utils.py
--- a/objdictgen/eds_utils.py	Wed Mar 06 23:22:36 2013 +0100
+++ b/objdictgen/eds_utils.py	Wed Mar 06 23:50:35 2013 +0100
@@ -92,10 +92,10 @@
 def GetDefaultValue(Node, index, subIndex = None):
     infos = Node.GetEntryInfos(index)
     if infos["struct"] & node.OD_MultipleSubindexes:
-        # First case entry is a record
+        # First case entry is a array
         if infos["struct"] & node.OD_IdenticalSubindexes:
             subentry_infos = Node.GetSubentryInfos(index, 1)
-        # Second case entry is an array
+        # Second case entry is an record
         else:
             subentry_infos = Node.GetSubentryInfos(index, subIndex)
         # If a default value is defined for this subindex, returns it
@@ -323,7 +323,7 @@
                 # verify that there is no whitespace into keyname
                 if keyname.isalnum():
                     # value can be preceded and followed by whitespaces, so we escape them
-                    value = value.strip().replace(" ", "")
+                    value = value.strip()
                     # First case, value starts with "$NODEID", then it's a formula
                     if value.upper().startswith("$NODEID"):
                         try:
@@ -548,9 +548,9 @@
             # Generate EDS informations for the entry
             text += "ParameterName=%s\n"%entry_infos["name"]
             if entry_infos["struct"] & node.OD_IdenticalSubindexes:
+                text += "ObjectType=0x8\n"
+            else:
                 text += "ObjectType=0x9\n"
-            else:
-                text += "ObjectType=0x8\n"
             
             # Generate EDS informations for subindexes of the entry in a separate text
             subtext = ""