优化模拟测试时,良率100时仍有NG的问题

master
lhiven 9 months ago
parent 82f304c4a9
commit adecbb5573

@ -59,14 +59,16 @@ namespace Rs.MotionPlat.Entitys
void CheckTest() void CheckTest()
{ {
if (!_btest) return; if (!_btest) return;
if(_start.ElapsedMilliseconds>GlobalVar.SimulateTestTime*1000) if (GlobalVar.SimulateTestTime > 0 && GlobalVar.SimulateTestYield > 0)
{
if (_start.ElapsedMilliseconds > GlobalVar.SimulateTestTime * 1000)
{ {
EndTime = DateTime.Now; EndTime = DateTime.Now;
_start.Stop(); _start.Stop();
_btest = false; _btest = false;
testResult = ""; testResult = "";
int res = 0; int res = 0;
if (GlobalVar.SimulateTestYield<100) if (GlobalVar.SimulateTestYield < 100)
{ {
Random rnd = new Random(); Random rnd = new Random();
int randomNumber = rnd.Next(0, 100); int randomNumber = rnd.Next(0, 100);
@ -77,6 +79,8 @@ namespace Rs.MotionPlat.Entitys
res = 1; res = 1;
} }
testResult = $"Result#0#{res}#{SN},{StartTime.ToString("yyyy-MM-dd HH:ss:mm fff")},{EndTime.ToString("yyyy-MM-dd HH:ss:mm fff")}##\r\n#P$"; testResult = $"Result#0#{res}#{SN},{StartTime.ToString("yyyy-MM-dd HH:ss:mm fff")},{EndTime.ToString("yyyy-MM-dd HH:ss:mm fff")}##\r\n#P$";
LogHelper.Debug($">>> {testResult}");
}
} }
} }
private void TcpClientHelper_DataRecived(System.Net.Sockets.Socket arg1, byte[] arg2) private void TcpClientHelper_DataRecived(System.Net.Sockets.Socket arg1, byte[] arg2)
@ -170,8 +174,8 @@ namespace Rs.MotionPlat.Entitys
_start.Restart(); _start.Restart();
msg = $"StartTest#1$"; msg = $"StartTest#1$";
tcpClientHelper.Send(msg); tcpClientHelper.Send(msg);
loginfo = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} <<< {msg} \r\n"; //loginfo = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} <<< {msg} \r\n";
LogHelper.Debug(loginfo); //LogHelper.Debug(loginfo);
} }
break; break;
case "Result": case "Result":

@ -634,7 +634,7 @@ namespace Rs.MotionPlat.Entitys
//this.Product.AddResult(this.Index, Result, items[6]); //this.Product.AddResult(this.Index, Result, items[6]);
} }
string csvContent = string.Join(",", items[3], items[4], items[5]); string csvContent = string.Join(",", items[3], items[4], items[5]);
LogHelper.Debug($"Result:{items[3]}"); LogHelper.Debug($"Result:{items[2]},{items[3]}");
DevLog.Summary(CsvTitle, csvContent); DevLog.Summary(CsvTitle, csvContent);
Status = ETestFixtureStatus.IDLE; Status = ETestFixtureStatus.IDLE;
dataEvent.Set(); dataEvent.Set();

@ -4,6 +4,7 @@ using Rs.Framework;
using Rs.MotionPlat.Commom; using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Entitys; using Rs.MotionPlat.Entitys;
using Rs.MotionPlat.Flow; using Rs.MotionPlat.Flow;
using Rs.MotionPlat.Flow.SubFlow;
using Rs.MotionPlat.SysConfig; using Rs.MotionPlat.SysConfig;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -27,7 +28,6 @@ namespace Rs.MotionPlat
[STAThread] [STAThread]
static void Main() static void Main()
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new FormIO2()); //Application.Run(new FormIO2());
@ -42,4 +42,6 @@ namespace Rs.MotionPlat
} }
} }
} }
} }

Loading…
Cancel
Save