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();