private void ToledoSerial_OnToledoStandardDataReceived(object sender, ToledoStandardData e) { if (InvokeRequired) { Invoke(new Action <object, ToledoStandardData>(ToledoSerial_OnToledoStandardDataReceived), sender, e); return; } receiveTimes++; StringBuilder sb = new StringBuilder( ); if (checkBox4.Checked) { sb.Append(DateTime.Now.ToString( ) + Environment.NewLine); } sb.Append(e.ToJsonString( ) + Environment.NewLine); textBox6.Text = sb.ToString( ); textBox1.Text = e.SourceData.ToHexString(' '); textBox3.Text = Encoding.ASCII.GetString(e.SourceData); toledoDataControl1.SetToledoData(e); hslCurve1.AddCurveData("重量", e.Weight); hslDialPlate1.Value = e.Weight; label2.Text = "Receive Times:" + receiveTimes; }
private void ToledoSerial_OnToledoStandardDataReceived(object sender, ToledoStandardData e) { if (InvokeRequired) { Invoke(new Action <object, ToledoStandardData>(ToledoSerial_OnToledoStandardDataReceived)); return; } StringBuilder sb = new StringBuilder( ); if (checkBox4.Checked) { sb.Append(DateTime.Now.ToString( ) + Environment.NewLine); } sb.Append(e.ToJsonString( ) + Environment.NewLine); textBox6.Text = sb.ToString( ); }