From 5334b1106ce20bdea08e25287df6ad5d135b681d 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, 16 Dec 2023 16:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A4=E6=8C=89=E9=92=AE=E6=9A=82=E5=81=9C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoControl/PlcAutoWriteHelper.cs | 49 +------ .../ManualControl/ForceWaterControl.cs | 136 ++++++++++-------- 2 files changed, 77 insertions(+), 108 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs index ca2356d..19f7151 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs @@ -734,54 +734,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl DB2105Helper dB2105= new DB2105Helper(); bool run = false; var singE = ControlsHelper.SingleSelect(RadioE); - switch (singE) - { - case 1: - case 2: - var h1 = dB2105.H1; - if (h1.RunStatus) - { - ShowError(); - run = true; - - } - break; - - case 3: - case 4: - var h2 = dB2105.H2; - if (h2.RunStatus) - { - ShowError(); - run = true; - - } - break; - - case 5: - case 6: - var h3 = dB2105.H3; - if (h3.RunStatus) - { - ShowError(); - run = true; - - } - break; - - - case 7: - case 8: - var h4 = dB2105.H4; - if (h4.RunStatus) - { - ShowError(); - run = true; - - } - break; - - } + if (run == false) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs index 1f0464e..8d23515 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs @@ -123,75 +123,91 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (ButtonE.StartMetage1 == runtime.Sender) { - if (!DB2105.Force_CA.forceOn) - { - MessageBox.Show("冷水称A强制控制按钮未打开!"); - return; - } - if (MessageBox.Show("确认向冷水称A补充?", "强制模式启动确认", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } - DB2105WriteHelper.AddCaAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue1.Text)); - DB2105WriteHelper.AddCaAddForceBin(GelChooseA); - DB2105WriteHelper.AddCaAddStartIn(true); - ManualLogControl("冷水称A强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue1.Text), GelChooseA); - MessageBox.Show("冷水称A强制补充"); + + MessageBox.Show("此按钮暂停使用!"); + return; + + //if (!DB2105.Force_CA.forceOn) + //{ + // MessageBox.Show("冷水称A强制控制按钮未打开!"); + // return; + //} + //if (MessageBox.Show("确认向冷水称A补充?", "强制模式启动确认", + // MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + //{ + // return; + //} + //DB2105WriteHelper.AddCaAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue1.Text)); + //DB2105WriteHelper.AddCaAddForceBin(GelChooseA); + //DB2105WriteHelper.AddCaAddStartIn(true); + //ManualLogControl("冷水称A强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue1.Text), GelChooseA); + //MessageBox.Show("冷水称A强制补充"); } if (ButtonE.StartMetage2 == runtime.Sender) { - if (!DB2105.Force_HA.forceOn) - { - MessageBox.Show("热水称A强制控制按钮未打开!"); - return; - } - if (MessageBox.Show("确认向热水称A补充?", "强制模式启动确认", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } - DB2105WriteHelper.AddHaAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue2.Text)); - DB2105WriteHelper.AddHaAddForceBin(GelChooseA); - DB2105WriteHelper.AddHaAddStartIn(true); - ManualLogControl("热水称A强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue2.Text), GelChooseA); - MessageBox.Show("热水称A强制补充"); + + MessageBox.Show("此按钮暂停使用!"); + return; + + //if (!DB2105.Force_HA.forceOn) + //{ + // MessageBox.Show("热水称A强制控制按钮未打开!"); + // return; + //} + //if (MessageBox.Show("确认向热水称A补充?", "强制模式启动确认", + // MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + //{ + // return; + //} + //DB2105WriteHelper.AddHaAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue2.Text)); + //DB2105WriteHelper.AddHaAddForceBin(GelChooseA); + //DB2105WriteHelper.AddHaAddStartIn(true); + //ManualLogControl("热水称A强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue2.Text), GelChooseA); + //MessageBox.Show("热水称A强制补充"); } if (ButtonE.StartMetage3 == runtime.Sender) { - if (!DB2105.Force_CB.forceOn) - { - MessageBox.Show("冷水称B强制控制按钮未打开!"); - return; - } - if (MessageBox.Show("确认向冷水称B补充?", "强制模式启动确认", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } - DB2105WriteHelper.AddCbAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue3.Text)); - DB2105WriteHelper.AddCbAddForceBin(GelChooseB); - DB2105WriteHelper.AddCbAddStartIn(true); - ManualLogControl("冷水称B强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue3.Text), GelChooseB + 4); - MessageBox.Show("冷水称B强制补充"); + + MessageBox.Show("此按钮暂停使用!"); + return; + + //if (!DB2105.Force_CB.forceOn) + //{ + // MessageBox.Show("冷水称B强制控制按钮未打开!"); + // return; + //} + //if (MessageBox.Show("确认向冷水称B补充?", "强制模式启动确认", + // MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + //{ + // return; + //} + //DB2105WriteHelper.AddCbAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue3.Text)); + //DB2105WriteHelper.AddCbAddForceBin(GelChooseB); + //DB2105WriteHelper.AddCbAddStartIn(true); + //ManualLogControl("冷水称B强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue3.Text), GelChooseB + 4); + //MessageBox.Show("冷水称B强制补充"); } if (ButtonE.StartMetage4 == runtime.Sender) { - if (!DB2105.Force_HB.forceOn) - { - MessageBox.Show("热水称B强制控制按钮未打开!"); - return; - } - if (MessageBox.Show("确认向热水称B补充?", "强制模式启动确认", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } - DB2105WriteHelper.AddHbAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue4.Text)); - DB2105WriteHelper.AddHbAddForceBin(GelChooseB); - DB2105WriteHelper.AddHbAddStartIn(true); - ManualLogControl("热水称B强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue4.Text), GelChooseB + 4); - MessageBox.Show("热水称B强制补充"); + + MessageBox.Show("此按钮暂停使用!"); + return; + + //if (!DB2105.Force_HB.forceOn) + //{ + // MessageBox.Show("热水称B强制控制按钮未打开!"); + // return; + //} + //if (MessageBox.Show("确认向热水称B补充?", "强制模式启动确认", + // MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + //{ + // return; + //} + //DB2105WriteHelper.AddHbAddValue(Convert.ToInt16(MCTextBoxE.SetWaterValue4.Text)); + //DB2105WriteHelper.AddHbAddForceBin(GelChooseB); + //DB2105WriteHelper.AddHbAddStartIn(true); + //ManualLogControl("热水称B强制补充", Convert.ToInt16(MCTextBoxE.SetWaterValue4.Text), GelChooseB + 4); + //MessageBox.Show("热水称B强制补充"); }