Closed cristi-neagu closed 6 years ago
Hi, Dupmicate names should happen in case of unsorted data but it should be avoided by line 223 in mdfinfo3. Something went wrong there, key 'ChannelNamesByDG' might be wrong, can you check ?
Hello,
Good call. The signal in question has a long name (41 characters). As such, signalName
and self['CNBlock'][dg][cg][channel]['signalName']
are not the same, since the first contains the long name (from line 209), and the latter has the short name. In line 221 you are checking for what basically is the short name in self['ChannelNamesByDG'][dg]
, but with line 230 you effectively put the long name in that list. As such, the check on line 221 you will always return False
. Line 224 will pick up the duplicate, will append the dg number to it, and move on. This will catch situations with two duplicates, but not situations with more than two duplicates, such as in my case.
So, basically, this is the order of events, keeping in mind that self['CNBlock'][dg][cg][channel]['signalName']
contains the short name, and signalName
contains the long name:
False
False
self['ChannelNamesByDG'][dg]
and in self['allChannelList']
False
, because that list contains the long nameTrue
, because we're checking the long name, and the dg
number is appendeddg
to the listsThe last 3 lines repeat for every other occurrence, leading to multiple channels with the same name, with the dg
attached.
Seems like the solution is to use signalName
instead of self['CNBlock'][dg][cg][channel]['signalName']
Hi, Thanks for the investigation, very clear and you are right. I corrected it I think according to your proposal in last commit, you can check it.
Hello,
Works now. No errors during file load and channels are getting the correct termination.
Thanks!
Hello,
mdfinfo3.readCGBlock
handles duplicate channel names by appending the datagroup number to their name. But if the duplicates are all inside the same datagroup, this causes an error inmdf3reader.readSortedRecord
when creating the recarray, due to duplicate names (Value Error: name already used as a name or title
).Unfortunately, i cannot share the mdf file that causes this issue, but i can investigate further, if needed.