2a98b40bfe112c05d839997f0e9913d91bbf69b1
- 重构了 VariableTableDataService 中的 AddVariableTable 方法,使其返回值从 bool 变为新表的 ID (int)。这使得服务层更加健壮,并能向调用方提供新创建实体的确切ID。 Fix: - 修复了 DeviceDetailViewModel 在创建变量表后UI不自动更新的Bug。现在视图模型会正确地将新表添加到UI集合中,确保了界面的即时刷新。 Feat: - 为 DeviceDetailViewModel 添加了 IsBusy 状态。现在“添加”、“编辑”和“删除”等异步操作会更新此状态,防止了用户重复点击,并允许UI在处理期间显示加载指示,提升了用户体验。
PMSWPF
OPC UA Service
This project includes an OPC UA service implementation that provides the following functionalities:
Features
- Connect to OPC UA servers
- Browse nodes in the OPC UA address space
- Read and write values from/to OPC UA nodes
- Add subscriptions for monitoring node changes
Usage
// Create an instance of the OPC UA service
var opcUaService = new OpcUaService();
// Connect to an OPC UA server
await opcUaService.CreateSession("opc.tcp://localhost:4840");
// Check connection status
if (opcUaService.IsConnected())
{
// Browse nodes
var rootNodeId = ObjectIds.RootFolder;
var references = opcUaService.BrowseNodes(rootNodeId);
// Read a value
var value = opcUaService.ReadValue(someNodeId);
// Write a value
opcUaService.WriteValue(someNodeId, newValue);
// Add a subscription
var subscription = opcUaService.AddSubscription("MySubscription");
}
// Disconnect when done
opcUaService.Disconnect();
Testing
Unit tests for the OPC UA service are included in the DMS.Infrastructure.UnitTests project. Run them using your preferred test runner.
Trigger System
The trigger system has been updated to support associating triggers with multiple variables instead of just one. This allows for more flexible trigger configurations where a single trigger can monitor multiple variables.
Key Changes
- Modified
TriggerDefinitionto use a list of variable IDs instead of a single variable ID - Added a new
TriggerVariablestable to maintain the many-to-many relationship between triggers and variables - Updated the UI to support selecting multiple variables when creating or editing triggers
- Updated all related services and repositories to handle the new many-to-many relationship
Description