Commit Graph

2125 Commits

Author SHA1 Message Date
Jeff Young f2e68e68d0 Add "Hide Tree" context menu options when tree has no selection.
Also cleans up some other code to be more consistent between symbol
editor and footprint editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/8052
2021-03-29 12:02:00 +01:00
Wayne Stambaugh 6d2f80b4cf Pcbnew: add write board netlist to file support.
This is hidden behind an advanced configuration setting and is primarily
useful for developers trying to troubleshoot the netlist payload sent
from the board editor to the schematic editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/8051
2021-03-28 08:38:29 -04:00
Ian McInerney 42c6af4bd8 Cleanup ACTION_MENU creation in some places
The ACTION_MENU constructor now takes the tool as an argument,
so the call to SetTool() immediately following it can be removed
and the tool just passed into the constructor.
2021-03-27 19:16:58 +00:00
Ian McInerney 9535153f9e Move the import graphics menu item to the action 2021-03-27 19:04:16 +00:00
Ian McInerney 7bfa8575fa Remove redundant information from import/export menu item labels
Saying "Import/Export" on the labels when the submenu has "Import"
or "Export" in it is redundant.

Note that we can't just update the action text with the new name,
because that is used in the hotkey list and would become too confusing
without the "Import"/"Export" text.
2021-03-27 18:50:35 +00:00
Jeff Young 3279e295ac Don't start filling zones with possibly stale caches.
Fixes https://gitlab.com/kicad/code/kicad/issues/8014
2021-03-25 17:20:08 +00:00
jean-pierre charras bbd7b4ca8c Eeschema, selection tool: uniformize the cursor shape and the actual modifiers.
SHIFT, CTRL, ALT modifier keys were handled in 2 different codes, one for
the selection tool and another to modify the mouse cursor shape, with 2
different configs.
Now the modifiers are managed from only one function.
Pcbnew: group also SHIFT, CTRL, ALT modifier keys management to a specific function.
Fixes #8021
https://gitlab.com/kicad/code/kicad/issues/8021
2021-03-25 10:28:20 +01:00
Ian McInerney a94a481574 Fix compile warnings
Some simple warnings and also a deprecation warning from wx
because they felt that a function should be renamed...
2021-03-23 19:46:49 +00:00
Jeff Young f24f0d93a5 Make OK default in inspectors (and hook up to close window).
Fixes https://gitlab.com/kicad/code/kicad/issues/7831
2021-03-22 21:20:54 +00:00
Jonathan Haas a677998f47 Don't select new items after cancelling move following item duplication
Fixes https://gitlab.com/kicad/code/kicad/issues/7956
2021-03-22 18:49:43 +01:00
Roberto Fernandez Bautista a9eb83201e Remove ZONE::ClearFilledPolysList() and fix ZONE::Unfill()
ClearFilledPolysList is redundant and Unfill() was missing the clearing
of m_insulatedIslands

This fixes potential latent bugs in zone unfilling.
2021-03-21 20:13:20 +00:00
Roberto Fernandez Bautista 50aafb9d2a Do not auto-refill zones when added or edited
The only exception is when using the Zone Properties Dialog and
user preference is enabled
2021-03-21 20:13:20 +00:00
Roberto Fernandez Bautista f6c4677189 ADDED Option to disable automatic zone filling in pcbnew
The new setting is stored as 'editing.auto_fill_zones' and controls
whether zones should be refilled after certain actions or not.
2021-03-21 20:13:20 +00:00
Roberto Fernandez Bautista a743e0c52b Add Zone fill to undo stack
Allows undoing zone filling and reverting to previous fill state.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7440
2021-03-21 20:13:20 +00:00
Jon Evans f1c599fa4d Tweak PCB selection behavior to reduce unintuitive behavior
We were discarding shapes too aggressively for having a
larger area than a shape underneath.

Let's also try showing fewer disambiguation menus, in particular
always preferring items on the active layer when the candidates
include overlapping items of similar area on other layers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7949
2021-03-20 13:11:51 -04:00
Jon Evans 6924b98bc3 Remove deprecated BRIGHT_BOX preview item 2021-03-20 12:09:20 -04:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Jeff Young 90742bba9f Adjust constraints after editing other points.
Fixes https://gitlab.com/kicad/code/kicad/issues/7103
2021-03-19 11:35:17 +00:00
Jonathan Haas 95051c4786 Also duplicate arcs in pcbnew
Fixes https://gitlab.com/kicad/code/kicad/issues/7943
2021-03-18 13:35:30 +00:00
pgvoorhees bb8d31cd06 Fix context item selection filter type omissions
Fixes #7839
2021-03-16 13:08:50 +00:00
jean-pierre charras cb451dc4b2 Pcbnew: Fix memory leaks and fix inefficient code. 2021-03-14 20:27:59 +01:00
jean-pierre charras a1b4bcc210 Refinements (add icons to menuitems and better help strings) 2021-03-14 18:44:31 +01:00
jean-pierre charras c763b0088e Fix some issues in drawing_stackup_table_tool.cpp 2021-03-14 17:44:16 +01:00
jean-pierre charras 3ba7fc0cc2 Move board stackup table drawing code from drawing_tool.cpp to drawing_stackup_table_tool.cpp
This avoid a too large drawing_tool.cpp file.
Remove also values in internal units and convert them to mm.
2021-03-14 17:44:16 +01:00
Fabien Corona f428ce03f2 ADDED: pcbnew - stackup / characteristics table 2021-03-13 20:19:46 +00:00
Jeff Young 18470693fe Copy linewidths when coverting to polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/7893
2021-03-13 17:06:49 +00:00
Jeff Young 93db7a130a Offset 3D models when moving footprint origin.
Fixes https://gitlab.com/kicad/code/kicad/issues/7868
2021-03-12 17:37:38 +00:00
Jeff Young a01bd52571 Use default line width when creating polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/7876
2021-03-12 14:54:54 +00:00
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00
Jeff Young ea9c269914 Don't fill polygons converted from lines.
The lines couldn't have been filled, so the polygon shouldn't start
out filled either.  The user can set it to filled if they want.

Fixes https://gitlab.com/kicad/code/kicad/issues/7867
2021-03-11 10:42:21 +00:00
Jeff Young e48f86bfd6 Move default assignment on Mac.
CHANGED: add corner and repeat last command now default to 'I' instead
of '<insert>' on Mac.

1) wxWidgets doesn't currently display the correct graphic in the menu
for the insert key
2) Mac laptops don't have an instert key

Fixes https://gitlab.com/kicad/code/kicad/issues/5016
2021-03-10 13:35:04 +00:00
Dominik Wernberger e2aa7be4b3 Added a lot of consts and refactored a few lines 2021-03-08 12:49:48 -08:00
Jeff Young 2bc10d58b5 Fix some cases where PCB_FP_ZONE_T was left out.
Fixes https://gitlab.com/kicad/code/kicad/issues/7615
2021-03-08 13:00:46 +00:00
Jonathan Haas 274d4e2eb4 Fix orientation of orthogonal dimensions
When drawing and editing orthogonal dimensions, take distance and
relative position to the end points into account.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/7189
2021-03-08 00:13:38 +00:00
Jon Evans 4ddb942ec0 Do not allow drag selection or drag move when already moving something
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7800
2021-03-04 19:01:31 -05:00
Jon Evans 1fc399fa31 Fix a few more cases of picking up wrong mouse positions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7745
2021-03-03 20:09:24 -05:00
Wayne Stambaugh 79a9d69ff5 Coverity fixes for issues 314755, 316287, 324536, 324539, and 324539. 2021-03-02 08:10:37 -05:00
Jon Evans 63b5d8db43 Pcbnew: use MRU path when opening files in standalone mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7734
2021-02-28 14:30:16 -05:00
Marek Roszko b82fcbcad6 More exception var disuse warnings 2021-02-26 19:30:58 -05:00
Jeff Young 86aaa2e9cb Rationalize footprint bounding boxes and cache all of them.
Fixes https://gitlab.com/kicad/code/kicad/issues/7720
2021-02-26 13:50:27 +00:00
Tomasz Wlostowski e221b11e3b GRID_HELPER: fixed arithmetic issue in segment snap distance check disguised as 'excessive optimization' by the dragger in the router 2021-02-25 17:18:23 +01:00
Seth Hillbrand 0bab025832 Fixup toolchaining for immediate mode
The move tool can stack on others, so when we re-enter the previous tool
this caused another immediate action.  We flag re-entry in the tool
stack to check for this and avoid unexpected tool starts
2021-02-24 10:44:54 -08:00
Seth Hillbrand 0518d9c546 Add more force-immediate tools 2021-02-23 17:05:03 -08:00
Seth Hillbrand 005622027f Add component/footprint is always immediate
When a user clicks on the "Add Component", "Add Power" or "Add Footprint"
icon, they want to add the item.  Requiring an extra click on the screen
before selecting the component/footprint is not needed.
2021-02-23 16:15:31 -08:00
Jeff Young a3b9e8ddb4 Round 2 of Worksheet -> Drawing Sheet. 2021-02-23 11:57:44 +00:00
Seth Hillbrand 2013a801d1 Fix zone merge undo
Also remove an implicit zone merge that was happening when the user
edited the zone parameters.  This appears to have been a feature but it
happened without a) telling the user and b) having the option to prevent
it.

Fixes https://gitlab.com/kicad/code/kicad/issues/7661
2021-02-22 15:45:17 -08:00
Jeff Young cad5198ab7 Worksheet -> (industry standard) Drawing Sheet. 2021-02-22 17:35:46 +00:00
Jon Evans 68b81c8271 Don't copy footprint text along with the footprint
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7647
2021-02-21 19:59:16 -05:00
Mikolaj Wielgus 2a9d76f1e3 Pcbnew: Fix snapping segment traces and graphics when initiating move
Fixes https://gitlab.com/kicad/code/kicad/issues/4746
2021-02-20 20:29:43 +00:00
Jeff Young 9dacd4abb7 Don't allow footprint children in groups outside their footprint.
Fixes https://gitlab.com/kicad/code/kicad/issues/7625
2021-02-20 18:09:56 +00:00
Jeff Young 91e876ce0d Make sure the title is updated when file is saved/reverted/etc.
Fixes https://gitlab.com/kicad/code/kicad/issues/7626
2021-02-20 15:09:47 +00:00
Zoltan Gyarmati 5a0a2a8366 pcbnew: only update cursor instead of activating selection tool when quiting delete tool
Fixes: https://gitlab.com/kicad/code/kicad/issues/7531
2021-02-20 06:40:00 +00:00
Jeff Young c2f68ca4da Whittle down library tree context menus to be more contextual.
(From discussion on Zulip.)
2021-02-19 19:07:45 +00:00
Jeff Young 828cdacc6f Add some missing tooltips.
Fixes https://gitlab.com/kicad/code/kicad/issues/7582
2021-02-18 18:33:52 +00:00
PJM c001c26575 Pcbnew: Drag selections containing only tracks or vias
CHANGED: If the user made a selection and then tried dragging it, the
drag would only succeed if the selection contained at least one
footprint.  Selections with only tracks and vias would instead make
KiCad drag a new selection box.

This MR allows routing of selections of a single track or via, while moving
selections containing more than one item, whether or not they also contain
a footprint.

Fixes https://gitlab.com/kicad/code/kicad/issues/7539
2021-02-18 17:49:48 +00:00
Jon Evans b2cd97fd84 Don't rotate/flip footprint texts along with the footprint 2021-02-18 12:39:28 -05:00
Seth Hillbrand 25e78162c8 Cleanup icons
- Adjust group/ungroup
- Use Mirror triangles for rotate
- Smooth goto badge
2021-02-17 17:26:16 -08:00
jean-pierre charras 5d2dc0b50e Fix a few (minor) issues:
- Make DIALOG_SHIM::SetPosition working)
- rename PCB_BASE_FRAME::SelectLayer() to PCB_BASE_FRAME::SelectOneLayer()
- PCB_BASE_FRAME::SelectOneLayer(): make dismiss dialog by escape key working.
Fixes #7578
https://gitlab.com/kicad/code/kicad/issues/7578
2021-02-17 20:56:43 +01:00
Jeff Young 34c2028e7b Assign via net before running DRC checks.
Fixes https://gitlab.com/kicad/code/kicad/issues/7579
2021-02-17 19:39:56 +00:00
Jeff Young d66de5bb35 Exclude footprints and groups from VIA_PLACER DRC testing.
(Their children need to get tested, but not the parent objects
themselves.)

Fixes https://gitlab.com/kicad/code/kicad/issues/7569
2021-02-17 14:08:53 +00:00
Jon Evans ba6aa3e034 Pcbnew: allow multiple selection of footprint text
With the selection filter and other improvements, we no longer
need to use this workaround to prevent accidental selections.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7527
2021-02-16 22:40:23 -05:00
Jon Evans 34c2bbfe51 Don't rebuild the whole nets grid on show/hide
Besides being slow, this causes the scroll position
of the grid to be lost.
2021-02-16 22:31:09 -05:00
Jeff Young 2a7e60960a Use standard mirror icons & terminology.
Also use standard group icons.

Also put both (and rotate commands) in toolbar.

Fixes https://gitlab.com/kicad/code/kicad/issues/7504
2021-02-16 21:11:36 +00:00
James Jackson dd7030a28f Keepout and graphic selection filters in footprint editor behave as per PCB editor
Fixes #7547

Fixes https://gitlab.com/kicad/code/kicad/issues/7545
2021-02-16 20:49:14 +00:00
Jeff Young cf42d692bf Remove some dead code. A little bit of comment cleanup as well. 2021-02-15 14:13:43 +00:00
Jeff Young b7672d3c92 Respece router Allow DRC Violations in free via placer.
Also don't check for collision on non-copper layers, but do check
for hole clearance violations.

Fixes https://gitlab.com/kicad/code/kicad/issues/7532
2021-02-14 22:32:12 +00:00
Mikolaj Wielgus 379c28340f Pcbnew: Do not disable grid snap in copy to clipboard operation
This simple commit makes the Pcbnew copy to clipboard operation snap the
obtained cursor position to grid before the anchors are calculated. This
is also the way the move operation has been apparently working so far.

To be clear, this will not remove all cases where the copy reference
point is not aligned to the grid (see the linked Gitlab issue for
details about the problem). This will still occur for zone outlines that
are not axis-aligned. But such behavior has been so far also present in
the moving operation, so this may be as designed.

Fixes https://gitlab.com/kicad/code/kicad/issues/7507
2021-02-14 01:44:28 +00:00
Jon Evans b708fd36ae Add tooltips to netclass setup panel column headers
Change router tooltips to be more straightforward
2021-02-11 20:50:26 -05:00
Mikolaj Wielgus 1dc0ef01b3 Fix automatic wire tool in gridless mode
The automatic wire tool was not working in the gridless mode because the
grid snapping on/off logic present in `EE_GRID_HELPER`, based on the
value of `m_enableGrid`, was not taking into account that another check,
but for the global KiCad setting, would be performed in the `Align()`
method, which is inherited from `GRID_HELPER`.

I've modified all tests of `m_enableGrid` value to also take the global
setting into account, and moved checks for it to `Align()` method, as
it's more consistent this way.

I've also removed an override of the `Align()` method in the
`PCB_GRID_HELPER` class, as it was made redundant by my changes.

Fixes https://gitlab.com/kicad/code/kicad/issues/7402
2021-02-10 22:07:49 +00:00
Jeff Young 20338c92e8 Move Flip board view to a shared tool (for FP Editor).
Fixes https://gitlab.com/kicad/code/kicad/issues/6687
2021-02-10 17:06:19 +00:00
Jeff Young a49a6c2f52 Refresh zone layers when copper layers change opacity.
Fixes https://gitlab.com/kicad/code/kicad/issues/7468
2021-02-09 12:26:46 +00:00
Jeff Young e2f8b1a4b1 Interpreting wxDialog::ShowModal()'s retval as bool is never what you want.
Fixes https://gitlab.com/kicad/code/kicad/issues/7454
2021-02-08 17:40:57 +00:00
Mikolaj Wielgus 5aaedd86ed Add "Limit graphic lines to 45 deg" to line drawing tool context menu
Fixes https://gitlab.com/kicad/code/kicad/issues/7181
2021-02-08 16:20:38 +00:00
Jeff Young 6272b48481 Make sure layer gets passed in to rules evaluation. 2021-02-08 14:53:49 +00:00
Jeff Young 0ca76571ce Add footprint zones to paste routine.
Fixes https://gitlab.com/kicad/code/kicad/issues/7442
2021-02-07 11:50:59 +00:00
Jeff Young c2dbd28101 Simplify and harmonize symbol editor and footprint editor menus.
Some differences are due to difference between libraries being files
in symbol editor and directories in footprint editor, but this unifies
most of the rest.

It also dispenses with the save-to-library vs save-to-document distinction
in the GUI because it makes for too much variability in the GUI, was
implemented differently between the two editors, and isn't needed as much
anymore now that we have the highly visible infobar.

There was also an issue that the save-to-board icon occupies the same
location and has the same size/shape/colours as the Board Setup icon in
PCBNew.

Fixes https://gitlab.com/kicad/code/kicad/issues/7215
2021-02-06 14:33:16 +00:00
Jeff Young 49a09f4c1c Pad selectability fix.
Physical layer test needs to be board-visible-layers, not pad-layers.

Also cleans up the tests so that LOD factors in.  (When things
disappear due to zoom level they should not be selectable.)

Fixes https://gitlab.com/kicad/code/kicad/issues/7238
2021-02-06 13:57:40 +00:00
Jeff Young 065a16b48c Careful that we don't move the wrong end of the arc.
Fixes https://gitlab.com/kicad/code/kicad/issues/7409
2021-02-03 23:53:11 +00:00
Jeff Young 90519c8324 Allow pads with holes to be selected when hole is visible. 2021-02-02 14:23:29 +00:00
Jeff Young 8571687f51 Upgrade place via tool to new DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/7358
2021-02-01 23:00:13 +00:00
Seth Hillbrand 29632e8b6f Include footprint center as snap point
Only when footprint center isn't approximate the footprint origin as
well.  This can help when moving/aligning THT footprints

Fixes https://gitlab.com/kicad/code/kicad/issues/7385
2021-02-01 12:03:26 -08:00
Jeff Young 89d3b0b670 Remove breakage of corner pinning in point editor.
For some reason the post-pinned local variable references were replaced
with calls to the points themselves (which are the pre-pinned values).

Fixes https://gitlab.com/kicad/code/kicad/issues/7291
2021-02-01 00:35:45 +00:00
Jon Evans abf0a46dce Refactor PICKER_TOOL and push up snapping disable functionality
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7348
2021-01-31 09:50:41 -05:00
Jeff Young a868fb97b6 Preserve Uuids when editing board footprints.
One way to do this would have been to keep the Uuids in the editor
copy.  However, this opens us up to errors if we forget a Save As or
export path and end up writing the Uuids out somewhere else.

In the end, it felt safer to store a map of the original Uuids and
restore them if we happen to save the editor footprint back to the
board.

Fixes https://gitlab.com/kicad/code/kicad/issues/7312
2021-01-31 14:09:59 +00:00
Jeff Young 56ea55ae9c Make sure that NPTH pads still get handled in copper clearance checker.
... because that's where we do hole-to-copper clearance testing.

Also augments the Clearance Resolution reporter to report on said
hole clearances.

And changes the interpretation of HOLE_CLEARANCE_CONSTRAINT to include
local pad clearance overrides.

Fixes https://gitlab.com/kicad/code/kicad/issues/7325
2021-01-31 00:33:35 +00:00
Jeff Young 41234a8373 Implement more precise annotation-required messages.
Also moves the message to an infobar so it's more noticeable.

Fixes https://gitlab.com/kicad/code/kicad/issues/7332
2021-01-30 16:31:27 +00:00
Seth Hillbrand 386ead30c5 All circle and arc tools to select all at first
Non-layer elements can be logical centers for the circle and arc tools.
We allow the non-layer to snap for the center points and revert to only
on-layer elements after

Fixes https://gitlab.com/kicad/code/kicad/issues/7327
2021-01-29 10:14:44 -08:00
Jon Evans b5e9a949bc Selection: skip sloppiness pruning if invalid
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7320
2021-01-28 19:51:29 -05:00
Jeff Young 1a7b7e84c6 Use consistent terminology for component placement files.
CHANGED footprint positions files -> component placement files.

Not all footprints get placed, so component is a more neutral word.
Use of "placement" instead of "positions" removes the double-plural
that makes footprint positions files such a mouth-full.

Fixes https://gitlab.com/kicad/code/kicad/issues/7097
2021-01-28 19:24:55 +00:00
Wayne Stambaugh 6a39b81647 Fix the last of broken Doxygen comment specifiers. 2021-01-27 17:39:44 -05:00
Mikołaj Wielgus 3e42ba18a9 Show dragging tools in context selection menu for components
Show the dragging tools in the context selection menu when a single
component is selected. Prevent the dragging tools from appearing when
more than one object is selected, as they will not activate anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/7258
2021-01-27 19:55:42 +00:00
Jon Evans 79f94c096e Rename legacy selection filter action to avoid confusion
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7290
2021-01-26 18:15:36 -05:00
Jeff Young dca7e44455 Fix a missed Module -> Footprint. 2021-01-26 10:56:19 +00:00
Michael Kavanagh d933a0a863 Use the pencil for Properties in Pcbnew 2021-01-25 14:21:23 +00:00
Michael Kavanagh eba09a59e9 Remove inappropriate icon 2021-01-25 14:21:22 +00:00
Jeff Young d40fe127aa Update pad locked status when adding footprints from schematic.
Also fixes some latent bugs with not updating the local ratsnest
visibility in other places, and the netcode in update PCB from schematic.

Fixes https://gitlab.com/kicad/code/kicad/issues/7202
2021-01-25 01:20:36 +00:00
Seth Hillbrand 47d5900600 Fix build warnings 2021-01-24 11:37:48 -08:00
Mikolaj Wielgus 04cc64c008 Restore the old reference after rotation or flip instead of clearing
After a rotation or flip the reference point has to be restored to the
previous value to prevent the dragged item from warping to the cursor.
Before this change, the reference point was only cleared, causing odd
behavior when a rotation or flip was performed.

Fixes https://gitlab.com/kicad/code/kicad/issues/7112
2021-01-24 18:56:46 +00:00
Roberto Fernandez Bautista f353fc448b Fix edge cases in EDIT_TOOL::DragArcTrack 2021-01-24 16:41:11 +00:00
Roberto Fernandez Bautista 99d203feae Clarify CIRCLE::ConstructFromTanTanPt
Remove unused bool aAlternateSolution and add doxygen comments
2021-01-24 16:41:11 +00:00