Skip to content

Commit

Permalink
TPDOdetectCOS should be saved with subobjects and enabled for REC obj…
Browse files Browse the repository at this point in the history
…ects. This is a CanOpenNode specific feature and only effects VAR, entire arrays or individual rec sub objects. As such it needs to be saved with all subobjects and only applied to individual entries for REC not array
  • Loading branch information
robincornelius committed Nov 28, 2016
1 parent 7d11a6d commit acbdbcf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion EDSTest/DeviceODView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,13 @@ public void validateanddisplaydata()
comboBox_memory.Enabled = false;
checkBox_COS.Enabled = false;
checkBox_enabled.Enabled = false;
checkBox_COS.Checked = od.parent.TPDODetectCos;

checkBox_enabled.Checked = !od.parent.Disabled;

if (od.parent.objecttype == ObjectType.ARRAY && od.subindex != 0)
{
textBox_defaultvalue.Enabled = true;
checkBox_COS.Checked = od.parent.TPDODetectCos;

}

Expand Down
4 changes: 2 additions & 2 deletions EDSTest/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions libEDSsharp/Bridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public Device convert(EDSsharp eds)
sub.DefaultValue = subod.defaultvalue;
sub.PDOmapping = subod.PDOtype.ToString();
sub.SubIndex = String.Format("{0:x2}",subod.subindex);
sub.TPDOdetectCOS = subod.TPDODetectCos.ToString().ToLower();
coo.CANopenSubObject.Add(sub);

}
Expand Down Expand Up @@ -330,6 +331,17 @@ public EDSsharp convert(Device dev)

subentry.objecttype = ObjectType.VAR;

if(coosub.TPDOdetectCOS!=null)
{
subentry.TPDODetectCos = coosub.TPDOdetectCOS == "true";
}
else
{
if(coo.TPDOdetectCOS!=null)
subentry.TPDODetectCos = coo.TPDOdetectCOS == "true";
}


entry.subobjects.Add(subentry.subindex,subentry);

}
Expand Down
4 changes: 3 additions & 1 deletion libEDSsharp/CanOpenXML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public class CANopenSubObject {
public string PDOmapping { get; set; }
[XmlAttribute(AttributeName="defaultValue")]
public string DefaultValue { get; set; }
}
[XmlAttribute(AttributeName = "TPDOdetectCOS")]
public string TPDOdetectCOS { get; set; }
}

[XmlRoot(ElementName="CANopenObjectList")]
public class CANopenObjectList {
Expand Down

0 comments on commit acbdbcf

Please sign in to comment.