Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

章政 8 năm trước cách đây
mục cha
commit
ccd59e7b3f

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

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