pcb

Convert PCB's base units to nanometers

Bug #772027 reported by Andrew Poelstra
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Wishlist
Andrew Poelstra

Bug Description

This bug will track the progress of converting PCB's base units to nanometers.

Revision history for this message
Andrew Poelstra (asp11) wrote :

Patch to use COOR_TO_MM, etc. macros throughout codebase rather than hardcoded multipliers.

Revision history for this message
Peter Clifton (pcjc2) wrote :

The patch in comment #1 was applied:

commit 4d239d983d96a13fcd48b837c5178af145ecca0c
Author: Andrew Poelstra <email address hidden>
Date: Wed Apr 27 20:20:48 2011 +0100

    PCB / Physical unit macros patch

    Specify various constants in physical units, converting to PCB internal
    units using macros. When reporting to the user (or exporting), convert
    dimensions to physical units using macros so the code does not rely on
    details of PCB's internal coordinates in so many places.

Changed in pcb:
assignee: nobody → Andrew Poelstra (asp11)
importance: Undecided → Wishlist
status: New → Confirmed
milestone: none → future-feature-release
Revision history for this message
Andrew Poelstra (asp11) wrote :

Additional macro patch affecting print.c. Applied yesterday 2011-04-28.

Revision history for this message
Andrew Poelstra (asp11) wrote :

This is a patch to make all numeric code use GetValue, to unify parsing code and make sure everything uses the same units. Contained is almost a complete rewrite of GetValue to simplify code that uses funny units.

Revision history for this message
Peter Clifton (pcjc2) wrote :

I strongly suggest pre-patching to drop support for arbitrary capitalisation in the unit numbers.

In SI units, mm and Mm are rather different. I know that isn't a major issue for PCB, but I think we should be strict about the syntax we accept.

Since we already accept units case insensitively, the first step would be to push a quick patch changing strcasecmp to strcmp in the existing code - along with a commit message explaining the policy change.

Revision history for this message
Andrew Poelstra (asp11) wrote :

Good call. I have attached such a patch (which breaks the previous one).

Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

A commit was made which affects this bug
git master commit 31b7309764f2e4bd40141038c30f1f38309efb4a
http://git.gpleda.org/?p=pcb.git;a=commit;h=31b7309764f2e4bd40141038c30f1f38309efb4a

commit 31b7309764f2e4bd40141038c30f1f38309efb4a
Author: Andrew Poelstra <email address hidden>
Commit: Peter Clifton <email address hidden>

    Add case-sensitivity to all unit-reading code

    Reviewed-by: Peter Clifton <email address hidden>

    This breaks existing behaviour for any users using capitalised units
    in scripts, but as in general, units ARE case sensitive, we should
    not support anything other than their canonical names.

    Affects-bug: lp-772027

Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

A commit was made which affects this bug
git master commit 9acdd88e22717510ff5dde277ecbd6f1de60b69d
http://git.gpleda.org/?p=pcb.git;a=commit;h=9acdd88e22717510ff5dde277ecbd6f1de60b69d

commit 9acdd88e22717510ff5dde277ecbd6f1de60b69d
Author: Andrew Poelstra <email address hidden>
Commit: Peter Clifton <email address hidden>

    Universal use of GetValue

    This is a patch to make all numeric code use GetValue, to unify parsing
    code and make sure everything uses the same units. Contained is almost
    a complete rewrite of GetValue to simplify code that uses funny units.

    Reviewed-by: Peter Clifton <email address hidden>

    When committing the patch from Launchpad, I rebased it to apply with
    strcasecmp and strncasecmp changed to strcmp and strncmp, as changed
    by commit 31b7309764f2e4bd40141038c30f1f38309efb4a

    Affects-bug: lp-772027

Revision history for this message
Andrew Poelstra (asp11) wrote :

We are on the final stretch now... remaining Big Changes are:

1. Conversion of all output code to use pcb-printf (approx. halfway done on my local branch)
2. Audit for precision/overflow issues, convert all int/BDimension/LocationType variables to one type Coord.
3. The Switch.

That last step should be a single change to the unit-conversion macros with no discernible effect.

At that point we can go through and remove hacks related to our current imperial units (ex., preventing .9999's from displaying for the cursor position on GTK gui).

Changed in pcb:
status: Confirmed → In Progress
Revision history for this message
Andrew Poelstra (asp11) wrote :

I have pushed the patches to convert the base unit to nanometers.

Changed in pcb:
status: In Progress → Fix Committed
Peter Clifton (pcjc2)
Changed in pcb:
milestone: future-feature-release → next-bug-release
Peter Clifton (pcjc2)
Changed in pcb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.