实现了设备详情页面,并添加了在设备界面点击对应的设备直接跳转到设备详情页面

This commit is contained in:
2025-07-16 18:39:00 +08:00
parent b17ee045ff
commit 76f16d50be
18 changed files with 374 additions and 63 deletions

View File

@@ -104,6 +104,21 @@ public class DialogService :IDialogService
}
return null;
}
public async Task<VariableTable> ShowEditVarTableDialog(VariableTable variableTable)
{
VarTableDialogViewModel vm = new();
vm.Title = "编辑变量表";
vm.PrimaryButtonText = "编辑变量表";
vm.VariableTable = variableTable;
var dialog = new VarTableDialog(vm);
var res = await dialog.ShowAsync();
if (res == ContentDialogResult.Primary)
{
return vm.VariableTable;
}
return null;
}
public async Task<VariableData> ShowAddVarDataDialog()
{

View File

@@ -13,6 +13,7 @@ public interface IDialogService
Task<bool> ShowConfrimeDialog(string title, string message,string buttonText="确认");
Task<VariableTable> ShowAddVarTableDialog();
Task<VariableTable> ShowEditVarTableDialog(VariableTable variableTable);
Task<VariableData> ShowAddVarDataDialog();

View File

@@ -417,7 +417,7 @@ namespace PMSWPF.Services
variable.DataValue = value.ToString();
variable.DisplayValue = value.ToString(); // 或者根据需要进行格式化
variable.UpdateTime = DateTime.Now;
Console.WriteLine($"OpcUa后台服务轮询变量{variable.Name},值:{variable.DataValue}");
// Console.WriteLine($"OpcUa后台服务轮询变量{variable.Name},值:{variable.DataValue}");
// 将更新后的数据推入处理队列。
await _dataProcessingService.EnqueueAsync(variable);
}

View File

@@ -285,7 +285,7 @@ namespace PMSWPF.Services
variable.DataValue = dataItem.Value.ToString();
variable.DisplayValue = dataItem.Value.ToString();
variable.UpdateTime = DateTime.Now;
Console.WriteLine($"S7后台服务轮询变量{variable.Name},值:{variable.DataValue}");
// Console.WriteLine($"S7后台服务轮询变量{variable.Name},值:{variable.DataValue}");
// 将更新后的数据推入处理队列。
await _dataProcessingService.EnqueueAsync(variable);
}