Browse Source

称重界面关闭时终止计算重量线程

Hcsy 8 years ago
parent
commit
789b5c9a94

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs

@@ -255,6 +255,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
         }
 
         private void PrintLabel_SelectedValueChanged(object sender, EventArgs e)

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

@@ -237,6 +237,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
         }
 
         private void StartWeight_Click(object sender, EventArgs e)

+ 2 - 12
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -90,19 +90,9 @@ namespace UAS_MES.Make
                         }
                         if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                         {
-                            //判断界面工单是否为空时的序列号是否自动归属工单
-                            string oStatus = "";
-                            if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage2))
-                            {
-                                if (ms_makecode.Text == "")
-                                {
-                                    OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
-                                    return;
-                                }
-                            }
-                            OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+                             OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                             // 获取工单归属工单下一工序是否正确
-                            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text == "" ? oMakeCode : ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                            if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                             {
                                 sql.Clear();
                                 sql.Append("select ma_code as ms_makecode,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -234,6 +234,7 @@ namespace UAS_MES.Make
                 thread.Interrupt();
                 thread.Join();
             }
+            thread.Abort();
         }
 
         private void Confirm_Click(object sender, EventArgs e)

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs

@@ -269,6 +269,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
         }
         private void recordResult(string palletcode, string weigh, string time)
         {

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -339,6 +339,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
             dh.Dispose();
         }
 

+ 1 - 0
UAS-MES/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -96,6 +96,7 @@ namespace UAS_MES.SystemSetting
             StopTest.PerformClick();
             try { ReadData = false; }
             catch (Exception) { }
+            thread.Abort();
         }
 
         private void StopTest_Click(object sender, EventArgs e)