From 4fb0b10928101067a58ef41a85e035a79d48302c Mon Sep 17 00:00:00 2001 From: wangsr Date: Tue, 10 Oct 2023 23:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E5=A4=9C=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InterfaceDocking/HttpResponse.cs | 2 +- .../ManualControl/InitAction.cs | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs index fc0f5d0..ef7c2ab 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs @@ -29,7 +29,7 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking catch (Exception ex) { string message = $" url:{item.URL} {Environment.NewLine} Data:{item.Postdata} {Environment.NewLine} 异常信息:{ex.Message}"; - return ex.Message; + return message; } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs index 6d8a016..9508e19 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs @@ -5,6 +5,8 @@ using log4net; using log4net.Config; using Mesnac.Action.Base; using Mesnac.Action.ChemicalWeighing.FreeDb; +using Mesnac.Action.ChemicalWeighing.InterfaceDocking; +using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity; using Mesnac.Action.ChemicalWeighing.LjMaterial; using Mesnac.Basic; using Mesnac.Controls.Base; @@ -143,8 +145,38 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl timer.Tick += new EventHandler(ReadFromPlc);//添加事件 } + private void Timer1_Tick() + { + + + + } + + + private void Time(int deviceNo,string statu) + { + TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity() + { + reqCode = System.Guid.NewGuid().ToString(), + reqTime = DateTime.Now, + deviceNo = deviceNo.ToString(), + state = statu.ToString(), + }; + HttpResponse httpResponse = new HttpResponse(); + ManualLogControl("湿混机1下发请求"); + MesnacServiceManager.Instance.LoggingService.Info("湿混机1下发请求"); + string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity); + ManualLogControl("湿混机1返回数据 " + returnTest); + MesnacServiceManager.Instance.LoggingService.Info("湿混机1返回数据" + returnTest); + } + + + private void ReadFromPlc(object sender, EventArgs e) { + + Timer1_Tick(); + flag += 1; if (flag > 10) {