|
|
@@ -105,7 +105,7 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- engine = new Engine(true);
|
|
|
+ //engine = new Engine(true);
|
|
|
BaseUtil.WriteLbl();
|
|
|
}
|
|
|
catch (Exception)
|
|
|
@@ -259,16 +259,24 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- int len = serialPort1.BytesToRead;
|
|
|
- Byte[] readBuffer = new Byte[len];
|
|
|
- serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
|
|
|
- string weigh = Encoding.Default.GetString(readBuffer);
|
|
|
- Remark.AppendText(weigh.Trim() + "\n");
|
|
|
- if (weigh != "")
|
|
|
+ //int len = serialPort1.BytesToRead;
|
|
|
+ //Byte[] readBuffer = new Byte[len];
|
|
|
+ //serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
|
|
|
+ //string weigh = Encoding.Default.GetString(readBuffer);
|
|
|
+ //Remark.AppendText(weigh.Trim() + "\n");
|
|
|
+ //if (weigh != "")
|
|
|
+ //{
|
|
|
+ // weight.Text = re.Match(weigh).Groups[0].Value;
|
|
|
+ //}
|
|
|
+ try
|
|
|
{
|
|
|
- weight.Text = re.Match(weigh).Groups[0].Value;
|
|
|
+ weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
|
|
|
+ Remark.AppendText(weight.Text + "\n");
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ GetData = false;
|
|
|
}
|
|
|
- Remark.Clear();
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|