Associate fields in AB and Focas driver editors
This commit is contained in:
+54
-39
@@ -14,46 +14,52 @@
|
||||
<div style="padding:1rem">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.TimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default libplctag call timeout. Default 2 s.</div>
|
||||
<label for="@FieldId("field-01")" class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-01-error", "field-01-hint")" id="@FieldId("field-01")" @bind-Value="_form.TimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-01-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.TimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-01-hint")" class="form-text">Default libplctag call timeout. Default 2 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Max concurrent reads</label>
|
||||
<InputNumber @bind-Value="_form.MaxConcurrentReads" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Read work items in flight at once. Default 8; 1 = sequential (libplctag). The native transport always uses at least 64 — it packs concurrent reads into one request.</div>
|
||||
<label for="@FieldId("field-02")" class="form-label">Max concurrent reads</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-02-error", "field-02-hint")" id="@FieldId("field-02")" @bind-Value="_form.MaxConcurrentReads" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-02-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.MaxConcurrentReads)" /> }</div>
|
||||
<div id="@FieldId("field-02-hint")" class="form-text">Read work items in flight at once. Default 8; 1 = sequential (libplctag). The native transport always uses at least 64 — it packs concurrent reads into one request.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check form-switch mt-4">
|
||||
<InputCheckbox @bind-Value="_form.EnableControllerBrowse" @bind-Value:after="EmitAsync" class="form-check-input" id="enableBrowse" />
|
||||
<label class="form-check-label" for="enableBrowse">Enable controller browse</label>
|
||||
<InputCheckbox aria-describedby="@FieldIds("enableBrowse-hint")" @bind-Value="_form.EnableControllerBrowse" @bind-Value:after="EmitAsync" class="form-check-input" id="@FieldId("enableBrowse")" />
|
||||
<label class="form-check-label" for="@FieldId("enableBrowse")">Enable controller browse</label>
|
||||
</div>
|
||||
<div class="form-text">Walk the Logix symbol table and surface globals under Discovered/.</div>
|
||||
<div id="@FieldId("enableBrowse-hint")" class="form-text">Walk the Logix symbol table and surface globals under Discovered/.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check form-switch mt-4">
|
||||
<InputCheckbox @bind-Value="_form.EnableDeclarationOnlyUdtGrouping" @bind-Value:after="EmitAsync" class="form-check-input" id="enableUdtGroup" />
|
||||
<label class="form-check-label" for="enableUdtGroup">Enable declaration-only UDT grouping</label>
|
||||
<InputCheckbox aria-describedby="@FieldIds("enableUdtGroup-hint")" @bind-Value="_form.EnableDeclarationOnlyUdtGrouping" @bind-Value:after="EmitAsync" class="form-check-input" id="@FieldId("enableUdtGroup")" />
|
||||
<label class="form-check-label" for="@FieldId("enableUdtGroup")">Enable declaration-only UDT grouping</label>
|
||||
</div>
|
||||
<div class="form-text">Only enable when UDT member declaration order matches controller compiled layout.</div>
|
||||
<div id="@FieldId("enableUdtGroup-hint")" class="form-text">Only enable when UDT member declaration order matches controller compiled layout.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label" for="abcipTransport">Transport</label>
|
||||
<InputSelect @bind-Value="_form.Transport" @bind-Value:after="EmitAsync" class="form-select form-select-sm" id="abcipTransport">
|
||||
<label class="form-label" for="@FieldId("abcipTransport")">Transport</label>
|
||||
<InputSelect aria-describedby="@FieldIds("abcipTransport-hint")" @bind-Value="_form.Transport" @bind-Value:after="EmitAsync" class="form-select form-select-sm" id="@FieldId("abcipTransport")">
|
||||
<option value="">Default (node setting; Native unless pinned)</option>
|
||||
<option value="@AbCipTransport.Native">Native (managed)</option>
|
||||
<option value="@AbCipTransport.Libplctag">libplctag (fallback)</option>
|
||||
</InputSelect>
|
||||
<div class="form-text">Which protocol stack talks to the controller. Default omits the setting so the node-level <code>Drivers:AbCip:DefaultTransport</code> picks (Native unless an operator pinned it); takes effect on the next deploy.</div>
|
||||
<div id="@FieldId("abcipTransport-hint")" class="form-text">Which protocol stack talks to the controller. Default omits the setting so the node-level <code>Drivers:AbCip:DefaultTransport</code> picks (Native unless an operator pinned it); takes effect on the next deploy.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label" for="abcipBrowsePageDelay">Browse page delay (ms)</label>
|
||||
<InputNumber @bind-Value="_form.BrowsePageDelayMs" @bind-Value:after="EmitAsync" class="form-control form-control-sm" id="abcipBrowsePageDelay" />
|
||||
<div class="form-text">Pause between controller symbol-browse pages (<code>browsePageDelayMs</code>). Default 5 ms; 0 disables the pause. Left at the default on a config that never set it, the key is not written.</div>
|
||||
<label class="form-label" for="@FieldId("abcipBrowsePageDelay")">Browse page delay (ms)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("abcipBrowsePageDelay-error", "abcipBrowsePageDelay-hint")" @bind-Value="_form.BrowsePageDelayMs" @bind-Value:after="EmitAsync" class="form-control form-control-sm" id="@FieldId("abcipBrowsePageDelay")" />
|
||||
<div id="@FieldId("abcipBrowsePageDelay-error")" class="field-error">
|
||||
@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.BrowsePageDelayMs)" /> }
|
||||
@if (_form.BrowsePageDelayError is { } browseDelayError)
|
||||
{
|
||||
<div class="text-danger small mt-1" id="abcipBrowsePageDelayError">@browseDelayError</div>
|
||||
<div class="text-danger small mt-1" id="@FieldId("abcipBrowsePageDelayError")">@browseDelayError</div>
|
||||
}
|
||||
</div>
|
||||
<div id="@FieldId("abcipBrowsePageDelay-hint")" class="form-text">Pause between controller symbol-browse pages (<code>browsePageDelayMs</code>). Default 5 ms; 0 disables the pause. Left at the default on a config that never set it, the key is not written.</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,15 +72,16 @@
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<div class="form-check form-switch mt-4">
|
||||
<InputCheckbox @bind-Value="_form.EnableAlarmProjection" @bind-Value:after="EmitAsync" class="form-check-input" id="enableAlarm" />
|
||||
<label class="form-check-label" for="enableAlarm">Enable ALMD alarm projection</label>
|
||||
<InputCheckbox aria-describedby="@FieldIds("enableAlarm-hint")" @bind-Value="_form.EnableAlarmProjection" @bind-Value:after="EmitAsync" class="form-check-input" id="@FieldId("enableAlarm")" />
|
||||
<label class="form-check-label" for="@FieldId("enableAlarm")">Enable ALMD alarm projection</label>
|
||||
</div>
|
||||
<div class="form-text">Surfaces ALMD tags as alarm conditions via IAlarmSource. Default off.</div>
|
||||
<div id="@FieldId("enableAlarm-hint")" class="form-text">Surfaces ALMD tags as alarm conditions via IAlarmSource. Default off.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Alarm poll interval (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.AlarmPollIntervalSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default 1 s.</div>
|
||||
<label for="@FieldId("field-08")" class="form-label">Alarm poll interval (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-08-error", "field-08-hint")" id="@FieldId("field-08")" @bind-Value="_form.AlarmPollIntervalSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-08-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.AlarmPollIntervalSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-08-hint")" class="form-text">Default 1 s.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,30 +94,33 @@
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<div class="form-check form-switch mt-4">
|
||||
<InputCheckbox @bind-Value="_form.ProbeEnabled" @bind-Value:after="EmitAsync" class="form-check-input" id="probeEnabled" />
|
||||
<label class="form-check-label" for="probeEnabled">Enabled</label>
|
||||
<InputCheckbox @bind-Value="_form.ProbeEnabled" @bind-Value:after="EmitAsync" class="form-check-input" id="@FieldId("probeEnabled")" />
|
||||
<label class="form-check-label" for="@FieldId("probeEnabled")">Enabled</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Interval (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.ProbeIntervalSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default 5 s.</div>
|
||||
<label for="@FieldId("field-10")" class="form-label">Interval (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-10-error", "field-10-hint")" id="@FieldId("field-10")" @bind-Value="_form.ProbeIntervalSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-10-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.ProbeIntervalSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-10-hint")" class="form-text">Default 5 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.ProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default 2 s.</div>
|
||||
<label for="@FieldId("field-11")" class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-11-error", "field-11-hint")" id="@FieldId("field-11")" @bind-Value="_form.ProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-11-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.ProbeTimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-11-hint")" class="form-text">Default 2 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Probe tag path</label>
|
||||
<InputText @bind-Value="_form.ProbeTagPath" @bind-Value:after="EmitAsync" class="form-control form-control-sm mono"
|
||||
<label for="@FieldId("field-12")" class="form-label">Probe tag path</label>
|
||||
<InputText aria-describedby="@FieldIds("field-12-hint")" id="@FieldId("field-12")" @bind-Value="_form.ProbeTagPath" @bind-Value:after="EmitAsync" class="form-control form-control-sm mono"
|
||||
placeholder="e.g. Program:Main.SomeTag" />
|
||||
<div class="form-text">Required when probe is enabled. Leave blank and an operator warning is logged.</div>
|
||||
<div id="@FieldId("field-12-hint")" class="form-text">Required when probe is enabled. Leave blank and an operator warning is logged.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Admin UI probe timeout (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.AdminProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Max 60. Used by Test Connect. Default 5.</div>
|
||||
<label for="@FieldId("field-13")" class="form-label">Admin UI probe timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-13-error", "field-13-hint")" id="@FieldId("field-13")" @bind-Value="_form.AdminProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-13-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.AdminProbeTimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-13-hint")" class="form-text">Max 60. Used by Test Connect. Default 5.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,6 +129,11 @@
|
||||
<DriverResilienceSection ResilienceConfig="@ResilienceConfig" ResilienceConfigChanged="OnResilienceChanged" />
|
||||
|
||||
@code {
|
||||
private readonly string _fieldScope = "ab-cip-driver-form-" + Guid.NewGuid().ToString("N");
|
||||
private string FieldIds(params string[] names) => string.Join(" ", names.Select(FieldId));
|
||||
private string FieldId(string name) => $"{_fieldScope}-{name}";
|
||||
[CascadingParameter] private Microsoft.AspNetCore.Components.Forms.EditContext? _fieldEditContext { get; set; }
|
||||
|
||||
/// <summary>The driver-level DriverConfig JSON (protocol/operation; endpoints live on the devices).</summary>
|
||||
[Parameter] public string DriverConfigJson { get; set; } = "{}";
|
||||
/// <summary>Fired (camelCase-serialized) whenever a field changes — enables @bind-DriverConfigJson.</summary>
|
||||
|
||||
+32
-23
@@ -15,25 +15,26 @@
|
||||
<div style="padding:1rem">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.TimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default read/write timeout. Default 2 s.</div>
|
||||
<label for="@FieldId("field-01")" class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-01-error", "field-01-hint")" id="@FieldId("field-01")" @bind-Value="_form.TimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-01-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.TimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-01-hint")" class="form-text">Default read/write timeout. Default 2 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label" for="ablegacyTransport">Transport</label>
|
||||
<InputSelect @bind-Value="_form.Transport" @bind-Value:after="EmitAsync" class="form-select form-select-sm" id="ablegacyTransport">
|
||||
<label class="form-label" for="@FieldId("ablegacyTransport")">Transport</label>
|
||||
<InputSelect aria-describedby="@FieldIds("ablegacyTransport-hint")" @bind-Value="_form.Transport" @bind-Value:after="EmitAsync" class="form-select form-select-sm" id="@FieldId("ablegacyTransport")">
|
||||
<option value="">Default (libplctag)</option>
|
||||
<option value="@AbLegacyTransport.Native">Native (managed, opt-in)</option>
|
||||
<option value="@AbLegacyTransport.Libplctag">libplctag</option>
|
||||
</InputSelect>
|
||||
<div class="form-text">Which protocol stack talks to the controller. Default omits the setting (libplctag). Native is opt-in: wire-proven only for N-file reads/writes and F8 reads. Takes effect on the next deploy.</div>
|
||||
<div id="@FieldId("ablegacyTransport-hint")" class="form-text">Which protocol stack talks to the controller. Default omits the setting (libplctag). Native is opt-in: wire-proven only for N-file reads/writes and F8 reads. Takes effect on the next deploy.</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-check form-switch mt-4">
|
||||
<InputCheckbox @bind-Value="_form.CoalesceReads" @bind-Value:after="EmitAsync" class="form-check-input" id="ablegacyCoalesceReads" />
|
||||
<label class="form-check-label" for="ablegacyCoalesceReads">Coalesce adjacent reads</label>
|
||||
<InputCheckbox aria-describedby="@FieldIds("ablegacyCoalesceReads-hint")" @bind-Value="_form.CoalesceReads" @bind-Value:after="EmitAsync" class="form-check-input" id="@FieldId("ablegacyCoalesceReads")" />
|
||||
<label class="form-check-label" for="@FieldId("ablegacyCoalesceReads")">Coalesce adjacent reads</label>
|
||||
</div>
|
||||
<div class="form-text">Read nearby scalar tags on one N/B/F/L file as a single PCCC request. A block the PLC refuses falls back to per-tag reads automatically. Default on.</div>
|
||||
<div id="@FieldId("ablegacyCoalesceReads-hint")" class="form-text">Read nearby scalar tags on one N/B/F/L file as a single PCCC request. A block the PLC refuses falls back to per-tag reads automatically. Default on.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,30 +47,33 @@
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<div class="form-check form-switch mt-4">
|
||||
<InputCheckbox @bind-Value="_form.ProbeEnabled" @bind-Value:after="EmitAsync" class="form-check-input" id="probeEnabled" />
|
||||
<label class="form-check-label" for="probeEnabled">Enabled</label>
|
||||
<InputCheckbox @bind-Value="_form.ProbeEnabled" @bind-Value:after="EmitAsync" class="form-check-input" id="@FieldId("probeEnabled")" />
|
||||
<label class="form-check-label" for="@FieldId("probeEnabled")">Enabled</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Interval (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.ProbeIntervalSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default 5 s.</div>
|
||||
<label for="@FieldId("field-05")" class="form-label">Interval (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-05-error", "field-05-hint")" id="@FieldId("field-05")" @bind-Value="_form.ProbeIntervalSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-05-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.ProbeIntervalSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-05-hint")" class="form-text">Default 5 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.ProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Default 2 s.</div>
|
||||
<label for="@FieldId("field-06")" class="form-label">Timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-06-error", "field-06-hint")" id="@FieldId("field-06")" @bind-Value="_form.ProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-06-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.ProbeTimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-06-hint")" class="form-text">Default 2 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Probe address</label>
|
||||
<InputText @bind-Value="_form.ProbeAddress" @bind-Value:after="EmitAsync" class="form-control form-control-sm mono"
|
||||
<label for="@FieldId("field-07")" class="form-label">Probe address</label>
|
||||
<InputText aria-describedby="@FieldIds("field-07-hint")" id="@FieldId("field-07")" @bind-Value="_form.ProbeAddress" @bind-Value:after="EmitAsync" class="form-control form-control-sm mono"
|
||||
placeholder="S:0" />
|
||||
<div class="form-text">PCCC file address to read for probe. Default S:0 (status file word 0).</div>
|
||||
<div id="@FieldId("field-07-hint")" class="form-text">PCCC file address to read for probe. Default S:0 (status file word 0).</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Admin UI probe timeout (seconds)</label>
|
||||
<InputNumber @bind-Value="_form.AdminProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div class="form-text">Max 60. Used by Test Connect. Default 5.</div>
|
||||
<label for="@FieldId("field-08")" class="form-label">Admin UI probe timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("field-08-error", "field-08-hint")" id="@FieldId("field-08")" @bind-Value="_form.AdminProbeTimeoutSeconds" @bind-Value:after="EmitAsync" class="form-control form-control-sm" />
|
||||
<div id="@FieldId("field-08-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.AdminProbeTimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("field-08-hint")" class="form-text">Max 60. Used by Test Connect. Default 5.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,6 +82,11 @@
|
||||
<DriverResilienceSection ResilienceConfig="@ResilienceConfig" ResilienceConfigChanged="OnResilienceChanged" />
|
||||
|
||||
@code {
|
||||
private readonly string _fieldScope = "ab-legacy-driver-form-" + Guid.NewGuid().ToString("N");
|
||||
private string FieldIds(params string[] names) => string.Join(" ", names.Select(FieldId));
|
||||
private string FieldId(string name) => $"{_fieldScope}-{name}";
|
||||
[CascadingParameter] private Microsoft.AspNetCore.Components.Forms.EditContext? _fieldEditContext { get; set; }
|
||||
|
||||
/// <summary>The driver-level DriverConfig JSON (protocol/channel; devices live on separate v3 entities).</summary>
|
||||
[Parameter] public string DriverConfigJson { get; set; } = "{}";
|
||||
/// <summary>Fired (camelCase-serialized) whenever a channel field changes — enables @bind-DriverConfigJson.</summary>
|
||||
|
||||
+50
-36
@@ -14,10 +14,11 @@
|
||||
<div style="padding:1rem">
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasTimeoutSec">Timeout (seconds)</label>
|
||||
<InputNumber id="focasTimeoutSec" @bind-Value="_form.TimeoutSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasTimeoutSec")">Timeout (seconds)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasTimeoutSec-error", "focasTimeoutSec-hint")" id="@FieldId("focasTimeoutSec")" @bind-Value="_form.TimeoutSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">Per-operation timeout. Default 2 s.</div>
|
||||
<div id="@FieldId("focasTimeoutSec-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.TimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("focasTimeoutSec-hint")" class="form-text">Per-operation timeout. Default 2 s.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,26 +31,29 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="form-check form-switch mt-2">
|
||||
<InputCheckbox id="focasProbeEnabled" @bind-Value="_form.ProbeEnabled" @bind-Value:after="EmitAsync"
|
||||
<InputCheckbox id="@FieldId("focasProbeEnabled")" @bind-Value="_form.ProbeEnabled" @bind-Value:after="EmitAsync"
|
||||
class="form-check-input" />
|
||||
<label class="form-check-label" for="focasProbeEnabled">Probe enabled</label>
|
||||
<label class="form-check-label" for="@FieldId("focasProbeEnabled")">Probe enabled</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasProbeInterval">Probe interval (s)</label>
|
||||
<InputNumber id="focasProbeInterval" @bind-Value="_form.ProbeIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasProbeInterval")">Probe interval (s)</label>
|
||||
<InputNumber aria-describedby="@FieldId("focasProbeInterval-error")" id="@FieldId("focasProbeInterval")" @bind-Value="_form.ProbeIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div id="@FieldId("focasProbeInterval-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.ProbeIntervalSeconds)" /> }</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasProbeTimeout">Probe timeout (s)</label>
|
||||
<InputNumber id="focasProbeTimeout" @bind-Value="_form.ProbeTimeoutSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasProbeTimeout")">Probe timeout (s)</label>
|
||||
<InputNumber aria-describedby="@FieldId("focasProbeTimeout-error")" id="@FieldId("focasProbeTimeout")" @bind-Value="_form.ProbeTimeoutSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div id="@FieldId("focasProbeTimeout-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.ProbeTimeoutSeconds)" /> }</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasAdminProbe">Admin probe timeout (s)</label>
|
||||
<InputNumber id="focasAdminProbe" @bind-Value="_form.AdminProbeTimeoutSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasAdminProbe")">Admin probe timeout (s)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasAdminProbe-error", "focasAdminProbe-hint")" id="@FieldId("focasAdminProbe")" @bind-Value="_form.AdminProbeTimeoutSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">Test Connect timeout (1–60 s).</div>
|
||||
<div id="@FieldId("focasAdminProbe-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.AdminProbeTimeoutSeconds)" /> }</div>
|
||||
<div id="@FieldId("focasAdminProbe-hint")" class="form-text">Test Connect timeout (1–60 s).</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,17 +66,18 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="form-check form-switch mt-2">
|
||||
<InputCheckbox id="focasAlarmEnabled" @bind-Value="_form.AlarmProjectionEnabled" @bind-Value:after="EmitAsync"
|
||||
<InputCheckbox aria-describedby="@FieldIds("focasAlarmEnabled-hint")" id="@FieldId("focasAlarmEnabled")" @bind-Value="_form.AlarmProjectionEnabled" @bind-Value:after="EmitAsync"
|
||||
class="form-check-input" />
|
||||
<label class="form-check-label" for="focasAlarmEnabled">Alarm projection enabled</label>
|
||||
<label class="form-check-label" for="@FieldId("focasAlarmEnabled")">Alarm projection enabled</label>
|
||||
</div>
|
||||
<div class="form-text">Legacy flag, no longer required (#647): authoring an <code>ALARM:</code> tag with native-alarm settings is the opt-in.</div>
|
||||
<div id="@FieldId("focasAlarmEnabled-hint")" class="form-text">Legacy flag, no longer required (#647): authoring an <code>ALARM:</code> tag with native-alarm settings is the opt-in.</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasAlarmPoll">Alarm poll interval (s)</label>
|
||||
<InputNumber id="focasAlarmPoll" @bind-Value="_form.AlarmProjectionPollIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasAlarmPoll")">Alarm poll interval (s)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasAlarmPoll-error", "focasAlarmPoll-hint")" id="@FieldId("focasAlarmPoll")" @bind-Value="_form.AlarmProjectionPollIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">One cnc_rdalmmsg2 call per tick for each device that owns an <code>ALARM:</code> tag. Default 2 s.</div>
|
||||
<div id="@FieldId("focasAlarmPoll-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.AlarmProjectionPollIntervalSeconds)" /> }</div>
|
||||
<div id="@FieldId("focasAlarmPoll-hint")" class="form-text">One cnc_rdalmmsg2 call per tick for each device that owns an <code>ALARM:</code> tag. Default 2 s.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,17 +90,18 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="form-check form-switch mt-2">
|
||||
<InputCheckbox id="focasRecycleEnabled" @bind-Value="_form.HandleRecycleEnabled" @bind-Value:after="EmitAsync"
|
||||
<InputCheckbox aria-describedby="@FieldIds("focasRecycleEnabled-hint")" id="@FieldId("focasRecycleEnabled")" @bind-Value="_form.HandleRecycleEnabled" @bind-Value:after="EmitAsync"
|
||||
class="form-check-input" />
|
||||
<label class="form-check-label" for="focasRecycleEnabled">Handle recycle enabled</label>
|
||||
<label class="form-check-label" for="@FieldId("focasRecycleEnabled")">Handle recycle enabled</label>
|
||||
</div>
|
||||
<div class="form-text">Proactive FWLIB session recycle to prevent handle pool exhaustion. Default off.</div>
|
||||
<div id="@FieldId("focasRecycleEnabled-hint")" class="form-text">Proactive FWLIB session recycle to prevent handle pool exhaustion. Default off.</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasRecycleInterval">Recycle interval (minutes)</label>
|
||||
<InputNumber id="focasRecycleInterval" @bind-Value="_form.HandleRecycleIntervalMinutes" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasRecycleInterval")">Recycle interval (minutes)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasRecycleInterval-error", "focasRecycleInterval-hint")" id="@FieldId("focasRecycleInterval")" @bind-Value="_form.HandleRecycleIntervalMinutes" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">Typical: 30 min (shared pool) or 360 min (single client).</div>
|
||||
<div id="@FieldId("focasRecycleInterval-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.HandleRecycleIntervalMinutes)" /> }</div>
|
||||
<div id="@FieldId("focasRecycleInterval-hint")" class="form-text">Typical: 30 min (shared pool) or 360 min (single client).</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,29 +114,32 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="form-check form-switch mt-2">
|
||||
<InputCheckbox id="focasFixedTree" @bind-Value="_form.FixedTreeEnabled" @bind-Value:after="EmitAsync"
|
||||
<InputCheckbox aria-describedby="@FieldIds("focasFixedTree-hint")" id="@FieldId("focasFixedTree")" @bind-Value="_form.FixedTreeEnabled" @bind-Value:after="EmitAsync"
|
||||
class="form-check-input" />
|
||||
<label class="form-check-label" for="focasFixedTree">Fixed tree enabled</label>
|
||||
<label class="form-check-label" for="@FieldId("focasFixedTree")">Fixed tree enabled</label>
|
||||
</div>
|
||||
<div class="form-text">Exposes Identity/, Axes/, etc. from cnc_sysinfo/cnc_rdaxisname/cnc_rddynamic2. Default off.</div>
|
||||
<div id="@FieldId("focasFixedTree-hint")" class="form-text">Exposes Identity/, Axes/, etc. from cnc_sysinfo/cnc_rdaxisname/cnc_rddynamic2. Default off.</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasAxisPoll">Axis poll interval (ms)</label>
|
||||
<InputNumber id="focasAxisPoll" @bind-Value="_form.FixedTreePollIntervalMs" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasAxisPoll")">Axis poll interval (ms)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasAxisPoll-error", "focasAxisPoll-hint")" id="@FieldId("focasAxisPoll")" @bind-Value="_form.FixedTreePollIntervalMs" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">cnc_rddynamic2 cadence per axis. Default 250 ms.</div>
|
||||
<div id="@FieldId("focasAxisPoll-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.FixedTreePollIntervalMs)" /> }</div>
|
||||
<div id="@FieldId("focasAxisPoll-hint")" class="form-text">cnc_rddynamic2 cadence per axis. Default 250 ms.</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasProgramPoll">Program poll interval (s)</label>
|
||||
<InputNumber id="focasProgramPoll" @bind-Value="_form.FixedTreeProgramPollIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasProgramPoll")">Program poll interval (s)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasProgramPoll-error", "focasProgramPoll-hint")" id="@FieldId("focasProgramPoll")" @bind-Value="_form.FixedTreeProgramPollIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">Program/mode info cadence. 0 = disabled. Default 1 s.</div>
|
||||
<div id="@FieldId("focasProgramPoll-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.FixedTreeProgramPollIntervalSeconds)" /> }</div>
|
||||
<div id="@FieldId("focasProgramPoll-hint")" class="form-text">Program/mode info cadence. 0 = disabled. Default 1 s.</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label class="form-label" for="focasTimerPoll">Timer poll interval (s)</label>
|
||||
<InputNumber id="focasTimerPoll" @bind-Value="_form.FixedTreeTimerPollIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
<label class="form-label" for="@FieldId("focasTimerPoll")">Timer poll interval (s)</label>
|
||||
<InputNumber aria-describedby="@FieldIds("focasTimerPoll-error", "focasTimerPoll-hint")" id="@FieldId("focasTimerPoll")" @bind-Value="_form.FixedTreeTimerPollIntervalSeconds" @bind-Value:after="EmitAsync"
|
||||
class="form-control form-control-sm" />
|
||||
<div class="form-text">Power-on/cutting/cycle timer cadence. 0 = disabled. Default 30 s.</div>
|
||||
<div id="@FieldId("focasTimerPoll-error")" class="field-error">@if (_fieldEditContext is not null) { <ValidationMessage For="@(() => _form.FixedTreeTimerPollIntervalSeconds)" /> }</div>
|
||||
<div id="@FieldId("focasTimerPoll-hint")" class="form-text">Power-on/cutting/cycle timer cadence. 0 = disabled. Default 30 s.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -139,6 +148,11 @@
|
||||
<DriverResilienceSection ResilienceConfig="@ResilienceConfig" ResilienceConfigChanged="OnResilienceChanged" />
|
||||
|
||||
@code {
|
||||
private readonly string _fieldScope = "focas-driver-form-" + Guid.NewGuid().ToString("N");
|
||||
private string FieldIds(params string[] names) => string.Join(" ", names.Select(FieldId));
|
||||
private string FieldId(string name) => $"{_fieldScope}-{name}";
|
||||
[CascadingParameter] private Microsoft.AspNetCore.Components.Forms.EditContext? _fieldEditContext { get; set; }
|
||||
|
||||
/// <summary>The driver-level DriverConfig JSON (protocol/channel; per-device endpoint lives in the device).</summary>
|
||||
[Parameter] public string DriverConfigJson { get; set; } = "{}";
|
||||
/// <summary>Fired (camelCase-serialized) whenever a channel field changes — enables @bind-DriverConfigJson.</summary>
|
||||
|
||||
Reference in New Issue
Block a user