Эх сурвалжийг харах

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

Hcsy 8 жил өмнө
parent
commit
179b78aad5

+ 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)
                             {