diff --git a/framework/ThingsGateway.Application/ThingsGateway.Application.xml b/framework/ThingsGateway.Application/ThingsGateway.Application.xml index 1eabfaf69..1ea0b0406 100644 --- a/framework/ThingsGateway.Application/ThingsGateway.Application.xml +++ b/framework/ThingsGateway.Application/ThingsGateway.Application.xml @@ -1841,7 +1841,7 @@ - 最近一次值 + 上次值 diff --git a/framework/ThingsGateway.Application/Workers/Collect/CollectDeviceWorker.cs b/framework/ThingsGateway.Application/Workers/Collect/CollectDeviceWorker.cs index 210fb6f44..a77fa3164 100644 --- a/framework/ThingsGateway.Application/Workers/Collect/CollectDeviceWorker.cs +++ b/framework/ThingsGateway.Application/Workers/Collect/CollectDeviceWorker.cs @@ -452,8 +452,8 @@ public class CollectDeviceWorker : BackgroundService var Propertys = _pluginService.GetDriverProperties(driver); if (devId != 0) { - var devcore = CollectDeviceCores.FirstOrDefault(it => it.Device.Id == devId); - devcore?.Device?.DevicePropertys?.ForEach(it => + var devcore = App.GetService().GetDeviceById(devId); + devcore?.DevicePropertys?.ForEach(it => { var dependencyProperty = Propertys.FirstOrDefault(a => a.PropertyName == it.PropertyName); if (dependencyProperty != null) diff --git a/framework/ThingsGateway.Application/Workers/Upload/UploadDeviceWorker.cs b/framework/ThingsGateway.Application/Workers/Upload/UploadDeviceWorker.cs index 978435c42..32411792f 100644 --- a/framework/ThingsGateway.Application/Workers/Upload/UploadDeviceWorker.cs +++ b/framework/ThingsGateway.Application/Workers/Upload/UploadDeviceWorker.cs @@ -302,8 +302,8 @@ public class UploadDeviceWorker : BackgroundService var Propertys = _pluginService.GetDriverProperties(driver); if (devId != 0) { - var devcore = UploadDeviceCores.FirstOrDefault(it => it.Device.Id == devId); - devcore?.Device?.DevicePropertys?.ForEach(it => + var devcore = App.GetService().GetDeviceById(devId); + devcore?.DevicePropertys?.ForEach(it => { var dependencyProperty = Propertys.FirstOrDefault(a => a.PropertyName == it.PropertyName); if (dependencyProperty != null)