From 9d552e8112522caaad72303cd77b97c2490a1cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Wed, 31 Jul 2024 10:07:06 +0800 Subject: [PATCH] 2 --- .../LjMetage/InitDbAction.cs | 18 +++++++++++++++++ .../LjMetage/MetageHelp.cs | 3 --- .../OliveEQSetting/InItDbAction.cs | 20 +++++++++++++++++-- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/InitDbAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/InitDbAction.cs index 1e1db9e..d9d2d9a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/InitDbAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/InitDbAction.cs @@ -37,6 +37,24 @@ namespace Mesnac.Action.ChemicalWeighing.LjMetage DataTable table = DBHelp.GetTable(@"select Id, Name, HighSpeed, LowSpeed, WeightSlow, Precut, JogTime from MetageSetting"); + + foreach (DataRow row in table.Rows) + { + string name=row["name"].ToString(); + if(name == "大仓G") + { + row["name"] = "大仓J"; + } + else + { + if (name == "大仓J") + { + row["name"] = "大仓G"; + } + } + } + + if (this._materialGridControl != null && this._materialGridControl.BaseControl != null) { this._materialGridControl.BaseControl.BindDataSource = null; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/MetageHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/MetageHelp.cs index 1ccff77..084ed04 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/MetageHelp.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMetage/MetageHelp.cs @@ -24,9 +24,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjMetage int jobTime = start + 16; PlcConnect.Instance.Write($"DB2107.{highSpeed}.0", view.HighSpeed); - - - PlcConnect.Instance.Write($"DB2107.{lowSpeed}.0", view.LowSpeed); PlcConnect.Instance.Write($"DB2107.{weightSlow}.0", view.WeightSlow); PlcConnect.Instance.Write($"DB2107.{precut}.0", view.Precut); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs index c1bd882..69757ce 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/OliveEQSetting/InItDbAction.cs @@ -292,8 +292,24 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting } DataTable table = - DBHelp.GetTable(@"select Id, Name, HighSpeed, LowSpeed, WeightSlow, Precut, JogTime from MetageSetting"); - + DBHelp.GetTable(@"select Id, Name, HighSpeed, LowSpeed, WeightSlow, Precut, JogTime from MetageSetting order by Soc"); + + foreach (DataRow row in table.Rows) + { + string name = row["name"].ToString(); + if (name == "大仓G") + { + row["name"] = "大仓J"; + } + else + { + if (name == "大仓J") + { + row["name"] = "大仓G"; + } + } + } + if (materialGridControl != null && materialGridControl.BaseControl != null) { materialGridControl.BaseControl.BindDataSource = null;