feat(browse): Wave-0 Batch F — capture coalescing/cap + AddAdminUI DI registration
Task 10: in-flight coalescing (Lazy<Task<CapturedTree>> keyed on driverType+SHA256(config))
so repeat Browse clicks share one device walk; global SemaphoreSlim cap
(MaxConcurrentCaptures=4) queues excess; per-caller ct via WaitAsync leaves the shared
capture (bounded by open-timeout, CancellationToken.None) unaffected; in-flight-only map
(Refresh = fresh capture). 7 concurrency tests green (158 total in Commons.Tests).
Task 12: AddAdminUI registers IUniversalDriverBrowser->DiscoveryDriverBrowser with
NullDriverFactory fallback (standalone AdminUI => CanBrowse false => manual entry).
AdminUI.Tests 542 green.
This commit is contained in:
@@ -3,9 +3,11 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using ZB.MOM.WW.OtOpcUa.AdminUI.Hubs;
|
||||
using ZB.MOM.WW.OtOpcUa.AdminUI.Uns;
|
||||
using ZB.MOM.WW.OtOpcUa.Commons.Browsing;
|
||||
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
||||
using ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser;
|
||||
using ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser;
|
||||
|
||||
@@ -48,6 +50,12 @@ public static class EndpointRouteBuilderExtensions
|
||||
services.AddScoped<IUnsTreeService, UnsTreeService>();
|
||||
services.AddSingleton<IDriverBrowser, OpcUaClientDriverBrowser>();
|
||||
services.AddSingleton<IDriverBrowser, GalaxyDriverBrowser>();
|
||||
// Universal Discover-backed fallback browser (Wave 0). IDriverFactory is bound by the
|
||||
// fused Host's DriverFactoryBootstrap; a standalone AdminUI has none → NullDriverFactory
|
||||
// → CanBrowse false → pickers gracefully stay manual-entry (design §6).
|
||||
services.AddSingleton<IUniversalDriverBrowser>(sp => new DiscoveryDriverBrowser(
|
||||
sp.GetService<IDriverFactory>() ?? NullDriverFactory.Instance,
|
||||
sp.GetRequiredService<ILogger<DiscoveryDriverBrowser>>()));
|
||||
|
||||
// Roslyn-backed Monaco script-editor analysis (diagnostics/completions/hover/...).
|
||||
services.AddScoped<ScriptAnalysis.ScriptAnalysisService>();
|
||||
|
||||
Reference in New Issue
Block a user