From 715a3606b937e6e81b2fd70157f8b2d5018cd71f Mon Sep 17 00:00:00 2001 From: yangw Date: Tue, 16 Apr 2024 16:57:06 +0800 Subject: [PATCH] demo --- ProductionSystem/Forms/HomeFormInfo.cs | 9 +++------ ProductionSystem/Untils/Tool/UxTool.cs | 4 ++-- ProductionSystem/Untils/Tool/Uy.cs | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs index b49aab1..a540927 100644 --- a/ProductionSystem/Forms/HomeFormInfo.cs +++ b/ProductionSystem/Forms/HomeFormInfo.cs @@ -638,9 +638,6 @@ namespace ProductionSystem.Forms middleIsCanRound = false; Thread.Sleep(Program.ReadPlcRate); - - - //自动模式 如果是手动模式就是false if (D1004) { @@ -923,12 +920,12 @@ namespace ProductionSystem.Forms //水泵2关闭 _uxTool.closeSend(); - TmTool.WritePlc(TmTool.ShuiBeng2, 1); - + TmTool.WritePlc(TmTool.ShuiBeng2, 1); + //启动水泵3 PWMHelper.Open(); - + TmTool.WritePlc(TmTool.ShuiBeng3, 1); } diff --git a/ProductionSystem/Untils/Tool/UxTool.cs b/ProductionSystem/Untils/Tool/UxTool.cs index 9501f74..50c20d6 100644 --- a/ProductionSystem/Untils/Tool/UxTool.cs +++ b/ProductionSystem/Untils/Tool/UxTool.cs @@ -103,14 +103,14 @@ namespace ProductionSystem.Untils.Tool public string GetMsg(int num) { - uint seep = uint.Parse((mo * 0.4).ToString()); + uint seep = uint.Parse((num * 0.4).ToString()); Write = seep.ToString(); XTrace.WriteLine($"水泵Ux 第[{mo}-{com}]个 写入真实速度:{seep}"); MFMsgVariable me = new MFMsgVariable(8); me.AddMotoralaLsb(0, 8, seep); - return me.GetByteDat().ToHex(); + return me.GetByteDat().ToHex(" "); } private TimerX _timer; diff --git a/ProductionSystem/Untils/Tool/Uy.cs b/ProductionSystem/Untils/Tool/Uy.cs index 06e098b..14b8bcc 100644 --- a/ProductionSystem/Untils/Tool/Uy.cs +++ b/ProductionSystem/Untils/Tool/Uy.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using System.Threading; using System.Threading.Tasks; using NewLife; @@ -40,7 +41,7 @@ namespace ProductionSystem.Untils.Tool public bool ToAction() { - uint seep = uint.Parse((mo * 0.4).ToString()); + uint seep = uint.Parse((mo * 0.4).ToString(CultureInfo.InvariantCulture)); Write = seep.ToString(); XTrace.WriteLine($"水泵Uy 第[{mo}-{com}]个 写入真实速度:{seep}"); @@ -112,7 +113,6 @@ namespace ProductionSystem.Untils.Tool var sendMes = GetMsg(mo); _timer= new TimerX(DoBackup, sendMes, 100, 800) { Async = true }; - } private void DoBackup(Object state)