Skip to content

Show running G-code source line during job playback#17

Draft
sfmissionmark wants to merge 2 commits into
figamore:mainfrom
sfmissionmark:feature/gcode-running-line-number
Draft

Show running G-code source line during job playback#17
sfmissionmark wants to merge 2 commits into
figamore:mainfrom
sfmissionmark:feature/gcode-running-line-number

Conversation

@sfmissionmark

@sfmissionmark sfmissionmark commented Jun 24, 2026

Copy link
Copy Markdown

Summary

  • Track 1-based source line numbers on each parsed G-code segment
  • Display Line X / Y in the viewer progress strip while a job is running or held
  • Add a Code toggle in the G-code viewer toolbar with a scrollable source text panel
  • Highlight and auto-scroll the current line in the text panel during Run/Hold
  • Resolve the running line from toolpath position (with segment fraction interpolation) instead of SD byte-read progress, which reflects parser buffer position ahead of execution
  • Parse FluidNC |Ln:N| from status reports when use_line_numbers is enabled and map N-words to source lines
  • Store loaded G-code source text in the G-code store for the text panel

Test plan

  • Load a G-code file in the viewer and confirm Code shows the full source with line numbers
  • Start a job from SD and confirm Line X / Y appears above the progress bar during Run/Hold
  • With Code open, confirm the highlighted line tracks the job and auto-scrolls
  • Verify line numbers advance smoothly during cuts (not jumping in large SD-percent blocks)
  • Confirm the display clears when the job stops or completes
  • Test with a file that has comments/blank lines to verify line count includes full source
  • Optional: enable use_line_numbers: true in FluidNC and N-words in G-code for Ln: reporting

Track source line numbers in the parser and display the current line in the viewer progress strip while a job is running or held.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sfmissionmark

Copy link
Copy Markdown
Author

This is actually not smoothly reporting the correct line number I think its jumping in buffer lengths or something. Taking this request back for testing.

@sfmissionmark sfmissionmark marked this pull request as draft June 24, 2026 18:25
Store source text in the G-code store, add a Code toggle with a scrollable
text panel and live line highlight, parse FluidNC Ln from status reports,
and resolve the current line from toolpath progress instead of SD byte read.

Co-authored-by: Cursor <cursoragent@cursor.com>
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