From fb9b3ce1bbd0b2b71d52bb1c0619e42684a6fdc3 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Sun, 23 Jun 2024 16:37:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B2=BB=E5=85=B7=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Controls/UFixture.cs | 137 ++++++++++++++----- Rs.DeweyTester/Entitys/TestFixtureManager.cs | 2 +- 2 files changed, 100 insertions(+), 39 deletions(-) diff --git a/Rs.DeweyTester/Controls/UFixture.cs b/Rs.DeweyTester/Controls/UFixture.cs index eb0511b..54577de 100644 --- a/Rs.DeweyTester/Controls/UFixture.cs +++ b/Rs.DeweyTester/Controls/UFixture.cs @@ -37,54 +37,115 @@ namespace Rs.MotionPlat if (lblStatus.Text != tf.Status.ToString()) { lblStatus.Text = tf.Status.ToString(); - switch (tf.Status) - { - case ETestFixtureStatus.NoConnect: + } + switch (tf.Status) + { + case ETestFixtureStatus.NoConnect: + if(btnReset.Enabled) + { btnReset.Enabled = false; + } + if(lblStatus.BackColor!=Color.Gray) + { lblStatus.BackColor = Color.Gray; - break; - case ETestFixtureStatus.IDLE: + } + break; + case ETestFixtureStatus.IDLE: + if(!btnReset.Enabled) + { btnReset.Enabled = true; + } + if(lblStatus.BackColor!=Color.Green) + { lblStatus.BackColor = Color.Green; - if (tf.Product != null) - { - if (tf.Product.Result == "true" && lblFixtureName.BackColor != Color.Green) - { - lblResult.BackColor = Color.Green; - } - if (tf.Product.Result == "false" && lblFixtureName.BackColor != Color.Red) - { - 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; - case ETestFixtureStatus.Testing: - if (tf.Product != null && lblSN.Text != tf.Product.SN) - { - lblSN.Text = tf.Product.SN; - } + } + //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; + case ETestFixtureStatus.Testing: + //if (tf.Product != null && lblSN.Text != tf.Product.SN) + //{ + // lblSN.Text = tf.Product.SN; + //} + if (btnReset.Enabled != false) + { + btnReset.Enabled = false; + } + if (lblStatus.BackColor != Color.Blue) + { lblStatus.BackColor = Color.Blue; - break; - case ETestFixtureStatus.Warning: - lblStatus.BackColor = Color.Red; + } + break; + case ETestFixtureStatus.Warning: + if(btnReset.Enabled!=true) + { btnReset.Enabled = true; - break; - case ETestFixtureStatus.Homing: + } + if (lblStatus.BackColor != Color.Red) + { + lblStatus.BackColor = Color.Red; + } + break; + case ETestFixtureStatus.Homing: + if(btnReset.Enabled!=false) + { btnReset.Enabled = false; + } + if(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.Product!=null && lblSN.Text != tf.Product.SN) diff --git a/Rs.DeweyTester/Entitys/TestFixtureManager.cs b/Rs.DeweyTester/Entitys/TestFixtureManager.cs index c601565..f9cf515 100644 --- a/Rs.DeweyTester/Entitys/TestFixtureManager.cs +++ b/Rs.DeweyTester/Entitys/TestFixtureManager.cs @@ -91,7 +91,7 @@ namespace Rs.MotionPlat.Entitys public void Clear() { this.Product = null; - + this.Result = ""; } public void ClearData()