Browse Source

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

章政 8 years ago
parent
commit
ccd59e7b3f
1 changed files with 2 additions and 2 deletions
  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)
                             {