Преглед на файлове

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

Hcsy преди 8 години
родител
ревизия
a5ba72cebb
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5 4
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

+ 5 - 4
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -115,9 +115,9 @@ namespace UAS_MES.Make
                         {
                         {
                             try
                             try
                             {
                             {
-                                weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
-                                if (pr_cartonunit.Text == "kg")
-                                    weight.Text = (double.Parse(weight.Text) / 1000).ToString();
+                                weight.Text = serialPort1.ReadLine();
+                                //if (pr_cartonunit.Text == "kg")
+                                //    weight.Text = (double.Parse(weight.Text) / 1000).ToString();
                             }
                             }
                             catch (Exception)
                             catch (Exception)
                             {
                             {
@@ -347,7 +347,8 @@ namespace UAS_MES.Make
                                             if (PR_CHECKCARTONW != "0")
                                             if (PR_CHECKCARTONW != "0")
                                             {
                                             {
                                                 //检查重量合格
                                                 //检查重量合格
-                                                if (float.Parse(weight.Text) > MinWeight && float.Parse(weight.Text) < MaxWeight)
+                                                float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
+                                                if (weigh > MinWeight && weigh < MaxWeight)
                                                 {
                                                 {
                                                     dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                                     dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                                     pa_standardqty.Text = "";
                                                     pa_standardqty.Text = "";