Skip to content

Commit e63ed44

Browse files
Improvements to denotation handling in XDD
1 parent c97e4ec commit e63ed44

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎libEDSsharp/CanOpenXDD.cs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ public void fillparamater(parameter p, ODentry od)
9292
lab.Value = od.parameter_name;
9393
p.Items[0] = lab;
9494

95-
//fixme we need to extract the denotation from the ODentry
96-
//this is just an empty place holder
95+
96+
//FIXME we are currently writing the denotation value to both the object and the parameterList section
97+
//i'm not sure why two exist
98+
9799
denotation denot = new denotation();
98100
vendorTextLabel lab2 = new vendorTextLabel();
99101
lab2.lang = "en";
@@ -378,6 +380,8 @@ public ISO15745ProfileContainer convert(EDSsharp eds)
378380
AppLayer.CANopenObjectList.CANopenObject[count].accessType = (CANopenObjectListCANopenObjectAccessType)Enum.Parse(typeof(CANopenObjectListCANopenObjectAccessType), accesstype.ToString());
379381
AppLayer.CANopenObjectList.CANopenObject[count].accessTypeSpecified = true;
380382

383+
AppLayer.CANopenObjectList.CANopenObject[count].denotation = od.denotation;
384+
381385
if (od.subobjects != null && od.subobjects.Count > 0)
382386
{
383387
AppLayer.CANopenObjectList.CANopenObject[count].subNumber = (byte)od.subobjects.Count;
@@ -401,6 +405,8 @@ public ISO15745ProfileContainer convert(EDSsharp eds)
401405
AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].name = subod.parameter_name;
402406
AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].objectType = (byte)subod.objecttype;
403407

408+
AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].denotation = subod.denotation;
409+
404410
bytes = BitConverter.GetBytes((UInt16)subod.datatype);
405411
Array.Reverse(bytes);
406412

@@ -1129,7 +1135,9 @@ public EDSsharp convert(ISO15745ProfileContainer container)
11291135

11301136
}
11311137

1132-
if(param.denotation!=null && param.denotation.Items.Length>0)
1138+
//FIXME: if we have a denotation set for an object in the <parameterList> section but it is not set on the object
1139+
//use the <parameterList> one. We may discover that this is used for something else and can be removed??
1140+
if ((od.denotation==null || od.denotation=="") && param.denotation!=null && param.denotation.Items.Length>0)
11331141
{
11341142
foreach (object item in param.denotation.Items)
11351143
{

0 commit comments

Comments
 (0)