Browse Source

彩盒称重重量单位换算调整

Hcsy 8 năm trước cách đây
mục cha
commit
179b78aad5
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -120,8 +120,6 @@ namespace UAS_MES.Make
                                 }
                             }
                             //如果未打开串口设置为0
-                            if (pr_colorboxunit.Text == "kg")
-                                weight.Text = (float.Parse(weight.Text) / 1000).ToString();
                             double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
                             if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                             {
@@ -171,6 +169,8 @@ namespace UAS_MES.Make
                             try
                             {
                                 weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
+                                if (pr_colorboxunit.Text == "kg")
+                                    weight.Text = (float.Parse(weight.Text) / 1000).ToString();
                             }
                             catch (Exception)
                             {