Files
scadaproj/components/ui-theme/validation/ot-ui/host/Components/Pages/RawPilot.razor
T

20 lines
1.4 KiB
Plaintext

@page "/raw-pilot"
@layout ZB.MOM.WW.OtOpcUa.AdminUI.Components.Layout.MainLayout
<h1>Local Raw virtualization verification</h1>
<p>Actual RawTree with800 synthetic already-loaded tags. Local in-memory context contains fixture-only records; browser/protocol sessions and mutations reject calls.</p>
<div id="raw-scroller" style="height:360px;overflow:auto;border:1px solid var(--rule)">
<RawTree Roots="_roots" PickerMode="true" SelectedTagIds="_selected" OnSelectionChanged="SelectedChanged" ResolveDescendantTagIds="ResolveTags" />
</div>
<output id="selection-count">@_selected.Count selected</output>
@code {
private readonly HashSet<string> _selected = [];
private readonly List<RawNode> _roots = Build();
private static List<RawNode> Build()
{
var root = new RawNode { Kind=RawNodeKind.Device, Key="dev:local", DisplayName="Synthetic device", EntityId="device-local", ClusterId="synthetic", DriverType="Modbus", Expanded=true, Loaded=true, HasLazyChildren=true };
root.Children.AddRange(Enumerable.Range(0,800).Select(i => new RawNode { Kind=RawNodeKind.Tag, Key="tag:local-"+i, DisplayName=$"Synthetic tag {i:000}", EntityId="tag-local-"+i, ClusterId="synthetic" }));root.ChildCount=root.Children.Count;return [root];
}
private void SelectedChanged() { }
private Task<IReadOnlyList<string>> ResolveTags(RawNode node) => Task.FromResult<IReadOnlyList<string>>(node.Children.Select(n => n.EntityId!).ToArray());
}