Skip to content

Cannot manually override numeric format (INCH/METRIC) or number of digits (drill file) #241

@Gianarci

Description

@Gianarci

I'm writing because I happened to work with a drill file, whose format is not detected correctly. If I try to remove the autodetect from the tool (by deactivating the checkbox) and try to change the unit from INCH to METRIC, it ignores the command and returns INCH again. Analyzing the drill.c file, I realized that in reality my setting is overwritten. To fix this you need to:

In the function drill_parse_header_is_metric_comment, add the check of autod (like if (state->autod)), before the final return:

if (state->autod) {
    state->header_number_format = state->number_format = FMT_USER;
    state->decimals = digits_after;
    state->autod = 0;
}

Same thing in drill_parse_header_is_inch, again before the final return, you need to add the same condition:

if (state->autod) {
    state->unit = GERBV_UNIT_INCH;
}

In my opinion, this fix is necessary and should be applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    drillParsing error when reading drill files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions