From 2d5f03807ed59bd37266756566f1120fd6588c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Sat, 23 Dec 2023 10:31:13 +0800 Subject: [PATCH] =?UTF-8?q?1=20=E7=BB=B4=E4=BF=AE=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControlAction.cs | 36 ++++++++++-------- .../Util/ControlsImprot.cs | 28 ++++++++++++++ .../Mesnac.Controls.ChemicalWeighing.csproj | 3 ++ .../Resources/AlarmLightPurple.png | Bin 0 -> 6868 bytes .../SwitchLight.cs | 32 +++++++++++++--- 5 files changed, 77 insertions(+), 22 deletions(-) create mode 100644 Controls/Mesnac.Controls.ChemicalWeighing/Resources/AlarmLightPurple.png diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index b25d8a0..61ec344 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -1342,22 +1342,26 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl ControlsHelper.SetFan(FanE.DM1DRY4_Running, PlcReadTemp.DM1DRY4_Running_Set); ControlsHelper.SetFan(FanE.PM3ADF01, PlcReadTemp.PM3ADF01_Set); - ControlsHelper.SetSwitchLight(LightE.DMWETER1, PlcReadTemp.DMWETER1_Set, PlcReadTemp.DMWETER1_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER11, PlcReadTemp.DMWETER1_Set, PlcReadTemp.DMWETER1_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER2, PlcReadTemp.DMWETER2_Set, PlcReadTemp.DMWETER2_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER22, PlcReadTemp.DMWETER2_Set, PlcReadTemp.DMWETER2_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER3, PlcReadTemp.DMWETER3_Set, PlcReadTemp.DMWETER3_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER33, PlcReadTemp.DMWETER3_Set, PlcReadTemp.DMWETER3_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER4, PlcReadTemp.DMWETER4_Set, PlcReadTemp.DMWETER4_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER44, PlcReadTemp.DMWETER4_Set, PlcReadTemp.DMWETER4_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER5, PlcReadTemp.DMWETER5_Set, PlcReadTemp.DMWETER5_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER55, PlcReadTemp.DMWETER5_Set, PlcReadTemp.DMWETER5_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER6, PlcReadTemp.DMWETER6_Set, PlcReadTemp.DMWETER6_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER66, PlcReadTemp.DMWETER6_Set, PlcReadTemp.DMWETER6_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER7, PlcReadTemp.DMWETER7_Set, PlcReadTemp.DMWETER7_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER77, PlcReadTemp.DMWETER7_Set, PlcReadTemp.DMWETER7_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER8, PlcReadTemp.DMWETER8_Set, PlcReadTemp.DMWETER8_Alarm); - ControlsHelper.SetSwitchLight(LightE.DMWETER88, PlcReadTemp.DMWETER8_Set, PlcReadTemp.DMWETER8_Alarm); + var wx = Db3000Helper.ReadModel(); + + ControlsHelper.SetSwitchLight(LightE.DMWETER1, PlcReadTemp.DMWETER1_Set, PlcReadTemp.DMWETER1_Alarm, wx[0]); + ControlsHelper.SetSwitchLight(LightE.DMWETER11, PlcReadTemp.DMWETER1_Set, PlcReadTemp.DMWETER1_Alarm, wx[0]); + ControlsHelper.SetSwitchLight(LightE.DMWETER2, PlcReadTemp.DMWETER2_Set, PlcReadTemp.DMWETER2_Alarm, wx[1]); + ControlsHelper.SetSwitchLight(LightE.DMWETER22, PlcReadTemp.DMWETER2_Set, PlcReadTemp.DMWETER2_Alarm, wx[1]); + ControlsHelper.SetSwitchLight(LightE.DMWETER3, PlcReadTemp.DMWETER3_Set, PlcReadTemp.DMWETER3_Alarm, wx[2]); + ControlsHelper.SetSwitchLight(LightE.DMWETER33, PlcReadTemp.DMWETER3_Set, PlcReadTemp.DMWETER3_Alarm, wx[2]); + + ControlsHelper.SetSwitchLight(LightE.DMWETER4, PlcReadTemp.DMWETER4_Set, PlcReadTemp.DMWETER4_Alarm, wx[3]); + ControlsHelper.SetSwitchLight(LightE.DMWETER44, PlcReadTemp.DMWETER4_Set, PlcReadTemp.DMWETER4_Alarm, wx[3]); + ControlsHelper.SetSwitchLight(LightE.DMWETER5, PlcReadTemp.DMWETER5_Set, PlcReadTemp.DMWETER5_Alarm, wx[4]); + ControlsHelper.SetSwitchLight(LightE.DMWETER55, PlcReadTemp.DMWETER5_Set, PlcReadTemp.DMWETER5_Alarm, wx[4]); + ControlsHelper.SetSwitchLight(LightE.DMWETER6, PlcReadTemp.DMWETER6_Set, PlcReadTemp.DMWETER6_Alarm, wx[5]); + ControlsHelper.SetSwitchLight(LightE.DMWETER66, PlcReadTemp.DMWETER6_Set, PlcReadTemp.DMWETER6_Alarm, wx[5]); + ControlsHelper.SetSwitchLight(LightE.DMWETER7, PlcReadTemp.DMWETER7_Set, PlcReadTemp.DMWETER7_Alarm, wx[6]); + ControlsHelper.SetSwitchLight(LightE.DMWETER77, PlcReadTemp.DMWETER7_Set, PlcReadTemp.DMWETER7_Alarm, wx[6]); + ControlsHelper.SetSwitchLight(LightE.DMWETER8, PlcReadTemp.DMWETER8_Set, PlcReadTemp.DMWETER8_Alarm, wx[7]); + ControlsHelper.SetSwitchLight(LightE.DMWETER88, PlcReadTemp.DMWETER8_Set, PlcReadTemp.DMWETER8_Alarm, wx[7]); + //压力参数 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs index 52dbb07..3cc4733 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs @@ -91,6 +91,34 @@ namespace Mesnac.Action.ChemicalWeighing.Util } } + + + public static void SetSwitchLight(SwitchLight obj, bool set, bool alarm, bool weixiu) + { + obj.BackColor = Color.Gray; + + if (weixiu == true) + { + obj.Status = SwitchLight.Statuses.ylWeiXiu; + } + else + { + + if (set == true && alarm == false) + { + obj.Status = SwitchLight.Statuses.ylMove; + } + else if (alarm == true) + { + obj.Status = SwitchLight.Statuses.ylAlarm; + } + else + { + obj.Status = SwitchLight.Statuses.ylNormal; + } + } + } + /// /// 阀门 /// diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj b/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj index 60f66e0..c580f5d 100644 --- a/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj +++ b/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj @@ -673,6 +673,9 @@ Always + + Always + diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/Resources/AlarmLightPurple.png b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/AlarmLightPurple.png new file mode 100644 index 0000000000000000000000000000000000000000..f2b50df02454abf693d1eac380c920d4e793d1ad GIT binary patch literal 6868 zcmcIp2T)Vpx&;J8L}?-l3Lyy6LK+DqbO=pA5a}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o1;{4LEGBTVYxAUqgzagC@3ey4RoAO z&TEiwdvG_`chCCS^}fB8yCM5AVXrpkXyfu2UV&L^zJ1Ero>-ld^tU#h!z&wQJtbhX zU+;agotf`3Eq!~jZftHQt(4!8rPKU#iqhv;dU}D?Fou|+!!KpwE~q%y>4MwI7n{Ab zUwCA9_4aVUyRY%M@f7c^HR^^d`}y z(5kY!L^TK&_8A7xfY*Jru@QLIlaO^wu(f3L{Mra9@}9{kK0j`L`Jhzl)zyq>nxF0H+tQ;M`ZZu(MU_=tz{vdHB6C5Z2le zS4#gjTG)}vQ21T)IkxR1w(?KEpP(K^EA+Yb1g4A+t%Fz>kA=#~NI$#Xp_qW>B)U!4 zKpmQw-?lUSzpnc%XCRSCK9O8q^Etm zpME^)CDtwt?k`QV9vxXc)T*rn3Rs1oZ!g*o^c)@U?Tr%b9X!-KsAHdflg-d*f;Z~v z8`#UCd5_LA^Zdm(Hfy%r!%OWks~bzNi}#OSgIm3y=(j(8@V}Fm+C@x(%C+GC0XdEv A`2YX_ literal 0 HcmV?d00001 diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/SwitchLight.cs b/Controls/Mesnac.Controls.ChemicalWeighing/SwitchLight.cs index 75e9717..0ccf4c7 100644 --- a/Controls/Mesnac.Controls.ChemicalWeighing/SwitchLight.cs +++ b/Controls/Mesnac.Controls.ChemicalWeighing/SwitchLight.cs @@ -32,7 +32,7 @@ namespace Mesnac.Controls.ChemicalWeighing } public enum Statuses { - ylNormal = 0, ylMove = 1, ylAlarm = 2 + ylNormal = 0, ylMove = 1, ylAlarm = 2,ylWeiXiu=3 } Statuses _status; string[] sImages; @@ -48,10 +48,11 @@ namespace Mesnac.Controls.ChemicalWeighing base.Init(); _imageStream = null; - sImages = new string[3]; + sImages = new string[4]; sImages[0] = "Mesnac.Controls.ChemicalWeighing.Resources.AlarmLightNewGray.png";// sImages[1] = "Mesnac.Controls.ChemicalWeighing.Resources.AlarmLightNewGreen.png";// sImages[2] = "Mesnac.Controls.ChemicalWeighing.Resources.AlarmLightNewRed.png";// + sImages[3] = "Mesnac.Controls.ChemicalWeighing.Resources.AlarmLightPurple.png";// _status = Statuses.ylNormal; } @@ -84,18 +85,37 @@ namespace Mesnac.Controls.ChemicalWeighing bNewPic = true; } } - if ((int)value < 0) + + var val = (int)value; + + + if (val == 0) { _status = (Statuses)0; } - else if ((int)value > 2) + + if (val == 1) + { + _status = (Statuses)1; + } + + if (val == 2) { _status = (Statuses)2; } - else + + if (val == 3) + { + _status = (Statuses)3; + } + + if (val == 4) { - _status = value; + _status = (Statuses)4; } + + + ReloadStream(); Reload(); }