Skip to content

fix: handle ATC,ON/OFF header command in Excellon drill files (#93)#326

Open
rampageservices wants to merge 3 commits intogerbv:developfrom
SourceParts:fix/drill-atc-header
Open

fix: handle ATC,ON/OFF header command in Excellon drill files (#93)#326
rampageservices wants to merge 3 commits intogerbv:developfrom
SourceParts:fix/drill-atc-header

Conversation

@rampageservices
Copy link
Copy Markdown
Contributor

Summary

  • Adds a case 'A' handler in the main parse loop to recognize ATC,ON and ATC,OFF (automatic tool change) commands
  • Zuken CR-8000 emits these in the Excellon header; previously they fell through to the default case and were logged as "Undefined code 'A' (0x41)"
  • Recognized ATC commands are logged at NOTE level (silently ignored, no visual effect)
  • Unrecognized strings starting with 'A' are still reported as errors
  • Follows the same pattern as the existing DETECT,ON/DETECT,OFF handler under case 'D'

Partially fixes #93 (the ATC portion). The M06 portion is addressed by #306.

Note: the test file attached to #93 (drill.zip) only contains a .fdl drill listing document, not the actual .fdr Excellon file. Tested with a hand-crafted Excellon file containing ATC,ON in the header.

Test plan

  • make builds cleanly with no warnings
  • make check — 92 passed, 12 failed (matches develop baseline)
  • Hand-crafted Excellon file with ATC,ON parses without errors

drill_parse_header_is_inch() and drill_parse_header_is_metric() set
state->unit unconditionally, overwriting user-supplied unit settings
even when autodetect is disabled (state->autod == 0).

The M-code handlers (DRILL_M_IMPERIAL, DRILL_M_METRIC) already guard
their unit assignments with if(state->autod). Apply the same guard to
the header parsing functions for consistency.

Fixes gerbv#241
Zuken CR-8000 emits an ATC (automatic tool change) command in the
Excellon header. Previously this fell through to the default case
and was logged as "Undefined code 'A' (0x41)", which is misleading
for a valid, well-known machine command.

Add a case 'A' handler that recognizes ATC,ON and ATC,OFF, logs
them as NOTE level (silently ignored, no visual effect), and
reports unrecognized 'A' strings as errors.

Fixes the ATC portion of gerbv#93.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Solution for a potential problem or omission.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsupported commands in Zuken CR-8000 Excellon files

2 participants