Commit Graph

4 Commits

Author SHA1 Message Date
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
John Beard 2c1b970027 Arrays: isolate axis code in a new class
Remove the axis numbering code from ARRAY_OPTIONS
and place in a new class, ARRAY_AXIS. This keeps
the logic for the array item numbering separate from
the logic for the array item geometry.

This simplifies the logic in the ARRAY_OPTIONS class, which
no longer has to deal with the numbering of each axis.
2019-05-16 11:20:52 +01:00
John Beard edc73de023 Pcbnew: ignore start values in "first available" grid numbering
The using the "first available" numbering option, force an
artifical linear numbering scheme starting at '1'.

Start the pad name provider at the 0'th pad index.

Also adds a few related tests and adjusts tests affected by
this change to reflect that the offset still applies.

This can be expanded in future to be more general by skipping
pad (which would allow a custom start and numbering scheme
while still avoiding duplication), but for now,
this does what the UI says and avoids string changes in 5.1rc.

Fixes: lp:1814918
* https://bugs.launchpad.net/kicad/+bug/1814918

Fixes: lp:1814917
* https://bugs.launchpad.net/kicad/+bug/1814917
2019-02-08 12:15:02 +00:00
John Beard 453a91f661 Pcbnew: arrays skip existing names
The current module cannot be queried for existing pads as we
add them (because we never commit, until we finish the whole array).

Instead, pre-gather the names and check as we add, skipping any existing
names.

Note: this will not prevent arrays becoming "mis-ordered", but there
is not a lot we can do to prevent all possible errors.

Fixes: 1808706
* https://bugs.launchpad.net/kicad/+bug/1808706

The same principle could be used to skip existing ref-des'es on PCBs.
2019-01-30 15:41:35 -08:00