From 99f6e934b44afcf879bd1578bdce0f600a844c63 Mon Sep 17 00:00:00 2001 From: lhiven Date: Mon, 4 Nov 2024 15:52:03 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=86=8D=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E4=BE=A7=E7=9B=B8=E6=9C=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Controls/UFixture.cs | 12 ++++++++++-- Rs.DeweyTester/Entitys/TestFixtureManager.cs | 10 +++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Rs.DeweyTester/Controls/UFixture.cs b/Rs.DeweyTester/Controls/UFixture.cs index 3da9dfd..3d0dfb4 100644 --- a/Rs.DeweyTester/Controls/UFixture.cs +++ b/Rs.DeweyTester/Controls/UFixture.cs @@ -50,13 +50,21 @@ namespace Rs.MotionPlat else { //打印日志 - string logDir = $"d:\\log\\Communition\\{DateTime.Now.ToString("yyyyMMdd")}"; + string logDir = $"d:\\log\\debug\\{DateTime.Now.ToString("yyyyMMdd")}"; if (!Directory.Exists(logDir)) { Directory.CreateDirectory(logDir); } string logFileName = $"{logDir}\\{tf.Index}.txt"; - File.WriteAllText(logFileName, $"{msg}\r\n"); + FileInfo fi = new FileInfo(logFileName); + if(fi.Exists && fi.Length<=1024 * 1024 *1) + { + File.AppendAllText(logFileName, $"{msg}"); + } + else + { + File.WriteAllText(logFileName, $"{msg}"); + } if (label5.BackColor != Color.Lime) { label5.BackColor = Color.Lime; diff --git a/Rs.DeweyTester/Entitys/TestFixtureManager.cs b/Rs.DeweyTester/Entitys/TestFixtureManager.cs index efd1d58..80edb90 100644 --- a/Rs.DeweyTester/Entitys/TestFixtureManager.cs +++ b/Rs.DeweyTester/Entitys/TestFixtureManager.cs @@ -6,6 +6,7 @@ using Rs.Framework; using Rs.MotionPlat.Commom; using Rs.MotionPlat.Flow; using Rs.MotionPlat.Flow.NormalFlow; +using Rs.MotionPlat.SysConfig; using Rs.MotionPlat.Vision; using System; using System.Collections.Concurrent; @@ -452,7 +453,10 @@ namespace Rs.MotionPlat.Entitys } } //先把侧相机数据清空 - VisionHelper.sideCameraVision.ClearQueue(this.Index); + if(!GlobalVar.IsSimTest) + { + VisionHelper.sideCameraVision.ClearQueue(this.Index); + } int noise = GlobalVar.Noise ? 1 : 0; int mtcp=GlobalVar.Mtcp ? 1 : 0; int isFirstFixture = IsFirstFixture ? 1 : 0; @@ -763,7 +767,7 @@ namespace Rs.MotionPlat.Entitys } } } - logs.Enqueue(log); + logs.Enqueue($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} {log}"); } public string GetLog() @@ -774,7 +778,7 @@ namespace Rs.MotionPlat.Entitys bool b = logs.TryDequeue(out string content); if(b) { - msg.Append($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} {content}\r\n"); + msg.Append($"{content}\r\n"); } } return msg.ToString();