From 00d5a84228b228f8a535923408535b6474dc0c76 Mon Sep 17 00:00:00 2001 From: SoulStar Date: Wed, 17 Dec 2025 18:57:11 +0800 Subject: [PATCH] =?UTF-8?q?feat=20-=20KPIVOV=E6=95=B0=E6=8D=AE=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sln.Iot.Business/ErrorAnalyseBusiness.cs | 2 +- Sln.Iot.Business/RFID01Business.cs | 3 + Sln.Iot.Business/RFID02Business.cs | 30 ++- Sln.Iot.Business/RFID03Business.cs | 4 +- Sln.Iot.Business/RFID04Business.cs | 24 ++- Sln.Iot.Business/RFID05Business.cs | 48 ++++- Sln.Iot.Business/RFID06Business.cs | 44 ++++- Sln.Iot.Business/RecipeBusiness.cs | 3 - Sln.Iot.Business/Sln.Iot.Business.csproj | 1 + .../UnitsProcessPLCDataGetBusiness.cs | 180 ++++++++++++++++++ Sln.Iot.CFX/CFXBusiness/CFXEventTools.cs | 5 - .../CFXBusiness/CFXUnitProcessedDataGet.cs | 34 ++-- Sln.Iot.CFX/CFXTest.cs | 5 +- Sln.Iot.CFX/Event/WorkCompletedEvent.cs | 82 ++++---- Sln.Iot.CFX/Sln.Iot.CFX.csproj | 1 + .../Entity/UnitsProcess1Entity.cs | 2 +- .../Entity/UnitsProcess3Entity.cs | 10 +- Sln.Iot.Repository/Sln.Iot.Repository.csproj | 1 + Sln.Iot.Repository/dao/OvenPlcData.cs | 60 ++++++ .../dao/VacuumInjectionPlcData.cs | 65 +++++++ .../service/OvenPlcDataService.cs | 140 ++++++++++++++ .../service/VacuumInjectionPlcDataService.cs | 101 ++++++++++ 22 files changed, 752 insertions(+), 93 deletions(-) create mode 100644 Sln.Iot.Business/UnitsProcessPLCDataGetBusiness.cs rename {Sln.Iot.CFX => Sln.Iot.Model}/Entity/UnitsProcess1Entity.cs (98%) rename {Sln.Iot.CFX => Sln.Iot.Model}/Entity/UnitsProcess3Entity.cs (81%) create mode 100644 Sln.Iot.Repository/dao/OvenPlcData.cs create mode 100644 Sln.Iot.Repository/dao/VacuumInjectionPlcData.cs create mode 100644 Sln.Iot.Repository/service/OvenPlcDataService.cs create mode 100644 Sln.Iot.Repository/service/VacuumInjectionPlcDataService.cs diff --git a/Sln.Iot.Business/ErrorAnalyseBusiness.cs b/Sln.Iot.Business/ErrorAnalyseBusiness.cs index a72b596..f524c08 100644 --- a/Sln.Iot.Business/ErrorAnalyseBusiness.cs +++ b/Sln.Iot.Business/ErrorAnalyseBusiness.cs @@ -38,7 +38,7 @@ namespace Sln.Iot.Business public ErrorAnalyseBusiness() { - _timer = new Timer(TimerCallback, null, 0, 5000); + _timer = new Timer(TimerCallback, null, 0, 2000); } /// diff --git a/Sln.Iot.Business/RFID01Business.cs b/Sln.Iot.Business/RFID01Business.cs index d84b343..3709b85 100644 --- a/Sln.Iot.Business/RFID01Business.cs +++ b/Sln.Iot.Business/RFID01Business.cs @@ -96,10 +96,13 @@ namespace Sln.Iot.Business { //单元抵达事件 connect2.PublishEvent(new CFXEnvelope(unitsArrivedEvent.Handle(traycode, prodcode))); + _log.Info($"{traycode} 抵达设备"); //工作开始事件 connect2.PublishEvent(new CFXEnvelope(workStartedEvent.Handle(tid, traycode, prodcode))); + _log.Info($"工作开始,ID:{tid}"); //预热炉工段开启 connect3.PublishEvent(new CFXEnvelope(workStageStartedEvent.Handle(tid, "PreHeatOven", 1))); + _log.Info($"预热炉工段开始 ID:{tid}"); }); } //流程完成 diff --git a/Sln.Iot.Business/RFID02Business.cs b/Sln.Iot.Business/RFID02Business.cs index f8e26bd..9d73d72 100644 --- a/Sln.Iot.Business/RFID02Business.cs +++ b/Sln.Iot.Business/RFID02Business.cs @@ -23,6 +23,11 @@ namespace Sln.Iot.Business private readonly SerilogHelper _log = SerilogHelper.Instance; private TrayBindingService trayBindingService = TrayBindingService.Instance; + private OvenPlcDataService ovenPlcDataService = OvenPlcDataService.Instance; + private VacuumInjectionPlcDataService vacuumInjectionPlcDataService = VacuumInjectionPlcDataService.Instance; + + private UnitsProcessPLCDataGetBusiness unitsProcessPLCDataGetBusiness = UnitsProcessPLCDataGetBusiness.Instance; + private WorkStageStartedEvent workStageStartedEvent = new WorkStageStartedEvent(); private WorkStageCompletedEvent workStageCompletedEvent = new WorkStageCompletedEvent(); private CFXConnect1 connect1 = CFXConnect1.Instance; @@ -32,7 +37,7 @@ namespace Sln.Iot.Business public RFID02Business() { - _timer = new Timer(TimerCallback, null, 0, 5000); + _timer = new Timer(TimerCallback, null, 0, 2000); } /// @@ -84,10 +89,33 @@ namespace Sln.Iot.Business { //预热炉工段完成事件 connect3.PublishEvent(new CFXEnvelope(workStageCompletedEvent.Handle(tid, "PreHeatOven", 1))); + _log.Info($"预热炉工段完成 ID:{tid}"); //真空箱1工段开启 connect1.PublishEvent(new CFXEnvelope(workStageStartedEvent.Handle(tid, "VacuumInjection1", 1))); + _log.Info($"真空箱1工段开始 ID:{tid}"); + + //预热炉数据采集 + var data = unitsProcessPLCDataGetBusiness.PreHeatOvenPlcDataGet(); + ovenPlcDataService.InsertData(stid, data); + _log.Info($"预热炉数据采集, {data}"); + //真空箱1数据采集 + var data2 = unitsProcessPLCDataGetBusiness.Vacuum1PlcDataGet(); + vacuumInjectionPlcDataService.InsertData(stid, data2); + _log.Info($"真空箱1温度数据采集, " + + $"GlueAmountSetValue1:{data2.GlueAmountSetValue1} " + + $"GluePushSpeedSetValue1:{data2.GluePushSpeedSetValue1} " + + $"BarrelA1TempActValue1:{data2.BarrelA1TempActValue1} " + + $"BarrelA2TempActValue1:{data2.BarrelA2TempActValue1} " + + $"BarrelB1TempActValue1:{data2.BarrelB1TempActValue1} " + + $"BarrelB2TempActValue1:{data2.BarrelB2TempActValue1} " + + $"PumpAPressureActValue1:{data2.PumpAPressureActValue1} " + + $"PumpBPressureActValue1:{data2.PumpBPressureActValue1} " + + $"VacuumDegreeActValue1:{data2.VacuumDegreeActValue1} " + + $"PressureHoldTimeSetValue1:{data2.PressureHoldTimeSetValue1}"); }); + + //CFX } //流程完成 } diff --git a/Sln.Iot.Business/RFID03Business.cs b/Sln.Iot.Business/RFID03Business.cs index 64aee47..3365454 100644 --- a/Sln.Iot.Business/RFID03Business.cs +++ b/Sln.Iot.Business/RFID03Business.cs @@ -31,7 +31,7 @@ namespace Sln.Iot.Business public RFID03Business() { - _timer = new Timer(TimerCallback, null, 0, 5000); + _timer = new Timer(TimerCallback, null, 0, 2000); } /// @@ -81,8 +81,10 @@ namespace Sln.Iot.Business { //真空箱1工段完成事件 connect1.PublishEvent(new CFXEnvelope(workStageCompletedEvent.Handle(tid, "VacuumInjection1", 1))); + _log.Info($"真空箱1工段完成, {tid}"); //预固炉工段开启 connect3.PublishEvent(new CFXEnvelope(workStageStartedEvent.Handle(tid, "PreCureOven", 2))); + _log.Info($"预固炉工段开启, {tid}"); }); } //流程完成 diff --git a/Sln.Iot.Business/RFID04Business.cs b/Sln.Iot.Business/RFID04Business.cs index c3be7ae..e0e5282 100644 --- a/Sln.Iot.Business/RFID04Business.cs +++ b/Sln.Iot.Business/RFID04Business.cs @@ -21,6 +21,10 @@ namespace Sln.Iot.Business private readonly PLCConnect _plc = PLCConnect.Instance; private readonly SerilogHelper _log = SerilogHelper.Instance; + private OvenPlcDataService ovenPlcDataService = OvenPlcDataService.Instance; + private VacuumInjectionPlcDataService vacuumInjectionPlcDataService = VacuumInjectionPlcDataService.Instance; + + private UnitsProcessPLCDataGetBusiness unitsProcessPLCDataGetBusiness = UnitsProcessPLCDataGetBusiness.Instance; private TrayBindingService trayBindingService = TrayBindingService.Instance; private WorkStageStartedEvent workStageStartedEvent = new WorkStageStartedEvent(); @@ -31,7 +35,7 @@ namespace Sln.Iot.Business public RFID04Business() { - _timer = new Timer(TimerCallback, null, 0, 5000); + _timer = new Timer(TimerCallback, null, 0, 2000); } /// @@ -82,8 +86,19 @@ namespace Sln.Iot.Business { //预固炉工段完成事件 connect3.PublishEvent(new CFXEnvelope(workStageCompletedEvent.Handle(tid, "PreCureOven", 2))); + _log.Info($"预固炉工段完成, {tid}"); //真空箱2工段开启 connect1.PublishEvent(new CFXEnvelope(workStageStartedEvent.Handle(tid, "VacuumInjection2", 2))); + _log.Info($"真空箱2工段开启, {tid}"); + + //预固炉数据采集 + var data = unitsProcessPLCDataGetBusiness.PreCureOvenPlcDataGet(); + ovenPlcDataService.UpdateDataPreCure(stid, data); + _log.Info($"预固炉温度数据采集, " + + $"PreCureOven1TempActValue:{data.PreCureOven1TempActValue} " + + $"PreCureOven2TempActValue:{data.PreCureOven2TempActValue} " + + $"PreCureOven3TempActValue:{data.PreCureOven3TempActValue} " + + $"PreCureOven4TempActValue:{data.PreCureOven4TempActValue}"); }); } //流程完成 @@ -122,13 +137,6 @@ namespace Sln.Iot.Business { _log.Error("胶机2真空箱前时间计算PLC写入完成信号异常"); } - - //CFX - Task.Run(() => - { - //单元抵达事件 - - }); } //流程完成 } diff --git a/Sln.Iot.Business/RFID05Business.cs b/Sln.Iot.Business/RFID05Business.cs index 88d43c7..368eed6 100644 --- a/Sln.Iot.Business/RFID05Business.cs +++ b/Sln.Iot.Business/RFID05Business.cs @@ -1,5 +1,6 @@ using CFX; using HslCommunication; +using Sln.Iot.CFX.CFXBusiness; using Sln.Iot.CFX.CFXConnect; using Sln.Iot.CFX.Event; using Sln.Iot.PLC; @@ -22,15 +23,23 @@ namespace Sln.Iot.Business private readonly SerilogHelper _log = SerilogHelper.Instance; private TrayBindingService trayBindingService = TrayBindingService.Instance; + private OvenPlcDataService ovenPlcDataService = OvenPlcDataService.Instance; + private VacuumInjectionPlcDataService vacuumInjectionPlcDataService = VacuumInjectionPlcDataService.Instance; + + private UnitsProcessPLCDataGetBusiness unitsProcessPLCDataGetBusiness = UnitsProcessPLCDataGetBusiness.Instance; + + private CFXUnitProcessedDataGet cFXUnitProcessedDataGet = CFXUnitProcessedDataGet.Instance; + private WorkStageStartedEvent workStageStartedEvent = new WorkStageStartedEvent(); private WorkStageCompletedEvent workStageCompletedEvent = new WorkStageCompletedEvent(); + private UnitsProcessedEvent unitsProcessedEvent = new UnitsProcessedEvent(); private CFXConnect1 connect1 = CFXConnect1.Instance; private CFXConnect2 connect2 = CFXConnect2.Instance; private CFXConnect3 connect3 = CFXConnect3.Instance; public RFID05Business() { - _timer = new Timer(TimerCallback, null, 0, 5000); + _timer = new Timer(TimerCallback, null, 0, 2000); } /// @@ -80,9 +89,46 @@ namespace Sln.Iot.Business { //真空箱2工段完成事件 connect1.PublishEvent(new CFXEnvelope(workStageCompletedEvent.Handle(tid, "VacuumInjection2", 2))); + _log.Info($"真空箱2工段完成, {tid}"); //固化炉工段开启 connect3.PublishEvent(new CFXEnvelope(workStageStartedEvent.Handle(tid, "CureOven", 3))); + _log.Info($"固化炉工段开启, {tid}"); + //真空箱获取并上传数据 + var unitsData1 = vacuumInjectionPlcDataService.GetData(stid); + var unitsData2 = unitsProcessPLCDataGetBusiness.Vacuum2PlcDataGet(); + unitsData1.GlueAmountSetValue2 = unitsData2.GlueAmountSetValue2; + unitsData1.GluePushSpeedSetValue2 = unitsData2.GluePushSpeedSetValue2; + unitsData1.BarrelA1TempActValue2 = unitsData2.BarrelA1TempActValue2; + unitsData1.BarrelA2TempActValue2 = unitsData2.BarrelA2TempActValue2; + unitsData1.BarrelB1TempActValue2 = unitsData2.BarrelB1TempActValue2; + unitsData1.BarrelB2TempActValue2 = unitsData2.BarrelB2TempActValue2; + unitsData1.PumpAPressureActValue2 = unitsData2.PumpAPressureActValue2; + unitsData1.PumpBPressureActValue2 = unitsData2.PumpBPressureActValue2; + unitsData1.VacuumDegreeActValue2 = unitsData2.VacuumDegreeActValue2; + unitsData1.PressureHoldTimeSetValue2 = unitsData2.PressureHoldTimeSetValue2; + connect1.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(tid, cFXUnitProcessedDataGet.ProcessDataGet1(unitsData1)))); + _log.Info($"真空箱温度数据上传, " + + $"GlueAmountSetValue1:{unitsData1.GlueAmountSetValue1} " + + $"GluePushSpeedSetValue1:{unitsData1.GluePushSpeedSetValue1} " + + $"BarrelA1TempActValue1:{unitsData1.BarrelA1TempActValue1} " + + $"BarrelA2TempActValue1:{unitsData1.BarrelA2TempActValue1} " + + $"BarrelB1TempActValue1:{unitsData1.BarrelB1TempActValue1} " + + $"BarrelB2TempActValue1:{unitsData1.BarrelB2TempActValue1} " + + $"PumpAPressureActValue1:{unitsData1.PumpAPressureActValue1} " + + $"PumpBPressureActValue1:{unitsData1.PumpBPressureActValue1} " + + $"VacuumDegreeActValue1:{unitsData1.VacuumDegreeActValue1} " + + $"PressureHoldTimeSetValue1:{unitsData1.PressureHoldTimeSetValue1} " + + $"GlueAmountSetValue2:{unitsData1.GlueAmountSetValue2} " + + $"GluePushSpeedSetValue2:{unitsData1.GluePushSpeedSetValue2} " + + $"BarrelA1TempActValue2:{unitsData1.BarrelA1TempActValue2} " + + $"BarrelA2TempActValue2:{unitsData1.BarrelA2TempActValue2} " + + $"BarrelB1TempActValue2:{unitsData1.BarrelB1TempActValue2} " + + $"BarrelB2TempActValue2:{unitsData1.BarrelB2TempActValue2} " + + $"PumpAPressureActValue2:{unitsData1.PumpAPressureActValue2} " + + $"PumpBPressureActValue2:{unitsData1.PumpBPressureActValue2} " + + $"VacuumDegreeActValue2:{unitsData1.VacuumDegreeActValue2} " + + $"PressureHoldTimeSetValue2:{unitsData1.PressureHoldTimeSetValue2}"); }); } //流程完成 diff --git a/Sln.Iot.Business/RFID06Business.cs b/Sln.Iot.Business/RFID06Business.cs index 960afde..f74278a 100644 --- a/Sln.Iot.Business/RFID06Business.cs +++ b/Sln.Iot.Business/RFID06Business.cs @@ -23,20 +23,30 @@ namespace Sln.Iot.Business private readonly SerilogHelper _log = SerilogHelper.Instance; - private UnitsDepartedEvent unitsDepartedEvent = new UnitsDepartedEvent(); - private TrayBindingService trayBindingService = TrayBindingService.Instance; + //CFX数据采集业务 + private UnitsProcessPLCDataGetBusiness unitsProcessPLCDataGetBusiness = UnitsProcessPLCDataGetBusiness.Instance; private CFXUnitProcessedDataGet cFXUnitProcessedDataGet = CFXUnitProcessedDataGet.Instance; + //SQL服务 + private OvenPlcDataService ovenPlcDataService = OvenPlcDataService.Instance; + private VacuumInjectionPlcDataService vacuumInjectionPlcDataService = VacuumInjectionPlcDataService.Instance; + private TrayBindingService trayBindingService = TrayBindingService.Instance; + + //CFX事件 + private UnitsDepartedEvent unitsDepartedEvent = new UnitsDepartedEvent(); private WorkStageCompletedEvent workStageCompletedEvent = new WorkStageCompletedEvent(); private UnitsProcessedEvent unitsProcessedEvent = new UnitsProcessedEvent(); + private WorkCompletedEvent workCompletedEvent = new WorkCompletedEvent(); + + // CFX连接 private CFXConnect1 connect1 = CFXConnect1.Instance; private CFXConnect2 connect2 = CFXConnect2.Instance; private CFXConnect3 connect3 = CFXConnect3.Instance; public RFID06Business() { - _timer = new Timer(TimerCallback, null, 0, 5000); + _timer = new Timer(TimerCallback, null, 0, 2000); } /// @@ -72,7 +82,7 @@ namespace Sln.Iot.Business string[] prodcode = trayBindingService.ProdCodeGet(traycode); bool res = trayBindingService.TrayCodeDelete(traycode); - + if (!res) { _log.Error("下料提升机绑定数据删除异常或删除条数为0"); @@ -90,10 +100,32 @@ namespace Sln.Iot.Business { //固化炉工段完成事件 connect3.PublishEvent(new CFXEnvelope(workStageCompletedEvent.Handle(tid, "CureOven", 3))); + _log.Info($"固化炉工段完成, {tid}"); //单元离站事件 connect2.PublishEvent(new CFXEnvelope(unitsDepartedEvent.Handle(traycode, prodcode))); - //上报数据 - connect2.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(tid, cFXUnitProcessedDataGet.ProcessDataGet1()))); + _log.Info($"{traycode} 单元离站 "); + //工单完成事件 + connect2.PublishEvent(new CFXEnvelope(workCompletedEvent.Handle(tid, traycode, prodcode))); + _log.Info($"工单完成 ID:{tid}"); + + //固化炉数据采集 + var unitsdata = unitsProcessPLCDataGetBusiness.CureOvenPlcDataGet(); + //存数据库里整合 + ovenPlcDataService.UpdateDataCure(stid, unitsdata); + //取出整合数据 + unitsdata = ovenPlcDataService.GetData(stid); + + connect3.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(tid, cFXUnitProcessedDataGet.ProcessDataGet3(unitsdata)))); + _log.Info($"隧道烤箱温度数据上传, " + + $"PreheatOvenTempActValue:{unitsdata.PreheatOvenTempActValue} " + + $"PreCureOven1TempActValue:{unitsdata.PreCureOven1TempActValue} " + + $"PreCureOven2TempActValue:{unitsdata.PreCureOven2TempActValue} " + + $"PreCureOven3TempActValue:{unitsdata.PreCureOven3TempActValue} " + + $"PreCureOven4TempActValue:{unitsdata.PreCureOven4TempActValue} " + + $"CureOven1TempActValue:{unitsdata.CureOven1TempActValue} " + + $"CureOven2TempActValue:{unitsdata.CureOven2TempActValue} " + + $"CureOven3TempActValue:{unitsdata.CureOven3TempActValue} " + + $"CureOven4TempActValue:{unitsdata.CureOven4TempActValue} "); }); } //流程完成 diff --git a/Sln.Iot.Business/RecipeBusiness.cs b/Sln.Iot.Business/RecipeBusiness.cs index 85816b3..14155e8 100644 --- a/Sln.Iot.Business/RecipeBusiness.cs +++ b/Sln.Iot.Business/RecipeBusiness.cs @@ -94,9 +94,6 @@ namespace Sln.Iot.Business _log.Info($"真空箱2配方激活{recipeName}"); } } - - } - } } diff --git a/Sln.Iot.Business/Sln.Iot.Business.csproj b/Sln.Iot.Business/Sln.Iot.Business.csproj index 96cca70..4fcbca8 100644 --- a/Sln.Iot.Business/Sln.Iot.Business.csproj +++ b/Sln.Iot.Business/Sln.Iot.Business.csproj @@ -13,6 +13,7 @@ + diff --git a/Sln.Iot.Business/UnitsProcessPLCDataGetBusiness.cs b/Sln.Iot.Business/UnitsProcessPLCDataGetBusiness.cs new file mode 100644 index 0000000..d1408d5 --- /dev/null +++ b/Sln.Iot.Business/UnitsProcessPLCDataGetBusiness.cs @@ -0,0 +1,180 @@ +using Sln.Iot.CFX.CFXBusiness; +using Sln.Iot.CFX.Entity; +using Sln.Iot.Model.Entity; +using Sln.Iot.PLC; +using Sln.Iot.Serilog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sln.Iot.Business +{ + public class UnitsProcessPLCDataGetBusiness + { + private static readonly Lazy lazy = new Lazy(() => new UnitsProcessPLCDataGetBusiness()); + + public static UnitsProcessPLCDataGetBusiness Instance + { + get + { + return lazy.Value; + } + } + + + private readonly PLCConnect _plc = PLCConnect.Instance; + private readonly SerilogHelper _log = SerilogHelper.Instance; + + /// + /// 真空箱PLC数据获取 + /// + /// + public UnitsProcess1Entity Vacuum1PlcDataGet() + { + try + { + var res11 = _plc.ReadBytes(_plc.DeltaInstance1, "D200", 8); + var res12 = _plc.ReadBytes(_plc.DeltaInstance1, "D610", 6); + var res13 = _plc.ReadBytes(_plc.DeltaInstance1, "D120", 4); + var res14 = _plc.ReadFloat(_plc.DeltaInstance1, "D58"); + + UnitsProcess1Entity entity = new UnitsProcess1Entity() + { + GlueAmountSetValue1 = BitConverter.ToSingle(res12.Content, 4), + GluePushSpeedSetValue1 = BitConverter.ToSingle(res12.Content, 0), + BarrelA1TempActValue1 = BitConverter.ToInt16(res11.Content, 0), + BarrelA2TempActValue1 = BitConverter.ToInt16(res11.Content, 4), + BarrelB1TempActValue1 = BitConverter.ToInt16(res11.Content, 12), + BarrelB2TempActValue1 = BitConverter.ToInt16(res11.Content, 16), + PumpAPressureActValue1 = BitConverter.ToSingle(res13.Content, 0), + PumpBPressureActValue1 = BitConverter.ToSingle(res13.Content, 4), + VacuumDegreeActValue1 = res14.Content, + PressureHoldTimeSetValue1 = BitConverter.ToInt16(res12.Content, 12), + }; + + return entity; + } + catch (Exception ex) + { + _log.Error("PLC读取真空箱1信息失败"); + return new UnitsProcess1Entity(); + } + } + + /// + /// 真空箱PLC数据获取 + /// + /// + public UnitsProcess1Entity Vacuum2PlcDataGet() + { + try + { + var res21 = _plc.ReadBytes(_plc.DeltaInstance2, "D200", 8); + var res22 = _plc.ReadBytes(_plc.DeltaInstance2, "D610", 6); + var res23 = _plc.ReadBytes(_plc.DeltaInstance2, "D120", 4); + var res24 = _plc.ReadFloat(_plc.DeltaInstance2, "D58"); + + UnitsProcess1Entity entity = new UnitsProcess1Entity() + { + GlueAmountSetValue2 = BitConverter.ToSingle(res22.Content, 4), + GluePushSpeedSetValue2 = BitConverter.ToSingle(res22.Content, 0), + BarrelA1TempActValue2 = BitConverter.ToInt16(res21.Content, 0), + BarrelA2TempActValue2 = BitConverter.ToInt16(res21.Content, 4), + BarrelB1TempActValue2 = BitConverter.ToInt16(res21.Content, 12), + BarrelB2TempActValue2 = BitConverter.ToInt16(res21.Content, 16), + PumpAPressureActValue2 = BitConverter.ToSingle(res23.Content, 0), + PumpBPressureActValue2 = BitConverter.ToSingle(res23.Content, 4), + VacuumDegreeActValue2 = res24.Content, + PressureHoldTimeSetValue2 = BitConverter.ToInt16(res22.Content, 12), + }; + + return entity; + } + catch (Exception ex) + { + _log.Error("PLC读取真空箱2信息失败"); + return new UnitsProcess1Entity(); + } + } + + /// + /// 预热炉数据获取 + /// + /// + public int PreHeatOvenPlcDataGet() + { + try + { + var res = _plc.ReadInt16(_plc.DeltaInstance0, "D200"); + + if (res.IsSuccess) + { + return res.Content; + } + + return 0; + } + catch (Exception ex) + { + _log.Error("PLC读取预热炉信息失败"); + return 0; + } + } + + /// + /// 预固炉数据获取 + /// + /// + public UnitsProcess3Entity PreCureOvenPlcDataGet() + { + try + { + var res = _plc.ReadBytes(_plc.DeltaInstance0, "D201", 4); + + UnitsProcess3Entity unitsProcess3Entity = new UnitsProcess3Entity() + { + PreCureOven1TempActValue = BitConverter.ToInt16(res.Content, 0), + PreCureOven2TempActValue = BitConverter.ToInt16(res.Content, 2), + PreCureOven3TempActValue = BitConverter.ToInt16(res.Content, 4), + PreCureOven4TempActValue = BitConverter.ToInt16(res.Content, 6), + }; + + return unitsProcess3Entity; + } + catch (Exception ex) + { + _log.Error("PLC读取预固炉信息失败"); + return new UnitsProcess3Entity(); + } + } + + /// + /// 固化炉数据获取 + /// + /// + public UnitsProcess3Entity CureOvenPlcDataGet() + { + try + { + var res = _plc.ReadBytes(_plc.DeltaInstance0, "D205", 4); + + UnitsProcess3Entity unitsProcess3Entity = new UnitsProcess3Entity() + { + CureOven1TempActValue = BitConverter.ToInt16(res.Content, 0), + CureOven2TempActValue = BitConverter.ToInt16(res.Content, 2), + CureOven3TempActValue = BitConverter.ToInt16(res.Content, 4), + CureOven4TempActValue = BitConverter.ToInt16(res.Content, 6), + }; + + return unitsProcess3Entity; + } + catch (Exception ex) + { + _log.Error("PLC读取固化炉信息失败"); + return new UnitsProcess3Entity(); + } + } + } +} diff --git a/Sln.Iot.CFX/CFXBusiness/CFXEventTools.cs b/Sln.Iot.CFX/CFXBusiness/CFXEventTools.cs index 406fc06..ff4e13e 100644 --- a/Sln.Iot.CFX/CFXBusiness/CFXEventTools.cs +++ b/Sln.Iot.CFX/CFXBusiness/CFXEventTools.cs @@ -37,10 +37,5 @@ namespace Sln.Iot.CFX.CFXBusiness } return units; } - - public List FaultsTrans() - { - - } } } diff --git a/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs b/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs index 96e9ab3..9cc23d0 100644 --- a/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs +++ b/Sln.Iot.CFX/CFXBusiness/CFXUnitProcessedDataGet.cs @@ -1,13 +1,7 @@ using CFX.Structures; using CFX.Structures.CommonUseEquipment; using CFX.Structures.SolderReflow; -using Sln.Iot.CFX.Entity; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Sln.Iot.Model.Entity; namespace Sln.Iot.CFX.CFXBusiness { @@ -22,14 +16,14 @@ namespace Sln.Iot.CFX.CFXBusiness return lazy.Value; } } - + /// /// 真空点胶数据 /// /// - public CommonProcessData ProcessDataGet1() + public CommonProcessData ProcessDataGet1(UnitsProcess1Entity entity) { - UnitsProcess1Entity entity = new UnitsProcess1Entity() + entity = new UnitsProcess1Entity() { GlueAmountSetValue1 = 123.4f, GluePushSpeedSetValue1 = 10.1f, @@ -234,19 +228,19 @@ namespace Sln.Iot.CFX.CFXBusiness /// 隧道烤箱数据 /// /// - public CommonProcessData ProcessDataGet3() + public CommonProcessData ProcessDataGet3(UnitsProcess3Entity entity) { - UnitsProcess3Entity entity = new UnitsProcess3Entity() + entity = new UnitsProcess3Entity() { PreheatOvenTempActValue = 800, PreCureOven1TempActValue = 800, PreCureOven2TempActValue = 800, PreCureOven3TempActValue = 800, PreCureOven4TempActValue = 800, - CureOven1ActValue = 800, - CureOven2ActValue = 800, - CureOven3ActValue = 800, - CureOven4ActValue = 800, + CureOven1TempActValue = 800, + CureOven2TempActValue = 800, + CureOven3TempActValue = 800, + CureOven4TempActValue = 800, }; CommonProcessData processData = new CommonProcessData() @@ -309,22 +303,22 @@ namespace Sln.Iot.CFX.CFXBusiness { new CommonUseReading() { - ReadingValue = entity.CureOven1ActValue, + ReadingValue = entity.CureOven1TempActValue, ReadingName = "CureOven1ActValue", }, new CommonUseReading() { - ReadingValue = entity.CureOven2ActValue, + ReadingValue = entity.CureOven2TempActValue, ReadingName = "CureOven2ActValue", }, new CommonUseReading() { - ReadingValue = entity.CureOven3ActValue, + ReadingValue = entity.CureOven3TempActValue, ReadingName = "CureOven3ActValue", }, new CommonUseReading() { - ReadingValue = entity.CureOven4ActValue, + ReadingValue = entity.CureOven4TempActValue, ReadingName = "CureOven4ActValue", } }, diff --git a/Sln.Iot.CFX/CFXTest.cs b/Sln.Iot.CFX/CFXTest.cs index d21bbc6..2540e41 100644 --- a/Sln.Iot.CFX/CFXTest.cs +++ b/Sln.Iot.CFX/CFXTest.cs @@ -8,6 +8,7 @@ using CFX.Structures; using Sln.Iot.CFX.CFXBusiness; using Sln.Iot.CFX.CFXConnect; using Sln.Iot.CFX.Event; +using Sln.Iot.Model.Entity; namespace Sln.Iot.CFX { @@ -93,7 +94,7 @@ namespace Sln.Iot.CFX _cfxHelper.PublishEvent(new CFXEnvelope(workCompletedEvent.Handle())); _cfxHelper.PublishEvent(new CFXEnvelope(unitsDepartedEvent.Handle(null, new string[1] { "A123" }))); - _cfxHelper.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(testGuid, cFXUnitProcessedDataGet.ProcessDataGet1()))); + _cfxHelper.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(testGuid, cFXUnitProcessedDataGet.ProcessDataGet1(new UnitsProcess1Entity())))); _cfxHelper.PublishEvent(new CFXEnvelope(endpointShuttingDownEvent.Handle("CFX.A00.SDSH000001"))); _cfxHelper.SendValidateUnitsRequest("amqp://127.0.0.1:8888", "A123456", new string[1] { "A123" }); @@ -207,7 +208,7 @@ namespace Sln.Iot.CFX _cfxHelper3.PublishEvent(new CFXEnvelope(workCompletedEvent.Handle())); _cfxHelper3.PublishEvent(new CFXEnvelope(unitsDepartedEvent.Handle(null, new string[1] { "A123" }))); - _cfxHelper3.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(testGuid, cFXUnitProcessedDataGet.ProcessDataGet3()))); + _cfxHelper3.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(testGuid, cFXUnitProcessedDataGet.ProcessDataGet3(new UnitsProcess3Entity())))); _cfxHelper3.PublishEvent(new CFXEnvelope(endpointShuttingDownEvent.Handle("CFX.A00.SDSH000003"))); _cfxHelper3.SendValidateUnitsRequest("amqp://127.0.0.1:8888", "A123456", new string[1] { "A123" }); diff --git a/Sln.Iot.CFX/Event/WorkCompletedEvent.cs b/Sln.Iot.CFX/Event/WorkCompletedEvent.cs index a6fb400..4a66eb5 100644 --- a/Sln.Iot.CFX/Event/WorkCompletedEvent.cs +++ b/Sln.Iot.CFX/Event/WorkCompletedEvent.cs @@ -1,6 +1,7 @@ using CFX; using CFX.Production; using CFX.Structures; +using Sln.Iot.CFX.CFXBusiness; using Sln.Iot.Serilog; namespace Sln.Iot.CFX.Event @@ -11,57 +12,60 @@ namespace Sln.Iot.CFX.Event /// public class WorkCompletedEvent { + private CFXEventTools cFXEventTools = CFXEventTools.Instance; + /// /// 数据封装处理 /// /// - public CFXMessage Handle() + public CFXMessage Handle(Guid transactionID, string pirmaryIdentifier, string[] unitIdentifier) { CFXMessage eve = null; try { eve = new WorkCompleted() { - TransactionID = Guid.Parse("281fa09f-cbf6-498d-9f27-7ca77cb60399"), - PrimaryIdentifier = "WORKORDER-0001", + TransactionID = transactionID, + PrimaryIdentifier = pirmaryIdentifier, Result = WorkResult.Completed, - Units = new List() - { - new UnitPosition() - { - UnitIdentifier = "PreHeatOven", - PositionNumber = 1, - PositionName = "位置1", - X = 50.0, - Y = 80.0, - Rotation = 0.0, - FlipX = false, - FlipY = false - }, - new UnitPosition() - { - UnitIdentifier = "PreCureOven", - PositionNumber = 2, - PositionName = "位置2", - X = 50.0, - Y = 80.0, - Rotation = 0.0, - FlipX = false, - FlipY = false - }, - new UnitPosition() - { - UnitIdentifier = "CureOven", - PositionNumber = 3, - PositionName = "位置3", - X = 50.0, - Y = 80.0, - Rotation = 0.0, - FlipX = false, - FlipY = false - }, + Units = cFXEventTools.UnitPositionTrans(unitIdentifier) + //Units = new List() + //{ + // new UnitPosition() + // { + // UnitIdentifier = "PreHeatOven", + // PositionNumber = 1, + // PositionName = "位置1", + // X = 50.0, + // Y = 80.0, + // Rotation = 0.0, + // FlipX = false, + // FlipY = false + // }, + // new UnitPosition() + // { + // UnitIdentifier = "PreCureOven", + // PositionNumber = 2, + // PositionName = "位置2", + // X = 50.0, + // Y = 80.0, + // Rotation = 0.0, + // FlipX = false, + // FlipY = false + // }, + // new UnitPosition() + // { + // UnitIdentifier = "CureOven", + // PositionNumber = 3, + // PositionName = "位置3", + // X = 50.0, + // Y = 80.0, + // Rotation = 0.0, + // FlipX = false, + // FlipY = false + // }, + //} - } }; } catch (Exception e) diff --git a/Sln.Iot.CFX/Sln.Iot.CFX.csproj b/Sln.Iot.CFX/Sln.Iot.CFX.csproj index 72d1a31..532b2c6 100644 --- a/Sln.Iot.CFX/Sln.Iot.CFX.csproj +++ b/Sln.Iot.CFX/Sln.Iot.CFX.csproj @@ -11,6 +11,7 @@ + diff --git a/Sln.Iot.CFX/Entity/UnitsProcess1Entity.cs b/Sln.Iot.Model/Entity/UnitsProcess1Entity.cs similarity index 98% rename from Sln.Iot.CFX/Entity/UnitsProcess1Entity.cs rename to Sln.Iot.Model/Entity/UnitsProcess1Entity.cs index 1aad493..ec37690 100644 --- a/Sln.Iot.CFX/Entity/UnitsProcess1Entity.cs +++ b/Sln.Iot.Model/Entity/UnitsProcess1Entity.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Sln.Iot.CFX.Entity +namespace Sln.Iot.Model.Entity { public class UnitsProcess1Entity { diff --git a/Sln.Iot.CFX/Entity/UnitsProcess3Entity.cs b/Sln.Iot.Model/Entity/UnitsProcess3Entity.cs similarity index 81% rename from Sln.Iot.CFX/Entity/UnitsProcess3Entity.cs rename to Sln.Iot.Model/Entity/UnitsProcess3Entity.cs index 5b6b0a7..675b035 100644 --- a/Sln.Iot.CFX/Entity/UnitsProcess3Entity.cs +++ b/Sln.Iot.Model/Entity/UnitsProcess3Entity.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Sln.Iot.CFX.Entity +namespace Sln.Iot.Model.Entity { public class UnitsProcess3Entity { @@ -36,21 +36,21 @@ namespace Sln.Iot.CFX.Entity /// /// 固化炉温度1 /// - public int CureOven1ActValue { get; set; } + public int CureOven1TempActValue { get; set; } /// /// 固化炉温度2 /// - public int CureOven2ActValue { get; set; } + public int CureOven2TempActValue { get; set; } /// /// 固化炉温度3 /// - public int CureOven3ActValue { get; set; } + public int CureOven3TempActValue { get; set; } /// /// 固化炉温度4 /// - public int CureOven4ActValue { get; set; } + public int CureOven4TempActValue { get; set; } } } diff --git a/Sln.Iot.Repository/Sln.Iot.Repository.csproj b/Sln.Iot.Repository/Sln.Iot.Repository.csproj index 1a5203f..aef5128 100644 --- a/Sln.Iot.Repository/Sln.Iot.Repository.csproj +++ b/Sln.Iot.Repository/Sln.Iot.Repository.csproj @@ -12,6 +12,7 @@ + diff --git a/Sln.Iot.Repository/dao/OvenPlcData.cs b/Sln.Iot.Repository/dao/OvenPlcData.cs new file mode 100644 index 0000000..52daac3 --- /dev/null +++ b/Sln.Iot.Repository/dao/OvenPlcData.cs @@ -0,0 +1,60 @@ +using SQLite; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sln.Iot.Repository.dao +{ + public class OvenPlcData + { + [PrimaryKey] + public string GUID { get; set; } + + /// + /// 预热炉温度 + /// + public int PreheatOvenTempActValue { get; set; } + + /// + /// 预固炉温度1 + /// + public int PreCureOven1TempActValue { get; set; } + + /// + /// 预固炉温度2 + /// + public int PreCureOven2TempActValue { get; set; } + + /// + /// 预固炉温度3 + /// + public int PreCureOven3TempActValue { get; set; } + + /// + /// 预固炉温度4 + /// + public int PreCureOven4TempActValue { get; set; } + + /// + /// 固化炉温度1 + /// + public int CureOven1TempActValue { get; set; } + + /// + /// 固化炉温度2 + /// + public int CureOven2TempActValue { get; set; } + + /// + /// 固化炉温度3 + /// + public int CureOven3TempActValue { get; set; } + + /// + /// 固化炉温度4 + /// + public int CureOven4TempActValue { get; set; } + } +} diff --git a/Sln.Iot.Repository/dao/VacuumInjectionPlcData.cs b/Sln.Iot.Repository/dao/VacuumInjectionPlcData.cs new file mode 100644 index 0000000..ad502d0 --- /dev/null +++ b/Sln.Iot.Repository/dao/VacuumInjectionPlcData.cs @@ -0,0 +1,65 @@ +using SQLite; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sln.Iot.Repository.dao +{ + public class VacuumInjectionPlcData + { + [PrimaryKey] + public string GUID { get; set; } + + /// + /// 当前胶量设定值 + /// + public float GlueAmountSetValue { get; set; } + + /// + /// 当前推胶速度设定值 + /// + public float GluePushSpeedSetValue { get; set; } + + /// + /// 当前A1桶温度实际值 + /// + public int BarrelA1TempActValue { get; set; } + + /// + /// 当前A2桶温度实际值 + /// + public int BarrelA2TempActValue { get; set; } + + /// + /// 当前B1桶温度实际值 + /// + public int BarrelB1TempActValue { get; set; } + + /// + /// 当前B2桶温度实际值 + /// + public int BarrelB2TempActValue { get; set; } + + /// + /// 当前A泵压力实际值 + /// + public float PumpAPressureActValue { get; set; } + + /// + /// 当前B泵压力实际值 + /// + public float PumpBPressureActValue { get; set; } + + /// + /// 当前真空度实际值 + /// + public float VacuumDegreeActValue { get; set; } + + /// + /// 保压时长设定值 + /// + public int PressureHoldTimeSetValue { get; set; } + } +} diff --git a/Sln.Iot.Repository/service/OvenPlcDataService.cs b/Sln.Iot.Repository/service/OvenPlcDataService.cs new file mode 100644 index 0000000..9172a0d --- /dev/null +++ b/Sln.Iot.Repository/service/OvenPlcDataService.cs @@ -0,0 +1,140 @@ +using Sln.Iot.Model.Entity; +using Sln.Iot.Repository.dao; +using Sln.Iot.Serilog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sln.Iot.Repository.service +{ + public class OvenPlcDataService + { + private static readonly Lazy lazy = new Lazy(() => new OvenPlcDataService()); + + public static OvenPlcDataService Instance + { + get + { + return lazy.Value; + } + } + + private SQLiteHelper _helper = SQLiteHelper.Instance; + + private SerilogHelper _log = SerilogHelper.Instance; + + /// + /// 插入数据 + /// + /// + /// + /// + public bool InsertData(string guid, int data) + { + try + { + var res = _helper.Insert(new OvenPlcData() + { + GUID = guid, + PreheatOvenTempActValue = data, + }); + return res == 0 ? false : true; + } + catch (Exception ex) + { + _log.Error("插入烤炉数据失败", ex); + return false; + } + } + + /// + /// 预固炉温度插入 + /// + /// + public bool UpdateDataPreCure(string guid, UnitsProcess3Entity data) + { + try + { + var res = _helper.Update(new OvenPlcData() + { + GUID = guid, + PreCureOven1TempActValue = data.PreCureOven1TempActValue, + PreCureOven2TempActValue = data.PreCureOven2TempActValue, + PreCureOven3TempActValue = data.PreCureOven3TempActValue, + PreCureOven4TempActValue = data.PreCureOven4TempActValue, + }); + return res == 0 ? false : true; + } + catch (Exception ex) + { + _log.Error("更新预固炉温度数据失败", ex); + return false; + } + } + + /// + /// 固化炉温度插入 + /// + /// + public bool UpdateDataCure(string guid, UnitsProcess3Entity data) + { + try + { + var res = _helper.Update(new OvenPlcData() + { + GUID = guid, + CureOven1TempActValue = data.CureOven1TempActValue, + CureOven2TempActValue = data.CureOven2TempActValue, + CureOven3TempActValue = data.CureOven3TempActValue, + CureOven4TempActValue = data.CureOven4TempActValue, + }); + return res == 0 ? false : true; + } + catch (Exception ex) + { + _log.Error("更新固化炉炉温度数据失败", ex); + return false; + } + } + + /// + /// 获取之前暂存的数据 + /// + /// + public UnitsProcess3Entity GetData(string guid) + { + try + { + var res = _helper.QuerySingle(x => x.GUID == guid); + if (res == null) + { + return new UnitsProcess3Entity(); + } + + UnitsProcess3Entity entity = new UnitsProcess3Entity() + { + PreheatOvenTempActValue = res.PreheatOvenTempActValue, + PreCureOven1TempActValue = res.PreCureOven1TempActValue, + PreCureOven2TempActValue = res.PreCureOven2TempActValue, + PreCureOven3TempActValue = res.PreCureOven3TempActValue, + PreCureOven4TempActValue = res.PreCureOven4TempActValue, + CureOven1TempActValue = res.CureOven1TempActValue, + CureOven2TempActValue = res.CureOven2TempActValue, + CureOven3TempActValue = res.CureOven3TempActValue, + CureOven4TempActValue = res.CureOven4TempActValue, + }; + + _helper.Delete(guid); + + return entity; + } + catch (Exception ex) + { + _log.Error("获取或删除隧道烤箱传感器数据失败", ex); + return new UnitsProcess3Entity(); + } + } + } +} diff --git a/Sln.Iot.Repository/service/VacuumInjectionPlcDataService.cs b/Sln.Iot.Repository/service/VacuumInjectionPlcDataService.cs new file mode 100644 index 0000000..921365c --- /dev/null +++ b/Sln.Iot.Repository/service/VacuumInjectionPlcDataService.cs @@ -0,0 +1,101 @@ +using Dm; +using Sln.Iot.Model.Entity; +using Sln.Iot.Repository.dao; +using Sln.Iot.Serilog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sln.Iot.Repository.service +{ + public class VacuumInjectionPlcDataService + { + private static readonly Lazy lazy = new Lazy(() => new VacuumInjectionPlcDataService()); + + public static VacuumInjectionPlcDataService Instance + { + get + { + return lazy.Value; + } + } + + private SQLiteHelper _helper = SQLiteHelper.Instance; + + private SerilogHelper _log = SerilogHelper.Instance; + + /// + /// 插入数据 + /// + /// + /// + /// + public bool InsertData(string guid, UnitsProcess1Entity data) + { + try + { + var res = _helper.Insert(new VacuumInjectionPlcData() + { + GUID = guid, + GlueAmountSetValue = data.GlueAmountSetValue1, + GluePushSpeedSetValue = data.GluePushSpeedSetValue1, + BarrelA1TempActValue = data.BarrelA1TempActValue1, + BarrelA2TempActValue = data.BarrelA2TempActValue1, + BarrelB1TempActValue = data.BarrelB1TempActValue1, + BarrelB2TempActValue = data.BarrelB2TempActValue1, + PumpAPressureActValue = data.PumpAPressureActValue1, + PumpBPressureActValue = data.PumpBPressureActValue1, + VacuumDegreeActValue = data.VacuumDegreeActValue1, + PressureHoldTimeSetValue = data.PressureHoldTimeSetValue1 + }); + return res == 0 ? false : true; + } + catch (Exception ex) + { + _log.Error("插入真空箱传感器数据失败", ex); + return false; + } + } + + /// + /// 获取之前暂存的数据 + /// + /// + public UnitsProcess1Entity GetData(string guid) + { + try + { + var res = _helper.QuerySingle(x => x.GUID == guid); + if(res == null) + { + return new UnitsProcess1Entity(); + } + + UnitsProcess1Entity entity = new UnitsProcess1Entity() + { + GlueAmountSetValue1 = res.GlueAmountSetValue, + GluePushSpeedSetValue1 = res.GluePushSpeedSetValue, + BarrelA1TempActValue1 = res.BarrelA1TempActValue, + BarrelA2TempActValue1 = res.BarrelA2TempActValue, + BarrelB1TempActValue1 = res.BarrelB1TempActValue, + BarrelB2TempActValue1 = res.BarrelB2TempActValue, + PumpAPressureActValue1 = res.PumpAPressureActValue, + PumpBPressureActValue1 = res.PumpBPressureActValue, + VacuumDegreeActValue1 = res.VacuumDegreeActValue, + PressureHoldTimeSetValue1 = res.PressureHoldTimeSetValue + }; + + _helper.Delete(guid); + + return entity; + } + catch (Exception ex) + { + _log.Error("获取或删除真空箱传感器数据失败", ex); + return new UnitsProcess1Entity(); + } + } + } +}