Skip to content

Commit

Permalink
fix timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
771-8bit committed Dec 18, 2024
1 parent 4848262 commit d846d37
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private void btnSend_Click(object sender, EventArgs e)
different_data = previous_send_data[previous_send_data.Count - 1] != data;
}
bool update = first_data || different_data;

if (update)
{
previous_send_data.Add(data);
Expand Down Expand Up @@ -303,22 +303,23 @@ private void timerReadSerial_Tick(object sender, EventArgs e)
}
else
{
if ((( first_timestamp || last_is_newline )) && check_timestamp.Checked )
{
new_text.Append(timestamp);
first_timestamp = false;
}

string newline = "\r\n";
if (check_timestamp.Checked)
{
newline += timestamp;
}

string rawdata = serialPort1.ReadExisting();
if (string.IsNullOrEmpty(rawdata) == false)
{
newdata = true;

if ((( first_timestamp || last_is_newline )) && check_timestamp.Checked )
{
new_text.Append(timestamp);
first_timestamp = false;
}

string newline = "\r\n";
if (check_timestamp.Checked)
{
newline += timestamp;
}

new_text.Append(rawdata);

if (checkNULL.Checked)
Expand Down

0 comments on commit d846d37

Please sign in to comment.