Skip to content

Acknowledge machine-only Excellon G/M-codes#306

Open
rampageservices wants to merge 1 commit intogerbv:developfrom
SourceParts:feat/machine-only-codes
Open

Acknowledge machine-only Excellon G/M-codes#306
rampageservices wants to merge 1 commit intogerbv:developfrom
SourceParts:feat/machine-only-codes

Conversation

@rampageservices
Copy link
Copy Markdown
Contributor

Summary

  • Add explicit case handlers for 17 G-codes and 10 M-codes that control physical machine behavior (vision systems, cutter compensation, peck drilling, etc.) with no visual representation
  • Log at GERBV_MESSAGE_NOTE level instead of falling through to default: which incorrectly reports them as GERBV_MESSAGE_ERROR
  • Track under grouped G_machine_only/M_machine_only stats counters shown in the analysis dialog

G-codes (17): G07, G34–G39, G40–G42, G45–G48, G81–G84

M-codes (10): M06, M08, M09, M50–M52, M60–M63

Per-code stats counters are possible if the maintainer or community wants more granularity, but grouped counters keep the struct small for codes that have no visual effect.

Codes with real implementations on other branches (G02/G03 #298, G87 #300, M70/M80/M90 #301, M25/M01/M02 #304) are excluded. M99 (user defined pattern) is also excluded as it may have future implementation potential.

Test plan

  • cmake --build build — clean build, zero warnings
  • ctest — all existing tests pass (94/104, 10 pre-existing image comparison mismatches identical to develop)
  • Test .exc file with machine-only codes produces NOTE-level messages, not ERROR

Ref: #297

Machine-only G-codes (G07, G34-G39, G40-G42, G45-G48, G81-G84)
and M-codes (M06, M08, M09, M50-M52, M60-M63) control physical
machine behavior with no visual representation. Previously these
fell through to the default case and were logged as errors, which
is misleading for valid, well-known commands.

Add explicit case handlers that log at GERBV_MESSAGE_NOTE level,
consume trailing parameters with eat_line(), and count under
grouped G_machine_only/M_machine_only stats counters shown in
the analysis dialog.

Ref: gerbv#297
@spe-ciellt spe-ciellt self-assigned this Mar 1, 2026
@spe-ciellt spe-ciellt added the enhancement New feature or request label Mar 1, 2026
rampageservices added a commit to SourceParts/gerbv that referenced this pull request Mar 5, 2026
Two drill parser fixes:

1. T0 with inline C diameter parameter (e.g. T0C0.006) now has
   the parameter consumed instead of leaving it in the stream.
   Previously the parser returned immediately on tool 0, causing
   the trailing C parameter to be reported as an undefined header
   code.  This is standard Excellon emitted by ekf2 and others.

2. Unrecognised header commands (vendor-specific directives like
   R,H and / from Veribest CAD) are downgraded from ERROR to NOTE.
   These are harmless unknowns that don't affect rendering, consistent
   with the precedent in gerbv#306 for unknown G/M machine codes.
   Undefined characters in the data section remain at ERROR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants