优化治具的状态显示

master
lhiven 12 months ago
parent 8a0666e7b8
commit fb9b3ce1bb

@ -37,54 +37,115 @@ namespace Rs.MotionPlat
if (lblStatus.Text != tf.Status.ToString()) if (lblStatus.Text != tf.Status.ToString())
{ {
lblStatus.Text = tf.Status.ToString(); lblStatus.Text = tf.Status.ToString();
}
switch (tf.Status) switch (tf.Status)
{ {
case ETestFixtureStatus.NoConnect: case ETestFixtureStatus.NoConnect:
btnReset.Enabled = false; if(btnReset.Enabled)
lblStatus.BackColor = Color.Gray;
break;
case ETestFixtureStatus.IDLE:
btnReset.Enabled = true;
lblStatus.BackColor = Color.Green;
if (tf.Product != null)
{ {
if (tf.Product.Result == "true" && lblFixtureName.BackColor != Color.Green) btnReset.Enabled = false;
{
lblResult.BackColor = Color.Green;
} }
if (tf.Product.Result == "false" && lblFixtureName.BackColor != Color.Red) if(lblStatus.BackColor!=Color.Gray)
{ {
lblResult.BackColor = Color.Red; lblStatus.BackColor = Color.Gray;
} }
if (tf.Product != null && tf.Product.Result != null && lblResult.Text != tf.Product.Result) break;
case ETestFixtureStatus.IDLE:
if(!btnReset.Enabled)
{ {
lblResult.Text = tf.Product.Result.ToString(); btnReset.Enabled = true;
}
} }
else if(lblStatus.BackColor!=Color.Green)
{ {
lblSN.Text = ""; lblStatus.BackColor = Color.Green;
lblFixtureName.BackColor = Color.FromArgb(56, 56, 56);
} }
//if (tf.Product != null)
//{
// if (tf.Product.Result == "true")
// {
// lblResult.BackColor = Color.Green;
// }
// if (tf.Product.Result == "false")
// {
// lblResult.BackColor = Color.Red;
// }
// if (tf.Product != null && tf.Product.Result != null && lblResult.Text != tf.Product.Result)
// {
// lblResult.Text = tf.Product.Result.ToString();
// }
//}
//else
//{
// lblSN.Text = "";
// lblFixtureName.BackColor = Color.FromArgb(56, 56, 56);
//}
break; break;
case ETestFixtureStatus.Testing: case ETestFixtureStatus.Testing:
if (tf.Product != null && lblSN.Text != tf.Product.SN) //if (tf.Product != null && lblSN.Text != tf.Product.SN)
//{
// lblSN.Text = tf.Product.SN;
//}
if (btnReset.Enabled != false)
{ {
lblSN.Text = tf.Product.SN; btnReset.Enabled = false;
} }
if (lblStatus.BackColor != Color.Blue)
{
lblStatus.BackColor = Color.Blue; lblStatus.BackColor = Color.Blue;
}
break; break;
case ETestFixtureStatus.Warning: case ETestFixtureStatus.Warning:
lblStatus.BackColor = Color.Red; if(btnReset.Enabled!=true)
{
btnReset.Enabled = true; btnReset.Enabled = true;
}
if (lblStatus.BackColor != Color.Red)
{
lblStatus.BackColor = Color.Red;
}
break; break;
case ETestFixtureStatus.Homing: case ETestFixtureStatus.Homing:
if(btnReset.Enabled!=false)
{
btnReset.Enabled = false; btnReset.Enabled = false;
}
if(lblStatus.BackColor!=Color.YellowGreen)
{
lblStatus.BackColor = Color.YellowGreen; lblStatus.BackColor = Color.YellowGreen;
break;
} }
break;
} }
if(tf.Product!=null)
{
if(lblSN.Text!= tf.Product.SN)
{
lblSN.Text = tf.Product.SN;
}
}
if(tf.Product!=null)
{
if(!string.IsNullOrEmpty(tf.Product.Result) && lblResult.Text!=tf.Product.Result)
{
if(tf.Product.Result=="true")
{
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)

@ -91,7 +91,7 @@ namespace Rs.MotionPlat.Entitys
public void Clear() public void Clear()
{ {
this.Product = null; this.Product = null;
this.Result = "";
} }
public void ClearData() public void ClearData()

Loading…
Cancel
Save