1、优化模拟测试时,不再清除侧相机数据

Eight
lhiven 7 months ago
parent d78007b441
commit 99f6e934b4

@ -50,13 +50,21 @@ namespace Rs.MotionPlat
else else
{ {
//打印日志 //打印日志
string logDir = $"d:\\log\\Communition\\{DateTime.Now.ToString("yyyyMMdd")}"; string logDir = $"d:\\log\\debug\\{DateTime.Now.ToString("yyyyMMdd")}";
if (!Directory.Exists(logDir)) if (!Directory.Exists(logDir))
{ {
Directory.CreateDirectory(logDir); Directory.CreateDirectory(logDir);
} }
string logFileName = $"{logDir}\\{tf.Index}.txt"; 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) if (label5.BackColor != Color.Lime)
{ {
label5.BackColor = Color.Lime; label5.BackColor = Color.Lime;

@ -6,6 +6,7 @@ using Rs.Framework;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow; using Rs.MotionPlat.Flow;
using Rs.MotionPlat.Flow.NormalFlow; using Rs.MotionPlat.Flow.NormalFlow;
using Rs.MotionPlat.SysConfig;
using Rs.MotionPlat.Vision; using Rs.MotionPlat.Vision;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
@ -452,7 +453,10 @@ namespace Rs.MotionPlat.Entitys
} }
} }
//先把侧相机数据清空 //先把侧相机数据清空
if(!GlobalVar.IsSimTest)
{
VisionHelper.sideCameraVision.ClearQueue(this.Index); VisionHelper.sideCameraVision.ClearQueue(this.Index);
}
int noise = GlobalVar.Noise ? 1 : 0; int noise = GlobalVar.Noise ? 1 : 0;
int mtcp=GlobalVar.Mtcp ? 1 : 0; int mtcp=GlobalVar.Mtcp ? 1 : 0;
int isFirstFixture = IsFirstFixture ? 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() public string GetLog()
@ -774,7 +778,7 @@ namespace Rs.MotionPlat.Entitys
bool b = logs.TryDequeue(out string content); bool b = logs.TryDequeue(out string content);
if(b) if(b)
{ {
msg.Append($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} {content}\r\n"); msg.Append($"{content}\r\n");
} }
} }
return msg.ToString(); return msg.ToString();

Loading…
Cancel
Save