From 64bcf7630998d4ef3759cfb2c8838df47ef50cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Fri, 15 Dec 2023 10:27:23 +0800 Subject: [PATCH] =?UTF-8?q?ReportReadDb=20=E8=AF=BB=E5=8F=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControl/MainDetailControlAction.cs | 8 +++++++- .../Report/ReportReadDb.cs | 13 ++++++++++--- .../Test/TestAction.cs | 2 +- DataBlockHelper/PlcConnect.cs | 1 - 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index fe8f7e9..7bd0c5c 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -28,6 +28,7 @@ using Mesnac.Action.ChemicalWeighing.InterfaceDocking; using Mesnac.Action.ChemicalWeighing.Report; using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity; using Mesnac.Core.Service; +using Mesnac.Basic; namespace Mesnac.Action.ChemicalWeighing.MainDetailControl { @@ -299,7 +300,12 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl if (ReadFlag >= 30) { ReadFlag = 0; - ReportReadDb.ReadFeededDry(); + var readName = UserInfo.Instance.RealName; + if (!string.IsNullOrEmpty(readName) && readName!= "mesnac" && readName != "Edit") + { + ReportReadDb.ReadFeededDry(); + } + } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs index 53f79f8..364c5d7 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs @@ -61,12 +61,13 @@ namespace Mesnac.Action.ChemicalWeighing.Report } - //水 + ///热水秤A + if (nornalStatus.RdyRpt_W1) { FeededWaterHA(dB2111Helper.hwReport_A); } - + ///冷水秤A if (nornalStatus.RdyRpt_W2) { FeededWaterCA(dB2111Helper.cwReport_A); @@ -77,6 +78,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report { FeededWaterHB(dB2111Helper.hwReport_B); } + ///冷水秤B if (nornalStatus.RdyRpt_W4) { FeededWaterCB(dB2111Helper.cwReport_B); @@ -123,6 +125,11 @@ namespace Mesnac.Action.ChemicalWeighing.Report DB2107WriteHelper.CleanWater(4); } + /// + /// 解决算法有问题 + /// + /// + /// private static void FeededDry(int deviceno, ReportDosEntity entity) { @@ -130,7 +137,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report int no = deviceno * 2; if (entity.eqNo == 1) { - no = deviceno-1; + no = no - 1; } var actValue = Convert.ToInt32(entity.actValue); string logName = $"螺旋{deviceno}向湿混机 [{no}] 投料 {actValue}"; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index ccc7493..00b4ee8 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -70,7 +70,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test mCButton.Click += MCButton_Click; - System.Timers.Timer t = new System.Timers.Timer(1000*20);//实例化Timer类,设置间隔时间为10000毫秒; + System.Timers.Timer t = new System.Timers.Timer(1000);//实例化Timer类,设置间隔时间为10000毫秒; t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//到达时间的时候执行事件; t.AutoReset = true;//设置是执行一次(false)还是一直执行(true); t.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件; diff --git a/DataBlockHelper/PlcConnect.cs b/DataBlockHelper/PlcConnect.cs index 888d8c5..c543ffe 100644 --- a/DataBlockHelper/PlcConnect.cs +++ b/DataBlockHelper/PlcConnect.cs @@ -21,7 +21,6 @@ namespace DataBlockHelper SiemensPLCS siemensPLCS = SiemensPLCS.S1500; SiemensS7Net s7 = new SiemensS7Net(siemensPLCS); s7.SetPersistentConnection(); - s7.IpAddress = "172.18.4.100"; s7.Port = 102; var su = s7.ConnectServer();