feat(heidenhain): Part 9 condition class from alarm class/group, ALARM: selectors in the browse picker, unclaimed alarms counted + logged (#839)

- Core: optional AlarmEventArgs.ConditionClass (AlarmConditionClass Base/Process/Maintenance/System/Safety)
  carried by NativeAlarmProjector on AlarmConditionSnapshot and written to ConditionClassId/Name by
  OtOpcUaNodeManager (kept across class-less events, carried across a #641 rebuild).
- Heidenhain: HeidenhainAlarmClasses — HEIDENHAIN DNC-interface class/group names (corroborated by the
  captured iTNC 530 record); class 5 => Safety, group 1/2 => Process, 4/5 => System, else Base.
- DiscoverAsync offers AlarmConditions/ selector leaves (IsAlarm Boolean); browse-commit seeds the alarm object.
- Alarms no selector claims: otopcua.driver.alarms.unmatched counter, /hosts diagnostics, rate-limited Warning.

Refs #839
This commit is contained in:
Joseph Doherty
2026-11-11 03:41:14 -05:00
parent 481985e20b
commit ddc1f29e3a
17 changed files with 593 additions and 39 deletions
@@ -122,4 +122,27 @@ public sealed class HeidenhainAuthoringTests
TagConfigValidator.Validate(DriverTypeNames.Heidenhain, json).ShouldBeNull();
HeidenhainTagConfigModel.FromJson(json).Address.ShouldBe(address);
}
/// <summary>
/// lmxopcua#839: every <c>ALARM:</c> selector the browse picker offers commits as a complete condition tag — the
/// paired <c>alarm</c> object seeded, Boolean, accepted by the driver's own factory and the editor's validator —
/// so a browse-commit never lands a tag the deploy gate would refuse.
/// </summary>
[Fact]
public void Browse_committed_alarm_selectors_are_complete_conditions_the_driver_accepts()
{
HeidenhainAlarmClasses.BrowseSelectors.Count.ShouldBeGreaterThan(2);
foreach (var (_, name, address) in HeidenhainAlarmClasses.BrowseSelectors)
{
var row = RawBrowseCommitMapper.MapLeaf(
DriverTypeNames.Heidenhain, address, name, nameof(DriverDataType.Boolean), "String",
groupPrefix: null, folderPath: null, createGroups: false);
row.Tag.DataType.ShouldBe("Boolean");
var json = row.Tag.TagConfig!;
JsonNode.Parse(json)!["alarm"].ShouldNotBeNull(address);
HeidenhainTagDefinitionFactory.TryFromTagConfig("p", "d", json, out var def, out var error).ShouldBeTrue(error);
def!.IsAlarmCondition.ShouldBeTrue();
TagConfigValidator.Validate(DriverTypeNames.Heidenhain, json).ShouldBeNull();
}
}
}