Skip to content

fix(WPF): crisp ClearType Trace and byte-accurate selected Frame Interpreter - #44

Merged
masarray merged 2 commits into
masterfrom
fix/iec101-crisp-trace-byte-inspector-20261029
Oct 28, 2026
Merged

masarray merged 2 commits into
masterfrom
fix/iec101-crisp-trace-byte-inspector-20261029

Conversation

@masarray

Copy link
Copy Markdown
Owner

Field report

Screenshot after PR #43: raw frame interpreter is visually faint/jagged. Trace used tiny 10.5–11.6 DIP monospaced font with explicit TextFormattingMode=Display overriding global Ideal/ClearType; Inspector used generic lecturing text and fabricated "L=105,CA=1,IOA=..." strings as raw evidence chips.

Implemented

  • WPF Trace has Ideal text formatting + ClearType, Segoe UI/Aptos for prose (12.8/12.2 DIP), Cascadia Mono/Consolas for true HEX (11.6 DIP), comfortable line spacing, stronger ink. No new animations, heavy cards or font files. Virtualization, 1200-frame bound and 75ms batching preserved.
  • Neutral white Inspector, compact field/hex/meaning rows at 11.9–12.2 DIP.
  • New pure Iec101FrameByteInspector.Explain only on selection, consumes typed FT1.2 + shared ASDU info-object offsets, returns byte-exact spans for envelope, control bits, link address, Type ID, VSQ, COT, CA, every IOA, each information element (value/quality/RTU time), and checksum/end. Unknown/truncated data never disguised as valid. One SSOT produces both clickable raw chips and corresponding linked decoded field rows, replacing fake/address-string raw chips.
  • Selected IEC-101 title/summary now directly reflects chosen line monitor frame instead of generic protocol prose. Copy Decoded Frame exports the same source-derived groups. IEC-103/104 fallback unchanged.
  • Added regression tests for 2-byte link address, 1-byte FC9 ACD=1, Type30 exact offsets + CP56 time, multiple objects, and isolation from IEC-104.
  • Engineering FAT checklist: docs/IEC101_WPF_TEXT_AND_BYTE_INSPECTOR_20261029.md.

Guardrails

No polling/FCB/DFC/COM transport changes; passive remains RX-only; no hot-path decoder work. Validate Release Windows/WPF build, code formatting, protocol smoke, full xUnit, package/GUI smoke, CodeQL, dependency/hygiene before merge. CI is NOT proof of real-screen antialiasing at various DPI; FAT on SICAM 1200bps still required.

@masarray
masarray marked this pull request as ready for review October 28, 2026 22:14
@masarray
masarray merged commit baf537a into master Oct 28, 2026
5 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T22:16:00.532158Z 210b9a4 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 210b9a4488

ℹ️ 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 on lines +79 to +82
var headerSize = asdu.Objects.FirstOrDefault(o => o.InformationObjectOffset >= 0)?.InformationObjectOffset;
if (headerSize is null)
headerSize = 2 + cotSize + (raw.Count > asduStart + 4 ? 2 : 1);
var caSize = headerSize.Value - 2 - cotSize;

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 Avoid guessing the common-address width when objects are absent

When an IEC-101 ASDU uses a one-byte common address but has no decoded objects (for example, VSQ=0 or a payload truncated before the first IOA), this fallback infers a two-byte CA from the total frame length, which includes checksum/end bytes. For a one-byte COT and header-only ASDU, the Common address group consequently includes the checksum as its second byte while displaying the decoded one-byte address. Preserve the configured header widths in the decode result, or leave the range unknown when they cannot be determined; total frame length cannot establish CA width.

Useful? React with 👍 / 👎.

<StackPanel>
<DockPanel LastChildFill="True">
<TextBlock Text="{Binding Title}" FontSize="12.2" FontWeight="Medium" Foreground="{StaticResource Ink900Brush}" Margin="0,0,9,0" DockPanel.Dock="Left" />
<TextBlock Text="{Binding Evidence}" FontFamily="Cascadia Mono, Consolas" FontSize="11.3" Foreground="{StaticResource Ink600Brush}" TextWrapping="Wrap" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the new inspector evidence text in Aptos

The replacement evidence TextBlock introduces an explicit Cascadia Mono/Consolas override where the previous inspector inherited the application font. This violates the root AGENTS.md typography requirement that the UI remain Aptos-only, explicitly including raw hex. Use the Aptos application resource for this new field rather than introducing a monospace override.

AGENTS.md reference: AGENTS.md:L351-L351

Useful? React with 👍 / 👎.


## Fix
- Trace title/meaning rendered in normal AppFont (Segoe UI/Aptos), 12.8/12.2 DIP, 18-DIP lines, darker ink and **Ideal + ClearType**, preserving light ListBox virtualized 1200-row bounded display; raw HEX uses Cascadia Mono/Consolas 11.6 DIP with Ideal + ClearType and no shadow, animation or per-frame additional UI.
- Inspector uses neutral white background; larger 11.9-12.2 DIP type and simple compact field + HEX + decoded value layout, not a large lecture-style two-column table.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the required responsive layout policy

This change replaces the inspector's two-column field layout with stacked field/hex/meaning rows and changes trace sizing, but only adds a standalone FAT document. The root AGENTS.md explicitly requires updating docs/RESPONSIVE_LAYOUT_POLICY.md whenever layout changes; that policy is untouched in this commit. Update the canonical policy to describe the revised inspector layout and its bounded scrolling behavior rather than documenting the change only in this dated checklist.

AGENTS.md reference: AGENTS.md:L215-L215

Useful? React with 👍 / 👎.

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