From 7c05455c2cf70ef1b644aad59d8094d28559b312 Mon Sep 17 00:00:00 2001 From: wangsr Date: Wed, 13 Dec 2023 11:46:10 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E8=87=AA=E5=8A=A8=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=B0=B4=E7=A7=B0=E5=81=9C=E6=AD=A2=E6=81=A2=E5=A4=8D=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoControl/AutoControl.cs | 43 +++++++++++++++++-- .../AutoControl/InitAction.cs | 40 +++++++++++++++++ .../Data/MCProject/nodeForm/AutoControlC.xml | 20 ++++----- 3 files changed, 88 insertions(+), 15 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs index 89ed491..4c3dd66 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs @@ -295,22 +295,59 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl if (ButtonE.CAOnOff == runtime.Sender) { + if(ButtonE.CAOnOff.Text == "停止称量") + { + DB2105WriteHelper.StopWater(0); + ButtonE.CAOnOff.Text = "恢复称量"; + } + else if(ButtonE.CAOnOff.Text == "恢复称量") + { + DB2105WriteHelper.StartWater(0); + ButtonE.CAOnOff.Text = "停止称量"; + } } if (ButtonE.CBOnOff == runtime.Sender) { - + if (ButtonE.CBOnOff.Text == "停止称量") + { + DB2105WriteHelper.StopWater(2); + ButtonE.CBOnOff.Text = "恢复称量"; + } + else if (ButtonE.CBOnOff.Text == "恢复称量") + { + DB2105WriteHelper.StartWater(2); + ButtonE.CBOnOff.Text = "停止称量"; + } } if (ButtonE.HAOnOff == runtime.Sender) { - + if (ButtonE.HAOnOff.Text == "停止称量") + { + DB2105WriteHelper.StopWater(1); + ButtonE.HAOnOff.Text = "恢复称量"; + } + else if (ButtonE.HAOnOff.Text == "恢复称量") + { + DB2105WriteHelper.StartWater(1); + ButtonE.HAOnOff.Text = "停止称量"; + } } if (ButtonE.HBOnOff == runtime.Sender) { - + if (ButtonE.HBOnOff.Text == "停止称量") + { + DB2105WriteHelper.StopWater(3); + ButtonE.HBOnOff.Text = "恢复称量"; + } + else if (ButtonE.HBOnOff.Text == "恢复称量") + { + DB2105WriteHelper.StartWater(3); + ButtonE.HBOnOff.Text = "停止称量"; + } } #endregion diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/InitAction.cs index d3798b6..aba214b 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/InitAction.cs @@ -21,6 +21,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Button = System.Windows.Forms.Button; using IAction = Mesnac.Action.Base.IAction; namespace Mesnac.Action.ChemicalWeighing.AutoControl @@ -33,6 +34,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl MCLabelEntity LabelE = new MCLabelEntity(); MCComboBoxEntity ComboE = new MCComboBoxEntity(); MCRadioButtonEntity RadioE = new MCRadioButtonEntity(); + ButtonEntity buttonE = new ButtonEntity(); DB2105Helper dB2105Helper = new DB2105Helper(); DB2104Helper dB2104Helper = new DB2104Helper(); @@ -58,6 +60,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl ControlsHelper.ControlImport(ComboE, McControls); ControlsHelper.ControlImport(LabelE, McControls); ControlsHelper.ControlImport(RadioE, McControls); + ControlsHelper.ControlImport