优化治具状态显示

master
lhiven 12 months ago
parent aef796b378
commit bbfff4b338

@ -35,14 +35,7 @@ namespace Rs.MotionPlat.Commom
InitDb(); InitDb();
SysConfigParam.Init(); SysConfigParam.Init();
int errNum = 0; int errNum = 0;
Task.Run(() => {
TestFixtureManager.Instance.StartLister();
Thread.Sleep(500);
if (GlobalVar.IsSimTest)
{
SimulateTesterManager.Instance.Init();
}
});
//Task.Run(() => { //Task.Run(() => {
if (!GlobalVar.VirtualAxis) if (!GlobalVar.VirtualAxis)
{ {
@ -95,7 +88,13 @@ namespace Rs.MotionPlat.Commom
DischargeFlow.Instance.Init(); DischargeFlow.Instance.Init();
GrrFlow.Instance.Init(); GrrFlow.Instance.Init();
SysConfigParam.Update("EnableVirtuleBarCode", "False"); SysConfigParam.Update("EnableVirtuleBarCode", "False");
Task.Run(() => {
TestFixtureManager.Instance.StartLister();
if (GlobalVar.IsSimTest)
{
SimulateTesterManager.Instance.Init();
}
});
} }
static void InitDb() static void InitDb()

@ -123,29 +123,54 @@ namespace Rs.MotionPlat
lblSN.Text = tf.Product.SN; lblSN.Text = tf.Product.SN;
} }
} }
if(tf.Product!=null) else
{ {
if(!string.IsNullOrEmpty(tf.Product.Result) && lblResult.Text!=tf.Product.Result) lblSN.Text = "";
{
if(tf.Product.Result=="PASS")
{
lblResult.BackColor = Color.Green;
}
else
{
lblResult.BackColor = Color.Red;
}
lblResult.Text = tf.Product.Result;
}
} }
else
if(lblResult.Text!=tf.Result)
{ {
if(!string.IsNullOrEmpty(lblResult.Text)) if(tf.Result=="PASS")
{
lblResult.BackColor = Color.Green;
}
else if(tf.Result=="NG")
{
lblResult.BackColor = Color.Red;
}
if(string.IsNullOrEmpty(tf.Result))
{ {
lblResult.Text = "";
lblResult.BackColor = Color.FromArgb(11, 16, 36); lblResult.BackColor = Color.FromArgb(11, 16, 36);
lblResult.Text = "";
}
else
{
lblResult.Text = tf.Result;
} }
} }
//if(tf.Product!=null)
//{
// if(!string.IsNullOrEmpty(tf.Product.Result) && lblResult.Text!=tf.Product.Result)
// {
// if(tf.Product.Result=="PASS")
// {
// lblResult.BackColor = Color.Green;
// }
// else
// {
// lblResult.BackColor = Color.Red;
// }
// lblResult.Text = tf.Product.Result;
// }
//}
//else
//{
// if(!string.IsNullOrEmpty(lblResult.Text))
// {
// lblResult.Text = "";
// lblResult.BackColor = Color.FromArgb(11, 16, 36);
// }
//}
//if (tf.Status== ETestFixtureStatus.Testing) //if (tf.Status== ETestFixtureStatus.Testing)
//{ //{
// if (tf.Product!=null && lblSN.Text != tf.Product.SN) // if (tf.Product!=null && lblSN.Text != tf.Product.SN)

@ -536,7 +536,7 @@ namespace Rs.MotionPlat.Entitys
break; break;
case "1": case "1":
//就绪状态,如果有产品就查询测试结果 //就绪状态,如果有产品就查询测试结果
if(Status == ETestFixtureStatus.Testing) if(Status == ETestFixtureStatus.Testing ||(Status== ETestFixtureStatus.IDLE && Product!=null &&String.IsNullOrEmpty(Result)))
{ {
Send("Result$"); Send("Result$");
if (CheckPrintLog()) if (CheckPrintLog())
@ -590,18 +590,18 @@ namespace Rs.MotionPlat.Entitys
} }
this.Product.AddResult(this.Index, Result); this.Product.AddResult(this.Index, Result);
} }
//string summaryPath = $"D:\\Summary\\{DateTime.Now.ToString("yyyyMMdd")}\\summary.csv"; string summaryPath = $"D:\\Summary\\{DateTime.Now.ToString("yyyyMMdd")}\\summary.csv";
//if(!Directory.Exists(Path.GetDirectoryName(summaryPath))) if (!Directory.Exists(Path.GetDirectoryName(summaryPath)))
//{ {
// Directory.CreateDirectory(Path.GetDirectoryName(summaryPath)); Directory.CreateDirectory(Path.GetDirectoryName(summaryPath));
//} }
//if(!File.Exists(summaryPath)) if (!File.Exists(summaryPath))
//{ {
// File.AppendAllText(summaryPath, CsvTitle); File.AppendAllText(summaryPath, CsvTitle);
//} }
//File.AppendAllText(summaryPath, items[3]); File.AppendAllText(summaryPath, items[3]);
this.EndTestTime = DateTime.Now; this.EndTestTime = DateTime.Now;
this.LastCT = (EndTestTime - StartTestTime).TotalSeconds; this.LastCT = (EndTestTime - StartTestTime).TotalSeconds;
TotalCount++; TotalCount++;
@ -621,7 +621,7 @@ namespace Rs.MotionPlat.Entitys
{ {
Status = ETestFixtureStatus.Warning; Status = ETestFixtureStatus.Warning;
Task.Run(() => { Task.Run(() => {
string errInfo = $"code:{items[1]},desc:{items[2]}"; string errInfo = $"tc{Index} test,code:{items[1]},desc:{items[2]}";
MessageQueue.Instance.Warn(errInfo); MessageQueue.Instance.Warn(errInfo);
Msgbox.ShowDialog(EButtonType.Ok, errInfo); Msgbox.ShowDialog(EButtonType.Ok, errInfo);
}); });
@ -869,7 +869,7 @@ namespace Rs.MotionPlat.Entitys
{ {
string content=Encoding.ASCII.GetString(registData.ToArray()); string content=Encoding.ASCII.GetString(registData.ToArray());
MessageQueue.Instance.Insert($">>> ip:{ep.Address.ToString()},port:{ep.Port.ToString()},{content}"); //MessageQueue.Instance.Insert($">>> ip:{ep.Address.ToString()},port:{ep.Port.ToString()},{content}");
string[] items = content.TrimEnd(new char[] { '$' }).Split('#'); string[] items = content.TrimEnd(new char[] { '$' }).Split('#');
string reg = "Register#1$"; string reg = "Register#1$";
int sendLen = clientSocket.Send(Encoding.ASCII.GetBytes(reg)); int sendLen = clientSocket.Send(Encoding.ASCII.GetBytes(reg));

@ -511,7 +511,7 @@ namespace Rs.MotionPlat.Flow
logInfo = $"{GetClassName()}取料完成真空检测OK吸嘴 {curTakeNozzle.NozzleIndex} 从治具 {curFixture.Index} 把产品SN {curFixture.Product.SN} 取出"; logInfo = $"{GetClassName()}取料完成真空检测OK吸嘴 {curTakeNozzle.NozzleIndex} 从治具 {curFixture.Index} 把产品SN {curFixture.Product.SN} 取出";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
curTakeNozzle.Product = curFixture.Product; curTakeNozzle.Product = curFixture.Product;
curFixture.Product = null; curFixture.Clear();//.Product = null;
GlobalTray.NozzleTray.ChangeStatus(curTakeNozzle.NozzleIndex, ESlotStatus.Have); GlobalTray.NozzleTray.ChangeStatus(curTakeNozzle.NozzleIndex, ESlotStatus.Have);
if(GlobalVar.TestMode=="GRR") if(GlobalVar.TestMode=="GRR")
{ {

@ -109,6 +109,7 @@ namespace Rs.MotionPlat.SysConfig
EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Retry | EButtonType.EndInput | EButtonType.Skip, $"穴位{i + 1}定位失败"); EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Retry | EButtonType.EndInput | EButtonType.Skip, $"穴位{i + 1}定位失败");
if (buttonSelect == EButtonType.EndInput) if (buttonSelect == EButtonType.EndInput)
{ {
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
exit = true; exit = true;
return; return;
} }

Loading…
Cancel
Save