Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/OpenAC.Net.Balanca.Demo/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using OpenAC.Net.Devices;
using System.IO.Ports;
using System.Windows.Forms;
using OpenAC.Net.Devices;

namespace OpenAC.Net.Balanca.Demo
{
Expand Down Expand Up @@ -74,11 +72,17 @@ private void Balanca_AoLerPeso(object sender, BalancaEventArgs e)
{
label7.Text = $@"Ultimo peso {e.Peso:N3} Kg";
textBox1.Text += $@"{DateTime.Now:dd/MM/yyyy HH:mm:ss} - {e.Peso:N3} Kg" + Environment.NewLine;

textBox1.SelectionStart = textBox1.Text.Length;
textBox1.ScrollToCaret();
}

if (e.Excecao != null)
{
textBox2.Text += $@"{DateTime.Now:dd/MM/yyyy HH:mm:ss} - {e.Excecao.Message}" + Environment.NewLine;

textBox2.SelectionStart = textBox2.Text.Length;
textBox2.ScrollToCaret();
}

Application.DoEvents();
Expand Down
3 changes: 2 additions & 1 deletion src/OpenAC.Net.Balanca/OpenBal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ await Task.Run(async () =>

try
{
bal.LeSerial();
bal.LePeso();
//bal.LeSerial();
AoLerPeso?.Raise(this, new BalancaEventArgs(bal.UltimaResposta, bal.UltimoPesoLido));
}
catch (Exception ex)
Expand Down