From 9931703a7e18210f25ca47d9477f07d9511d2ac0 Mon Sep 17 00:00:00 2001 From: Robin Cornelius Date: Fri, 1 Feb 2019 12:53:25 +0000 Subject: [PATCH] Complete hooking up of High/Low limits and actual value --- EDSTest/DeviceODView.cs | 10 +++++----- libEDSsharp/CanOpenXDD.cs | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/EDSTest/DeviceODView.cs b/EDSTest/DeviceODView.cs index 0637d54c..18f2a4d0 100644 --- a/EDSTest/DeviceODView.cs +++ b/EDSTest/DeviceODView.cs @@ -118,17 +118,17 @@ private void button_save_changes_Click(object sender, EventArgs e) selectedobject.Description = textBox_description.Text; selectedobject.defaultvalue = textBox_defaultvalue.Text; selectedobject.denotation = textBox_denotation.Text; + selectedobject.HighLimit = textBox_highvalue.Text; + selectedobject.LowLimit = textBox_lowvalue.Text; + selectedobject.actualvalue = textBox_actualvalue.Text; if (!(selectedobject.parent != null && selectedobject.parent.objecttype == ObjectType.ARRAY)) { selectedobject.defaultvalue = textBox_defaultvalue.Text; selectedobject.TPDODetectCos = checkBox_COS.Checked; - selectedobject.HighLimit = textBox_highvalue.Text; - selectedobject.LowLimit = textBox_lowvalue.Text; - selectedobject.actualvalue = textBox_actualvalue.Text; - - + + DataType dt = (DataType)Enum.Parse(typeof(DataType), comboBox_datatype.SelectedItem.ToString()); selectedobject.datatype = dt; diff --git a/libEDSsharp/CanOpenXDD.cs b/libEDSsharp/CanOpenXDD.cs index 7c974655..692ef985 100644 --- a/libEDSsharp/CanOpenXDD.cs +++ b/libEDSsharp/CanOpenXDD.cs @@ -430,6 +430,10 @@ public ISO15745ProfileContainer convert(EDSsharp eds) AppLayer.CANopenObjectList.CANopenObject[count].denotation = od.denotation; AppLayer.CANopenObjectList.CANopenObject[count].edseditor_extenstion_storagelocation = od.StorageLocation; + AppLayer.CANopenObjectList.CANopenObject[count].highLimit = od.HighLimit; + AppLayer.CANopenObjectList.CANopenObject[count].lowLimit = od.LowLimit; + AppLayer.CANopenObjectList.CANopenObject[count].actualValue = od.actualvalue; + if (od.subobjects != null && od.subobjects.Count > 0) { AppLayer.CANopenObjectList.CANopenObject[count].subNumber = (byte)od.subobjects.Count; @@ -485,6 +489,11 @@ public ISO15745ProfileContainer convert(EDSsharp eds) AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].accessType = (CANopenObjectListCANopenObjectCANopenSubObjectAccessType)Enum.Parse(typeof(CANopenObjectListCANopenObjectCANopenSubObjectAccessType), accesstype.ToString()); AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].accessTypeSpecified = true; + AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].highLimit = subod.HighLimit; + AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].lowLimit = subod.LowLimit; + AppLayer.CANopenObjectList.CANopenObject[count].CANopenSubObject[subcount].actualValue = subod.actualvalue; + + subcount++; } } @@ -1049,6 +1058,10 @@ public EDSsharp convert(ISO15745ProfileContainer container) subentry.uniqueID = subobj.uniqueIDRef; + subentry.HighLimit = subobj.highLimit; + subentry.LowLimit = subobj.lowLimit; + subentry.actualvalue = subobj.actualValue; + //FIXME WTF is going on here?? entry.subobjects.Add(subobj.subIndex[1], subentry);