From 88b2ffbbfd1591e094a63ebb5eaa3ce6ecf7dea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Mon, 15 Jan 2024 09:28:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=87=AA=E5=8A=A8=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjElectrical/UpAction.cs | 13 +++---- .../LjMetage/UpAction.cs | 36 +++++++++--------- .../LjPressure/UpAction.cs | 13 +++---- .../LjProportional/UpAction.cs | 38 ++++++++++--------- .../LjWeight/UpAction.cs | 38 ++++++++++--------- .../OliveEQSetting/InItDbAction.cs | 13 +++++++ 6 files changed, 82 insertions(+), 69 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjElectrical/UpAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjElectrical/UpAction.cs index 85d6708..9187e25 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjElectrical/UpAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjElectrical/UpAction.cs @@ -20,17 +20,14 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ElectricalSetting") .FirstOrDefault(); //获取物料数据控件 - - - if (MessageBox.Show("确定上传变频参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) - { - DoWord(); - }; - + + + DoWord(); + } - private void DoWord() + public void DoWord() { var view = ElectricalPlc.UpFromPlc(); foreach (var v in view) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/UpAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/UpAction.cs index 726f73a..a49ead7 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/UpAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/UpAction.cs @@ -20,23 +20,25 @@ namespace Mesnac.Action.ChemicalWeighing.LjMetage DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "MetageSetting") .FirstOrDefault(); //获取物料数据控件 - - - if (MessageBox.Show("确定上传称量频参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) - { - LoadingHelper.ShowLoadingScreen(); - var watchDog = LjHelp.WatchDog; - if (watchDog == 0) - { - LoadingHelper.CloseForm(); - MessageBox.Show("PLC通讯失败"); - return; - } - - DoWord(); - LoadingHelper.CloseForm(); - }; - + + + //if (MessageBox.Show("确定上传称量频参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) + //{ + // LoadingHelper.ShowLoadingScreen(); + // var watchDog = LjHelp.WatchDog; + // if (watchDog == 0) + // { + // LoadingHelper.CloseForm(); + // MessageBox.Show("PLC通讯失败"); + // return; + // } + + + // LoadingHelper.CloseForm(); + //}; + + DoWord(); + } private void DoWord() diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs index c34b9ba..01efb18 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs @@ -19,14 +19,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "pressureSetting") .FirstOrDefault(); //获取物料数据控件 - - - if (MessageBox.Show("确定上传压力参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) - { - DoWord(); - }; - - + + + DoWord(); + + } private void DoWord() diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpAction.cs index d7679e2..91ec63f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpAction.cs @@ -20,24 +20,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ProportionalSetting") .FirstOrDefault(); //获取物料数据控件 - - - if (MessageBox.Show("确定上传比例阀参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) - { - - LoadingHelper.ShowLoadingScreen(); - var watchDog = LjHelp.WatchDog; - if (watchDog == 0) - { - LoadingHelper.CloseForm(); - MessageBox.Show("PLC通讯失败"); - return; - } - - DoWord(); - LoadingHelper.CloseForm(); - }; - + + + //if (MessageBox.Show("确定上传比例阀参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) + //{ + + // LoadingHelper.ShowLoadingScreen(); + // var watchDog = LjHelp.WatchDog; + // if (watchDog == 0) + // { + // LoadingHelper.CloseForm(); + // MessageBox.Show("PLC通讯失败"); + // return; + // } + + + // LoadingHelper.CloseForm(); + //}; + + DoWord(); + } private void DoWord() diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjWeight/UpAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjWeight/UpAction.cs index 4603795..5b7a60e 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjWeight/UpAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjWeight/UpAction.cs @@ -20,24 +20,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "WeightSetting") .FirstOrDefault(); //获取物料数据控件 - - - if (MessageBox.Show("确定上传重量参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) - { - - LoadingHelper.ShowLoadingScreen(); - var watchDog = LjHelp.WatchDog; - if (watchDog == 0) - { - LoadingHelper.CloseForm(); - MessageBox.Show("PLC通讯失败"); - return; - } - - DoWord(); - LoadingHelper.CloseForm(); - }; - + + + //if (MessageBox.Show("确定上传重量参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) + //{ + + // LoadingHelper.ShowLoadingScreen(); + // var watchDog = LjHelp.WatchDog; + // if (watchDog == 0) + // { + // LoadingHelper.CloseForm(); + // MessageBox.Show("PLC通讯失败"); + // return; + // } + + + // LoadingHelper.CloseForm(); + //}; + + DoWord(); + } private void DoWord() diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs index f1ef8c6..0b5f0f7 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs @@ -8,6 +8,13 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting { public class InItDbAction: ChemicalWeighingAction, IAction { + + LjElectrical.UpAction UpActionElectrical = new LjElectrical.UpAction(); + LjMetage.UpAction UpActionMetage = new LjMetage.UpAction(); + LjPressure.UpAction UpActionPressure = new LjPressure.UpAction(); + LjProportional.UpAction UpActionProportional = new LjProportional.UpAction(); + LjWeight.UpAction UpActionWeight = new LjWeight.UpAction(); + public void Run(RuntimeParameter runtime) { base.RunIni(runtime); //必须调用 @@ -17,6 +24,12 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting FillElectricalSetting(); FillMetageSetting(); InitEvent(); + + UpActionElectrical.Run(runtime); + UpActionMetage.Run(runtime); + UpActionPressure.Run(runtime); + UpActionProportional.Run(runtime); + UpActionWeight.Run(runtime); } private void InitEvent()