Commit Graph

1593 Commits

Author SHA1 Message Date
Seth Hillbrand c08736e245 Assign stack pointer to lib table
When creating new lib table rows, the pointer becomes managed by the new
table through the boost::ptr_vector.  The row is non-copyable, however,
so we lose the reference as soon as it goes out of scope. Creating a
clone provides a new pointer that is moved into the table on creation.

Fixes: lp:1792456
* https://bugs.launchpad.net/kicad/+bug/1792456
2019-02-03 05:20:50 +01:00
jean-pierre charras 3ad5fd056e Pcbnew, Update PCB from schematic: Fix the reference point of the new footprints to place, when moving the cursor.
It was a regression from 5.02 version.
The block of new footprints to place has now its reference point (the point that is on the graphic cursor) fixed.
This is the first footprint loaded from the list.
2019-02-01 11:43:16 +01:00
John Beard f85f10930a Break widget save/restore out to reusable class
The CONFIG_SAVE_RESTORE_WINDOW class does not need to be tied
to the array dialog, put it in common/widgets.

Also do a refactor and tidy-up of the the class, use a union for (slightly)
better type-safety and syntax (a variant would be better but that's C++17).

Also enable integral field save/restore from text boxes.
2019-01-30 15:41:35 -08:00
John Beard 24ac9b7055 Pcbnew: array: repair dialog value init
Fully initialise the CREATE_ARRAY_DIALOG_ENTRIES object,
and use these values for the dialog on first open. Currently,
the initial values aren't all initialised, and none are used, as the
valid flag is not set. This means there are poor defaults in some
fields.

Also more declarations and defintions of CREATE_ARRAY_DIALOG_ENTRIES
to the .cpp, as these do not need to be exposed in the header,
even privately.
2019-01-30 15:41:35 -08:00
John Beard ffaf99a600 Pcbnew: Enable some numbering options in pcbnew
The numbering axis priority (h then v or v then h), and alternate
reversing are not actually numbering parameters, they are part of
the geometry of the array (the items are physically in different
orders).

So enable these options, even when numbering is disabled.

Also fix broken logic about when numbering scheme is enabled
(it still applies even if the numbering offset is fixed.)
2019-01-30 15:41:35 -08:00
John Beard 5504981d00 Separate ARRAY_OPTIONS to own class in common
The geometry and numbering logic is separate to the dialog, and
can be separated for clearer logic and better testability.

Moreover, refactor it to avoid any dependency on pcbnew
classes, so it can be move to common for potential re-use in
eeschema and friends in future.

Also convert all wxPoint logic in these classes to VECTOR2I and
fix some function visibilities.

Add some unit tests of the ARRAY_OPTIONS geometry and numbering.
2019-01-30 15:41:35 -08:00
Jeff Young 2dea3a49c8 Fix compile error in std::pow useage. 2019-01-30 16:38:34 +00:00
Seth Hillbrand 05483a06c6 pcbnew: Re-attach snap options
Snapping to item options were partially disconnected when unifying
framework.  This re-attaches the options and adds the additional option
for graphical items.

Fixes: lp:1801377
* https://bugs.launchpad.net/kicad/+bug/1801377
2019-01-29 13:36:17 -08:00
Seth Hillbrand 914596fcbb pcbnew: Allow STEP export tolerancing
kicad2step has a tolerance level that sets whether two points are at the
same location or not.  This allows KiCad to access these levels to some
degree, permitting a looser interpretation of a closed board outline.
2019-01-29 13:05:23 -08:00
Jeff Young 577bb73320 Revert 7d06651a10. 2019-01-28 20:10:13 +00:00
Seth Hillbrand 9d99fd188f Revert "Change top selection drop-down to combobox"
This reverts commit 7d06651a10.
2019-01-28 10:15:32 -08:00
jean-pierre charras e850a482d1 Gerber output: fix a potential minor issue in a G04 line comment.
In gbr files only ASCII7 chars are allowed.
However, in a comment line a UTF8 string is used. It should not create issues, but it is incorrect.
2019-01-27 10:14:16 +01:00
jean-pierre charras b8cfabd22e Fix some issues in I10n strings
Fix typo and missing I10n identifier for 2 strings
2019-01-26 09:25:12 +01:00
Wayne Stambaugh b13efdb0f2 Initial global footprint library table fixes.
Fix bug when pcbnew is launched from a folder containing an existing
fp-lib-table file by using same method as setting the initial global
symbol library table.

Fixes lp:1810169

https://bugs.launchpad.net/kicad/+bug/1810169

Fixes lp:1738871

https://bugs.launchpad.net/kicad/+bug/1738871
2019-01-20 13:51:07 -05:00
jean-pierre charras 9cac0a38cc DIALOG_GRAPHIC_ITEM_PROPERTIES: better tooltip.
minor other code enhancement (does not create any actual change)
2019-01-19 12:35:35 +01:00
Tomasz Włostowski 9657039af2 pcbnew: multiple fixes concerning track->pad net propagation used by Track/Via properties dialog:
- Added ignore netcode option to CONNECTIVITY_DATA::GetConnectedItems()
- PlaceModule() now ensures the module added to the board (and thus to the connectivity database) has correct bounding box necessary for R-trees to work
- Use recursive connected pad search so that the new net is propagated to all pads

Fixes: lp:1787961
* https://bugs.launchpad.net/kicad/+bug/1787961
2019-01-18 02:53:29 +01:00
Seth Hillbrand 9458ae8221 pcbnew: Prevent GITHUB plugin from being registered
If the user does not build the GITHUB plugin (deprecated), we cannot use
it in our footprint load and should remove the define to ensure
accidental use is caught at compile time.
2019-01-15 12:14:02 -08:00
Seth Hillbrand 90ad240660 units: Move common units and add tests
Centralizing duplicate code from Eeschema and pcbnew and adding unit
tests
2019-01-08 09:29:32 -08:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
jean-pierre charras db7dba96ad Fix a few Coverity warnings.
Mainly not initialized members, and replace not tested dynamic_cast by static_cast.
2019-01-04 09:49:21 +01:00
Seth Hillbrand 7d06651a10 Change top selection drop-down to combobox
wxChoice centers the selection on GTK.  So when switching from a
mid-list item to an item at the top, the list is always cut off for
choice lists located on the top toolbar.  Using a combobox provides a
drop-down that allows easier access to all elements in the box.

Fixes: lp:1808569
* https://bugs.launchpad.net/kicad/+bug/1808569
2019-01-03 14:48:28 -08:00
Seth Hillbrand efbc50b7b8 prevent NULL dereference in dialog_text_properties 2019-01-02 19:40:29 -08:00
Seth Hillbrand b39061855e pcbnew: Translate scripting test window 2019-01-02 14:49:55 -08:00
Jeff Young dffa399eab Set mirrored when creating footprint texts on back layer. 2018-12-31 21:50:09 +00:00
Jeff Young 061d993448 Warn the user when global track/via edits fail. 2018-12-31 21:50:09 +00:00
Jeff Young 4d9b4428fa It's never a good idea to dereference a freed pointer.
Fixes: lp:1809897
* https://bugs.launchpad.net/kicad/+bug/1809897
2018-12-27 13:33:19 +00:00
Jeff Young 0c0dda54bf Close any active editor before rebuilding netclass lists.
Fixes: lp:1809555
* https://bugs.launchpad.net/kicad/+bug/1809555
2018-12-24 01:55:02 +00:00
jean-pierre charras 5f3cbff977 Pcbnew, DIALOG_SET_GRID_BASE: A few cosmetic enhancements and fix a wxWidgets minor alert 2018-12-21 10:15:15 +01:00
Jeff Young 95dcc30ffb Load footprint browser with last-selected footprint. 2018-12-16 21:59:42 +00:00
Jeff Young f0c0f04348 Fix ReadNetList and UpdatePCB issues with new footprints.
Make sure the view is rebuilt before selecting the new footprints
so that they're shown only in the selection overlay.

Don't start the drag until the dialog is closed so we don't have
a bunch of extraneous mouse warping.

Fixes: lp:1775265
* https://bugs.launchpad.net/kicad/+bug/1775265
2018-12-10 19:48:58 +00:00
jean-pierre charras 7f20c55ed6 Pcbnew, Plot dialog, Gerber format: Enable or disable adding net metadata both in X1 and X2 format. Previously, this option was existing only in X2 format. Should be existing in both formats.
A bit of cleaning code related to this option.
2018-12-09 08:38:23 +01:00
Jeff Young 6a7ee5b107 Add locale handling for orientation combobox.
Fixes: lp:1806851
* https://bugs.launchpad.net/kicad/+bug/1806851
2018-12-05 18:08:50 +00:00
Jeff Young 4f5771f79f Don't nag user about changes they made in a text editor.
Fixes: lp:1806748
* https://bugs.launchpad.net/kicad/+bug/1806748
2018-12-04 23:32:55 +00:00
Jeff Young da40def69d Standardize on "local coordinates" terminology. 2018-12-04 23:32:55 +00:00
Seth Hillbrand 26765161c1 drc: Add board outline and edge crossing
This adds a check for contiguous board outlines to the DRC.  It also
uses the calculated outline to ensure that traces are not crossing the
outlines.

Fixes: lp:1648055
* https://bugs.launchpad.net/kicad/+bug/1648055
2018-12-02 07:54:52 -08:00
jean-pierre charras 5eb5b5ce58 DIALOG_TEXT_PROPERTIES: hide visibility option, because this option exists only for footprint texts, and do nothing for other texts.
Texts on board (not on footprints) cannot be invisible, at least in 5.0 and previous versions.
2018-12-02 10:30:48 +01:00
Jeff Young 45ee95f5e2 Apply CharHook uniformly as other platforms appear to have issues.
Fixes: lp:1806124
* https://bugs.launchpad.net/kicad/+bug/1806124
2018-12-01 11:57:16 +00:00
Jeff Young ff6a3482ec Remove on-kill-focus-validation.
Fixes: lp:1805361
* https://bugs.launchpad.net/kicad/+bug/1805361
2018-11-29 19:00:21 +00:00
jean-pierre charras 558c38b5c5 Very minor enhancement in plot dialog.
Inside the layers listbox, the context menu can select all fabrication layers.
The courtyard layers (only used for DRC) are now not selected.
2018-11-24 17:48:05 +01:00
Jeff Young 2e1920abad Add tooltips to library manager dialogs.
Fixes: lp:1804930
* https://bugs.launchpad.net/kicad/+bug/1804930
2018-11-24 15:06:21 +00:00
Jeff Young b2db49f4ac Add browse buttons to Library Manager dialogs.
Fixes: lp:1804924
* https://bugs.launchpad.net/kicad/+bug/1804924
2018-11-24 15:06:21 +00:00
Jeff Young 647fa6547d Update grid drop-down when changing user grid. 2018-11-23 23:33:02 +00:00
jean-pierre charras 149c4b55a6 DIALOG_TRACK_VIA_PROPERTIES_BASE: fix a minor wxWidgets alert. 2018-11-23 15:46:54 +01:00
jean-pierre charras d03e82602e PANEL_COMMON_SETTINGS: minor fixes, mainly cosmetic. 2018-11-22 17:11:49 +01:00
Jeff Young 5a74b55074 Reset delayedFocusPage even if it's already the right page.
Fixes: lp:1804315
* https://bugs.launchpad.net/kicad/+bug/1804315
2018-11-21 19:51:04 +00:00
jean-pierre charras 65a967dca1 Fix minor I10n issues. 2018-11-18 14:40:36 +01:00
Jeff Young 0de9cb345c Add shortcuts to setting dialogs for track widths, via sizes and grid sizes.
Fixes: lp:1803671
* https://bugs.launchpad.net/kicad/+bug/1803671
2018-11-17 00:35:06 +00:00
Jeff Young 3c6adbdf03 Indent layer properties for better comprehension. 2018-11-17 00:35:06 +00:00
jean-pierre charras b35b1bb644 Fix a few minor I18n issues.
Especially remove trailing and leading spaces in sentences, always annoying in translations, and never useful in sources.
2018-11-16 18:12:01 +01:00
Jeff Young 4050991d28 Move ERC marker focusing to GAL architecture.
Fixes: lp:1802537
* https://bugs.launchpad.net/kicad/+bug/1802537
2018-11-16 10:38:44 +00:00