Skip to content

Commit 0c11e50

Browse files
When loading eds files the parent object will not have the datatype set. Its really useful having this set for arrays internally so we known what the array is without walking subobjects
1 parent b9ddfa0 commit 0c11e50

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎libEDSsharp/Bridge.cs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ public Device convert(EDSsharp eds)
9595
}
9696
}
9797

98+
if (od.objecttype == ObjectType.ARRAY && od.datatype == DataType.UNKNOWN)
99+
{
100+
//add the datatype field to parent objects if they don't have it already
101+
//if the 2nd subobject does not exist then we do nothing.
102+
ODentry sub = od.getsubobject(1);
103+
if (sub != null)
104+
{
105+
od.datatype = sub.datatype;
106+
}
107+
108+
109+
}
110+
98111
dev.CANopenObjectList.CANopenObject.Add(coo);
99112
}
100113

0 commit comments

Comments
 (0)