Skip to content

Export IO FAT results as Excel and native PDF in .arsas projects - #115

Merged
masarray merged 15 commits into
mainfrom
agent/io-fat-native-pdf-arsas-extension
Jul 28, 2026
Merged

Export IO FAT results as Excel and native PDF in .arsas projects#115
masarray merged 15 commits into
mainfrom
agent/io-fat-native-pdf-arsas-extension

Conversation

@masarray

@masarray masarray commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Purpose

Complete the next IO List FAT evidence-export phase:

  1. shorten the portable project extension to .arsas
  2. export completed evidence back into an XLSX copy
  3. generate the final PDF directly with a native engine ported from ARIEC60870
  4. bundle both reports with the resumable FAT project

Excel result export

  • adds Export Excel to the FAT workspace
  • copies the approved source workbook and never modifies it in place
  • resolves ARSAS_SIGNAL_IMPORT through OOXML workbook relationships
  • matches every project point by TestPointId
  • writes:
    • ON/OFF observed values
    • IED timestamps
    • ARSAS capture timestamps
    • quality
    • acquisition source
    • ON/OFF verdict
    • overall result
    • authoritative state-machine notes
  • refuses partial output when workbook rows and project points do not match exactly
  • uses atomic temporary-file replacement

Native PDF engine

  • ports the dependency-free PDF 1.4 primitive design from the project-owned Apache-2.0 masarray/ARIEC60870 engine
  • no QuestPDF, browser, HTML converter, printer driver, or external PDF executable
  • built-in Type 1 Helvetica, Helvetica-Bold, and Courier fonts
  • native pages tree, content streams, vector drawing, wrapping, pagination, xref, trailer, and metadata
  • A4 landscape IO FAT layout with:
    • project summary and verdict
    • PASS/REVIEW/FAIL/PENDING counters
    • repeated per-IED headers
    • signal name and IEC 61850 reference
    • expected ON/OFF state
    • IED and ARSAS timestamps
    • quality and acquisition source
    • final result and reason

.arsas portable project

The new user-facing project contains:

  • manifest.json
  • project.snapshot.json
  • approved source workbook
  • sealed hash-chain evidence journals
  • report/IO-FAT-Report.pdf
  • report/IO-FAT-Results.xlsx
  • handover README

Manifest SHA-256 values protect the snapshot, source workbook, PDF, Excel result workbook, and evidence journals. Package creation is atomic and remains blocked while an IED session is active.

Import and compatibility

  • launcher now says Open ARSAS Project
  • open dialog accepts .arsas and legacy .arsas-iofat
  • additive manifest fields preserve the existing package schema reader
  • new PDF and Excel hashes are verified before project restore
  • package kind is checked before routing a .arsas file into IO List Testing
  • legacy packages without the new report hashes remain readable

UI

  • Save Progress
  • Export Excel
  • Export PDF
  • Export .arsas
  • Open ARSAS Project

The browser-print workflow is no longer the primary report path.

Regression coverage

Focused IO Testing now runs 59 tests covering:

  • native %PDF-1.4 generation, readable evidence, xref, and EOF
  • XLSX evidence writing without changing the source workbook
  • exact TestPointId matching
  • .arsas package contents
  • PDF and Excel report bundling
  • progress round-trip to another workspace
  • legacy extension compatibility
  • tampered snapshot rejection
  • tampered native report rejection
  • launcher and workspace UI contracts

Automated validation at head c8367290f34aef9ff6e3cb79377bb03a64cd5b32

  • Validate IO List Testing run 34 — success
    • focused build
    • 59/59 IO List import, session, evidence, persistence, Excel, PDF, package, and UI tests
  • Build ARSAS run 768 — success
    • full solution build
    • complete application regression suite
    • source/license and UX invariants
    • portable Windows x64 publication and artifact upload
  • Validate SV evidence bundles run 66 — success
    • deterministic Sampled Values evidence workflow remains intact

Source provenance

The PDF primitive design is ported from masarray/ARIEC60870, especially src/ARIEC60870.Desktop/Reporting/EvidencePdfReportService.cs. The IEC 61850 IO FAT layout and report model are newly implemented for ARSAS.

@masarray masarray changed the title Export IO FAT projects as .arsas with native PDF reports Export IO FAT results as Excel and native PDF in .arsas projects Jul 28, 2026
@masarray
masarray marked this pull request as ready for review July 28, 2026 11:19
@masarray
masarray merged commit 180ce86 into main Jul 28, 2026
3 checks passed

@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: c8367290f3

ℹ️ 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 +219 to +222
if (!manifest.TryGetProperty(entryProperty, out var entryValue) || entryValue.ValueKind != JsonValueKind.String ||
!manifest.TryGetProperty(hashProperty, out var hashValue) || hashValue.ValueKind != JsonValueKind.String)
{
return; // Legacy package: existing importer verifies snapshot, workbook and journals.

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 Require report hashes for modern packages

When an io-fat manifest is present but either report entry or hash property is missing or has the wrong JSON type, this returns as though the package were legacy. Removing reportSha256 or resultWorkbookSha256 therefore lets a corrupted or missing native report pass ValidateAsync and the project opens successfully. Preserve compatibility only for manifests that are actually identified as legacy; modern manifests should reject incomplete report metadata.

Useful? React with 👍 / 👎.

Comment on lines +682 to +683
>= ' ' and <= '~' => character,
_ => ' '

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 Preserve non-ASCII evidence text in PDFs

For projects containing non-ASCII names, locations, signal descriptions, or status reasons, every character outside printable ASCII is silently replaced with a space. Common values such as Überstrom, accented operator notes, and non-Latin identifiers are consequently altered or erased in the final evidence report. Encode the supported WinAnsi characters correctly or use a font/encoding that preserves the source text rather than discarding it.

Useful? React with 👍 / 👎.

Comment on lines +252 to +255
_page.Text(
PageWidth - Margin - 218f,
_cursorY - 18f,
$"{ied.TestPoints.Count} signals | {ied.PassedCount} PASS | {ied.ReviewCount} review | {pending} pending",

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 Include failed points in each IED header

When an IED has failed points, the header subtracts them from pending but never displays a FAIL count. For example, an IED with one failed signal is summarized as 1 signals | 0 PASS | 0 review | 0 pending, so the displayed categories do not total the signal count and the repeated per-IED header conceals the failure until individual rows are inspected.

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