治具取料完成后不清除治具的测试结果,等下一个产品开始测试时清除上一个产品的测试结果,目的是为了解决产品刚放下去就获取结果的问题。

Eight
lhiven 11 months ago
parent 94ba24307f
commit f4ebd8a85c

@ -34,12 +34,14 @@ namespace Rs.MotionPlat
int errNum = 0;
public void RefreshStatus(TestFixture tf)
{
try
{
string msg = tf.GetLog();
if(string.IsNullOrEmpty(msg))
if (string.IsNullOrEmpty(msg))
{
errNum++;
if(errNum>=10)
if (errNum >= 10)
{
if (label5.BackColor != Color.Red)
label5.BackColor = Color.Red;
@ -55,7 +57,7 @@ namespace Rs.MotionPlat
}
string logFileName = $"{logDir}\\{tf.Index}.txt";
File.WriteAllText(logFileName, $"{msg}\r\n");
if (label5.BackColor!=Color.Lime)
if (label5.BackColor != Color.Lime)
{
label5.BackColor = Color.Lime;
}
@ -68,21 +70,21 @@ namespace Rs.MotionPlat
switch (tf.Status)
{
case ETestFixtureStatus.NoConnect:
if(btnReset.Enabled)
if (btnReset.Enabled)
{
btnReset.Enabled = false;
}
if(lblStatus.BackColor!=Color.Gray)
if (lblStatus.BackColor != Color.Gray)
{
lblStatus.BackColor = Color.Gray;
}
break;
case ETestFixtureStatus.IDLE:
if(!btnReset.Enabled)
if (!btnReset.Enabled)
{
btnReset.Enabled = true;
}
if(lblStatus.BackColor!=Color.Green)
if (lblStatus.BackColor != Color.Green)
{
lblStatus.BackColor = Color.Green;
}
@ -122,7 +124,7 @@ namespace Rs.MotionPlat
}
break;
case ETestFixtureStatus.Warning:
if(btnReset.Enabled!=true)
if (btnReset.Enabled != true)
{
btnReset.Enabled = true;
}
@ -132,20 +134,20 @@ namespace Rs.MotionPlat
}
break;
case ETestFixtureStatus.Homing:
if(btnReset.Enabled!=false)
if (btnReset.Enabled != false)
{
btnReset.Enabled = false;
}
if(lblStatus.BackColor!=Color.YellowGreen)
if (lblStatus.BackColor != Color.YellowGreen)
{
lblStatus.BackColor = Color.YellowGreen;
}
break;
}
if(tf.Product!=null)
if (tf.Product != null)
{
if(lblSN.Text!= tf.Product.SN)
if (lblSN.Text != tf.Product.SN)
{
lblSN.Text = tf.Product.SN;
}
@ -155,17 +157,17 @@ namespace Rs.MotionPlat
lblSN.Text = "";
}
if(lblResult.Text!=tf.Result)
if (lblResult.Text != tf.Result)
{
if(tf.Result=="PASS")
if (tf.Result == "PASS")
{
lblResult.BackColor = Color.Green;
}
else if(tf.Result=="NG")
else if (tf.Result == "NG")
{
lblResult.BackColor = Color.Red;
}
if(string.IsNullOrEmpty(tf.Result))
if (string.IsNullOrEmpty(tf.Result))
{
lblResult.BackColor = Color.FromArgb(11, 16, 36);
lblResult.Text = "";
@ -236,7 +238,7 @@ namespace Rs.MotionPlat
// btnReset.Enabled = false;
// }
//}
if(lblName.Text!=tf.MachineID)
if (lblName.Text != tf.MachineID)
{
lblName.Text = tf.MachineID;
}
@ -252,23 +254,29 @@ namespace Rs.MotionPlat
this.lblYield.Text = $"{(tf.Yield * 100).ToString("0.00")}%";
if(this.lblLastCT.Text != double.Parse(tf.LastCT.ToString()).ToString("0.000"))
if (this.lblLastCT.Text != double.Parse(tf.LastCT.ToString()).ToString("0.000"))
{
this.lblLastCT.Text = double.Parse(tf.LastCT.ToString()).ToString("0.000");
}
if(lblPassCount.Text != tf.PassCount.ToString())
if (lblPassCount.Text != tf.PassCount.ToString())
{
lblPassCount.Text = tf.PassCount.ToString();
}
if(lblTotalCount.Text != tf.TotalCount.ToString())
if (lblTotalCount.Text != tf.TotalCount.ToString())
{
lblTotalCount.Text = tf.TotalCount.ToString();
}
if(this.lblFixtureName.Enabled!=tf.Enable)
if (this.lblFixtureName.Enabled != tf.Enable)
{
this.lblFixtureName.Enabled = tf.Enable;
}
}
catch (Exception ex)
{
this.lblFixtureName.Enabled= tf.Enable;
LogHelper.Error("RefreshStatus", ex);
}
}
private void btnReset_Click(object sender, EventArgs e)

@ -103,7 +103,7 @@ namespace Rs.MotionPlat.Entitys
public void Clear()
{
this.Product = null;
this.Result = "";
//this.Result = "";
}
public void ClearData()
@ -405,6 +405,7 @@ namespace Rs.MotionPlat.Entitys
}
}
Send($"Reset$");
Result = "";
if (CheckPrintLog())
{
AddLog($"<<< TC{Index} Reset$");

@ -63,6 +63,7 @@ namespace Rs.MotionPlat.Flow
homeStep = 0;
m_bHomed = false;
m_bCancle = false;
Stopwatch stopwatch = new Stopwatch();
Task.Run(() =>
{
while (!m_bCancle && !m_bHomed)
@ -199,15 +200,21 @@ namespace Rs.MotionPlat.Flow
while (true)
{
Ops.On($"抽屉锁{i}");
Thread.Sleep(200);
if (Ops.IsOff($"抽屉锁{i}动位"))
stopwatch.Restart();
while (true)
{
Msgbox.ShowDialog(AlarmCollection.Get(AlarmConstID.), EButtonType.Retry);
}
else
if(Ops.IsOn($"抽屉锁{i}动位"))
{
stopwatch.Stop();
break;
}
else if(stopwatch.ElapsedMilliseconds>5000)
{
Msgbox.ShowDialog(AlarmCollection.Get(AlarmConstID.), EButtonType.Retry);
stopwatch.Restart();
}
}
break;
}
}
//检测各个轴是否有使能

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
[assembly: AssemblyVersion("1.20.24.16")]
[assembly: AssemblyVersion("1.20.24.17")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save