Skip to content

Commit 2711f0c

Browse files
committed
bugfix defaultvalue: Do not ask to take new default value to all sub if new default is the same
bugfix #129
1 parent 49979a5 commit 2711f0c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

EDSEditorGUI/DeviceODView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ private void ObjectSave()
549549

550550
for (int i = 2; i < od.parent.Nosubindexes; i++)
551551
{
552-
identicalDefaultValues &= (od.parent.subobjects[(ushort)i].defaultvalue == od.parent.subobjects[(ushort)(i - 1)].defaultvalue);
552+
identicalDefaultValues &= ((od.parent.subobjects[(ushort)i].defaultvalue == od.parent.subobjects[(ushort)(i - 1)].defaultvalue) && (od.parent.subobjects[(ushort)i].defaultvalue != textBox_defaultValue.Text));
553553
}
554554

555555
if (identicalDefaultValues) {

EDSEditorGUI/DevicePDOView2.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,12 @@ public void UpdatePDOinfo(bool updatechoices = true)
460460
int ordinal = 0;
461461
foreach (ODentry entry in slot.Mapping)
462462
{
463+
if ((bitoff + entry.Sizeofdatatype()) > 64)
463464
{
465+
string toDisplay = string.Join(Environment.NewLine, slot.Mapping);
466+
MessageBox.Show(string.Format("Invalid TXPDO mapping parameters in 0x{0:X}!\r\nTrying to map more than the maximum lenght of a CAN message (8 bytes).\r\n\r\nMembers are:\r\n{1}", slot.ConfigurationIndex,toDisplay));
467+
break;
468+
}
464469
string target = slot.getTargetName(entry);
465470
grid1[row + 2, bitoff + 3] = new SourceGrid.Cells.Cell(target, comboStandard);
466471
grid1[row + 2, bitoff + 3].ColumnSpan = entry.Sizeofdatatype();
@@ -480,14 +485,9 @@ public void UpdatePDOinfo(bool updatechoices = true)
480485

481486
grid1[row + 2, bitoff + 3].AddController(vcc);
482487
bitoff += entry.Sizeofdatatype();
483-
}
484488

485-
ordinal++;
486489

487-
if (bitoff > 64) {
488-
MessageBox.Show(string.Format("Invalid TXPDO mapping parameters in 0x{0:X}. Trying to map more than 64 bit (8 Bytes). CAN message maximum lenght is 8 Byte", slot.ConfigurationIndex));
489-
break;
490-
}
490+
ordinal++;
491491

492492
}
493493

0 commit comments

Comments
 (0)