Skip to content

Commit

Permalink
UI cleanup, added support for displaying clock.
Browse files Browse the repository at this point in the history
  • Loading branch information
rehsd committed Jul 19, 2021
1 parent cc887b0 commit 2c745d8
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 17 deletions.
61 changes: 45 additions & 16 deletions 8-bit computer interface/MainForm.Designer.cs

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

22 changes: 21 additions & 1 deletion 8-bit computer interface/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void ConnectButton_Click(object sender, EventArgs e)
{
MessageBox.Show(xcp.Message, "Ya'...., something failed...");
}
}
}

private void MyPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
Expand All @@ -140,6 +140,7 @@ private void MyPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
UpdateBusDisplay(stmp);
UpdateControlDisplay(stmp);
UpdateOutputDisplay(stmp);
UpdateClockDisplay(stmp);
}));
}
else
Expand All @@ -155,6 +156,25 @@ private void MyPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
}


void UpdateClockDisplay(string stmp)
{
try
{
int startingLoc = stmp.IndexOf("Clock:");

//int closingLoc = stmp.IndexOf("]");
if (startingLoc > 0)
{
clockLabel.Text = stmp.Substring(startingLoc + 6, stmp.Length-startingLoc-7);
}
}
catch
{
//Ignore for now
//MessageBox.Show(xcp.Message, "Ya'...., something failed...");
}
}

void UpdateOutputDisplay(string stmp)
{
try
Expand Down

0 comments on commit 2c745d8

Please sign in to comment.