feat(eventviewer): add EventViewer.exportImage() PNG/JPEG export (#321)#333
Merged
Merged
Conversation
…dEngine - Public exportImage(obj, filepath, format) method on EventViewer - Format inference: .jpg/.jpeg extension -> jpeg, else png - not-rendered guard: EventViewer:notRendered when hFigure invalid - Format switch: EventViewer:unknownImageFormat for unsupported formats - 3-tier MATLAB path: exportapp (R2024a+) / exportgraphics / getframe+imwrite - Octave print() path with stub-axes insertion when no top-level axes - Visible toggle for headless R2020b compatibility - Cleanup of stub axes + visibility state in both success and catch paths - Updated class-header method list with viewer.exportImage usage line
- testExportImagePngRoundtrip: writes non-empty PNG via exportImage - testExportImageJpegRoundtrip: explicit 'jpeg' format + .jpeg extension inference - testExportImageUnknownFormatErrors: verifies EventViewer:unknownImageFormat for gif - testExportImageNotRenderedAfterClose: verifies EventViewer:notRendered after close(fig) - Reuses existing makeFixtureEvents/safeClose/safeDelete helpers + tempname + addTeardown
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…rtWorks guard) Headless CI MATLAB raises 'Specified handle is not valid for export' on uicontrol figures — same environment guard as TestDashboardToolbarImageExport.assumeExportWorks. Error-path tests stay active headless.
…entviewer-exportimage # Conflicts: # .planning/STATE.md
HanSur94
marked this pull request as ready for review
July 8, 2026 20:25
3 tasks
Owner
Author
|
Wiki documentation updated for
Generated by Claude Code |
HanSur94
added a commit
that referenced
this pull request
Jul 9, 2026
#308 #326 #312 #316 #328) Adds getStats (keystone), resampleUniform, derivative, movingStat, exceedance, and crossings to the Tag base class — toolbox-free, Octave-safe, additive. Verified: 84 headless assertions + full MATLAB/Octave CI green (codecov/patch advisory only; repo unprotected). #327 and #321 shipped separately on main (PRs #331/#333).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was built
Adds a new additive public method
exportImage(obj, filepath, format)toEventViewer(libs/EventDetection/EventViewer.m), so the interactive event-analysis figure can be saved straight to a report image — closing the last figure-producing surface in FastSense without a save path.Captures
obj.hFigureat 150 DPI; PNG default, JPEG by extension/argument.Design — port, don't reinvent: the method ports
DashboardEngine.exportImage's hardened cross-platform branch verbatim (exportapp on MATLAB R2024a+ / exportgraphics /getframe+imwritefallback;print()+hidden-stub-axes on Octave), retargetingobj.hFigureand swapping the three error IDs to theEventViewer:namespace. NoDashboardEngine:IDs remain in the file.Scope kept minimal: the method is the deliverable; the optional toolbar "Export Image" button is explicitly a follow-on in the issue and is not included — so the change touches one method plus its tests, with no toolbar-layout edits.
Backward-compatible & additive only: one new public method; no signature,
Event/EventStore/DashboardWidget/Tagcontract, or serialization change (EventViewer is not serialized). Toolbox-free, pure MATLAB/Octave, no MEX.Error IDs:
EventViewer:notRendered(figure empty/closed),EventViewer:unknownImageFormat,EventViewer:imageWriteFailed.How it was verified
TestEventViewerExtras: 16/16 pass in the live MATLAB session (4 new cases: PNG round-trip exists+non-empty, JPEG via explicit format + extension inference,unknownImageFormaterror,notRendered-after-close error — all reusing the existingmakeFixtureEvents/safeClose/safeDeletefixtures withtempname+addTeardown).TestEventViewer: 7/7 pass — no regression in the base suite.imfinfo) + JPEG via extension inference; both error IDs fire correctly.mh_style+mh_lint: everything seems fine on both changed files.Closes #321
AI-built via
/feature-build— needs human review before merge.