@@ -335,14 +335,14 @@ def AddSubentriesToCurrent(self, index, number, node=None):
335335 default = subentry_infos ["default" ]
336336 else :
337337 default = self .GetTypeDefaultValue (subentry_infos ["type" ])
338- # First case entry is record
338+ # First case entry is array
339339 if infos ["struct" ] & OD .IdenticalSubindexes :
340340 for i in range (1 , min (number , subentry_infos ["nbmax" ] - length ) + 1 ):
341341 node .AddEntry (index , length + i , default )
342342 if not disable_buffer :
343343 self .BufferCurrentNode ()
344344 return
345- # Second case entry is array, only possible for manufacturer specific
345+ # Second case entry is record (and array) , only possible for manufacturer specific
346346 if infos ["struct" ] & OD .MultipleSubindexes and 0x2000 <= index <= 0x5FFF :
347347 values = {"name" : "Undefined" , "type" : 5 , "access" : "rw" , "pdo" : True }
348348 for i in range (1 , min (number , 0xFE - length ) + 1 ):
@@ -363,8 +363,8 @@ def RemoveSubentriesFromCurrent(self, index, number):
363363 nbmin = infos ["nbmin" ]
364364 else :
365365 nbmin = 1
366- # Entry is a record , or is an array of manufacturer specific
367- if infos ["struct" ] & OD .IdenticalSubindexes or 0x2000 <= index <= 0x5FFF and infos ["struct" ] & OD .IdenticalSubindexes :
366+ # Entry is an array , or is an array/record of manufacturer specific
367+ if infos ["struct" ] & OD .IdenticalSubindexes or 0x2000 <= index <= 0x5FFF and infos ["struct" ] & OD .MultipleSubindexes :
368368 for i in range (min (number , length - nbmin )):
369369 self .RemoveCurrentVariable (index , length - i )
370370 self .BufferCurrentNode ()
@@ -1043,10 +1043,14 @@ def GetNodeEntryValues(self, node, index):
10431043 dic ["buffer_size" ] = ""
10441044 try :
10451045 fmt = "0x%0" + str (int (values [1 ]) // 4 ) + "X"
1046- dic ["value" ] = fmt % dic ["value" ]
10471046 except ValueError as exc :
10481047 log .debug ("ValueError: '%s': %s" % (values [1 ], exc ))
10491048 raise # FIXME: Originial code swallows exception
1049+ try :
1050+ dic ["value" ] = fmt % dic ["value" ]
1051+ except TypeError as exc :
1052+ log .debug ("ValueError: '%s': %s" % (dic ["value" ], exc ))
1053+ pass # FIXME: dict["value"] can contain $NODEID for PDOs which is not an int i.e. $NODEID+0x200
10501054 editor ["value" ] = "string"
10511055 if values [0 ] == "INTEGER" :
10521056 editor ["value" ] = "number"
0 commit comments