Commit Graph

806 Commits

Author SHA1 Message Date
Jon Evans 12b4a55ae8 Port Eeschema to new project settings
DRC/ERC error serialization changed to use explicit tokens
Old stored severities and ignored errors are discarded
2020-07-02 22:08:54 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Jeff Young 441dfa30f0 Return individual custom pad shapes instead of a SHAPE_POLY_SET.
Also implements an optional pointer to return the actual distance
from all the SHAPE collision routines.

Fixes https://gitlab.com/kicad/code/kicad/issues/4774
2020-07-02 17:09:15 +01:00
Jeff Young 424d551054 Cache pad bounding boxes for performance.
Also allows us to return to a LOD test for pad numbers which treats
round and square pads the same.
2020-07-01 16:57:00 +01:00
Jeff Young 40a72d9530 Add SH_RECT handling to 3D shape conversion.
Also add some debugging for not-implemented shape cases in other
places to catch simmilar issues in future.

Fixes https://gitlab.com/kicad/code/kicad/issues/4757
2020-06-30 18:32:31 +01:00
jean-pierre charras 42296d7eb9 fix issues in DRC and fill zone, related to recent changes in code.
Note also: the actual clearance between 2 pads when < minimal clearance
is incorrectly calculated.
2020-06-30 12:59:26 +02:00
Jon Evans 0d4ee39f75 CHANGED: Copper zones can be on more than one layer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1963
2020-06-28 08:52:37 -04:00
Jeff Young d01b29ab37 Cleanup pad geometry handling.
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.

This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
2020-06-22 22:28:37 +01:00
Jeff Young c57c21f577 Pad bounding radius is from pad centre, NOT shape centre. 2020-06-22 20:36:54 +01:00
Jeff Young 7877e4083e Don't match to an unknown layer. 2020-06-20 14:34:53 +01:00
Seth Hillbrand 32738862b8 Fix build error in linux 2020-06-18 09:52:04 -07:00
Jeff Young 76d1b8bfa1 Make sure selectors match against user layer names.
Also allows for user specification of units in rule constraints.
2020-06-18 15:38:01 +01:00
Jeff Young a7703d1207 Cleanup Graphics to parallel Cleanup Tracks & Vias.
This also allows for easier migration to DRAWSEGMENT::S_RECTs by
auto-converting 4 rectilinear lines to a rectangle.
2020-06-17 18:44:39 +01:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Jeff Young d7d877241a More explicit type conversion to attempt to fix GCC compile issue. 2020-06-10 13:41:45 +01:00
Jeff Young 4138c8554c Parse DRC rules when closing Board Setup dialog. 2020-06-10 12:03:37 +01:00
Jeff Young f4d8c30f9a Tighten DRC epsilon value until we decide what to do about it. 2020-06-04 18:28:48 +01:00
Jeff Young 36d197d8b6 Increase pad clearance test epsilon to polygonization max error.
Fixes https://gitlab.com/kicad/code/kicad/issues/4604
2020-06-03 18:47:19 +01:00
Jeff Young d2cd4de280 Allow rules to operate on hole when hole-to-track testing. 2020-06-03 12:11:50 +01:00
Jeff Young 6d5b6c8b81 A bit more refactoring to get code out of the DRC tool. 2020-05-29 22:06:48 +01:00
Jeff Young 39ec63c4e9 Fix some inconsistencies in clearance priorities.
Fixes https://gitlab.com/kicad/code/kicad/issues/4555
2020-05-29 13:41:45 +01:00
Jeff Young 9f2be3714f Add unresolved variable testing for worksheet items. 2020-05-28 17:36:22 +01:00
Jeff Young e61185775f Implement testCopperDrawItem() for POLYGON draw items.
Fixes https://gitlab.com/kicad/code/kicad/issues/4549
2020-05-26 23:48:21 +01:00
Jeff Young 1db799d841 Implement "disallow" rules and integrate with keepout settings. 2020-05-25 22:51:47 +01:00
Jeff Young c415130de9 Improve parse error messages. 2020-05-25 22:51:47 +01:00
Jeff Young 160981ee71 Better error reporting for DRC rule parsing. 2020-05-25 22:51:47 +01:00
Jeff Young 416d82727f Redo DRC rules to get ready for new system. 2020-05-25 22:51:47 +01:00
Jeff Young 9a08ee2778 Add a 1nm tolerance to prevent rotated pad roundoff errors.
Fixes https://gitlab.com/kicad/code/kicad/issues/4139
2020-05-22 18:04:29 +01:00
Jeff Young 0a9adaef73 Don't use bboxes for non-cartesian-rotated pad collision testing. 2020-05-22 14:12:56 +01:00
Jeff Young 69f121d907 Another attempt to get DRC and status bar to share message content. 2020-05-22 14:12:56 +01:00
Jeff Young 4f14769ce1 Use both pads when calculating pad-to-pad clearance. 2020-05-21 21:26:36 +01:00
Jeff Young a5b53a623d Update status bar with clearance & rule sources. 2020-05-21 21:26:30 +01:00
Jeff Young 98be50883d Fix bug in single-item layer matching. 2020-05-21 11:25:39 +01:00
Jeff Young 89c46e6834 Fix typo in DRC check of rule-based track-width. 2020-05-19 21:17:49 +01:00
Jon Evans f4d7c323f5 Coverity fixes 2020-05-18 22:58:28 -04:00
Jeff Young 7d537e83ea Match layers only if both items are on the given layer. 2020-05-18 22:37:37 +01:00
Jeff Young ae9662c5cd Fix some unitialized variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4477

Fixes https://gitlab.com/kicad/code/kicad/issues/4473
2020-05-18 21:30:38 +01:00
Jeff Young d046f165de Fix board outline issues.
1) Don't try and do board-edge clearance checking against a
synthetic polygon constructed because we didn't find any edges.

2) Check pads against board edge.

3) Don't report vias as "Track too close to board edge".
2020-05-18 21:11:01 +01:00
Jeff Young cec857c0f4 Complete hookup of zone filler to new clearance engine. 2020-05-18 19:20:46 +01:00
Jeff Young 05855a5a1c Performance enhancements for DRC. 2020-05-18 13:38:17 +01:00
Jeff Young 8dc6f8e82b Allow empty rules files. 2020-05-17 15:49:02 +01:00
Jeff Young 75b139c7b4 Move hole testing to DRC client and improve performance. 2020-05-17 15:49:02 +01:00
Jeff Young 3656297f99 Add a simple editor for DRC rules. 2020-05-16 23:30:30 +01:00
Jeff Young 5b07889347 Better error messages for rule parsing. 2020-05-16 20:53:49 +01:00
Jeff Young d3f017d825 DRC rules parser and engine.
Fixes https://gitlab.com/kicad/code/kicad/issues/2182

Fixes https://gitlab.com/kicad/code/kicad/issues/2116

Fixes https://gitlab.com/kicad/code/kicad/issues/1958

Fixes https://gitlab.com/kicad/code/kicad/issues/1965
2020-05-16 15:53:05 +01:00
Jeff Young 13493437d0 Add hole-inside-courtyard DRC checks.
One for NPTH and one for PTH; both default to "ignore".

Fixes https://gitlab.com/kicad/code/kicad/issues/3434
2020-05-14 22:02:47 +01:00
Jeff Young aedc624340 Add DRC checks for dangling vias and tracks.
Fixes https://gitlab.com/kicad/code/kicad/issues/1999
2020-05-14 22:02:47 +01:00
Jeff Young 74ee143d45 Add via annulus minimum. 2020-05-11 22:56:09 +01:00
Jeff Young 2568c168a2 Silence Coverity warning. 2020-05-09 14:14:38 +01:00
Jeff Young 8efa8af8cc Add persistence of DRC error severities. 2020-05-07 17:51:27 +01:00
Jeff Young 0f8c7ffd11 Add pad keepout and footprint keepout areas.
Fixes https://gitlab.com/kicad/code/kicad/issues/2365
2020-05-07 17:51:27 +01:00
Jeff Young e0da677d4d Add min clearance to DRC; rename Min Via Drill to Min Through Hole.
Also fixes a crash bug when ignoring a DRC violoation with multiple
markers.

Fixes https://gitlab.com/kicad/code/kicad/issues/2528
2020-05-04 22:08:36 +01:00
Jeff Young e39d145d72 Add DRC tests for minimum drill size (based on min via size). 2020-05-04 22:08:36 +01:00
Jeff Young fd991db0a9 Forgot last commit. 2020-05-01 21:10:36 +01:00
Jeff Young 9954484dfd Don't show source in violation "name". 2020-05-01 18:49:42 +01:00
Jeff Young 058108dd6d There are 3 courtyard DRC checks, not 2. 2020-05-01 18:49:42 +01:00
Jeff Young 4a60b8a776 Improve DRC error reporting and fix some bugs. 2020-05-01 18:49:42 +01:00
Jeff Young 068874a626 Add clearance source for zone-to-zone clearance violations. 2020-05-01 18:49:42 +01:00
Jeff Young bba2fa3028 Fix bug with doubling the pad corner radius twice. 2020-05-01 18:49:42 +01:00
Jeff Young dfe4a00d43 Add distance reporting for copper item DRC tests.
Also adds some performance improvements.
2020-05-01 18:49:42 +01:00
Jeff Young 0c20c0b4af Fix broken hole-to-track test. 2020-05-01 18:49:42 +01:00
Jeff Young 874f13e29e Fix some issues with rotated oval pads. 2020-05-01 18:49:42 +01:00
Jeff Young 5c8d712a56 Fix some issues with rotated rectangular pads. 2020-05-01 18:49:42 +01:00
Jeff Young 1280a4d2f3 Add pre-flighting to DRC checks for performance. 2020-05-01 18:49:42 +01:00
Jeff Young c955f45728 Fix compile error on gcc. 2020-05-01 18:49:42 +01:00
Jeff Young f7e518dbc6 Add clearance sources to some DRC violation reports. 2020-05-01 18:49:42 +01:00
Jeff Young a56191b658 Add distances to a bunch of DRC violation reports. 2020-05-01 18:49:42 +01:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young 32db9eb0f1 Add some distances to a few DRC errors. 2020-04-24 22:17:45 +01:00
Ian McInerney 3f9b3e505e Add some virtual destructors 2020-04-24 18:24:39 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
Jeff Young 41b5872f12 Add ERC & DRC checks for unresolved variables. 2020-03-30 14:15:59 +01:00
jean-pierre charras 64d217edda drc.h: replace a list of #define by an enum.
Due to changes in code, the reason for using #define does not exist
since a long time.
2020-03-18 10:19:46 +01:00
Jeff Young cee973dc04 Move ERC error reporting over to the new framework.
Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-16 11:06:15 +00:00
Seth Hillbrand 61704cb508 Initialize missing variable 2020-03-11 15:24:08 -07:00
jean-pierre charras fbd01f2f7d DRC_TREE_MODEL: Fix incorrect display of DRC errors on linux+wxGTK 3.0
Fixes #4038
https://gitlab.com/kicad/code/kicad/issues/4038
2020-03-11 10:46:08 +01:00
Ian McInerney f079c41118 Prevent the board setup dialog from opening when DRC is open
The board setup dialog controls DRC error visibility, so the
two dialogs shouldn't be open at the same time to prevent
data contention.

Follow-up to https://gitlab.com/kicad/code/kicad/-/issues/4023
2020-03-08 15:55:14 +00:00
Jeff Young 1e4ae5d526 Bug fix for DRC tree view on MSW. 2020-03-07 18:52:30 +00:00
Jeff Young 44b8bb8f60 Fix a bug when deleting DRC markers from their child items. 2020-03-06 16:23:44 +00:00
Jeff Young d20f36511f Fix issue with severities not get initialised in DRC_TREE_MODELs. 2020-03-04 21:52:30 +00:00
Jeff Young 0894674869 Save severities settings in the DRC dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/3978
2020-03-04 21:52:30 +00:00
jean-pierre charras b7cd0c54c2 Fix compil issues, especially on Windows:
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
2020-03-04 10:48:18 +01:00
Jeff Young 85c2e0d23a Add user-defined severities, exclusions and colors to DRC markers.
Exclusions are currently persisted in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-04 00:39:28 +00:00
Jeff Young 3860ab9f0c Fix issue returning pointers to items inside std::vector.
(When the vector is re-allocated your pointers become bogus.)
2020-02-27 22:00:51 +00:00
Jeff Young 82ae9db262 Another variation on the wxDataViewCtrl issue.... 2020-02-26 17:56:47 +00:00
Jeff Young a2234b348d Another attempt to work around wxDataViewCtrl bug on GTK. 2020-02-26 17:35:10 +00:00
Jeff Young 4c563b541e Another attempt to get GTK wxDataViewCtrl to reload properly. 2020-02-26 14:41:12 +00:00
Jeff Young 7c6f7e6b01 Try some undocumented wxWidgets call to fix DRC. 2020-02-25 18:26:42 +00:00
Jeff Young 0614bbc663 Silence a couple of compiler warnings. 2020-02-25 18:26:42 +00:00
Jeff Young 4e0cb3c1ad Another attempt at fixing Linux issue.
Note that I have no Linux machine, so this is shooting in the dark....
2020-02-25 13:51:59 +00:00
Jeff Young 4b380f0dc3 Fix compile issue on Linux & crash issue on Windows.
Fixes https://gitlab.com/kicad/code/kicad/issues/3937
2020-02-25 12:28:05 +00:00
Jeff Young a4837f7d32 Move DRC dialogs to wxDataView.
This allows for hierarchy and better selection handling.
2020-02-24 23:19:17 +00:00
Jeff Young c5077aeb97 Move weak-reference stuff to UUIDs. 2020-02-24 23:19:17 +00:00
jean-pierre charras 625249322e Pcbnew: regroup drc files to the already existing drc folder. 2020-02-19 10:31:32 +01:00
Jeff Young fbeb0709ef Formatting cleanup. 2020-02-03 19:35:48 +00:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
Jeff Young fbfbb64387 A bit of cleanup of stale DRC code. 2019-06-04 13:56:54 +01:00
Jeff Young 568c8c336b Move DRC control to a tool; move assorted commands to ACTIONS. 2019-06-03 21:08:30 +01:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand 40309a17ef pcbnew: Check exact overlapping polygons
Checks for polygon collisions in the outline when the polygon contains
two or more segments that exactly overlap.  This also places the DRC
marker at the location where the collision happens.

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

Fixes: lp:1818218
* https://bugs.launchpad.net/kicad/+bug/1818218
2019-03-01 09:38:33 -08:00
John Beard 8297ab24e4 DRC: Break out courtyard overlap function
Introduce the concept of a DRC_PROVIDER which allows
to separate the various DRC functions to their own
areas. This allows, amongst other things, a slimmer core
DRC class, and allows DRC functions to be separately testable.

The courtyard DRCs (overlap, missing and malformed)
are the first victims, so instrumentation can be added to this function.

Add some unit tests on this DRC function, as well a few re-usable PCB-based
utility functions in a library (qa_pcbnew_utils) that could be shared between
unit tests and other utilities.
2019-01-23 13:27:52 -05:00
John Beard e6edc1b670 DRC: Make the marker factory a separate class
This separates the "newMarker" functions from the DRC class. These
are moved to a new class, DRC_MARKER_FACTORY, which is now responsible for
constructing suitable markers from BOARD_ITEMS.

The reasons for this are:

1) Allow DRC related functions to access theese functions without having
   to bake these functions into the main DRC class.
2) Thereby simplify the DRC class interface
3) As DRC_MARKER is now a small class with public interfaces, it's
   possible to put unit tests on these functions.

The motivation here is to allow to start to split out pieces of DRC
into separate classes.
2019-01-23 13:27:52 -05:00