feat(browse): Wave-0 Batch A — SupportsOnlineDiscovery gate, Commons ref, TagModal editor plumbing
Task 1: ITagDiscovery.SupportsOnlineDiscovery default member (=> false)
Task 2: Commons -> Core.Abstractions ProjectReference
Task 13: TagModal BuildEditorParameters passes DriverType + GetDriverConfigJson;
all 7 typed tag editors declare the two new [Parameter]s (DynamicComponent
throws on unmatched params, so every editor must accept them).
This commit is contained in:
@@ -10,4 +10,8 @@
|
|||||||
<PackageReference Include="ZB.MOM.WW.Audit"/>
|
<PackageReference Include="ZB.MOM.WW.Audit"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ZB.MOM.WW.OtOpcUa.Core.Abstractions\ZB.MOM.WW.OtOpcUa.Core.Abstractions.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -30,4 +30,12 @@ public interface ITagDiscovery
|
|||||||
|
|
||||||
/// <summary>Post-connect re-discovery policy. Default preserves the original retry-until-stable behavior.</summary>
|
/// <summary>Post-connect re-discovery policy. Default preserves the original retry-until-stable behavior.</summary>
|
||||||
DiscoveryRediscoverPolicy RediscoverPolicy => DiscoveryRediscoverPolicy.UntilStable;
|
DiscoveryRediscoverPolicy RediscoverPolicy => DiscoveryRediscoverPolicy.UntilStable;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True when <see cref="DiscoverAsync"/> enumerates the tag set from the live backend
|
||||||
|
/// (browsable by the universal discovery browser), rather than replaying
|
||||||
|
/// pre-declared/authored tags. Default false — flat-address drivers stay manual-entry.
|
||||||
|
/// See docs/plans/2026-07-15-universal-discovery-browser-design.md §5.
|
||||||
|
/// </summary>
|
||||||
|
bool SupportsOnlineDiscovery => false;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -41,6 +41,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private AbCipTagConfigModel _m = new();
|
private AbCipTagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
+4
@@ -41,6 +41,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private AbLegacyTagConfigModel _m = new();
|
private AbLegacyTagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
+4
@@ -39,6 +39,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private FocasTagConfigModel _m = new();
|
private FocasTagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
+4
@@ -49,6 +49,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private ModbusTagConfigModel _m = new();
|
private ModbusTagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
+4
@@ -11,6 +11,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private OpcUaClientTagConfigModel _m = new();
|
private OpcUaClientTagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
+4
@@ -41,6 +41,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private S7TagConfigModel _m = new();
|
private S7TagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
+4
@@ -41,6 +41,10 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter] public string? ConfigJson { get; set; }
|
[Parameter] public string? ConfigJson { get; set; }
|
||||||
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
[Parameter] public EventCallback<string> ConfigJsonChanged { get; set; }
|
||||||
|
/// <summary>DriverType of the selected driver — lets browse-capable pickers open a universal session.</summary>
|
||||||
|
[Parameter] public string DriverType { get; set; } = "";
|
||||||
|
/// <summary>Live accessor for the selected driver's DriverConfig JSON (browse connect config).</summary>
|
||||||
|
[Parameter] public Func<string> GetDriverConfigJson { get; set; } = () => "{}";
|
||||||
|
|
||||||
private TwinCATTagConfigModel _m = new();
|
private TwinCATTagConfigModel _m = new();
|
||||||
private string? _lastConfigJson;
|
private string? _lastConfigJson;
|
||||||
|
|||||||
@@ -353,6 +353,8 @@
|
|||||||
{
|
{
|
||||||
["ConfigJson"] = _form.TagConfig,
|
["ConfigJson"] = _form.TagConfig,
|
||||||
["ConfigJsonChanged"] = EventCallback.Factory.Create<string>(this, v => _form.TagConfig = v),
|
["ConfigJsonChanged"] = EventCallback.Factory.Create<string>(this, v => _form.TagConfig = v),
|
||||||
|
["DriverType"] = SelectedDriverType ?? "",
|
||||||
|
["GetDriverConfigJson"] = (Func<string>)(() => SelectedDriverConfig),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Cache a single NativeAlarmModel parse keyed on the current TagConfig string, so the two computed
|
// Cache a single NativeAlarmModel parse keyed on the current TagConfig string, so the two computed
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Shouldly;
|
||||||
|
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests;
|
||||||
|
|
||||||
|
public class TagDiscoveryDefaultsTests
|
||||||
|
{
|
||||||
|
private sealed class MinimalDiscovery : ITagDiscovery
|
||||||
|
{
|
||||||
|
public Task DiscoverAsync(IAddressSpaceBuilder builder, CancellationToken ct) => Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void SupportsOnlineDiscovery_DefaultsToFalse() =>
|
||||||
|
((ITagDiscovery)new MinimalDiscovery()).SupportsOnlineDiscovery.ShouldBeFalse();
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void RediscoverPolicy_DefaultRemainsUntilStable() =>
|
||||||
|
((ITagDiscovery)new MinimalDiscovery()).RediscoverPolicy.ShouldBe(DiscoveryRediscoverPolicy.UntilStable);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user