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.
52 lines
1.8 KiB
Plaintext
52 lines
1.8 KiB
Plaintext
@* Static Modbus address builder: register type + offset + length → 4x00001-4 *@
|
|
@using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers
|
|
|
|
<div class="row g-3">
|
|
<div class="col-md-4">
|
|
<label class="form-label">Register type</label>
|
|
<select class="form-select form-select-sm" @bind="_regType" @bind:after="OnChangedAsync">
|
|
<option value="Coil">Coil (0x)</option>
|
|
<option value="DiscreteInput">DiscreteInput (1x)</option>
|
|
<option value="Input">Input (3x)</option>
|
|
<option value="Holding">Holding (4x)</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label class="form-label">Offset</label>
|
|
<input type="number" class="form-control form-control-sm" min="0" max="99999"
|
|
@bind="_offset" @bind:after="OnChangedAsync" />
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label class="form-label">Length</label>
|
|
<input type="number" class="form-control form-control-sm" min="1" max="125"
|
|
@bind="_length" @bind:after="OnChangedAsync" />
|
|
</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 _regType = "Holding";
|
|
private int _offset = 1;
|
|
private int _length = 1;
|
|
private string _built = "";
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_built = ModbusAddressBuilder.Build(_regType, _offset, _length);
|
|
_ = CurrentAddressChanged.InvokeAsync(_built);
|
|
}
|
|
|
|
private async Task OnChangedAsync()
|
|
{
|
|
_built = ModbusAddressBuilder.Build(_regType, _offset, _length);
|
|
await CurrentAddressChanged.InvokeAsync(_built);
|
|
}
|
|
}
|