修复变量值不更新的问题

This commit is contained in:
2025-09-09 15:57:04 +08:00
parent 1dad2a0d2f
commit 7fad87fff5
8 changed files with 44 additions and 17 deletions

View File

@@ -299,6 +299,8 @@ namespace DMS.Infrastructure.Services
variable.DataValue = newValue;
variable.DisplayValue = newValue;
variable.UpdatedAt = DateTime.Now;
_logger.LogDebug($"节点:{variable.OpcUaNodeId}值发生了变化:{newValue}");
// 触发变量值变更事件
var eventArgs = new VariableValueChangedEventArgs(
@@ -308,7 +310,7 @@ namespace DMS.Infrastructure.Services
newValue,
variable.UpdatedAt);
// _appDataCenterService.OnVariableValueChanged( eventArgs);
_appDataCenterService.VariableManagementService.VariableValueChanged( eventArgs);
// 推送到数据处理队列
await _dataProcessingService.EnqueueAsync(variable);