Feature/software icon export on pr11#12
Conversation
… to keep matrix awake
|
You're working together, so we can close #11? |
|
I merged #10, please help fix the conflicts that came up now. |
JohnAZoidberg
left a comment
There was a problem hiding this comment.
Looks pretty simple overall, please dedup the code for left and right
- Fix README.md typo (Controlh -> Control) - Move feature documentation to proper Features section - Remove commented-out startWakeLoop() line - Fix comment: '39 x 9' -> '34 x 9' (correct dimensions) - Deduplicate matrix helper functions: - Combine getRawValsMatrixLeft/Right into getRawVals(matrix) - Combine setMatrixLeftFromVals/setMatrixRightFromVals into setMatrixFromVals(matrix, vals) - Combine setMatrixLeftFromRawVals/setMatrixRightFromRawVals into setMatrixFromRawVals(matrix, vals) - Change UI label from 'Persist' to 'Keep Awake' for clarity
- Replace triple negation with explicit ternary operator - Remove unused raw parameter and dead code path - Simplify export button handlers
|
I'll get back to it soon, travelling right now |
|
Quick follow-up on this PR: all prior review threads are resolved on my side. Could you please take a final look and, if it all looks good, approve so we can merge? Thanks! |
|
@JohnAZoidberg quick ping — all previous feedback has been addressed and review threads are resolved. When you have a moment, could you please do a final pass and approve if it looks good? Thanks! |
|
@JohnAZoidberg quick re-review when you have a moment? I addressed the prior feedback and resolved the review threads. If it looks good, please approve. Thanks! |
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.