From e59f052e1f8ea97c365941368d5e67cde08e9dc1 Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 8 Dec 2023 17:07:08 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E6=B7=BB=E5=8A=A0=E4=BA=A7=E7=BA=BF?= =?UTF-8?q?=E7=A7=8D=E7=B1=BB=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InterfaceDocking/HttpResponse.cs | 16 ++++++++-------- .../MainDetailControlAction.cs | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs index f5024f8..89c88c8 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs @@ -13,17 +13,17 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking { public class HttpResponse { - public string PostResponse(TankIsDischargedSyncEntity taskIsDisChargedSyncEntity) + public string PostResponse(TankIsDischargedSyncEntity taskIsDisChargedSyncEntity) { return Post("http://192.168.202.23:5001/api/ReceivingAndFeedingMaterials/TankIsDischargedSync", taskIsDisChargedSyncEntity.JsonTo()); - + } - public string PostUsed(int deCode, string used) + public string PostUsed(int deCode, string used) { - string stry = new LGusedEntity(deCode, used).JsonTo(); + string stry = new LGusedEntity(deCode, used).JsonTo(); return Post("http://192.168.202.34:8080/mes/wcsInterface/saveLGusedLog", stry); } @@ -41,7 +41,7 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking string stry = new GetLGInfoEntity().JsonTo(); var str = Post("http://192.168.202.34:30000/prod-api/open/openInterface/getLGInfo", stry); var job = JObject.Parse(str); - if (job["code"].ToString()== "200") + if (job["code"].ToString() == "200") { JArray arr = job["data"] as JArray; foreach (JObject item in arr) @@ -62,15 +62,15 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking return dic; } } - - private string Post(string url,string postData) + + private string Post(string url, string postData) { HttpItem item = new HttpItem() { - + URL = url, //URL 必需项 Method = "post",//URL 可选项 默认为Get ContentType = "application/json",//返回类型 可选项有默认值 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index a25de57..a1f3a5f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -29,6 +29,7 @@ using Mesnac.Action.ChemicalWeighing.FreeDb; using Mesnac.Action.ChemicalWeighing.ManualControl; using DevExpress.Pdf.Native; using DevExpress.Utils.Drawing.Helpers; +using Mesnac.Action.ChemicalWeighing.InterfaceDocking; namespace Mesnac.Action.ChemicalWeighing.MainDetailControl { @@ -47,7 +48,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl private string AlarmString = "报警信息 "; - int LineKindFlag; + int LineKindFlag = 0; //DataTable ParametersWithPCTable = new DataTable(); @@ -159,6 +160,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl this.AlarmForm.BaseControl.BindDataSource = TempTable; } + SetMCLabel(LabelE.LineKind1, new HttpResponse().GetLGInfo()[1]); + SetMCLabel(LabelE.LineKind2, new HttpResponse().GetLGInfo()[2]); + SetMCLabel(LabelE.LineKind3, new HttpResponse().GetLGInfo()[3]); + SetMCLabel(LabelE.LineKind4, new HttpResponse().GetLGInfo()[4]); + timer = new Timer(); timer.Interval = 1000; timer.Enabled = true; @@ -274,7 +280,15 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl timer.Dispose(); } - + LineKindFlag += 1; + if(LineKindFlag >= 300) + { + LineKindFlag = 0; + SetMCLabel(LabelE.LineKind1, new HttpResponse().GetLGInfo()[1]); + SetMCLabel(LabelE.LineKind2, new HttpResponse().GetLGInfo()[2]); + SetMCLabel(LabelE.LineKind3, new HttpResponse().GetLGInfo()[3]); + SetMCLabel(LabelE.LineKind4, new HttpResponse().GetLGInfo()[4]); + } var reachSingle = RgvPlcUtil.GetRGVAllError(); var mixSingle = Db3000Helper.ReadDb();