Repository navigation
fix(IEC-101): exact engineer-readable multiline Trace blocks for each physical FT1.2 frame - #43
Conversation
…ASDU objects and raw hex
|
|
||
| var primary = $"[PRM:1,FCV:{Bit(link.Fcv)}] [FCB:{Bit(link.Fcb)}]"; | ||
| var secondary = $"[PRM:0,ACD:{Bit(link.Acd)},DFC:{Bit(link.Dfc)}]"; | ||
| var declaredLength = frame?.DeclaredLength is int len ? $" Length {len}" : ""; |
| $"Master requests {requested} queued data from RTU · [{flags}]."); | ||
| } | ||
| true => ", Class 1 Data Available!", | ||
| false => ", No Class 1 Data Indicated", |
| 10, 0, 0, 1, | ||
| 11, 0, 0, 0 | ||
| }); | ||
| var f = LinkFrame("10 29 69 92 16", "Class 1"); |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b901d24a76
ℹ️ 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".
| if (timeByteOffset >= 0 && obj.RawBytes.Count >= timeByteOffset + 7) | ||
| { | ||
| details += $"; IOA {first.InformationObjectAddress}={first.ShortValue}"; | ||
| if (first.QualityDetails is not null) details += $"; Quality={first.QualityDetails.DisplayText}"; | ||
| if (!string.IsNullOrWhiteSpace(first.TimestampText)) details += $"; RTU time={first.TimestampText}"; | ||
| var minuteFlags = obj.RawBytes[timeByteOffset + 2]; | ||
| var hourFlags = obj.RawBytes[timeByteOffset + 3]; | ||
| invalid |= (minuteFlags & 0x80) != 0; |
There was a problem hiding this comment.
Move CP56 field decoding into the shared protocol decoder
For timestamped ASDUs, this formatter now selects type-dependent information-element offsets and decodes CP56 validity and summer-time bits directly from RawBytes. This introduces a second ASDU interpretation implementation in Desktop alongside Iec10xAsduDecoder.DecodeTimestampText, requiring protocol changes to be maintained in both layers. AGENTS.md explicitly prohibits Desktop ownership of ASDU parsing. Expose the required time flags as typed decoder results and restrict this formatter to presenting them.
AGENTS.md reference: AGENTS.md:L76-L76
Useful? React with 👍 / 👎.
| if (obj.QualityDetails is { } q) | ||
| builder.Append(" [").Append(q.Invalid ? "Invalid" : q.DisplayText == "Good" ? "Valid" : "Valid, " + q.DisplayText) | ||
| .Append(']'); |
There was a problem hiding this comment.
Preserve other quality flags when IV is set
When a received object's quality has IV set together with another flag, the new conditional prints only Invalid, discarding the remaining decoded quality information. For example, SIQ 0xB1 previously displayed Invalid, Blocked, Substituted through QualityDetails.DisplayText, but now displays only [Invalid]; QDS overflow and BCR carry/adjusted flags are similarly hidden whenever IV is set. Keep q.DisplayText for invalid objects as well so operators can distinguish these conditions without manually decoding the raw bytes.
Useful? React with 👍 / 👎.
| if (item.ProtocolMode == Iec60870ProtocolMode.Iec101 && | ||
| item.AsduDetails is not null && | ||
| item.InformationObjectDetails is { Index: > 1 }) | ||
| return false; |
There was a problem hiding this comment.
Update the required output policy for the trace changes
This commit changes Frame Trace output and retention behavior by introducing multiline blocks and suppressing secondary per-object trace rows, but only adds a standalone contract document. AGENTS.md specifically requires updating docs/OUTPUT_AND_PERFORMANCE_POLICY.md when output, retention, or rendering behavior changes; that policy is untouched. Update the canonical policy to describe physical-frame deduplication and the new presentation contract so its documented behavior remains consistent with the implementation.
AGENTS.md reference: AGENTS.md:L194-L194
Useful? React with 👍 / 👎.
Screenshot-driven mandatory UI contract
Prior PR #42 produced a one-line title + one generic narrative, not the required engineer-readable four-part line monitor. This PR implements exact physical telegram structure:
⇧/⇩ [PC time] service,Data Link: flags and DL Address (+ Length),ASDU: Type/Count, COT/Origin, Comm Addr, one row per IOA incl quality/time,Hex Frame: complete original bytes. Compact TX-blue/RX-green WPF monospace text, no bulky cards or repeated timestamps.Correctness and scope
Ft12FrameDecode.LinkControl+Iec10xAsduDecode.Objects, never parses HEX twice, calls no WPF APIs and performs no transport I/O.docs/IEC101_TRACE_MULTILINE_CONTRACT_20261029.mdincludes exact format and FAT checks.Merge gates
Windows Release + format, protocol smoke + all xUnit, GUI packaging/smoke, CodeQL + hygiene + dependency review, checked against exact commit SHA. Real SICAM/independent IEC-101 reference FAT still required; no premature real-device claims.