Repository navigation
feat: Vortek toolhead HUD for Bambu H2C files - #34
Merged
Merged
Conversation
Parser now flags Bambu H2C / Vortek files (H2C printer_model header, or M620 N with M632/M640.8), reads per-slot filament colors and types from the header, and records tool changes from NOZZLE_CHANGE_START annotations plus the initial T<n> H-1 load. activeToolAt() and activeToolInLayer() resolve the active tool for a line or a viewer position. Non-Vortek files stay untouched.
Presentational badge for the active Vortek tool (nozzle, filament swatch, type). update() diffs against the last tool shown and only reports an animation when two non-null tools differ; color/type reach the DOM via textContent and style only.
…s view switches Hiding the HUD mid-flip left th-flip set (display:none cancels the animation without animationend), so it replayed on re-show. setView() resets the inline display of every .preview-toolbar > span, which re-showed #vortekControls on non-Vortek files; hide it with a class instead.
2 of 4 tasks
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.
Summary
Bambu H2C (Vortek) files switch between two nozzles and several filaments mid-print. This adds a small HUD to the 3D viewer that shows the active tool (nozzle, filament colour, filament type) for the current layer or simulated move, and flips when the tool changes.
printer_modelis an H2C, or it hasM620 NplusM632orM640.8. The toolbar shows aVortek detected · N changesbadge and a "Vortek toolhead" toggle (on by default). Both hide for other files.parser.toolChanges[](line, layer, x/y/z, from/to filament, from/to nozzle) andparser.vortek.T<n>,OF#andNF#index directly into the header'sfilament_colourandfilament_typelists. The first event comes from the firstT<n> H-1, with its nozzle taken fromfilament_nozzle_map.T1000,T65279and repeatedT<n> H-1lines are ignored.ToolheadHUDmodule is purely presentational. It updates inGcodeViewer3D.render()and is skipped for review viewers. It animates only when the tool changes between two known tools, so the first appearance, a re-show and a new file load don't flip.style.background. The type goes through the existing sanitiser and thentextContent. There is noinnerHTMLpath.Behaviour notes
;,MandTlines for Vortek markers.gcode-modifier.htmlis rebuilt in the commits, as in earlier feature commits.Test plan
npm test: 410 of 410, including 23 parser tests on a new H2C fixture and 10 HUD tests101 changes, the HUD starts atN1,#001489,PETG, and flips once across layer 25 and not on repeats or within a runbridge_base_plate_2_filaments(441 changes): only#F4EE2APLA and#ADB1B2PETG appearbridge_base_plate_1_0.6mm(1 change): a static#001489PETG, the badge says1 change, and nothing animatesCommits
Not in this PR
src/comparison.js:25callsp.parse(...), butGcodeParseronly hasparseAsync, so loading a compare file appears to throw. It was already broken onmainand is unrelated to this change.