diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs index da6828f..556bf6d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs @@ -98,7 +98,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver MCLabel MCLabel349; MCLabel MCLabel350; - + HslLanternSimple HslLanternSimple1; + HslLanternSimple HslLanternSimple2; Color mcCol; #region 接口Run方法 @@ -117,7 +118,12 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver MCLabel349 = Controls.FirstOrDefault(x => x != null && x.Name == "MCLabel349") as MCLabel; MCLabel350 = Controls.FirstOrDefault(x => x != null && x.Name == "MCLabel350") as MCLabel; - mcCol = MCLabel349.ForeColor; + + + HslLanternSimple1 = Controls.FirstOrDefault(x => x != null && x.Name == "HslLanternSimple1") as HslLanternSimple; + HslLanternSimple2 = Controls.FirstOrDefault(x => x != null && x.Name == "HslLanternSimple2") as HslLanternSimple; + + mcCol = HslLanternSimple1.LanternBackground; //wangsr(); AllAlarmTable = DBHelp.GetTable(@"SELECT Alarm_ID, Alarm_Block, Alarm_Word, Alarm_Bit, Alarm_Cn_Info, Alarm_Other_Info FROM Pmt_Alarm"); @@ -132,20 +138,35 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver private void other() { var a = PlcConnect.Instance.ReadFloat("DB1.1634").Content; - if (a > 40) - { - MCLabel349.ForeColor=Color.Red; + MCLabel349.Text = a.ToString("0.00") + " mg/m3"; + + Other(HslLanternSimple1, a); + + var b = PlcConnect.Instance.ReadFloat("DB1.1654").Content; + MCLabel350.Text = b.ToString("0.00") + " ℃"; + Other(HslLanternSimple2, b); + + } + private void Other(HslLanternSimple simple,float a) + { + if(a>=0 && a <= 40) + { + simple.LanternBackground = mcCol; } - else + + if (a > 40 && a < 60) { - MCLabel349.ForeColor = mcCol; + simple.LanternBackground = System.Drawing.Color.Yellow; } - MCLabel349.Text = a.ToString("0.00") + " mg/m3"; - var b = PlcConnect.Instance.ReadFloat("DB1.1654").Content; - MCLabel350.Text = b.ToString("0.00") + " ℃"; + if (a>60) + { + simple.LanternBackground = System.Drawing.Color.Red; + } } + + #endregion diff --git a/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml b/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml index 2c8c5a8..bc51dae 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml @@ -1,6 +1,16 @@ + + 1796, 54 + HslLanternSimple2 + 18, 18 + + + 1796, 30 + HslLanternSimple1 + 18, 18 + @@ -18,7 +28,7 @@ 压送罐1 Transparent ButtonHighlight - 475, 112 + 1731, 56 MCLabel350 47, 12 @@ -39,13 +49,12 @@ 压送罐1 Transparent ButtonHighlight - 476, 86 + 1732, 30 MCLabel349 47, 12 - - + Red DarkGray @@ -60,13 +69,12 @@ True 大仓排气口温度 ButtonHighlight - 357, 111 + 1613, 55 MCLabel348 89, 12 - - + Red DarkGray @@ -81,7 +89,7 @@ True 大仓排气口粉尘浓度 ButtonHighlight - 357, 86 + 1613, 30 MCLabel347 113, 12 @@ -4664,9 +4672,9 @@ True MiddleCenter Lime - 1691, 138 + 1691, 70 SpecialLabelBlue690 - 1, 87 + 1, 167 ylNormal