|
|
@@ -15,6 +15,7 @@ using UAS_MES_NEW.Packing;
|
|
|
using Seagull.BarTender.Print;
|
|
|
using System.Net.Sockets;
|
|
|
using System.Net;
|
|
|
+using System.Text.RegularExpressions;
|
|
|
|
|
|
namespace UAS_MES_NEW.Packing
|
|
|
{
|
|
|
@@ -734,6 +735,8 @@ namespace UAS_MES_NEW.Packing
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ Regex re = new Regex("\\d+.\\d+");
|
|
|
+
|
|
|
private void getSerialData()
|
|
|
{
|
|
|
if (serialPort1.IsOpen)
|
|
|
@@ -747,8 +750,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- weight.Text = serialPort1.ReadLine();
|
|
|
- //weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
+ weight.Text = re.Match(serialPort1.ReadLine()).Groups[0].Value;
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|