Commit Graph

9802 Commits

Author SHA1 Message Date
Jeff Young 8dd725469f Process properties command locally within drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/5612

Fixes https://gitlab.com/kicad/code/kicad/issues/5615
2020-09-17 22:32:22 +01:00
Jeff Young e202dba386 Be careful not to unload current project if settings imported from it.
Fixes https://gitlab.com/kicad/code/kicad/issues/5684
2020-09-17 20:56:51 +01:00
Jeff Young 7b2a111a1c Implicit rules go first so that other rules will take priority.
Fixes https://gitlab.com/kicad/code/kicad/issues/5687
2020-09-17 20:13:39 +01:00
Jeff Young 0f3d2147aa Performance enhancements for DRC. 2020-09-17 20:13:39 +01:00
Jeff Young 8e530db633 Reporting must be kept inside the REPORT macro.
Reporting is run on a single clearance where performance doesn't
matter much.  Doing the string building during a DRC, however, kills
performance.
2020-09-17 20:13:39 +01:00
Jeff Young a3d65a2b43 Smoother progress reporting for DRC checks.
Also moves Messages tab out to an overlay, and restores the longer
messages now that messages are no longer a textbox in the upper right.
2020-09-17 20:13:39 +01:00
jean-pierre charras e8d09cd998 Pcbnew: fix incorrect creation of scripting/plugins in user directory.
Initialize Python scripting even if this directory cannot be created
It is not a mandatory dir, and not initializing python scripting can create crashes.

Fixes #5667
https://gitlab.com/kicad/code/kicad/issues/5667
2020-09-17 10:47:21 +02:00
jean-pierre charras a1439881b7 Fix a collision name with a Windows header. 2020-09-17 07:46:02 +02:00
Seth Hillbrand 45ca1709bb Unify scripting dirs and open user-based
This consolidates python scripting in two locations: the system-wide
package-based location and the user configuration location.  It also
updates the "Show Scripting Folder" action to open the user
configuration location instead of the package-based one.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5115
2020-09-16 20:09:23 -07:00
PJM f3586ccd45 Pcbnew: Make 'GetBoundingBox' return correct answer when passed false
CHANGED: 'GetBoundingBox' has a variant that accepts a boolean that
determines if invisible text is included in the Bbox calculations.  The
'IsVisible' function for the value and reference strings doesn't
factor in if the layer it's on is visible or even in the PCB stackup,
so 'GetBoundingBox' returns a bbox that factors in invisible text
regardless of what it's passed.  This MR fixes that problem.

CHANGED: Refactored the original 'GetBoundingBox' function that doesn't
take a parameter.  It now just calls the variant that does take a
parameter and passes it 'true'.  The two versions had a lot of
duplicate code and this eliminates it.

Note: Issue 5629 might be better solved at the PCB module level, but this
does fix the known problems caused by it which were discovered in
'GetBoundingBox'.

Fixes https://gitlab.com/kicad/code/kicad/issues/5629
2020-09-17 00:59:07 +00:00
Jon Evans e9b627bfd8 ADDED: Center marker dimension type 2020-09-16 20:55:11 -04:00
Jon Evans 5109857883 Disable deselect net from main context menu
Right now we can't track the intended item to deselect
when there's an active selection already.

Having this feature available just from the appearance panel
should be fine.
2020-09-16 20:55:11 -04:00
Marek Roszko a82edb60fe Rotate the bounding box for hit tests on the fly 2020-09-16 23:29:21 +00:00
Marek Roszko 721c30e464 Make SetPosition and SetOrientation simply adjust the bounding box rather than continously recalculate it.
SetPosition is called on every pixel of a move operation which could be performance impacting on some systems.
2020-09-16 23:29:21 +00:00
Jon Evans 4a25db599e ADDED: Deselect net action
You can now deselect nets and netclasses (i.e. remove them from the
active selection) via the context menus in the appearance panel
2020-09-16 19:10:12 -04:00
Jeff Young 2b43ffd12d Better error reporting; better nullptr safety.
Also clears the marker lists before running a DRC, and sets
the drcRun flags afterwards so that the notebook tab counts
get updated.

Fixes https://gitlab.com/kicad/code/kicad/issues/5659
2020-09-16 22:14:41 +01:00
Jon Evans db40e0c595 Fix dimension point editor ordering
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5656
2020-09-16 12:05:30 -04:00
Jeff Young ce3819abf8 Remove redundant clearances from DRC dialog. Fold progress bar in. 2020-09-16 16:06:29 +01:00
Jeff Young c0f83b30d3 Minor reformatting and performance improvement. 2020-09-16 16:04:28 +01:00
Tomasz Wlostowski b993a29695 drc: fix heap overflow 2020-09-16 13:45:12 +02:00
jean-pierre charras e137d61b29 Fix typo 2020-09-16 11:46:16 +02:00
jean-pierre charras c4b66e7cd3 drc/drc_test_provider: Fix a crash due to code change, at least on Windows.
The new code has not a lot of change, and is a bit cleaner.
2020-09-16 11:46:16 +02:00
Jeff Young 0ca09abbd3 Don't assume colour theme preview board will have a DRCEngine.
Fixes https://gitlab.com/kicad/code/kicad/issues/5650
2020-09-16 10:42:25 +01:00
jean-pierre charras 652a59b781 Fix null pointer use 2020-09-16 09:21:39 +02:00
Jon Evans 75ffce1a0b ADDED: Leader dimension object
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5555
2020-09-15 23:37:38 -04:00
Seth Hillbrand 0f22e8e2fe Make SWIG aware of PYTHON3 for its bindings and remove threads
This removes the threading from the SWIG interface (it was supposed to
be off by default) and adds support for Python3 bindings when supported
by the system
2020-09-15 19:46:53 -07:00
Ian McInerney ea06c16255 Cleanup PCB_GROUP objects on the board when deleting the board 2020-09-16 02:04:17 +01:00
Ian McInerney 8bd77c4fe7 Rename the ITEM_SET types to be descriptive of their contents
Now that we have one set type for BOARD_ITEMs and another for SCH_ITEMs
it is better to explictly say if they are board or schematic sets.
2020-09-16 02:04:17 +01:00
Jeff Young 43ab963650 Don't expect footprint viewer frame to have a DRC engine. 2020-09-16 01:10:16 +01:00
Jeff Young cdbe2fd2d2 User terminology specific to Change Footprint/Symbol.
Also implements separate session settings for the reset checkboxes
for Change Footprint and Update Footprint.

Fixes https://gitlab.com/kicad/code/kicad/issues/5614
2020-09-16 00:15:26 +01:00
Jeff Young b4229d9a3e Fix testcase crash when progressReporter was null.
(And it helps if the DRC tester you're trying to test is actually
in the make file.)
2020-09-15 22:25:12 +01:00
Ian McInerney 6a7266d589 Only update DRC progress reporter if the reporter exists
The DRC engine might not have a reporter when run headless
2020-09-15 21:18:58 +01:00
Jeff Young b6a8e165c3 Don't allow schematic/pcb DRC tests when in standalone mode.
Fixes https://gitlab.com/kicad/code/kicad/issues/5635
2020-09-15 21:14:11 +01:00
Jeff Young e2e229da96 Finish exorcising the old DRC system.
This moves the various BOARD_ITEM calls to the new system, and make
the DRC_ENGINE long-lived so that it can field those queries.
2020-09-15 20:15:46 +01:00
Seth Hillbrand 67a7aa8ba4 Make snapping size grid-dependent
Fixes https://gitlab.com/kicad/code/kicad/issues/5638

Fixes https://gitlab.com/kicad/code/kicad/issues/5588
2020-09-15 12:07:34 -07:00
Seth Hillbrand 08bf5f4b4e ADDED: 45° snapping for rectangles aka Squares
The snap obeys only the Ctrl key and not the global preference setting
for drawsegments because rectangles are _always_ on H/V lines when drawn

Fixes https://gitlab.com/kicad/code/kicad/issues/5607
2020-09-15 11:22:26 -07:00
Roberto Fernandez Bautista 5467729611 Fix incorrect comparison in CADSTAR PCB Archive Importer
Also avoid use of magic numbers in case KiCad internal units ever change
2020-09-15 17:16:01 +00:00
Seth Hillbrand aa7e021bfc Remove translated null strings
Also improves translatability by separating clauses
2020-09-15 08:35:09 -07:00
Jeff Young 665212341d Cleanup (consistent naming, 100-char line width, message precision). 2020-09-15 12:07:31 +01:00
Jeff Young 514da2f886 Move DRC dialog to new DRC engine. 2020-09-14 22:39:36 +01:00
Seth Hillbrand 52d9a47d5b Fix endless loop in drc
Need to allow looping to negative when decrementing
2020-09-14 12:25:25 -07:00
jean-pierre charras 4cda653dbd dialog_drc: fix a minor issue when saving dialog drc options.
Fixes #5623
https://gitlab.com/kicad/code/kicad/issues/5623
2020-09-14 17:45:39 +02:00
jean-pierre charras ff0a728753 Fix a few I18N issues. 2020-09-14 10:02:07 +02:00
Jeff Young 748bee1bc7 Hook up netclasses and board minimums to new DRC engine.
Improves implicit rule reporting.
Makes some internal names more consistent.
Moves DRC_REPORT to the test framework.
Removes priority (which isn't supported in the grammar)
2020-09-13 17:08:24 +01:00
Jeff Young d47d119d5f Compile layer test into CONSTRAINT_WITH_CONDITIONS.
Also processes constraints in correct order for priority (reversed)
and removes multiple-expression-conditions for a single constraint
(which is not supported in the grammar).
2020-09-13 17:08:24 +01:00
Jeff Young 8420fcc33b Cleanup. 2020-09-13 17:08:24 +01:00
Jeff Young 5d9301d394 Adjust isErrorLimitExceeded so it can be used for severity==IGNORE. 2020-09-13 17:08:24 +01:00
jean-pierre charras 9f44d72923 Zone filler: fix regression: zone with no nets are now clipped to board outlines.
Due to code changes, only zones belonging a net were considered, and
zones with no nets were not examined when removing islands.

Fixes #5608
https://gitlab.com/kicad/code/kicad/issues/5608
2020-09-13 10:38:16 +02:00
Jon Evans 2380c4384a Fix alignment of label in dimension properties 2020-09-12 13:16:20 -04:00
Jon Evans d7e9411049 Filter out footprints that are larger than the viewport in either direction
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2448
2020-09-12 13:16:10 -04:00
Jon Evans a80190e206 Make sure auto-unit dimensions are updated on board load 2020-09-12 11:52:59 -04:00
Jon Evans 3940e20fcb Expose extension offset and zero suppression settings 2020-09-12 11:52:59 -04:00
Seth Hillbrand 1703657fb5 Decrease default snap range
The snap range needs tuning to preference and monitor resolution.  This
shifts the default range down for users until the customization bits are
implemented.
2020-09-12 08:34:21 -07:00
Jon Evans e40287d327 Fix auto units to work when drawing new dimensions 2020-09-12 10:30:33 -04:00
Jon Evans 0347515cec Support text expansion in dimensions 2020-09-12 10:23:19 -04:00
Jon Evans 9d93f60fc4 Fix parsing old dimensions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5600
2020-09-12 08:25:54 -04:00
jean-pierre charras 1aa38b8f82 drc_rule.cpp: avoid crash with a incorrect (broken or too old?) drc_rule file.
The crash was due to a null pointer not tested.
2020-09-12 11:26:53 +02:00
jean-pierre charras a98ea2fb2e Fix a minor wxWidgets alert. 2020-09-12 10:52:12 +02:00
Jon Evans 30a428677f Change rotation command to only impact dimension text 2020-09-11 21:12:36 -04:00
Jon Evans 0e9997d9ca Add new dimension features to board design defaults 2020-09-11 21:12:36 -04:00
Jon Evans 76c4c959e6 Implement new dimension properties
- Automatic units mode (follow UI units)
- New text and number formatting options
- Automatic/manual text orientation control
- New text positioning options (inline and manual)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4280
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4497
2020-09-11 21:12:36 -04:00
Jon Evans f1b7903a7d WIP: Implement new dimension properties 2020-09-11 21:12:36 -04:00
Jon Evans ae7877c6cb Migrate dimension precision 2020-09-11 21:12:36 -04:00
Jon Evans b11e315d10 Refactor DIMENSION to hide internal details; add some new properties
This is a board file format change to account for the new properties.
Also, we now only store the critical information about the dimension's
geometry in the board, rather than storing every drawn line.

The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
2020-09-11 21:12:36 -04:00
Jon Evans 50b92379c8 Add new dimension properties dialog 2020-09-11 21:12:36 -04:00
Jeff Young 5be887a60f Iron out some wrinkles in the DRC migration. 2020-09-12 01:57:37 +01:00
Jeff Young 8ac7288696 Fix a crash bug loading DRC rules.
Also moves the clearance report to the new DRC engine.
2020-09-12 00:46:55 +01:00
Jeff Young ce2937a399 Move rest of DRC tests to kicad. 2020-09-11 23:14:12 +01:00
Seth Hillbrand d14c6ba71f Keep snap line alignment before new snaps
Also fixes the alignment line that was supposed to be dashed and not
solid.
2020-09-11 14:22:41 -07:00
Jeff Young 5424d6fa09 Move new clearance tests into kicad. 2020-09-11 21:26:57 +01:00
Seth Hillbrand 965a32077d Fix compile error 2020-09-11 08:40:36 -07:00
Jeff Young cc86630f11 Start pulling new DRC engine into Kicad. 2020-09-11 16:04:11 +01:00
Jeff Young 6b4a6f4d3e Restore min seg limit for rounded-corner pads.
It suffered from a cacophony of errors, starting with an errant
comment that made it later look like a bug.  Sigh.
2020-09-11 14:41:45 +01:00
Jeff Young e2bc7557cc Clean up arc/circle polygonization.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle.  However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.

2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
 anyway.  (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".

3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers.  Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.

4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.

5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards.  It's now only exposed as a RAII object which  automatically
cleans up when it goes out of scope.

6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/5567
2020-09-11 11:23:49 +01:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Jean-Samuel Reynaud d6322dcf0d Ensure Tools->External plugins is populated
Since the commit e8b11c911e, the menu tools->external plugins is empty.
This is because on new system, an added submenu is cloned when added. So any update  on the object
after Add it as no effect. The menu stay empty.
With this commit the menu filling is made before adding submenu.
2020-09-11 03:04:27 +00:00
Jeff Young fc1665ff28 ADDED Clearance Inspector. 2020-09-10 20:58:38 +01:00
Jeff Young e31705d4b3 More source reporting for clearance rules. 2020-09-10 20:58:38 +01:00
jean-pierre charras 6009414e22 Drill files export: ensure the Top to Bottom PTH drill file is always created,
even if there are no hole.
NPTH file is already always created.

Fixes #5566
https://gitlab.com/kicad/code/kicad/issues/5566
2020-09-10 16:42:04 +02:00
jean-pierre charras 6ab6c00f61 Plot solder mask: fix incorrect shape for rectangular pads.
It was noticeable only for pads having a large solder mask clearance.

Fixes #5570
https://gitlab.com/kicad/code/kicad/issues/5570
2020-09-10 13:22:16 +02:00
Seth Hillbrand 4026904cc4 Make grid snapping depend on grid visibility
Turning the grid view on enables snapping to the grid.  Turning it off
removes the snap and allows free draw
2020-09-09 10:18:15 -07:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00
Jeff Young 59c6635286 Add restrictions on copper layers for NPTH pads.
Also updates the stackup graphics to include NPTH pads.

Fixes https://gitlab.com/kicad/code/kicad/issues/5477
2020-09-09 10:22:17 +01:00
Jeff Young c090f1b646 Add restrictions on copper layers for NPTH pads.
Also updates the stackup graphics to include NPTH pads.
2020-09-09 01:49:50 +01:00
Jeff Young ab71ef9ec5 Try a different strategy at getting wxWidgets to honor stackup bitmaps.
Fixes https://gitlab.com/kicad/code/kicad/issues/5559
2020-09-08 23:34:43 +01:00
Jeff Young 0ec4c4fe65 A more targetted fix at the focus issue.
Fixes https://gitlab.com/kicad/code/kicad/issues/5477
2020-09-08 22:35:04 +01:00
Roberto Fernandez Bautista 6a82f23981 CADSTAR PCB Archive Importer: Load Component Copper and Component Areas 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista c1dec964be CADSTAR PCB Archive Importer: Fix Parsing errors
Change error displayed when a Library .cpa file is opened (instead of a Layout file)
Add warning if variants exist in original design.
Parse LAYERHEIGHT in LAYER (same thing a MAKE but without the MATERIAL_ID)
Parse PADEXCEPTION in COMPONENT
Add DESIGN as one of the valid UNITS
2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 05e5740504 CADSTAR PCB Archive Importer: Parse VARIANT data + add missing "REFPLANE" flag to layers 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 349ac06ee2 CADSTAR PCB Archive Importer: Fix compile error + BULLET pad is now correct 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 112da7828e CADSTAR PCB Archive Importer: Load Dimensions 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 8296b1d669 CADSTAR PCB Archive Importer: Load GROUPs 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 7ca4f0b375 CADSTAR PCB Archive Importer: Formatting fixes 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 94568e8699 CADSTAR PCB Archive Importer: Load Net Classes (Routing Widths in CADSTAR) 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista a3531b02e7 CADSTAR PCB Archive Importer: Load documentation symbols and fix some import errors
Fix unnamed net import
Fix missing tokens
Fix zero-sized pads (make them really small instead)
2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 7e65d443e8 CADSTAR PCB Archive Importer: Load TEXTS and fix loading speed
Loading speed fixed by changing the way CADSTAR_ARCHIVE_PARSER::InsertAttributeAtEnd works (we now have a new attribute in each node to keep track of how many attributes there are). Now loads a 30,000 line file in 10seconds instead of 25 minutes!
2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista fe3e20ddc7 CADSTAR PCB Archive Importer: Load design rules 2020-09-08 21:21:20 +00:00
Roberto Fernandez Bautista 866c069873 CADSTAR PCB Archive Importer: Load TEMPLATEs, COPPERs and NETs (including Tracks and Vias) 2020-09-08 21:21:20 +00:00
Roberto Fernandez Bautista 05de678f4e CADSTAR PCB Archive Importer: Rename CADSTAR_PCB class to CADSTAR_PCB_ARCHIVE_LOADER 2020-09-08 21:21:20 +00:00
Roberto Fernandez Bautista 08a77e0af8 CADSTAR PCB Archive Importer: Add import warnings for CADSTAR layers with no KiCad equivalent 2020-09-08 21:21:20 +00:00