将所有的VariableData改为Variable,将DataVariables改为Variables,修复了变量添加MQTT服务器后,服务器列表不更新的问题

This commit is contained in:
2025-07-17 20:13:21 +08:00
parent 6b21c387d5
commit 018fe7c9d0
44 changed files with 410 additions and 407 deletions

View File

@@ -3,7 +3,7 @@ using PMSWPF.Models;
namespace PMSWPF.Services.Processors;
public class CheckValueChangedProcessor : IVariableDataProcessor
public class CheckValueChangedProcessor : IVariableProcessor
{
private readonly DataServices _dataServices;
@@ -11,10 +11,10 @@ public class CheckValueChangedProcessor : IVariableDataProcessor
{
_dataServices = dataServices;
}
public Task ProcessAsync(VariableDataContext context)
public Task ProcessAsync(VariableContext context)
{
VariableData newVariable = context.Data;
if (!_dataServices.AllVariables.TryGetValue(newVariable.Id, out VariableData oldVariable))
Variable newVariable = context.Data;
if (!_dataServices.AllVariables.TryGetValue(newVariable.Id, out Variable oldVariable))
{
NlogHelper.Warn($"检查变量值是否改变时在_dataServices.AllVariables中找不到Id:{newVariable.Id},Name:{newVariable.Name}的变量。");
context.IsHandled = true;