063005fefa
- DriverTagPicker shell: modal chrome + per-driver picker body rendered as ChildContent. - 9 picker bodies (Modbus/AbCip/AbLegacy/S7/TwinCat/FOCAS/ OpcUaClient/Galaxy/Historian.Wonderware). 5 have computed builder logic + unit tests; 4 are free-text passthroughs (live browse for OPC UA + Galaxy is a documented follow-up). - Each typed driver page gets a "Pick address" button that opens the modal with the matching body. Picked address surfaces in the modal footer for manual copy — no JS interop in v1.
59 lines
2.2 KiB
Plaintext
59 lines
2.2 KiB
Plaintext
@* Static AB Legacy address builder: file type + file number + element → N7:0 *@
|
|
@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
|
|
|
|
<div class="row g-3">
|
|
<div class="col-md-3">
|
|
<label class="form-label">File type</label>
|
|
<select class="form-select form-select-sm" @bind="_fileType" @bind:after="OnChangedAsync">
|
|
<option value="N">N — Integer</option>
|
|
<option value="B">B — Binary/Bit</option>
|
|
<option value="F">F — Float</option>
|
|
<option value="I">I — Input</option>
|
|
<option value="O">O — Output</option>
|
|
<option value="S">S — Status</option>
|
|
<option value="T">T — Timer</option>
|
|
<option value="C">C — Counter</option>
|
|
<option value="R">R — Control</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label class="form-label">File number</label>
|
|
<input type="number" class="form-control form-control-sm" min="0" max="999"
|
|
@bind="_fileNumber" @bind:after="OnChangedAsync" />
|
|
<div class="form-text">e.g. 7 for N7</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label class="form-label">Element</label>
|
|
<input type="number" class="form-control form-control-sm" min="0" max="9999"
|
|
@bind="_element" @bind:after="OnChangedAsync" />
|
|
<div class="form-text">e.g. 0 for N7:0</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-3">
|
|
<span class="text-muted small">Result:</span>
|
|
<code class="mono ms-2">@_built</code>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] public string CurrentAddress { get; set; } = "";
|
|
[Parameter] public EventCallback<string> CurrentAddressChanged { get; set; }
|
|
|
|
private string _fileType = "N";
|
|
private int _fileNumber = 7;
|
|
private int _element = 0;
|
|
private string _built = "";
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_built = AbLegacyAddressBuilder.Build(_fileType, _fileNumber, _element);
|
|
_ = CurrentAddressChanged.InvokeAsync(_built);
|
|
}
|
|
|
|
private async Task OnChangedAsync()
|
|
{
|
|
_built = AbLegacyAddressBuilder.Build(_fileType, _fileNumber, _element);
|
|
await CurrentAddressChanged.InvokeAsync(_built);
|
|
}
|
|
}
|