|
|
@@ -104,7 +104,7 @@ namespace UAS_MES.Packing
|
|
|
//将重量信息加到集合中
|
|
|
sncodes.Add(palletcode);
|
|
|
indates.Add(time.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
- weights.Add(weigh);
|
|
|
+ weights.Add(weigh.Replace("kg", "").Trim());
|
|
|
}
|
|
|
|
|
|
private void startWeigh_Click(object sender, EventArgs e)
|
|
|
@@ -139,7 +139,8 @@ namespace UAS_MES.Packing
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
+ weight.Text = serialPort1.ReadLine();
|
|
|
+ //weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
@@ -209,7 +210,7 @@ namespace UAS_MES.Packing
|
|
|
OperateResult.AppendText("<<未读取到重量信息\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
- if (double.Parse(weight.Text) == 0)
|
|
|
+ if (double.Parse(weight.Text.Replace("kg", "").Trim()) == 0)
|
|
|
{
|
|
|
OperateResult.AppendText("<<重量不能等于0\n", Color.Red, sncode);
|
|
|
return;
|