fix(modbus): review r1 - resolved address keys win only when the editor pinned them
N1: the m2 precedence trusted region/address whenever the keys were present,
but the AdminUI model stamps defaulted HoldingRegisters/0 on every save, so a
string-only tag (CSV import, or any editor toggle) silently became HR[0] -
reads AND writes. The resolved keys are now authoritative only when the editor
marked them ("addressResolved": true, written by Resolve); an unmarked
addressString is always resolved through the parser with the driver's family.
The model no longer stamps address fields for a string-only tag, CSV export
leaves its address cells blank, and the editor hint distinguishes string-only
from pinned tags. Tests: CSV import and editor save of a string-only tag, a
stamped-default blob, and the pinned positive control across families.
n1: docs/v2/modbus-addressing.md updated (FC23 opt-in, maxReadGap semantics,
coalescing scope, addressString/family rules, coil coercion, refusals).
n2: form round-trip tests for UseFC23ForMultiRegisterWrites /
DisableReadCoalescing. n4: the editor keeps unresolved address text when the
parent echoes back its own emit. n3: noted, no change.
Refs #741
Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
This commit is contained in:
@@ -30,6 +30,8 @@ public sealed class ModbusDriverPageFormSerializationTests
|
||||
UseFC15ForSingleCoilWrites = true,
|
||||
UseFC16ForSingleRegisterWrites = true,
|
||||
DisableFC23 = true,
|
||||
UseFC23ForMultiRegisterWrites = true,
|
||||
DisableReadCoalescing = true,
|
||||
WriteOnChangeOnly = true,
|
||||
AutoReconnect = false,
|
||||
Family = ModbusFamily.DL205,
|
||||
@@ -72,6 +74,8 @@ public sealed class ModbusDriverPageFormSerializationTests
|
||||
back.UseFC15ForSingleCoilWrites.ShouldBeTrue();
|
||||
back.UseFC16ForSingleRegisterWrites.ShouldBeTrue();
|
||||
back.DisableFC23.ShouldBeTrue();
|
||||
back.UseFC23ForMultiRegisterWrites.ShouldBeTrue();
|
||||
back.DisableReadCoalescing.ShouldBeTrue();
|
||||
back.WriteOnChangeOnly.ShouldBeTrue();
|
||||
back.AutoReconnect.ShouldBeFalse();
|
||||
back.Family.ShouldBe(ModbusFamily.DL205);
|
||||
|
||||
Reference in New Issue
Block a user