From 68cfadd7fa7691557487829715d2cbbf77457943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Mon, 29 Jul 2024 08:35:57 +0800 Subject: [PATCH] =?UTF-8?q?17=E3=80=8290?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Qu/InitAction.cs | 18 ++++++++++++++++++ Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml | 11 +++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs index 20f8974..55bb8aa 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs @@ -154,6 +154,7 @@ namespace Mesnac.Action.ChemicalWeighing.Qu HslSwitch HslSwitch15; HslSwitch HslSwitch16; + HslSwitch HslSwitch17; HslLanternSimple Hsldq1; @@ -415,6 +416,10 @@ namespace Mesnac.Action.ChemicalWeighing.Qu HslSwitch16.Text = "回收仓侧吹启停"; + HslSwitch17 = controls.FirstOrDefault(x => x.Name == "HslSwitch17") as HslSwitch; + HslSwitch17.Text = "回收仓振动电机启停"; + + HslSwitch1.OnSwitchChanged += HslSwitch1_OnSwitchChanged; HslSwitch2.OnSwitchChanged += HslSwitch1_OnSwitchChanged; HslSwitch3.OnSwitchChanged += HslSwitch1_OnSwitchChanged; @@ -433,10 +438,19 @@ namespace Mesnac.Action.ChemicalWeighing.Qu HslSwitch16.OnSwitchChanged += HslSwitch16_OnSwitchChanged; + HslSwitch17.OnSwitchChanged += HslSwitch17_OnSwitchChanged; MCButton2147483644_Click(new object(), new EventArgs()); } + private void HslSwitch17_OnSwitchChanged(object arg1, bool arg2) + { + + string add = "DB2119.17.0"; + var val = PlcConnect.Instance.ReadBool(add).Content; + PlcConnect.Instance.Write(add, !val); + } + private void HslSwitch16_OnSwitchChanged(object arg1, bool arg2) { string add = "DB2119.16.7"; @@ -1239,6 +1253,10 @@ namespace Mesnac.Action.ChemicalWeighing.Qu var sss = plc.ReadBool("DB2119.16.7").Content; this.HslSwitch16.SwitchStatus = sss; + + sss = plc.ReadBool("DB2119.17.0").Content; + + this.HslSwitch17.SwitchStatus = sss; } } diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml b/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml index e3e30a2..8136c00 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml @@ -1,6 +1,11 @@ + + 206, 20 + HslSwitch17 + 119, 121 + 43, 20 HslSwitch16 @@ -118,8 +123,7 @@ 39, 32 - - + Red DarkGray @@ -138,8 +142,7 @@ 29, 12 - - + Red DarkGray