From e966f2b130bfed127226b443b3fc8c41449313dd Mon Sep 17 00:00:00 2001 From: SoulStar Date: Sat, 20 Dec 2025 14:44:19 +0800 Subject: [PATCH] change - ForTest --- .../CFXBusiness/CFXUnitProcessedDataGet.cs | 70 +++++++++---------- .../GetActiveFaultsRequestReceived1.cs | 38 +++++----- .../GetActiveFaultsRequestReceived2.cs | 20 +++--- .../GetActiveFaultsRequestReceived3.cs | 18 ++--- .../GetActiveRecipeRequestReceived1.cs | 22 +++--- Sln.Iot/Program.cs | 36 +++++----- 6 files changed, 103 insertions(+), 101 deletions(-) diff --git a/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs b/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs index 32285cf..9cc23d0 100644 --- a/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs +++ b/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs @@ -23,29 +23,29 @@ namespace Sln.Iot.CFX.CFXBusiness /// public CommonProcessData ProcessDataGet1(UnitsProcess1Entity entity) { - //entity = new UnitsProcess1Entity() - //{ - // GlueAmountSetValue1 = 123.4f, - // GluePushSpeedSetValue1 = 10.1f, - // BarrelA1TempActValue1 = 60, - // BarrelA2TempActValue1 = 60, - // BarrelB1TempActValue1 = 60, - // BarrelB2TempActValue1 = 60, - // PumpAPressureActValue1 = 3.5f, - // PumpBPressureActValue1 = 3.2f, - // VacuumDegreeActValue1 = 3000.4f, - // PressureHoldTimeSetValue1 = 100, - // GlueAmountSetValue2 = 123.4f, - // GluePushSpeedSetValue2 = 10.1f, - // BarrelA1TempActValue2 = 60, - // BarrelA2TempActValue2 = 60, - // BarrelB1TempActValue2 = 60, - // BarrelB2TempActValue2 = 60, - // PumpAPressureActValue2 = 3.5f, - // PumpBPressureActValue2 = 3.2f, - // VacuumDegreeActValue2 = 3000.4f, - // PressureHoldTimeSetValue2 = 100, - //}; + entity = new UnitsProcess1Entity() + { + GlueAmountSetValue1 = 123.4f, + GluePushSpeedSetValue1 = 10.1f, + BarrelA1TempActValue1 = 60, + BarrelA2TempActValue1 = 60, + BarrelB1TempActValue1 = 60, + BarrelB2TempActValue1 = 60, + PumpAPressureActValue1 = 3.5f, + PumpBPressureActValue1 = 3.2f, + VacuumDegreeActValue1 = 3000.4f, + PressureHoldTimeSetValue1 = 100, + GlueAmountSetValue2 = 123.4f, + GluePushSpeedSetValue2 = 10.1f, + BarrelA1TempActValue2 = 60, + BarrelA2TempActValue2 = 60, + BarrelB1TempActValue2 = 60, + BarrelB2TempActValue2 = 60, + PumpAPressureActValue2 = 3.5f, + PumpBPressureActValue2 = 3.2f, + VacuumDegreeActValue2 = 3000.4f, + PressureHoldTimeSetValue2 = 100, + }; CommonProcessData processData = new CommonProcessData() { @@ -230,18 +230,18 @@ namespace Sln.Iot.CFX.CFXBusiness /// public CommonProcessData ProcessDataGet3(UnitsProcess3Entity entity) { - //entity = new UnitsProcess3Entity() - //{ - // PreheatOvenTempActValue = 800, - // PreCureOven1TempActValue = 800, - // PreCureOven2TempActValue = 800, - // PreCureOven3TempActValue = 800, - // PreCureOven4TempActValue = 800, - // CureOven1TempActValue = 800, - // CureOven2TempActValue = 800, - // CureOven3TempActValue = 800, - // CureOven4TempActValue = 800, - //}; + entity = new UnitsProcess3Entity() + { + PreheatOvenTempActValue = 800, + PreCureOven1TempActValue = 800, + PreCureOven2TempActValue = 800, + PreCureOven3TempActValue = 800, + PreCureOven4TempActValue = 800, + CureOven1TempActValue = 800, + CureOven2TempActValue = 800, + CureOven3TempActValue = 800, + CureOven4TempActValue = 800, + }; CommonProcessData processData = new CommonProcessData() { diff --git a/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived1.cs b/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived1.cs index 9474e2b..bbfec5d 100644 --- a/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived1.cs +++ b/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived1.cs @@ -48,27 +48,27 @@ public class GetActiveFaultsRequestReceived1 : BaseGetActiveFaultsRequestReceive public override CFXMessage SubHandle(GetActiveFaultsRequest request) { // 获取现在所有的错误 - var errorList1 = errorService.GetV1List().ToList(); - var errorList2 = errorService.GetV2List().ToList(); + //var errorList1 = errorService.GetV1List().ToList(); + //var errorList2 = errorService.GetV2List().ToList(); - List faults = new List(); + //List faults = new List(); - foreach (var fault in errorList1) - { - faults.Add(new Fault() - { - Description = fault.ErrorName, - FaultCode = fault.ErrorCode, - }); - } - foreach (var fault in errorList2) - { - faults.Add(new Fault() - { - Description = fault.ErrorName, - FaultCode = fault.ErrorCode, - }); - } + //foreach (var fault in errorList1) + //{ + // faults.Add(new Fault() + // { + // Description = fault.ErrorName, + // FaultCode = fault.ErrorCode, + // }); + //} + //foreach (var fault in errorList2) + //{ + // faults.Add(new Fault() + // { + // Description = fault.ErrorName, + // FaultCode = fault.ErrorCode, + // }); + //} CFXMessage response = new GetActiveFaultsResponse() { diff --git a/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived2.cs b/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived2.cs index 9d5f9eb..7f71bc3 100644 --- a/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived2.cs +++ b/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived2.cs @@ -48,18 +48,18 @@ public class GetActiveFaultsRequestReceived2 : BaseGetActiveFaultsRequestReceive public override CFXMessage SubHandle(GetActiveFaultsRequest request) { // 获取现在所有的错误 - var errorList = errorService.GetLiftList().ToList(); + //var errorList = errorService.GetLiftList().ToList(); - List faults = new List(); + //List faults = new List(); - foreach (var fault in errorList) - { - faults.Add(new Fault() - { - Description = fault.ErrorName, - FaultCode = fault.ErrorCode, - }); - } + //foreach (var fault in errorList) + //{ + // faults.Add(new Fault() + // { + // Description = fault.ErrorName, + // FaultCode = fault.ErrorCode, + // }); + //} CFXMessage response = new GetActiveFaultsResponse() { diff --git a/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived3.cs b/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived3.cs index 410c2d7..cb725ff 100644 --- a/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived3.cs +++ b/Sln.Iot.CFX/CFXRequestes/GetActiveFaultsRequestReceived3.cs @@ -50,16 +50,16 @@ public class GetActiveFaultsRequestReceived3 : BaseGetActiveFaultsRequestReceive // 获取现在所有的错误 var errorList = errorService.GetOvenList().ToList(); - List faults = new List(); + //List faults = new List(); - foreach (var fault in errorList) - { - faults.Add(new Fault() - { - Description = fault.ErrorName, - FaultCode = fault.ErrorCode, - }); - } + //foreach (var fault in errorList) + //{ + // faults.Add(new Fault() + // { + // Description = fault.ErrorName, + // FaultCode = fault.ErrorCode, + // }); + //} CFXMessage response = new GetActiveFaultsResponse() { diff --git a/Sln.Iot.CFX/CFXRequestes/GetActiveRecipeRequestReceived1.cs b/Sln.Iot.CFX/CFXRequestes/GetActiveRecipeRequestReceived1.cs index 5588d7e..50f6c99 100644 --- a/Sln.Iot.CFX/CFXRequestes/GetActiveRecipeRequestReceived1.cs +++ b/Sln.Iot.CFX/CFXRequestes/GetActiveRecipeRequestReceived1.cs @@ -54,18 +54,18 @@ public class GetActiveRecipeRequestReceived1 : BaseGetActiveRecipeRequestReceive string restr1 = string.Empty; string restr2 = string.Empty; - //获取现在激活的配方 - var res1 = _plc.ReadBytes(_plc.DeltaInstance1, "D600", 10); - var res2 = _plc.ReadBytes(_plc.DeltaInstance2, "D600", 10); + ////获取现在激活的配方 + //var res1 = _plc.ReadBytes(_plc.DeltaInstance1, "D600", 10); + //var res2 = _plc.ReadBytes(_plc.DeltaInstance2, "D600", 10); - if (res1.IsSuccess) - { - restr1 = Encoding.ASCII.GetString(res1.Content); - } - if (res2.IsSuccess) - { - restr2 = Encoding.ASCII.GetString(res2.Content); - } + //if (res1.IsSuccess) + //{ + // restr1 = Encoding.ASCII.GetString(res1.Content); + //} + //if (res2.IsSuccess) + //{ + // restr2 = Encoding.ASCII.GetString(res2.Content); + //} CFXMessage response = new GetActiveRecipeResponse() { diff --git a/Sln.Iot/Program.cs b/Sln.Iot/Program.cs index cf9931f..e812fa6 100644 --- a/Sln.Iot/Program.cs +++ b/Sln.Iot/Program.cs @@ -61,21 +61,21 @@ namespace Sln.Iot //配置文件加载 var appConfig = AppConfigSetting.Load(); //PLC连接初始化 - PLCConnect.Instance.InitConnect(); + //PLCConnect.Instance.InitConnect(); - //CFX接口启动 - //真空注胶机 - CFXConnect1.Instance.Init("CFX.A00.SDSH000001", - new Uri("amqp://127.0.0.1:1235"), - new Uri("amqp://127.0.0.1:30031")); - //升降回流 - CFXConnect2.Instance.Init("CFX.A00.SDSH000002", - new Uri("amqp://127.0.0.1:1236"), - new Uri("amqp://127.0.0.1:30031")); - //隧道烤箱 - CFXConnect3.Instance.Init("CFX.A00.SDSH000003", - new Uri("amqp://127.0.0.1:1237"), - new Uri("amqp://127.0.0.1:30031")); + ////CFX接口启动 + ////真空注胶机 + //CFXConnect1.Instance.Init("CFX.A00.SDSH000001", + // new Uri("amqp://127.0.0.1:1235"), + // new Uri("amqp://127.0.0.1:30031")); + ////升降回流 + //CFXConnect2.Instance.Init("CFX.A00.SDSH000002", + // new Uri("amqp://127.0.0.1:1236"), + // new Uri("amqp://127.0.0.1:30031")); + ////隧道烤箱 + //CFXConnect3.Instance.Init("CFX.A00.SDSH000003", + // new Uri("amqp://127.0.0.1:1237"), + // new Uri("amqp://127.0.0.1:30031")); ////CFX接口启动 @@ -94,12 +94,14 @@ namespace Sln.Iot //业务类启动 - BusinessStart business = new BusinessStart(); + //BusinessStart business = new BusinessStart(); log.Info($"系统启动成功,日志存放位置:{appConfig.logPath}"); - //CFXTest cFXTest = new CFXTest(); - //cFXTest.Test1(); + CFXTest cFXTest = new CFXTest(); + cFXTest.Test1(); + cFXTest.Test2(); + cFXTest.Test3(); //TestBusiness test = new TestBusiness();