1 feat: 将 OpcUaEndpointUrl 移动到 Device 并更新 OpcUaBackgroundService
2 将 OpcUaEndpointUrl 属性从 VariableData 和 DbVariableData 移动到 Device 和 DbDevice。 3 更新 OpcUaBackgroundService 以从关联的 Device 对象中检索 OpcUaEndpointUrl。 4 确保 DataServices 和 VarDataRepository 正确加载关联的 VariableTable 和 Device 数据。 5 在 VariableData 模型中添加 VariableTable 属性以正确解析。
This commit is contained in:
@@ -193,6 +193,16 @@ public partial class DataServices : ObservableRecipient, IRecipient<LoadMessage>
|
||||
return await _varDataRepository.GetAllAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步根据ID获取设备数据。
|
||||
/// </summary>
|
||||
/// <param name="id">设备ID。</param>
|
||||
/// <returns>设备对象,如果不存在则为null。</returns>
|
||||
public async Task<Device> GetDeviceByIdAsync(int id)
|
||||
{
|
||||
return await _deviceRepository.GetById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载变量数据。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user