修复首页的颜色变化

dep_yangw
我叫锄头 11 months ago
parent accd635b0a
commit 91bb746da1

@ -171,9 +171,7 @@ namespace ProductionSystem.Forms
ShowMiddleData2();
ShowMiddleData2();
ShowMiddleData2();
ShowMiddleData2();
}
@ -573,15 +571,18 @@ namespace ProductionSystem.Forms
testValPoint.Val = val;
this.Invoke(new Action(() =>
{
topMyResultControls[i].SetForeColor(Color.Black);
topMyResultControls[i].TestValText = testValPoint.Val;
if (testValPoint.Val == "0.000")
{
topMyResultControls[i].TestValText = "停止";
topMyResultControls[i].SetForeColor(Color.Red);
}
else
if (testValPoint.Val == "1.000")
{
topMyResultControls[i].TestValText = "启动";
topMyResultControls[i].SetForeColor(Color.Green);
}
}));
//if (M249.Val != "0.000" && M249.Val != "10.000")
@ -803,7 +804,7 @@ namespace ProductionSystem.Forms
private void ShowMiddleData2()
{
Thread.Sleep(Program.ReadPlcRate);
GetPlc(Program.BZ1, "BZ1");
GetPlc(Program.BZ2, "BZ2");
@ -812,6 +813,7 @@ namespace ProductionSystem.Forms
GetPlc(Program.BZ5, "BZ5");
GetPlc(Program.BZ6, "BZ6");
Thread.Sleep(Program.ReadPlcRate);
}
@ -1223,6 +1225,11 @@ namespace ProductionSystem.Forms
/// <summary>
/// 显示Db块的数据
/// </summary>
/// <param name="paraCategory"></param>
private void SetMiddleData(string paraCategory)
{
try

@ -33,23 +33,29 @@ namespace ProductionSystem_UserControl.ExtendedControls
get { return txtTestVal.Text; }
set
{
if (txtTestVal.Text == "停止")
{
txtTestVal.ForeColor = Color.Red;
}
else if(txtTestVal.Text == "启动")
{
txtTestVal.ForeColor = Color.Green;
}
else
{
txtTestVal.ForeColor = Color.Black;
}
//if (txtTestVal.Text == "停止")
//{
// txtTestVal.ForeColor = Color.Red;
//}
//else if(txtTestVal.Text == "启动")
//{
// txtTestVal.ForeColor = Color.Green;
//}
//else
//{
// txtTestVal.ForeColor = Color.Black;
//}
_testValText = value;
txtTestVal.Text = _testValText;
}
}
public void SetForeColor(Color color)
{
this.txtTestVal.ForeColor = color;
}
//添加背景颜色
/// <summary>

Loading…
Cancel
Save