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

master
lhiven 9 months ago
parent 82f304c4a9
commit adecbb5573

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

@ -634,7 +634,7 @@ namespace Rs.MotionPlat.Entitys
//this.Product.AddResult(this.Index, Result, items[6]);
}
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);
Status = ETestFixtureStatus.IDLE;
dataEvent.Set();

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

Loading…
Cancel
Save