From 369b2dfa5410486876fb3e3604bdcd10212a1fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Tue, 9 Apr 2024 21:08:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProductionSystem/Forms/HomeForm.cs | 13 ++++++++----- ProductionSystem/Untils/MFSerialInfo.cs | 6 +++++- ProductionSystem/Untils/Tool/UxTool.cs | 9 ++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ProductionSystem/Forms/HomeForm.cs b/ProductionSystem/Forms/HomeForm.cs index 0b72eee..1141275 100644 --- a/ProductionSystem/Forms/HomeForm.cs +++ b/ProductionSystem/Forms/HomeForm.cs @@ -760,7 +760,7 @@ namespace ProductionSystem.Forms - var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB); + var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType); //var stf1= model.STF1; //SitongTool sitongTool = new SitongTool(stf1.Com,stf1.TargetVal.ToDouble().ToInt()); //var si1 = sitongTool.ToAction(); @@ -777,17 +777,20 @@ namespace ProductionSystem.Forms var pzf1 = model.PZF1; - ExvTool exv = new ExvTool("COM10", 576); - var exv1 = exv.ToAction(); + ExvTool exv = new ExvTool(pzf1.Com, pzf1.TargetVal.ToDouble().ToInt()); + // var exv1 = exv.ToAction(); //水泵1 + var sb1 = model.SB1; + UxTool uxTool = new UxTool(sb1.Com, sb1.TargetVal.ToDouble().ToInt()); + - UxTool uxTool = new UxTool("COM10", 255); - var ya= uxTool.ToAction(); + + Thread.Sleep(2000); diff --git a/ProductionSystem/Untils/MFSerialInfo.cs b/ProductionSystem/Untils/MFSerialInfo.cs index 49c2620..b7b66e3 100644 --- a/ProductionSystem/Untils/MFSerialInfo.cs +++ b/ProductionSystem/Untils/MFSerialInfo.cs @@ -64,7 +64,11 @@ namespace ProductionSystem.Untils for (int i = 0; i < num; i++) { - if (Exit) break; + if (Exit) + { + Dispose(); + break; + } _mfser.SendMsg(Entrance, data); Thread.Sleep(mill); diff --git a/ProductionSystem/Untils/Tool/UxTool.cs b/ProductionSystem/Untils/Tool/UxTool.cs index ed3dada..a4ff2cc 100644 --- a/ProductionSystem/Untils/Tool/UxTool.cs +++ b/ProductionSystem/Untils/Tool/UxTool.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.VisualBasic; namespace ProductionSystem.Untils.Tool { @@ -26,6 +27,9 @@ namespace ProductionSystem.Untils.Tool this.mo = mo; } + + public string Val { get; set; } + public bool ToAction() { @@ -43,6 +47,7 @@ namespace ProductionSystem.Untils.Tool bool b = false; + MfSerialInfo mfSerialInfo = new MfSerialInfo(0x21, 0x29, com, "19200"); @@ -64,6 +69,8 @@ namespace ProductionSystem.Untils.Tool intelLsb = me.GetMotoralaLsb(24, 8); XTrace.WriteLine("RealRPM: {0}", intelLsb); + Val = intelLsb.ToString(); + int begin = Convert.ToInt32(intelLsb) - 5; int end = Convert.ToInt32(intelLsb) + 5; @@ -80,7 +87,7 @@ namespace ProductionSystem.Untils.Tool }; - mfSerialInfo.SendMsg(sendMes,30); + mfSerialInfo.SendMsg(sendMes,40); return b;