This tells you the arguments when it fails.
BOOST_TEST is available in all our Boost.Test version.
Even if you didn't use it, these calls should have been
BOOST_TEST_EQUAL(A, B) which also tells you the
arguments on a test failure.
Like the DSNLEXER header, this has visibility in over 700
files, whereas well under half actually use any of it
(quite a bit, but not all, of it actually via DSNLEXER)
Many places already forward-declare the OUTPUTFORMATTER type,
by doing that for the others, it still possible to use the
non-IO methods without having to see richio.h.
CHANGED: PCB file format now supports saving/loading complex padstacks
CHANGED: PTH pads are now rendered per copper layer in the copper color;
the PTH pad color is no longer used.
ADDED: support for importing complex pad stacks from Altium PCBs
Enforce padstack-aware access to pad properties across KiCad
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
- Adds Component Class field to SCH_DIRECTIVE_LABEL
- Adds SCH_SYMBOLs to SCH_RULE_AREA item lists
- SCH_SYMBOLs resolve Component Class directives
- Netlist exporter / importer handles Component Class names
- Adds DRC expressions and functions
- Adds QA check for component class netlist export
Break the non-PCB-specfic parts of PCB_REFERENCE_IMAGE out
to a common REFERENCE_IMAGE class, which is then composed into
the PCB_REFERENCE_IMAGE. This will make it easier to bring the
transform origin logic to eeschema without repetition.
This has always been possible (especially through the properties
panel with large scales), but it's even easier if the transform
origin is near a manipulated corner.
Check and reject scales that result in an overflowed image box.
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).
Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.
This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
A copy-paste-o meant that this wasn't working and
was also trashing the enable variable.
Add a test that loads an IBS file in the QA directory
that demonstrates this is fixed.
This would be OK if m_reporter were overwritten in the
derived ctor after being filled with junk in the base
ctor. But this is not always true - the null ctor doesn't
do it. So it can stick about and fool the null check.
Rather than just doing that, push the reponsibility for
maintaining the m_reporter invariant contract (if it isn't null,
you may use it) to the base class ctor.
And get rid of the shadowing m_reporter in KIBIS.
SYMBOL_BUFFER GetSymbol and GetOriginal cannot return null,
as the SYMBOL_BUFFER class internally ensures that the
original and current symbol pointers are always filled
through checks in the ctor and setters.
This means that clients don't need to null-check the returns,
which is good because they mostly already do not.
Return references instead, to formalise the non-nullity of
these pointers and absolve the calling code of having to
consider if they might be null.
Previously, SYMBOL_BUFFER took plain pointers and took ownership
of it (plus the ownership of an internal new'd pointer).
Use unique_ptr to express this relationship more clearly and
safely.
Add a non-null assert in SYMBOL_BUFFER's ctor.
Use more restricted-scope variables in a couple of places where
a re-used variable was not required.
There are still memory-leak opportunities in here, for example
SaveBuffer new's things and can return without handing them over
or deleting.
Again, this doesn't retain part-ownership of the pointer
and null is a wxCHECK failure. So hoist the null check
and then handle it as a ref (=non null, caller owns).
Also fixes a trivial mem leak in test_symbol_library_manager.cpp.
DeleteBuffer took a std::shared_ptr by value. This means
it claims to take (and keep) part-ownership of the pointed-to
item. However, this function does not take any ownership or
change the item, it just refers to it. It also does not null-check
the pointer. So it should be a const reference to the item.
Ownership semantics are then: the caller retains ownership
while the function executes.
(It also saves a shared_ptr ref count, but that won't be
important here).
Mostly intended right now for allowing testing of library tables
to help with testing chained loading, but it also decouples the
idea of a library table from on-disk files in general.
All current (real) lib table implementations continue to use the
file-based IO.
This could be made more general (not just for tables) if really
needed.
Makes it easier to reason about oval shapes in geometric terms.
For now, this isn't a SHAPE, but it could be (and it's a
fairly common primitive, so it could be useful, though the
obvious use (clearance) is equivalent to a SEG with a clearance,
which is already a function that exists.
In the core geometric types, this can provide some
useful optimisation opportunites.
As most trig functions and std::sqrt aren't constexpr
until C++26, anything that involves a vector length
can't be constexpr yet. But std::clamp and, importantly,
KiROUND are, which does allow quite a bit. And squared
sizes do work, as they are just multiplies, so size
comparisons work too.
The floating point equals-with-epsilon function can't
be directly made constexpr until C++23 (unless std::abs
is replaced with manual code, but that may then forgo
the use of intrinsics at runtime). And they're probably
not important to have at compile-time.
Add a few tests with static_asserts to show/prove that
some non-trivial operations can be done at compile time,
for example BOX2 merging.
This allows better value-semantics and const correctness.
This is a common method, as the Inflate method is
in-place:
BOX2I inflated = other;
// 'Inflated' is not inflated yet
inflated.Inflate( delta );
// Now it is inflated, but it's not const
This is annoying, as the 'inflated' box cannot easily
be made const. Instead:
const BOX2I inflated = other.GetInflated( delta );
If this is just 'int', BOX2D will not Inflate
as you might expect if given an non-integer parameter,
but will instead do a conversion.
Use coord_type, like the two-parameter Inflate method.
Add a test for this.
This is a pretty major rework of the snapping system.
The GRID_HELPERs now have a separate CONSTRUCTION_MANAGER
which handles some of the state involving "construction
geometry".
This is fed with 'extended' geometry (e.g. "infinite" lines from
segments) for use in generating things like intersection points.
It also handles adding this geoemtry to a GAL view item
(CONSTRUCTION_GEOM) for display to the user.
The process is:
* A TOOL creates a GRID_HELPER
* Optionally, it pre-loads a "persistent" batch of construction
geometry (e.g. for an item's original position)
* The grid helper finds useful snap 'anchors' as before, including
those involving the construction items.
* Other items on the board can be 'activated' by snapping to one
of their main points. Then, if it has construction geometry,
it will be added to the display. At most 2 items of this kind of
geometry are shown, plus the original item, to reduce avoid
too much clutter.
The dashed snap lines state machine is also handled in the
CONSTRUCTION_MANAGER and displayed in the CONSTRUCTION_GEOM item.
Put these in a separate header - they don't need to be available
whenever VECTOR2 is, but they are generic, reusable functions that
can have the corner cases defined and tested.
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing
Non-copper layers are odd and incrementing.
This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )
Similarly, gt/lt tests should not refer to the integer value of the
layer. We have functions such as IsCopperLayer to test whether a layer
is copper or not.
When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified. There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS
Similarly, PNS layers remain unchanged and sequential. A set of
interface functions is provided to map PNS layers to Board layers and
back. This allows the PNS_LAYER_RANGE to function as expected
SHA256 is fine for one-offs but for large libraries where we might be
running the hash on hundreds of files, the speed difference is
appreciable. We don't require crytographic hashing, just a check that
the original file hasn't been corrupted so Murmur3 satisfies our basic
requirement.
Issue raised by TomW, points included in new QA test where Simplify was
not properly removing colinear points.
Also removed TestSegmentHitFast() as the speed gains were minimal when
testing against the revised SEG::SquaredDistance routine in
TestSegmentHit()
Don't parse PEGTL twice, once for modelType and once for
model itself.
Also don't do O(n^2) searches on parameter names when
reading libraries.
And, because it's still too slow, multi-thread it.
This allows to see what the current snap point is, which is useful when
zoomed in, or the point is like the corner of a rounded pad where it's
"in free space" and might not be immediately obvious.