Skip to content

Fix command reliability, fast IED liveness, and event-first monitoring - #11

Merged
masarray merged 9 commits into
mainfrom
fix/command-health-event-first-ui
Jul 13, 2026
Merged

Fix command reliability, fast IED liveness, and event-first monitoring#11
masarray merged 9 commits into
mainfrom
fix/command-health-event-first-ui

Conversation

@masarray

@masarray masarray commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Root cause from the field debug output

The apparent two-click command problem is not a lost WPF click. The diagnostic report shows rejected redundant SBO commands where process feedback was already at the requested state, followed by a successful command to the opposite state. The UI also floods the debugger with an invalid implicit DataGridRow binding to IsRecentlyChanged on SignalDefinition, creating avoidable UI work and hiding useful exceptions.

The delayed green-to-red connection state came from two runtime issues: the monitor loop reset session-error counters on every otherwise successful pass, and the device view-model was not marked offline until reconnect processing had progressed.

Commands

  • Always perform a live ctlModel/current-state preflight before sending.
  • Suppress duplicate Open/Close when the IED is already in the requested state.
  • Disable the button representing the active process state.
  • Keep Test mode available.
  • Preserve control safety: no automatic Operate retry and no duplicate SBOw/Operate sequence.
  • Show actual security, including SBO • Enhanced security and SBO • Normal security.

Fast connection health

  • Add one conditional MMS heartbeat only when no other successful report/MMS I/O occurred recently.
  • Use a bounded 900 ms probe.
  • Mark the IED offline after two consecutive failed probes, normally around two seconds.
  • Turn the card/icon red before reconnecting rather than after reconnect failure.
  • Reconnect on a fresh association with a two-second retry cadence.

Event-first and lightweight acquisition

  • Once report traffic is proven, reporting is the primary value path.
  • Report-covered fast points use 5–10 second verification; analogs use 15–30 seconds depending on dchg verification.
  • The single conditional heartbeat owns liveness detection instead of polling every point quickly.
  • Bound report slices and polling work per loop.
  • Relax idle loop cadence to reduce CPU use while keeping report delivery responsive.

Layout and debugger cleanup

  • Remove the invalid global IsRecentlyChanged trigger while retaining explicit flash styling on live monitor grids.
  • Fix Connect All clipping.
  • Rebalance live/command grid columns so values and model text fit.
  • Enlarge the SVG to 60 px, vertically center it, shorten card height, and remove the subtitle.

Validation

GitHub Actions completed successfully:

  • ARIEC61850 Smart Control API verification
  • .NET restore
  • Windows Release build
  • Portable x64 publish
  • Artifact upload

The field-test document covers single-sequence Open/Close, rapid offline indication, automatic reconnect, report-primary acquisition, and debugger binding-noise verification.

@masarray
masarray marked this pull request as ready for review July 13, 2026 09:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d618388594

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread MainWindow.CommandPanelUx.cs Outdated
return (liveArmed || testMode) && supportsOperate && !busy;
var current = values.ElementAtOrDefault(4)?.ToString() ?? string.Empty;
var command = parameter?.ToString() ?? string.Empty;
return (liveArmed || testMode) && supportsOperate && !busy && !AlreadyActive(command, current);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow test commands for the active state

When CommandTestMode is checked and the current feedback already matches the button, this binding still disables that button because AlreadyActive(...) is always applied. ExecuteQuickControlAsync explicitly skips duplicate suppression in test mode (!CommandTestMode), so the UI prevents a valid test Open/Close/True/False command from ever reaching that path whenever the device is already in the requested state.

Useful? React with 👍 / 👎.

@masarray
masarray merged commit c57e491 into main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant