Skip to content

Commit

Permalink
v1.05 Small refactor, post cleanup release
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanHall23 committed Aug 30, 2021
1 parent f7ce764 commit d2bed30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 33 deletions.
31 changes: 1 addition & 30 deletions MainWindowForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public MainWindowForm()
}

/// <summary>
/// Use Form2's instance of a serialPort for types etc and copy values into primary serial port
/// Use OptionsForm instance of a serialPort for types etc and copy values into primary serial port
/// </summary>
/// <param name="sPort"></param>
public void SerialPortSet(SerialPort sPort)
Expand Down Expand Up @@ -249,35 +249,6 @@ private void UpdateHexText(string rawData)
serialDataGridView.Rows.Add(row);
}
}
#region Legacy
/*
if (this.serialDataGridView.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(UpdateHexText);
this.Invoke(d, new object[] { rawData });
}
else
{
char[] charValues = rawData.ToCharArray();
string hexOutput = "";
int i = 0;
foreach (char _eachChar in charValues)
{
++i;
int value = Convert.ToInt32(_eachChar);
hexOutput += String.Format("{0:X} ", value);
}
DataGridViewRow row = (DataGridViewRow)serialDataGridView.Rows[0].Clone();
row.Cells[0].Value = currentRow;
row.Cells[1].Value = serialPort.PortName;
row.Cells[2].Value = hexOutput;
row.Cells[3].Value = rawData;
serialDataGridView.Rows.Add(row);
currentRow++;
}
*/
#endregion
}
catch (Exception ex)
{
Expand Down
6 changes: 3 additions & 3 deletions OptionsWindowForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace SerialSuite
{
public partial class OptionsWindowForm : Form
{
MainWindowForm mainWindow; // Initialises F1 form
SerialPort sPort = new SerialPort(); // Used to copy create a template of the types
UserSettings userSettings = new UserSettings(); // Creates an object to persist serial port settings
readonly MainWindowForm mainWindow; // Initialises MainWindowForm
readonly SerialPort sPort = new SerialPort(); // Used to copy create a template of the types
readonly UserSettings userSettings = new UserSettings(); // Creates an object to persist serial port settings

public OptionsWindowForm()
{
Expand Down

0 comments on commit d2bed30

Please sign in to comment.