From cd5c0b67e0c7fd5ac1a20c17058b82f181b52923 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, 12 Apr 2024 18:26:48 +0800 Subject: [PATCH 1/3] Collect --- ProductionSystem/Forms/HomeFormInfo.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs index 8ff5414..851b53d 100644 --- a/ProductionSystem/Forms/HomeFormInfo.cs +++ b/ProductionSystem/Forms/HomeFormInfo.cs @@ -1656,7 +1656,7 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1202"); t.Voltage = GetPlcValue("D1200"); - if (t.Electricity != "0.000" || t.Voltage != "0.0000") + if (t.Electricity != "0.000" || t.Voltage != "0.000") { _result2Service.AddTResult2(t); } @@ -1667,7 +1667,7 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1206"); t.Voltage = GetPlcValue("D1204"); - if (t.Electricity != "0.000" || t.Voltage != "0.0000") + if (t.Electricity != "0.000" || t.Voltage != "0.000") { _result2Service.AddTResult2(t); } @@ -1677,7 +1677,7 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1210"); t.Voltage = GetPlcValue("D1208"); - if (t.Electricity != "0.000" || t.Voltage != "0.0000") + if (t.Electricity != "0.000" || t.Voltage != "0.000") { _result2Service.AddTResult2(t); } @@ -1687,7 +1687,7 @@ namespace ProductionSystem.Forms { t.Xll = GetPlcValue("D1224"); t.Xllzt = GetPlcValue("D1226"); - if (t.Xll != "0.000" || t.Xllzt != "0.0000") + if (t.Xll != "0.000" || t.Xllzt != "0.000") { _result2Service.AddTResult2(t); } @@ -1700,7 +1700,7 @@ namespace ProductionSystem.Forms t.Xll = GetPlcValue("D1214"); t.Xllzt = GetPlcValue("D1114"); - if (t.Xll != "0.000" || t.Xllzt != "0.0000") + if (t.Xll != "0.000" || t.Xllzt != "0.000") { _result2Service.AddTResult2(t); } @@ -1712,7 +1712,7 @@ namespace ProductionSystem.Forms { t.Xll = GetPlcValue("D1216"); t.Xllzt = GetPlcValue("D1116"); - if (t.Xll != "0.000" || t.Xllzt != "0.0000") + if (t.Xll != "0.000" || t.Xllzt != "0.000") { _result2Service.AddTResult2(t); } @@ -1722,7 +1722,7 @@ namespace ProductionSystem.Forms { t.Xll = GetPlcValue("D1212"); t.Xllzt = GetPlcValue("D1112"); - if (t.Xll != "0.000" || t.Xllzt != "0.0000") + if (t.Xll != "0.000" || t.Xllzt != "0.000") { _result2Service.AddTResult2(t); } From 76a970041d7d3f7182ed28d2c462101b9ff29637 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, 12 Apr 2024 19:01:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B3=84=E6=BC=8F=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProductionSystem/Forms/HomeFormInfo.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs index 851b53d..773c6f2 100644 --- a/ProductionSystem/Forms/HomeFormInfo.cs +++ b/ProductionSystem/Forms/HomeFormInfo.cs @@ -1656,7 +1656,7 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1202"); t.Voltage = GetPlcValue("D1200"); - if (t.Electricity != "0.000" || t.Voltage != "0.000") + if (t.Electricity.ToDouble()>0 && t.Voltage.ToDouble()>0) { _result2Service.AddTResult2(t); } @@ -1667,7 +1667,7 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1206"); t.Voltage = GetPlcValue("D1204"); - if (t.Electricity != "0.000" || t.Voltage != "0.000") + if (t.Electricity.ToDouble() > 0 && t.Voltage.ToDouble() > 0) { _result2Service.AddTResult2(t); } @@ -1677,7 +1677,7 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1210"); t.Voltage = GetPlcValue("D1208"); - if (t.Electricity != "0.000" || t.Voltage != "0.000") + if (t.Electricity.ToDouble() > 0 && t.Voltage.ToDouble() > 0) { _result2Service.AddTResult2(t); } @@ -1687,7 +1687,7 @@ namespace ProductionSystem.Forms { t.Xll = GetPlcValue("D1224"); t.Xllzt = GetPlcValue("D1226"); - if (t.Xll != "0.000" || t.Xllzt != "0.000") + if (t.Xll.ToDouble()>0 ) { _result2Service.AddTResult2(t); } @@ -1700,7 +1700,7 @@ namespace ProductionSystem.Forms t.Xll = GetPlcValue("D1214"); t.Xllzt = GetPlcValue("D1114"); - if (t.Xll != "0.000" || t.Xllzt != "0.000") + if (t.Xll.ToDouble() > 0 ) { _result2Service.AddTResult2(t); } @@ -1712,7 +1712,7 @@ namespace ProductionSystem.Forms { t.Xll = GetPlcValue("D1216"); t.Xllzt = GetPlcValue("D1116"); - if (t.Xll != "0.000" || t.Xllzt != "0.000") + if (t.Xll.ToDouble() > 0 ) { _result2Service.AddTResult2(t); } @@ -1722,7 +1722,7 @@ namespace ProductionSystem.Forms { t.Xll = GetPlcValue("D1212"); t.Xllzt = GetPlcValue("D1112"); - if (t.Xll != "0.000" || t.Xllzt != "0.000") + if (t.Xll.ToDouble() > 0) { _result2Service.AddTResult2(t); } From 07e5b4bbeb32da174cf10df991f09d5d224b2f1d Mon Sep 17 00:00:00 2001 From: yangw Date: Fri, 12 Apr 2024 20:29:07 +0800 Subject: [PATCH 3/3] demo --- ProductionSystem/Forms/HomeFormInfo.cs | 3 +++ ProductionSystem/Program.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs index 773c6f2..b7cd400 100644 --- a/ProductionSystem/Forms/HomeFormInfo.cs +++ b/ProductionSystem/Forms/HomeFormInfo.cs @@ -731,6 +731,9 @@ namespace ProductionSystem.Forms EditonType editonType; while (!cancellationTokenSource.IsCancellationRequested && middleIsCanRound) { + + Step1(); + if (!Program.canSaveDb) { continue; diff --git a/ProductionSystem/Program.cs b/ProductionSystem/Program.cs index 9e3d2a0..5402c80 100644 --- a/ProductionSystem/Program.cs +++ b/ProductionSystem/Program.cs @@ -22,6 +22,7 @@ using NewLife.Log; namespace ProductionSystem { + //杨 internal static class Program { #region 使用的Win32函数的声明