章政 8 rokov pred
rodič
commit
aa1899f91e

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.Designer.cs

@@ -170,6 +170,7 @@
             this.pr_cartonunit.Size = new System.Drawing.Size(38, 31);
             this.pr_cartonunit.TabIndex = 42;
             this.pr_cartonunit.Text = "克";
+            this.pr_cartonunit.Visible = false;
             // 
             // label22
             // 

+ 11 - 10
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -130,25 +130,25 @@ namespace UAS_MES.Make
                         pr_cartongw.Text = Weight + "±" + (MaxWeight - Weight);
                     else
                         pr_cartongw.Text = MinWeight + "-" + MaxWeight;
-                    if (pr_cartonunit.Text == "kg")
-                    {
-                        weight.Text = (float.Parse(weight.Text) / 1000).ToString();
-                    }
-                    double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
+                    //if (pr_cartonunit.Text == "kg")
+                    //{
+                    //    weight.Text = (float.Parse(weight.Text) / 1000).ToString();
+                    //}
+                    double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim());
                     //需要检查称重重量
                     if (PR_CHECKCARTONW != "0")
                     {
                         //称量合格或不合格都记录重量
                         if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight)
                         {
-                        
+
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格", outboxcode.Text, "");
-                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green,outboxcode);
+                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
                         }
                         else
                         {
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不合格", outboxcode.Text, "");
-                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red,outboxcode);
+                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red);
                             return;
                         }
                     }
@@ -169,7 +169,7 @@ namespace UAS_MES.Make
                     lsi.SubItems.Add(ActualWeight.ToString() + pr_cartonunit.Text);
                     lsi.SubItems.Add(System.DateTime.Now.ToString());
                     WeighRecord.Items.Add(lsi);
-                    OperateResult.AppendText(">>箱号" + outboxcode.Text + "称重完成\n", Color.Green,outboxcode);
+                    OperateResult.AppendText(">>箱号" + outboxcode.Text + "称重完成\n", Color.Green);
                     dh.ExecuteSql("update package set pa_weight='" + weight.Text + "', pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
                     outboxcode.Clear();
                 }
@@ -191,7 +191,8 @@ namespace UAS_MES.Make
                         {
                             try
                             {
-                                weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
+                                weight.Text = serialPort1.ReadLine();
+                                //weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
                             }
                             catch (Exception)
                             {

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

@@ -110,10 +110,10 @@ namespace UAS_MES.Make
                         if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                         {
                             //如果未打开串口设置为0
-                            if (pr_colorboxunit.Text == "kg" && !WeightChange)
-                            {
-                                WeightChange = true;
-                            }
+                            //if (pr_colorboxunit.Text == "kg" && !WeightChange)
+                            //{
+                            //    WeightChange = true;
+                            //}
                             double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim());
                             if (PR_CHECKCOLORBOXW != "0")
                             {