fix(grpc-data): A1 review round 2 F3 — an MTConnect delta signals the conditions it touched
A condition Unavailable at baseline never became known: its later Normal is a quality-only emission and only full emissions signalled. A delta emission now signals its touched conditions whose level is not Unavailable, after the events and under the same lock (tracker baseline required). Sample_delta_does_not_signal… (which pinned the old behaviour) is now Sample_delta_signals_its_touched_conditions_and_a_rebaseline_signals_all.
This commit is contained in:
@@ -78,7 +78,8 @@ public sealed partial class MTConnectDriver : IAlarmSource, IAlarmInitialStateSi
|
||||
/// grpc-data A1 (§5.1 MTConnect row): raised after a FULL emission (the resync in
|
||||
/// <see cref="SubscribeAlarmsAsync"/>, the restarted pump's first act, comms-loss recovery) over a tracker
|
||||
/// built from a <c>/current</c> baseline, covering every subscribed condition whose level is known and not
|
||||
/// <c>Unavailable</c> (an Unavailable item is the device not reporting — it stays unknown).
|
||||
/// <c>Unavailable</c> (an Unavailable item is the device not reporting — it stays unknown); and after a DELTA
|
||||
/// emission, covering the touched conditions whose level is not <c>Unavailable</c> (review round 2 F3).
|
||||
/// </remarks>
|
||||
public event EventHandler<AlarmInitialStateEventArgs>? InitialAlarmStateDelivered;
|
||||
|
||||
@@ -220,15 +221,19 @@ public sealed partial class MTConnectDriver : IAlarmSource, IAlarmInitialStateSi
|
||||
}
|
||||
|
||||
// grpc-data A1: a full emission (or a re-baseline) over a /current baseline establishes every subscribed
|
||||
// condition it can judge — known and not Unavailable. After every event of this emission, under the same
|
||||
// lock and handler gate (F2, G5).
|
||||
if ((touchedDataItemIds is null || baselineRead) && tracker.HasBaseline)
|
||||
// condition it can judge — known and not Unavailable. A DELTA emission (A1 review round 2 F3) establishes
|
||||
// the conditions it touched that now report a level other than Unavailable — so a condition Unavailable at
|
||||
// baseline becomes known when it later reports (e.g. Normal, whose emission is only quality). After every
|
||||
// event of this emission, under the same lock and handler gate (F2, G5).
|
||||
if (tracker.HasBaseline)
|
||||
{
|
||||
var full = touchedDataItemIds is null || baselineRead;
|
||||
var established = new List<string>();
|
||||
foreach (var conditionId in subscription.References)
|
||||
{
|
||||
if (tracker.Get(binding.ToDataItemId(conditionId)) is { } state
|
||||
&& state.Level != MTConnectConditionLevel.Unavailable)
|
||||
var dataItemId = binding.ToDataItemId(conditionId);
|
||||
if (!full && !touchedDataItemIds!.Contains(dataItemId)) continue;
|
||||
if (tracker.Get(dataItemId) is { } state && state.Level != MTConnectConditionLevel.Unavailable)
|
||||
established.Add(conditionId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user