From 892d2ee8d248362ab76ba99ca4f89dfdba391ce5 Mon Sep 17 00:00:00 2001
From: Kimdiego2098 <2248356998@qq.com>
Date: Wed, 6 Sep 2023 17:14:24 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=8E=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8F=96?=
=?UTF-8?q?=E5=8E=9F=E5=B1=9E=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ThingsGateway.Application/ThingsGateway.Application.xml | 2 +-
.../Workers/Collect/CollectDeviceWorker.cs | 4 ++--
.../Workers/Upload/UploadDeviceWorker.cs | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
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)