refactor(uns): drop dead LoadEquipmentChildrenAsync + LinesForCluster; fix stale comment
This commit is contained in:
@@ -82,51 +82,6 @@ public sealed class UnsTreeService(IDbContextFactory<OtOpcUaConfigDbContext> dbF
|
||||
return UnsTreeAssembly.Build(clusters, areas, lines, equipment);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<UnsNode>> LoadEquipmentChildrenAsync(
|
||||
string equipmentId,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
await using var db = await dbFactory.CreateDbContextAsync(ct);
|
||||
|
||||
var tagNodes = await db.Tags
|
||||
.AsNoTracking()
|
||||
.Where(t => t.EquipmentId == equipmentId)
|
||||
.OrderBy(t => t.Name)
|
||||
.Select(t => new UnsNode
|
||||
{
|
||||
Kind = UnsNodeKind.Tag,
|
||||
Key = $"tag:{t.TagId}",
|
||||
DisplayName = $"{t.Name} ({t.DataType})",
|
||||
EntityId = t.TagId,
|
||||
ClusterId = null,
|
||||
ChildCount = 0,
|
||||
HasLazyChildren = false,
|
||||
})
|
||||
.ToListAsync(ct);
|
||||
|
||||
var vtagNodes = await db.VirtualTags
|
||||
.AsNoTracking()
|
||||
.Where(v => v.EquipmentId == equipmentId)
|
||||
.OrderBy(v => v.Name)
|
||||
.Select(v => new UnsNode
|
||||
{
|
||||
Kind = UnsNodeKind.VirtualTag,
|
||||
Key = $"vtag:{v.VirtualTagId}",
|
||||
DisplayName = $"{v.Name} (VirtualTag)",
|
||||
EntityId = v.VirtualTagId,
|
||||
ClusterId = null,
|
||||
ChildCount = 0,
|
||||
HasLazyChildren = false,
|
||||
})
|
||||
.ToListAsync(ct);
|
||||
|
||||
var result = new List<UnsNode>(tagNodes.Count + vtagNodes.Count);
|
||||
result.AddRange(tagNodes);
|
||||
result.AddRange(vtagNodes);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<EquipmentTagRow>> LoadTagsForEquipmentAsync(string equipmentId, CancellationToken ct = default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user