Feature/software icon export on pr11 #12
Open
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.
This PR is stacked directly on top of PR #11 (Import and Export patterns by @MidnightJava) and adds a software-oriented JSON export feature. All of the behavior from PR #11 remains unchanged.
Relationship to PR #11
That means maintainers can:
Additions in this PR
1. UI: “Export for Software” section
Below the existing Import/Export buttons, this PR adds:
Format options
Binary (0/1)Grayscale (0–255)(default)Layout
9 x 34), matching the physical LED matrix orientation and my icon library usage.Buttons
Export Left (JSON)Export Right (JSON)The existing Import/Export buttons and the 39‑byte hardware pattern format from PR #11 remain exactly as implemented there.
2. JSON export format
The new buttons generate a
.jsonfile with:Shape
9 x 34(outer array = columns, inner array = rows)Values
0(off) or1(on)0(off) or255(fully lit)This is derived from the existing convention where
matrix[row][col] === 0means “LED on”.Filenames follow this pattern, e.g.:
matrix_left_grayscale_colmajor.jsonmatrix_right_binary_colmajor.json3. Implementation details
index.htmlExport Left/Right (JSON)buttons.app.jsinitSoftwareExportOptions()in the main$(function() { ... }).initSoftwareExportOptions():#exportLeftSoftwareBtn/#exportRightSoftwareBtnto the new behavior.exportFormatradio value.exportMatrixSoftware(matrix, side, grayscale):9 x 34array from the existingmatrix_*.0/1cells to0/1or0/255.Compatibility
Happy to adjust naming/text if you prefer different terminology for the new options.