将pollLevel属性名改为pollingInterval

This commit is contained in:
2025-09-05 20:24:27 +08:00
parent 6e123b47cc
commit 08f9de137e
17 changed files with 95 additions and 98 deletions

View File

@@ -277,15 +277,15 @@ public class OpcUaBackgroundService : BackgroundService
if (_opcUaVariablesByDeviceId.TryGetValue(device.Id, out var opcUaVariables))
{
var variableGroup = opcUaVariables.GroupBy(variable => variable.PollLevel);
var variableGroup = opcUaVariables.GroupBy(variable => variable.PollingInterval);
foreach (var vGroup in variableGroup)
{
var pollLevel = vGroup.Key;
var pollingInterval = vGroup.Key;
var opcUaNodes
= vGroup.Select(variableDto => new OpcUaNode() { NodeId = variableDto.OpcUaNodeId })
.ToList();
PollingIntervals.TryGetValue(pollLevel, out var interval);
PollingIntervals.TryGetValue(pollingInterval, out var interval);
opcUaService.SubscribeToNode(opcUaNodes,HandleDataChanged,10000,1000);
}
}