diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbCipTagConfigEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbCipTagConfigEditor.razor index 5a039f7e..4d4d8f83 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbCipTagConfigEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbCipTagConfigEditor.razor @@ -1,23 +1,43 @@ @using ZB.MOM.WW.OtOpcUa.AdminUI.Uns.TagEditors @using ZB.MOM.WW.OtOpcUa.Driver.AbCip +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
-
-
+
+ +
+ + +
+
+@if (_showPicker) +{ + + + +} + @code { [Parameter] public string? ConfigJson { get; set; } [Parameter] public EventCallback ConfigJsonChanged { get; set; } private AbCipTagConfigModel _m = new(); private string? _lastConfigJson; + private bool _showPicker; + private string _pickerAddress = ""; // Re-parse only when the incoming JSON actually changes, so an unrelated parent re-render // (Blazor Server live-status pushes do this) can't reset the user's in-progress edits. @@ -37,4 +57,10 @@ apply(); await ConfigJsonChanged.InvokeAsync(_m.ToJson()); } + + private async Task OnAddressPicked(string address) + { + if (!string.IsNullOrWhiteSpace(address)) + await Update(() => _m.TagPath = address); + } } diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbLegacyTagConfigEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbLegacyTagConfigEditor.razor index 77014b05..2bdc9e6d 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbLegacyTagConfigEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/AbLegacyTagConfigEditor.razor @@ -1,23 +1,43 @@ @using ZB.MOM.WW.OtOpcUa.AdminUI.Uns.TagEditors @using ZB.MOM.WW.OtOpcUa.Driver.AbLegacy +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
-
-
+
+ +
+ + +
+
+@if (_showPicker) +{ + + + +} + @code { [Parameter] public string? ConfigJson { get; set; } [Parameter] public EventCallback ConfigJsonChanged { get; set; } private AbLegacyTagConfigModel _m = new(); private string? _lastConfigJson; + private bool _showPicker; + private string _pickerAddress = ""; // Re-parse only when the incoming JSON actually changes, so an unrelated parent re-render // (Blazor Server live-status pushes do this) can't reset the user's in-progress edits. @@ -37,4 +57,10 @@ apply(); await ConfigJsonChanged.InvokeAsync(_m.ToJson()); } + + private async Task OnAddressPicked(string address) + { + if (!string.IsNullOrWhiteSpace(address)) + await Update(() => _m.Address = address); + } } diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/FocasTagConfigEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/FocasTagConfigEditor.razor index 8c7bd56e..1a0a5a00 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/FocasTagConfigEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/FocasTagConfigEditor.razor @@ -1,23 +1,43 @@ @using ZB.MOM.WW.OtOpcUa.AdminUI.Uns.TagEditors @using ZB.MOM.WW.OtOpcUa.Driver.FOCAS +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
-
-
+
+ +
+ + +
+
+@if (_showPicker) +{ + + + +} + @code { [Parameter] public string? ConfigJson { get; set; } [Parameter] public EventCallback ConfigJsonChanged { get; set; } private FocasTagConfigModel _m = new(); private string? _lastConfigJson; + private bool _showPicker; + private string _pickerAddress = ""; // Re-parse only when the incoming JSON actually changes, so an unrelated parent re-render // (Blazor Server live-status pushes do this) can't reset the user's in-progress edits. @@ -37,4 +57,10 @@ apply(); await ConfigJsonChanged.InvokeAsync(_m.ToJson()); } + + private async Task OnAddressPicked(string address) + { + if (!string.IsNullOrWhiteSpace(address)) + await Update(() => _m.Address = address); + } } diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/ModbusTagConfigEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/ModbusTagConfigEditor.razor index bcaa0533..b59ba9ac 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/ModbusTagConfigEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/ModbusTagConfigEditor.razor @@ -1,5 +1,7 @@ @using ZB.MOM.WW.OtOpcUa.AdminUI.Uns.TagEditors @using ZB.MOM.WW.OtOpcUa.Driver.Modbus +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
@@ -20,14 +22,30 @@
+
+ +
+@if (_showPicker) +{ + + + +} + @code { [Parameter] public string? ConfigJson { get; set; } [Parameter] public EventCallback ConfigJsonChanged { get; set; } private ModbusTagConfigModel _m = new(); private string? _lastConfigJson; + private bool _showPicker; + private string _pickerAddress = ""; // Re-parse only when the incoming JSON actually changes, so an unrelated parent re-render // (Blazor Server live-status pushes do this) can't reset the user's in-progress edits. @@ -49,4 +67,22 @@ apply(); await ConfigJsonChanged.InvokeAsync(_m.ToJson()); } + + // Parse the builder string (e.g. "4x00001-1") back into Region + Address fields. + // Format: {prefix}{offset:00000}-{length} where prefix is 0x/1x/3x/4x. + private async Task OnAddressPicked(string address) + { + if (string.IsNullOrWhiteSpace(address)) return; + var region = address.StartsWith("0x") ? ModbusRegion.Coils + : address.StartsWith("1x") ? ModbusRegion.DiscreteInputs + : address.StartsWith("3x") ? ModbusRegion.InputRegisters + : ModbusRegion.HoldingRegisters; + var rest = address.Length > 2 ? address[2..] : address; + var dashIdx = rest.IndexOf('-'); + var offsetStr = dashIdx >= 0 ? rest[..dashIdx] : rest; + if (int.TryParse(offsetStr, out var offset)) + { + await Update(() => { _m.Region = region; _m.Address = offset; }); + } + } } diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/S7TagConfigEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/S7TagConfigEditor.razor index 8f8120fd..9f1d8611 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/S7TagConfigEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/S7TagConfigEditor.razor @@ -1,9 +1,16 @@ @using ZB.MOM.WW.OtOpcUa.AdminUI.Uns.TagEditors @using ZB.MOM.WW.OtOpcUa.Driver.S7 +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
-
-
+
+ +
+ + +
+
+@if (_showPicker) +{ + + + +} + @code { [Parameter] public string? ConfigJson { get; set; } [Parameter] public EventCallback ConfigJsonChanged { get; set; } private S7TagConfigModel _m = new(); private string? _lastConfigJson; + private bool _showPicker; + private string _pickerAddress = ""; // Re-parse only when the incoming JSON actually changes, so an unrelated parent re-render // (Blazor Server live-status pushes do this) can't reset the user's in-progress edits. @@ -39,4 +59,10 @@ apply(); await ConfigJsonChanged.InvokeAsync(_m.ToJson()); } + + private async Task OnAddressPicked(string address) + { + if (!string.IsNullOrWhiteSpace(address)) + await Update(() => _m.Address = address); + } } diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/TwinCATTagConfigEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/TwinCATTagConfigEditor.razor index af11e1d2..7d7f9c80 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/TwinCATTagConfigEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagEditors/TwinCATTagConfigEditor.razor @@ -1,23 +1,43 @@ @using ZB.MOM.WW.OtOpcUa.AdminUI.Uns.TagEditors @using ZB.MOM.WW.OtOpcUa.Driver.TwinCAT +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers +@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
-
-
+
+ +
+ + +
+
+@if (_showPicker) +{ + + + +} + @code { [Parameter] public string? ConfigJson { get; set; } [Parameter] public EventCallback ConfigJsonChanged { get; set; } private TwinCATTagConfigModel _m = new(); private string? _lastConfigJson; + private bool _showPicker; + private string _pickerAddress = ""; // Re-parse only when the incoming JSON actually changes, so an unrelated parent re-render // (Blazor Server live-status pushes do this) can't reset the user's in-progress edits. @@ -37,4 +57,10 @@ apply(); await ConfigJsonChanged.InvokeAsync(_m.ToJson()); } + + private async Task OnAddressPicked(string address) + { + if (!string.IsNullOrWhiteSpace(address)) + await Update(() => _m.SymbolPath = address); + } }