Skip to content

Commit 16e161d

Browse files
authored
Fix description not saving (#59)
* fix required level being limited to 5 * fixed description object not saving on edit
1 parent 5cc0884 commit 16e161d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/G2DataGUI.Common/Data/Common/FixedLengthDescription.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public string Description
1515
string description = "";
1616
foreach (var character in _characters)
1717
{
18-
description += Convert.ToChar(character);
18+
description += character > 0 ? Convert.ToChar(character) : ' ';
1919
}
2020

2121
return description.TrimEnd();
@@ -25,7 +25,7 @@ public string Description
2525
value = value.PadRight((int)MaxLength, ' ');
2626
for (int index = 0; index < MaxLength; index++)
2727
{
28-
_characters[index] = Convert.ToByte(_characters[index]);
28+
_characters[index] = Convert.ToByte(value[index]);
2929
}
3030
}
3131
}
@@ -43,4 +43,4 @@ public void WriteFixedLengthDescription(Stream writer) =>
4343
writer.WriteRawByteArray(_characters);
4444

4545
public static uint MaxLength { get => 40; }
46-
}
46+
}

src/G2DataGUI.Common/Data/Common/FixedLengthName.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public string Name
2222
}
2323
set
2424
{
25-
value = value.PadRight((int)MaxLength, ' ');
25+
value = value.PadLeft((int)MaxLength, ' ');
2626
for (int index = 0; index < MaxLength; index++)
2727
{
2828
_characters[index] = Convert.ToByte(value[index]);

0 commit comments

Comments
 (0)