diff --git a/Rs.DeweyTester/Commom/Ops.cs b/Rs.DeweyTester/Commom/Ops.cs index 1afea2d..fe118dc 100644 --- a/Rs.DeweyTester/Commom/Ops.cs +++ b/Rs.DeweyTester/Commom/Ops.cs @@ -35,14 +35,7 @@ namespace Rs.MotionPlat.Commom InitDb(); SysConfigParam.Init(); int errNum = 0; - Task.Run(() => { - TestFixtureManager.Instance.StartLister(); - Thread.Sleep(500); - if (GlobalVar.IsSimTest) - { - SimulateTesterManager.Instance.Init(); - } - }); + //Task.Run(() => { if (!GlobalVar.VirtualAxis) { @@ -95,7 +88,13 @@ namespace Rs.MotionPlat.Commom DischargeFlow.Instance.Init(); GrrFlow.Instance.Init(); SysConfigParam.Update("EnableVirtuleBarCode", "False"); - + Task.Run(() => { + TestFixtureManager.Instance.StartLister(); + if (GlobalVar.IsSimTest) + { + SimulateTesterManager.Instance.Init(); + } + }); } static void InitDb() diff --git a/Rs.DeweyTester/Controls/UFixture.cs b/Rs.DeweyTester/Controls/UFixture.cs index 08b73fc..c9ee647 100644 --- a/Rs.DeweyTester/Controls/UFixture.cs +++ b/Rs.DeweyTester/Controls/UFixture.cs @@ -123,29 +123,54 @@ namespace Rs.MotionPlat lblSN.Text = tf.Product.SN; } } - if(tf.Product!=null) + else { - if(!string.IsNullOrEmpty(tf.Product.Result) && lblResult.Text!=tf.Product.Result) - { - if(tf.Product.Result=="PASS") - { - lblResult.BackColor = Color.Green; - } - else - { - lblResult.BackColor = Color.Red; - } - lblResult.Text = tf.Product.Result; - } + lblSN.Text = ""; } - else + + if(lblResult.Text!=tf.Result) { - if(!string.IsNullOrEmpty(lblResult.Text)) + if(tf.Result=="PASS") + { + lblResult.BackColor = Color.Green; + } + else if(tf.Result=="NG") + { + lblResult.BackColor = Color.Red; + } + if(string.IsNullOrEmpty(tf.Result)) { - lblResult.Text = ""; lblResult.BackColor = Color.FromArgb(11, 16, 36); + lblResult.Text = ""; + } + else + { + lblResult.Text = tf.Result; } } + //if(tf.Product!=null) + //{ + // if(!string.IsNullOrEmpty(tf.Product.Result) && lblResult.Text!=tf.Product.Result) + // { + // if(tf.Product.Result=="PASS") + // { + // lblResult.BackColor = Color.Green; + // } + // else + // { + // lblResult.BackColor = Color.Red; + // } + // lblResult.Text = tf.Product.Result; + // } + //} + //else + //{ + // if(!string.IsNullOrEmpty(lblResult.Text)) + // { + // lblResult.Text = ""; + // lblResult.BackColor = Color.FromArgb(11, 16, 36); + // } + //} //if (tf.Status== ETestFixtureStatus.Testing) //{ // if (tf.Product!=null && lblSN.Text != tf.Product.SN) diff --git a/Rs.DeweyTester/Entitys/TestFixtureManager.cs b/Rs.DeweyTester/Entitys/TestFixtureManager.cs index b00eaf1..d8fc457 100644 --- a/Rs.DeweyTester/Entitys/TestFixtureManager.cs +++ b/Rs.DeweyTester/Entitys/TestFixtureManager.cs @@ -536,7 +536,7 @@ namespace Rs.MotionPlat.Entitys break; case "1": //就绪状态,如果有产品就查询测试结果 - if(Status == ETestFixtureStatus.Testing) + if(Status == ETestFixtureStatus.Testing ||(Status== ETestFixtureStatus.IDLE && Product!=null &&String.IsNullOrEmpty(Result))) { Send("Result$"); if (CheckPrintLog()) @@ -590,18 +590,18 @@ namespace Rs.MotionPlat.Entitys } this.Product.AddResult(this.Index, Result); } - - - //string summaryPath = $"D:\\Summary\\{DateTime.Now.ToString("yyyyMMdd")}\\summary.csv"; - //if(!Directory.Exists(Path.GetDirectoryName(summaryPath))) - //{ - // Directory.CreateDirectory(Path.GetDirectoryName(summaryPath)); - //} - //if(!File.Exists(summaryPath)) - //{ - // File.AppendAllText(summaryPath, CsvTitle); - //} - //File.AppendAllText(summaryPath, items[3]); + + + string summaryPath = $"D:\\Summary\\{DateTime.Now.ToString("yyyyMMdd")}\\summary.csv"; + if (!Directory.Exists(Path.GetDirectoryName(summaryPath))) + { + Directory.CreateDirectory(Path.GetDirectoryName(summaryPath)); + } + if (!File.Exists(summaryPath)) + { + File.AppendAllText(summaryPath, CsvTitle); + } + File.AppendAllText(summaryPath, items[3]); this.EndTestTime = DateTime.Now; this.LastCT = (EndTestTime - StartTestTime).TotalSeconds; TotalCount++; @@ -621,7 +621,7 @@ namespace Rs.MotionPlat.Entitys { Status = ETestFixtureStatus.Warning; Task.Run(() => { - string errInfo = $"code:{items[1]},desc:{items[2]}"; + string errInfo = $"tc{Index} test,code:{items[1]},desc:{items[2]}"; MessageQueue.Instance.Warn(errInfo); Msgbox.ShowDialog(EButtonType.Ok, errInfo); }); @@ -869,7 +869,7 @@ namespace Rs.MotionPlat.Entitys { string content=Encoding.ASCII.GetString(registData.ToArray()); - MessageQueue.Instance.Insert($">>> ip:{ep.Address.ToString()},port:{ep.Port.ToString()},{content}"); + //MessageQueue.Instance.Insert($">>> ip:{ep.Address.ToString()},port:{ep.Port.ToString()},{content}"); string[] items = content.TrimEnd(new char[] { '$' }).Split('#'); string reg = "Register#1$"; int sendLen = clientSocket.Send(Encoding.ASCII.GetBytes(reg)); diff --git a/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs index d404c1c..1eb6985 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/GrrFlow.cs @@ -511,7 +511,7 @@ namespace Rs.MotionPlat.Flow logInfo = $"{GetClassName()}取料完成,真空检测OK,吸嘴 {curTakeNozzle.NozzleIndex} 从治具 {curFixture.Index} 把产品SN {curFixture.Product.SN} 取出"; MessageQueue.Instance.Insert(logInfo); curTakeNozzle.Product = curFixture.Product; - curFixture.Product = null; + curFixture.Clear();//.Product = null; GlobalTray.NozzleTray.ChangeStatus(curTakeNozzle.NozzleIndex, ESlotStatus.Have); if(GlobalVar.TestMode=="GRR") { diff --git a/Rs.DeweyTester/SysConfig/SelectProductFrm.cs b/Rs.DeweyTester/SysConfig/SelectProductFrm.cs index 4c2f562..700a683 100644 --- a/Rs.DeweyTester/SysConfig/SelectProductFrm.cs +++ b/Rs.DeweyTester/SysConfig/SelectProductFrm.cs @@ -109,6 +109,7 @@ namespace Rs.MotionPlat.SysConfig EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Retry | EButtonType.EndInput | EButtonType.Skip, $"穴位{i + 1}定位失败"); if (buttonSelect == EButtonType.EndInput) { + DischargeModuleGoSafePosFlow.Instance.GoSafePostion(); exit = true; return; }