Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

110 canopeneditor exporting to xdd v10 format sets wrong type on highest sub index supported #111

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Tests/XDDImportExportTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public void TestImportExportArray()
if (od.subobjects[1].PDOtype != PDOMappingType.optional)
throw new Exception("TPDOMappingType.optional not set in EDS for ARRAY");

Assert.True(od.subobjects[0].datatype == DataType.UNSIGNED8, "array subindex 0 datatype is changed");


}
Expand Down
2 changes: 1 addition & 1 deletion libEDSsharp/CanOpenXDD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@

AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].edseditor_extension_notifyonchange = subod.prop.CO_flagsPDO;

if (od.objecttype == ObjectType.ARRAY)
if (od.objecttype == ObjectType.ARRAY && count != 0)
bytes = BitConverter.GetBytes((UInt16)od.datatype);
else
bytes = BitConverter.GetBytes((UInt16)subod.datatype);
Expand Down Expand Up @@ -765,7 +765,7 @@
productID = ApplicationLayers.identity.productID.Value;
}

if (ApplicationLayers.identity.buildDate != null)

Check warning on line 768 in libEDSsharp/CanOpenXDD.cs

View workflow job for this annotation

GitHub Actions / build (net6, Debug)

The result of the expression is always 'true' since a value of type 'DateTime' is never equal to 'null' of type 'DateTime?'

Check warning on line 768 in libEDSsharp/CanOpenXDD.cs

View workflow job for this annotation

GitHub Actions / build (net6, Release)

The result of the expression is always 'true' since a value of type 'DateTime' is never equal to 'null' of type 'DateTime?'
{
buildDate = ApplicationLayers.identity.buildDate;
}
Expand Down
Loading