修复首页的颜色变化

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

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

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

Loading…
Cancel
Save