Commit Graph

8080 Commits

Author SHA1 Message Date
jean-pierre charras e75be4074e Pcbnew: finalize the new zone filling algo (filled polygons with no thickness). 2019-06-05 18:36:20 +02:00
qu1ck 3cb90063a1 Pcbnew scripting fixes
* Remove infinite recursion calls in footprint.i
* Extend DRAWINGS deque iterator to auto cast contained BOARD_ITEMS,
similar to what dlist implementation did.
2019-06-04 19:29:31 -07:00
Seth Hillbrand f007d2857a pcbnew: ClearPcb() without queuing tools
When exiting pcbnew, we only want to run the sections of ClearPcb that
remove the old pcb data.  We do not want to queue events that handle
initializing a new pcb.  These were caught after freeing memory in some
cases, leading to segfaults.

Fixes: lp:1831560
* https://bugs.launchpad.net/kicad/+bug/1831560
2019-06-04 19:27:17 -07:00
Jeff Young 15241b7fcf ACTION-ize toolbar/palette control. 2019-06-04 22:31:42 +01:00
Jeff Young 1222f3cc72 ACTION-ize fab outputs. 2019-06-04 22:31:42 +01:00
Jeff Young 1ea5b04e22 More ACTIONS work. Nearly done now. 2019-06-04 22:31:42 +01:00
jean-pierre charras eb1faebf1f Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress. 2019-06-04 21:24:24 +02:00
Jeff Young 0ea75cb4e7 Another attempt to fix build failure. 2019-06-04 16:26:45 +01:00
Jeff Young e3c1235572 Fix link issue with qa_pcbnew test.
I'm not terribly happy about the solution as it's a bit less safe.
But it's what we had before.
2019-06-04 15:09:18 +01:00
Jeff Young 1ea001d497 Go back to event-loop zooming for new frames.
The immediate mode appears to have made things worse not better.
2019-06-04 13:56:54 +01:00
Jeff Young 4e11dcfa31 Better error reporting for board edge collisions. 2019-06-04 13:56:54 +01:00
Jeff Young fbfbb64387 A bit of cleanup of stale DRC code. 2019-06-04 13:56:54 +01:00
Jeff Young ea3c29e3ec Now that we allow multiple 3DViewers, we need to make sure we have the right one.
Note that FindWindow() searches children, whereas FindWindowByName() searches
all windows.
2019-06-04 13:56:54 +01:00
jean-pierre charras 34ccd0f004 Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress. 2019-06-04 09:39:17 +02:00
Jeff Young 1bf04d1722 More ACTIONs work. 2019-06-04 00:51:16 +01:00
Jeff Young 584ed9e204 Add files accidentally left out of last commit. 2019-06-04 00:51:16 +01:00
Jeff Young 59a01789ff Show board info in status bar when seleciton isn't a single object.
Fixes: lp:1831402
* https://bugs.launchpad.net/kicad/+bug/1831402
2019-06-03 21:52:59 +01:00
Jeff Young 3912c7407f Move global commands to ACTIONs.
Also fixes a crash bug opening Edit Tracks and Vias dialog.
2019-06-03 21:08:30 +01:00
Jeff Young d7574db805 Fix regression in dialog-avoidance when focusing on a location. 2019-06-03 21:08:30 +01:00
Jeff Young 568c8c336b Move DRC control to a tool; move assorted commands to ACTIONS. 2019-06-03 21:08:30 +01:00
Jeff Young 9f1e2e34b7 Move some dupicated tools to common tools. 2019-06-03 21:08:30 +01:00
Jeff Young e517199794 Move ConfigurePaths and LibTable management to common ACTIONs. 2019-06-03 21:08:30 +01:00
jean-pierre charras be54f357eb Better tooltip, more easy to translate 2019-06-03 18:27:17 +02:00
Seth Hillbrand 95ab0b1813 pcbnew: Hide dynamic ratsnest after canceling edit
The dynamic ratsnest is shown while moving items but this needs to be
hidden after cancelling.  Previously this was handled by the
SelectionClear event but we've changed this to (correctly) keep the
previous selection when canceling.

Fixes: lp:1831350
* https://bugs.launchpad.net/kicad/+bug/1831350
2019-06-02 20:25:02 -07:00
Seth Hillbrand 1f30d0c803 pcbnew: remove the last dlist components from pcbnew 2019-06-02 20:06:11 -07:00
Seth Hillbrand 99756efea5 Use GetFirstModule() for call that can be NULL 2019-06-02 20:06:11 -07:00
Ian McInerney cbea5149cb pcbnew: Cleanup context menu ordering 2019-06-02 21:10:56 +01:00
Jeff Young da4fe27447 More ACTIONS work. 2019-06-02 21:10:56 +01:00
Jeff Young 33773bad4d Yet more command conversions to ACTIONs. 2019-06-02 21:10:56 +01:00
Jeff Young 6ac273264d Move Show3DViewer to common action. 2019-06-02 16:21:44 +01:00
Ian McInerney 208a8553a5 pcbnew: Add context menu to measure tool
Fixes: lp:1831063
* https://bugs.launchpad.net/kicad/+bug/1831063
2019-06-02 07:55:29 -07:00
Seth Hillbrand 63fb408478 pcbnew: Don't modify the board lists outside of class
We should not be updating the board lists without using the class_board
methods.

Fixes: lp:1831370
* https://bugs.launchpad.net/kicad/+bug/1831370
2019-06-02 07:30:17 -07:00
jean-pierre charras 17b18637f8 Fix a compil issue on msys2: %zu format does not exist on msys2 2019-06-02 14:37:37 +02:00
Jeff Young 45a9544726 Instantate a default menu from no selection when menu is first built.
This might resolve some of the GTK menu anomalies.
2019-06-02 12:58:08 +01:00
jean-pierre charras 072fc4f8cb DIALOG_COPPER_ZONE: minor cosmetic change. 2019-06-02 11:50:46 +02:00
qu1ck 41a9546b3d Pcbnew: fix crash in netlist updater 2019-06-01 21:02:16 -07:00
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand b244a940ef pcbnew: Fix crash in modedit saving 2019-06-01 19:44:29 -07:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Jon Evans f49779465e Fix broken build in array_creator 2019-06-01 16:30:58 -04:00
Seth Hillbrand 3fb8963536 pcbnew: Cleanup tracks and vias rework
Fixes a few commit issues based on the std:: rework.  Add an option to
delete tracks fully in pads and makes merge tracks smarter

Fixes: lp:1787190
* https://bugs.launchpad.net/kicad/+bug/1787190
2019-06-01 09:53:23 -07:00
Seth Hillbrand 888c01d11b pcbnew: Move tracks to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand 961b22d603 pcbnew: Changing drawings from dlist to std::deque 2019-06-01 09:51:57 -07:00
Jeff Young 296ec66796 Cosmetic cleanup in preference panels. 2019-06-01 16:29:12 +01:00
Jeff Young 74e10791ff Fix some Mac-specific issues with the Preferences... menu item. 2019-06-01 16:29:12 +01:00
Jeff Young f67df4bf11 Collapse ARRAY_CREATOR into single class now that legacy instance is gone.
Also removes AllowLegacyCanvas ADVANCED_CONFIG option.
2019-06-01 16:29:12 +01:00
Jeff Young c1298570cb Remove legacy routing options. 2019-06-01 16:29:12 +01:00
Jeff Young 69e60d3982 Make sure grid settings get set in new canvas when switching. 2019-06-01 01:57:24 +01:00
Jeff Young 7553cc2651 Clean up some dangling legacy odds and ends. 2019-06-01 01:17:46 +01:00
Jeff Young ed9153a786 Fix assert launching PCBNew. 2019-06-01 00:06:25 +01:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jeff Young 03bab2f4a9 Remove some more legacy drawing stuff. 2019-05-31 21:54:22 +01:00
Jeff Young d2daab808c Remove some legacy cursor handling stuff. 2019-05-31 21:54:22 +01:00
Jeff Young edc8438ef0 Start the process of removing the legacy draw panel. 2019-05-31 21:54:21 +01:00
jean-pierre charras 30ad8e9369 Pcbnew, file menu: fix missing initialization of Append Board menuitem 2019-05-31 18:28:31 +02:00
Jon Evans d0926cce58 PcbNew: prevent crash in point editor if selection gets invalidated 2019-05-29 21:27:59 -04:00
Seth Hillbrand eb0fc7bae2 Re-connect switch canvas on startup 2019-05-29 15:29:36 -07:00
Seth Hillbrand 218bea9ace pcbnew: Fix crash in find dialog
Tool manager is not exposed to the dialogs, we need to reference it
through the parent frame.

Fixes: lp:1830942
* https://bugs.launchpad.net/kicad/+bug/1830942
2019-05-29 15:05:38 -07:00
jean-pierre charras 48899a4c96 Fix incorrect tooltip. 2019-05-29 21:33:05 +02:00
Seth Hillbrand e7e20b85b5 Don't change the board without user action
Grid and ratsnest visibility are stored in the board file and should not
be changed without the user explicitly modifying them.

In the future, we'll move these settings out of the board file but we
shouldn't cause extra file-churn for flipped bits.

Fixes: lp:1828285
* https://bugs.launchpad.net/kicad/+bug/1828285
2019-05-29 11:25:44 -07:00
Jon Evans 4d8be7b2bb PcbNew: ensure Bezier points are updated before plotting 2019-05-29 00:17:34 -04:00
Jon Evans adfc4d2485 PcbNew: fix Bezier curves not having bounding boxes at startup 2019-05-29 00:17:34 -04:00
Seth Hillbrand cdaba24f0d pcbnew: Remove some legacy code
The menu IDs were used for disambiguation in legacy canvas.
2019-05-28 20:33:17 -07:00
Seth Hillbrand 453eb9c3eb pcbnew: Reconnect Grid settings dialog
Connects using the new common grid settings ID
2019-05-28 20:32:40 -07:00
Jeff Young 1e9da7f57b Remove CurItem() architecture and legacy routers and drawing code. 2019-05-29 00:26:30 +01:00
Jeff Young 9d29e94cb5 Remove some more legacy code. 2019-05-29 00:26:29 +01:00
Jeff Young 0260b32125 Push resetLocalCoords down into COMMON_TOOLS.
Fixes: lp:1830693
* https://bugs.launchpad.net/kicad/+bug/1830693
2019-05-29 00:26:29 +01:00
Jeff Young a27e4246e0 Move some more menu commands to ACTIONs. 2019-05-29 00:26:29 +01:00
Jeff Young c0909611d3 Remove a bunch more legacy editing code. 2019-05-29 00:26:29 +01:00
Seth Hillbrand f59a2410fa pcbnew: Check netlist settings in proper spot
We have _two_ settings that independently control whether the netlist is
updated by timestamp.  One in the NETLIST object and one in the
NETLIST_UPDATER object.  It looks like we are phasing one out but the
commit was not complete.

Fixes: lp:1828754
* https://bugs.launchpad.net/kicad/+bug/1828754
2019-05-28 14:21:25 -07:00
Seth Hillbrand 10b0b18d80 netlist: Update via netnames
Vias may need to have their netnames updated because floating vias do
not get a connectivity push.

Fixes: lp:1830102
* https://bugs.launchpad.net/kicad/+bug/1830102
2019-05-28 12:14:42 -07:00
Michael Kavanagh 27d097a78c Stop PNS router settings from being overwritten when switching modes
Fixes: lp:1824967
* https://bugs.launchpad.net/kicad/+bug/1824967
2019-05-27 16:10:00 -07:00
Jeff Young 50d2aaa97c Fix copy/paste typos in undo/redo. 2019-05-27 22:17:22 +01:00
Jeff Young ce4c4c9409 Fix crash in PCBNew undo from uninitialized variable. 2019-05-27 18:58:36 +01:00
Jeff Young 718ad77891 Fix a bug introduced when UseGalCanvas() no longer switches.
We still need to setup the viewport the first time.
Also removes some more legacy editing code.
2019-05-27 18:47:20 +01:00
Jeff Young 9d9745b555 Remove more legacy editing code. 2019-05-27 18:47:20 +01:00
Jon Evans 3625668ff5 PcbNew: Fix ordering of fab and courtyard layers
Fixes: lp:1829511
* https://bugs.launchpad.net/kicad/+bug/1829511

(cherry picked from commit eb4aded5d6)
2019-05-27 13:06:26 -04:00
Jon Evans cfe588a853 Prevent unbalanced PTH pad labels from being hidden by drills
Fixes: lp:1829067
* https://bugs.launchpad.net/kicad/+bug/1829067

(cherry picked from commit 5230f45658)
2019-05-27 13:06:26 -04:00
Jeff Young d24a2afaca Fix duplicate to work like paste to keep pins from getting duplicated.
Also fixes the post-duplicate move to start at the cursor pos.
Also fixes the fact that duplicate wasn't getting its hotkey.

Fixes: lp:1830596
* https://bugs.launchpad.net/kicad/+bug/1830596
2019-05-27 11:58:56 +01:00
Jeff Young e9e28b9aac Retire legacy block architecture. 2019-05-27 11:58:56 +01:00
Jeff Young 2502bce987 Move quit back to wxIDs. wxWidgets like to muck around with the location on OSX. 2019-05-27 11:58:55 +01:00
Jeff Young 6936effaa7 Implement undo for Page Settings in PlEditor, Eeschema and PCBNew.
Fixes: lp:1820059
* https://bugs.launchpad.net/kicad/+bug/1820059
2019-05-27 11:58:55 +01:00
Jeff Young bdd44ce88c Use consistent PageLayout data structure names. 2019-05-27 11:55:58 +01:00
Jon Evans 638ac3838c PcbNew: Fix layer alpha overrides being overwritten by color changes
Fixes: lp:1827518
* https://bugs.launchpad.net/kicad/+bug/1827518

(cherry picked from commit cb3edf2607)
2019-05-26 20:20:53 -04:00
Jon Evans e156e4509c Report actual intersection position for crossing tracks
Fixes: lp:1825588
* https://bugs.launchpad.net/kicad/+bug/1825588

(cherry picked from commit f101934909)
2019-05-26 13:03:23 -04:00
Jon Evans 549b76739e Exclude invisible items from view bounding box for zoom-to-fit
Fixes: lp:1116457
* https://bugs.launchpad.net/kicad/+bug/1116457

(cherry picked from commit ede2575018)
2019-05-26 13:03:23 -04:00
jean-pierre charras 568d4e2b19 Avoid including id.h in a lot of files that do not use it. 2019-05-26 08:14:25 +02:00
Seth Hillbrand 6bcf1839b7 pcbnew: Add arc approximation setting to board
This places the arc approximation setting in the kicad_pcb file and uses
it for all parts of the board rendering where arcs are converted to
segments.  This allows the user to customize their speed vs. accuracy
tradeoff.  The default setting of maximum error of 0.005mm is acceptable
for small boards on moderate systems.
2019-05-24 21:21:06 -07:00
Seth Hillbrand 0a668ee550 pcbnew: Remove segment count from board file
This removes the setting for number of segments per circle from the zone
definition.  All segment counts are handled by absolute error allowed.
2019-05-24 21:13:53 -07:00
Jon Evans 52a9e68093 Store items changed by connectivity algorithm in undo list
Fixes: lp:1828442
* https://bugs.launchpad.net/kicad/+bug/1828442

(cherry picked from commit fb80ee5a0e)
2019-05-24 21:56:37 -04:00
Michael Kavanagh 741140e4a4 Fix footprint marked as modified when layer visibility changed
Fixes: lp:1830330
* https://bugs.launchpad.net/kicad/+bug/1830330
2019-05-24 16:13:22 -04:00
Seth Hillbrand 7058b79bf1 pcbnew: Fix assert in debug build
Previously we saved the visibility as a mask of 32bits and the check was
needed.  These are now saved as per-layer setting, so the assert is
extra.
2019-05-24 12:39:01 -07:00
Jeff Young 85f984ccd9 Add point-editor activation for immediate-mode drawing. 2019-05-24 19:49:09 +01:00
Jeff Young 323bb0f8e1 Moving PageLayout editor to GAL canvas and modern toolset. 2019-05-24 19:49:09 +01:00
Wayne Stambaugh 816f6db310 Pcbnew: Python scripting support clean up.
Always check the return value of PyRun_SimpleString() for errors when a
Python script is run and show an error message rather than fail silently.

Enable Python interpreter I/O redirection in debug builds so that script
string errors will be shown when PyRun_SimpleString() is called.

Do not call PyErr_Print() after a PyRun_SimpleString() call failure.  It
doesn't do anything useful.

Do not call Py_Finalize() after a PyRun_SimpleString() call failure.  It
seems to cause Pcbnew to crash.
2019-05-24 07:32:38 -04:00
jean-pierre charras ce93934f08 Pcbnew, ZONE_FILLER: fix incorrect test to remove filled areas outside the board edge cuts.
This incorrect test was only for zones with no net.
2019-05-23 20:22:03 +02:00
Ian McInerney 0daf14f9c3 pcbnew: Fixed listing of 3D libraries in the github wizard
Fixes: lp:1830137
* https://bugs.launchpad.net/kicad/+bug/1830137
2019-05-23 09:50:05 -07:00
jean-pierre charras 75cea18f07 Pcbnew, toolbars: fix incorrect icons 2019-05-23 11:07:55 +02:00
Seth Hillbrand ac435ecd68 Moving further arc approximations down
This corrects an issue with fill segments-per-circle and moves the error
to segmetns calculation down in a number of functions to expose the
single value for approximation
2019-05-22 14:35:17 -07:00
Jeff Young 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +01:00
Michael Kavanagh 07b82d19e3 Allow setting cursor and aux items colour in footprint editor
Fixes: lp:1829850
* https://bugs.launchpad.net/kicad/+bug/1829850
2019-05-22 15:46:15 -04:00
jean-pierre charras 459a972116 Remove unused vars. 2019-05-22 08:27:48 +02:00
Seth Hillbrand 6f7475dcd3 pcbnew: Prevent no-connects from driving clusters
The no-connect net (0) should never drive the net of a cluster.
Otherwise, tracks connecting between unconnected pads and connected pads
can acquire net 0 incorrectly.
2019-05-21 19:29:29 -07:00
Seth Hillbrand 1181b9f9b4 EAGLE: Correct pcb text orientation
Fixes: lp:1829711
* https://bugs.launchpad.net/kicad/+bug/1829711
2019-05-21 14:04:03 -07:00
Seth Hillbrand a62a89eac3 EAGLE: Prevent numeric-only component references
KiCad does not allow references to be numeric only.  This prefixes such
references with "UNK" to note that the reference designator type is
unknown.
2019-05-21 13:49:18 -07:00
Seth Hillbrand 490c805319 Allow squared inflation and inflate Eagle Zones
Sometimes we want to inflate a polygon without adding rounded edges.
This add the option using the jtMiter setting.

This is used in the Eagle parser to expand the Eagle zones for KiCad.
Eagle Zones are drawn on the polygon edge, so they extend out from the
outline.  KiCad zones are drawn inside the polygon.  We need to both
increase the zone size and decrease the minimum pen width to account for
this.

Fixes: lp:1817312
* https://bugs.launchpad.net/kicad/+bug/1817312
2019-05-21 13:49:18 -07:00
Seth Hillbrand bf0a466642 pcbnew: Allow adding SHAPE_LINE_CHAIN to zones 2019-05-21 13:49:18 -07:00
Seth Hillbrand c80e3e0ffc eagle: Use width on imported lines if available
If not, use the current board design settings for line thickness based
on the board layer.
2019-05-21 13:49:17 -07:00
jean-pierre charras d3dc7ade8a menubar_pcb_editor.cpp: minor code refactor. 2019-05-21 14:24:08 +02:00
jean-pierre charras 6e6063b258 Pcbnew: release the lock file if a board was loaded, and when clearing the board currently edited.
When the board is cleared, the previous loaded board is no longer in edit.
2019-05-20 18:36:24 +02:00
Seth Hillbrand dbc40096db eagle: Use the "first" tag instead of pin num
Eagle parsing allows pin 1 to be different from the other pins in the
package but this is set by a tag marking the pin as "first" rather than
the actual number of the pin.

Fixes: lp:1829251
* https://bugs.launchpad.net/kicad/+bug/1829251
2019-05-20 06:02:15 -07:00
jean-pierre charras 4ac20d7ab1 menubar_pcb_editor.cpp: add missing icons. 2019-05-20 10:05:33 +02:00
jean-pierre charras 5137b54bd8 Pcbnew: fix a (minor) lock file issue: the lock was too early set.
If the file was (for some reason) not actually loaded, it was locked.
Now, the file is locked only if it is actually loaded.
2019-05-19 11:03:44 +02:00
Jeff Young 7d9a0b06e0 Push help menu down into EDA_BASE_FRAME. 2019-05-18 13:14:08 +01:00
Jeff Young b90b454ada Remove legacy block operations. 2019-05-18 00:21:49 +01:00
Jeff Young 1a3d0492f5 Push polar coords down into COMMON_TOOLS. 2019-05-18 00:21:49 +01:00
Seth Hillbrand f32c95229e pcbnew: Check for valid data before deleting
We need to check for valid rows and iterators before removing a 3d model

Fixes: lp:1829337
* https://bugs.launchpad.net/kicad/+bug/1829337
2019-05-17 09:34:27 -07:00
Wayne Stambaugh 97166a72f5 Pcbnew: fix bug in Eagle footprint plugin.
Some how a board object was required to fetch the line width when a
footprint is being parsed.  The problem is that there is no board
defined when loading Eagle footprint libraries so there was a nullptr
segfault as a result.  When there is no board defined, use the default
KiCad layer line widths.

Fixes lp:1829243

https://bugs.launchpad.net/kicad/+bug/1829243
2019-05-17 08:38:03 -04:00
Jeff Young 97445f1714 Don't go into interactive move when position was set in creation dialog.
Fixes: lp:1822569
* https://bugs.launchpad.net/kicad/+bug/1822569
2019-05-16 19:57:06 +01:00
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Seth Hillbrand ddc6079ceb Move remaining hard-coded segment counts
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
2019-05-16 08:49:55 -07:00
John Beard 0eb8f92c69 Pcbnew: add a step field to the array tool
This is useful, for example, when arraying only one side
of a connector.

Fixes: lp:1809580
* https://bugs.launchpad.net/kicad/+bug/1809580
2019-05-16 11:20:52 +01:00
John Beard eb1e67583f Pcbnew: tidy up array options access/allocation
Use unique_ptrs for ownership transfer.

Pass the target object to the constructor rather than
creating an internal verison.
2019-05-16 11:20:52 +01:00
John Beard 6ade8c25e1 Pcbnew: allow alphabetic numbering in n circular grids
Add controls to the dialog and wire up to the axis numbering
scheme, same as the grid axes.

Fixes: lp:1814923
* https://bugs.launchpad.net/kicad/+bug/1814923
2019-05-16 11:20:52 +01:00
John Beard f47e2b54f8 Decouple the array tool list box from the numbering enum
This prevents the dialog being sensitive to the exact ordering
of the enum, and instead defines an explicit mapping between
the axis numbering type, the label string and the position in the
list box control.
2019-05-16 11:20:52 +01:00
John Beard 2c1b970027 Arrays: isolate axis code in a new class
Remove the axis numbering code from ARRAY_OPTIONS
and place in a new class, ARRAY_AXIS. This keeps
the logic for the array item numbering separate from
the logic for the array item geometry.

This simplifies the logic in the ARRAY_OPTIONS class, which
no longer has to deal with the numbering of each axis.
2019-05-16 11:20:52 +01:00
Seth Hillbrand 44e111b37e pcbnew: Add remaining Eagle pad types
This adds octagon and offset pad types to the Eagle pcb importer.

Fixes: lp:1814498
* https://bugs.launchpad.net/kicad/+bug/1814498
2019-05-15 11:12:16 -07:00
Seth Hillbrand b3b5ffe799 pcbnew: fixup small type issue 2019-05-15 09:53:42 -07:00
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +01:00
Jeff Young f9e4ee1fc9 CONTEXT_MENU -> ACTION_MENU. (Now used for menu-bar menus too.) 2019-05-15 17:50:52 +01:00
Jeff Young eb3a201d39 Move some PCBNew and GerbView actions to their COMMON equivalents. 2019-05-15 17:50:52 +01:00
Wayne Stambaugh a32bb4e9a5 Pcbnew: fix crash when deleting DRC errors from DRC dialog.
Fixes lp:1828726

https://bugs.launchpad.net/kicad/+bug/1828726
2019-05-14 18:07:34 -04:00
Wayne Stambaugh 6f27ef7f66 Fix library table editor dialog environment variable grid column names.
Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1828459
2019-05-14 07:57:58 -04:00
Jeff Young ef5c69167a Start moving some LibEdit and SchEdit menubar menus to actions.
Also includes a bunch of bug fixes that got intermingled.

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

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

Fixes: lp:1828793
* https://bugs.launchpad.net/kicad/+bug/1828793
2019-05-13 21:44:29 +01:00
Wayne Stambaugh 3c4f8c1bf7 Fix frame name capitalization in all about dialogs.
This is a stop gap fix.  It should be possible to use the wxFrame title
string for this but some of the frame windows have appropriated the title
string for configuration file naming purposes which is less than ideal.

Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1825977
2019-05-13 15:40:44 -04:00
jean-pierre charras 92ccb766ab Python fp wizards: fix a few issues in qrcode_footprint_wizard.py
Fixes: lp:1828744
https://bugs.launchpad.net/kicad/+bug/1828744
2019-05-13 13:04:57 +02:00
jean-pierre charras 51bfec8ef9 Footprint viewer: fix a crash when clicking the "Insert footprint in board" tool when no footprint selected 2019-05-12 17:07:23 +02:00
Jeff Young f602ccd814 Insert EE_TOOL_BASE under SchEdit and LibEdit tools, and fix errant rename scope which clobbered PCBNew's PICKER_TOOL. 2019-05-12 13:47:08 +01:00
Jeff Young 7995b5cc3c Restore selection on abort and undo/redo.
Also includes a related bug fix to not create an undo record for
the initial schematic cleanup.

Fixes: lp:1825975
* https://bugs.launchpad.net/kicad/+bug/1825975
2019-05-11 15:38:49 +01:00
Martin McNamara 7200f4d7b5 PCBnew: Fixes crosshair issue with "Place Text" and "Add Dimension".
When using "Place Text" the crosshair was freezing if cancelled before
placing text.

After the crosshair freezes, the next uses of the "Place Text" or
"Add Dimension" caused the crosshair to jump to the screen location
where the previously the crosshair was frozen.

Cancelling the "Add Dimension" caused the crosshair to jump to the
screen location where the crosshair was when cancelled on the next use
of the "Place Text" or "Add Dimension".

Fixes: lp:1822578
* https://bugs.launchpad.net/kicad/+bug/1822578
2019-05-11 06:44:40 -07:00
Jeff Young b83dac68d0 Fix drag-select hit-testing of LibEdit items. 2019-05-10 23:24:27 +01:00
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young ea0941cab3 Implement modern tools for LibEdit. 2019-05-10 16:11:57 +01:00
Michael Kavanagh a3483f44d2 Add Save As hotkey to footprint editor
Fixes: lp:1828481
* https://bugs.launchpad.net/kicad/+bug/1828481
2019-05-10 15:12:39 +01:00
jean-pierre charras 5f4a6e33a0 Custom pads: minor fix in legacy mode related to commit a155289f. 2019-05-09 16:45:25 +02:00
jean-pierre charras a155289f70 Custom pads: fix incorrect shape of masks when the shape is a polygon with holes and the mask margin is < 0.
This is mainly the solder paste layer that shows this issue.
This is due to the fact SHAPE_POLY_SET::Inflate does not work fine with polygons with linked holes.
SHAPE_POLY_SET::InflateWithLinkedHoles it added to fix this issue.

Fixes: lp:1828287
https://bugs.launchpad.net/kicad/+bug/1828287
2019-05-09 16:23:18 +02:00
Seth Hillbrand f7c042a357 pcbnew: Allow curves in custom pads
Updates custom pad functions to permit adding arbitrary curves to the
primitives
2019-05-08 15:54:26 -07:00
Seth Hillbrand b56ca3f09c Staging wxFormBuilder change for next commit 2019-05-08 15:54:26 -07:00
John Beard 2c71d550ab Icons: Add 'import vector' icon
This distinguishes vector graphics import from other imports
(when icons in menus are enabled).

Previously, it was a generic import icon.
2019-05-07 12:08:48 +01:00
Jeff Young cd2bd23c37 Fix a bunch of issues with hotkeys, IDs and event processing.
Fixes: lp:1827894
* https://bugs.launchpad.net/kicad/+bug/1827894
2019-05-06 21:42:00 +01:00
Jeff Young a12d769074 Code clarification and commenting.
Also renames toolbar files to reduce confusion with the modern toolset
tool files.
2019-05-06 15:31:23 +01:00
Jeff Young fd546da640 Homogenize hit testing and selection return types.
Prep work for sharing SCH_SELECTION_TOOL with LibEdit.
2019-05-05 17:14:30 +01:00
Jeff Young ed0e6af66d Move to direct tool registration.
It was confusing that the primary frames registered their tools
differently than the other frames.  In addition, since the other
frames also added their own tools, foo_actions::RegisterAllTools()
didn't really register all tool but rather those used by the
principal frame (PCB_EDIT_FRAME, SCH_EDIT_FRAME, etc.)
2019-05-05 17:14:30 +01:00
Jeff Young f81007f74b Some clean-up and moving message panel update to selection event. 2019-05-05 17:12:59 +01:00
Jeff Young 902be18a04 More modern toolset context menu work.
Text/label type changes and bus entry shape changes.  And some
context menu bug fixing.
2019-05-05 17:12:59 +01:00
Jeff Young b526461a8e Fix colliding hotkeys issue.
All grid commands need to be shared now as they're implemented
by a common tool.
2019-05-05 17:12:59 +01:00
Jeff Young 42383ae871 Build out some of the modern toolkit context menus. 2019-05-05 17:12:59 +01:00
Jeff Young 4e0208dfba Move duplicate item and block to modern toolset. 2019-05-05 17:12:59 +01:00
Jon Evans 722edda83c Make it easier to select footprints that overlap pads on opposite side 2019-05-04 22:59:56 -04:00
Jon Evans e0ada1379f Allow clearing PcbNew highlight through cross-probing
Fixes: lp:1821486
* https://bugs.launchpad.net/kicad/+bug/1821486
2019-05-04 16:18:51 -04:00
Andrei Pozolotin 3e4913adce Pcbnew export/import scripting functions.
Discussion can be found at
https://forum.kicad.info/t/pcbnew-export-import-scripting-functions/16343

Fixes lp:1824668

https://bugs.launchpad.net/kicad/+bug/1824668
2019-05-04 09:55:25 -04:00
Ian McInerney 9e6e9d0910 Replace remaining Boost mutexs with std::mutex
CHANGED: Replaced all MUTEX types with std::mutex
         Replaced all MUTLOCK types with std::lock_guard
2019-05-03 17:13:20 -07:00
Michael Kavanagh 2a09664ebc Clean up import and export menus
Fixes: lp:1822907
* https://bugs.launchpad.net/kicad/+bug/1822907
2019-05-02 12:25:59 -04:00
jean-pierre charras 4e5a94efb7 Pcbnew, non copper zones: fix 2 issues.
1 - For debug purposes, the code to fill non copper zones was disabled and the copper zone code was uses instead.
It creates issues with pad clearance areas, because a non copper zone has no clearance areas.
2 - The non copper zone dialog had no option to set the outline smoothing option.
Unfortunately, this parameter was inherited from the last edited copper zone.
And therefore the non copper zone can have a non wanted outline smoothing option.
This option is now added to the dialog.

Fixes: lp:1826952
https://bugs.launchpad.net/kicad/+bug/1826952
2019-04-30 13:16:29 +02:00
John Beard 42d20cbd96 Pcbnew: use same null check as eeschema for recently used
When Pcbnew's add footprint browser is run up, it constructs
the recently used list without checking for nulls.

Although the DoAddLibrary call does internally check for
null, it's easier to filter these out before placing into
the vector in the first place.

The same logic in the symbol tree is already handled in the
same way.
2019-04-29 16:52:39 +01:00
jean-pierre charras 0d7708430d Pcbnew: fix in board editor crash when try to load a footprint from Add footprint tool if the latest loaded footprint was deleted.
In this case, the history has a cleared link that created the crash when the dialog tried to select this deleted FootprintEnumerate

Fixes: lp:1826794
https://bugs.launchpad.net/kicad/+bug/1826794
2019-04-29 17:21:51 +02:00
jean-pierre charras e808c7f956 Remove a message used in a previous debug session. 2019-04-27 17:07:31 +02:00
Michael Kavanagh df228a3c10 Pcbnew: Fix missing UI elements for curved ratsnest function
Fixes: lp:1826446
* https://bugs.launchpad.net/kicad/+bug/1826446
2019-04-27 15:11:41 +02:00
Jeff Young 69cdb4a76c Make Import Settings button label more specific.
Fixes: lp:1826477
* https://bugs.launchpad.net/kicad/+bug/1826477
2019-04-26 15:02:17 +01:00
Jeff Young a967adbf26 Don't toggle selection twice when trying to select.
Also fixes issues with trying to use a CONTEXT_MENU as a wxMenu.
2019-04-23 14:19:55 +01:00
Tomasz Włostowski 9e00f48efc router: copy m_maxClearance when cloning/branching PNS::NODEs
Fixes: lp:1813328
* https://bugs.launchpad.net/kicad/+bug/1813328
2019-04-23 12:00:54 +02:00
Jeff Young 1a007c3e4b Implement SCH_SELECTION_TOOL (but still with legacy semantics). 2019-04-22 22:08:18 +01:00
Jeff Young e885d739a4 Simiplify VECTOR2 -> wxPoint conversions.
There has always been an operator specified, but it's explicit so
most folks don't notice it.
2019-04-22 22:08:18 +01:00
Jeff Young a461eae8b9 Fix 100s of usages of GetFlags() which conflated != 0 with being edited.
While this was true long ago, many flags have been added since which
have nothing to do with editing (HIGHLIGHTED, BEGIN_ONPAD, etc.)
2019-04-22 09:58:06 +01:00
jean-pierre charras 223e24f423 export_hyperlynx.cpp: better message in a warning. 2019-04-21 12:03:00 +02:00
Simon Richter 2b3b26b502 Remove two extraneous spaces from a tooltip 2019-04-20 22:04:22 +01:00
John Beard 02fca8e0df Pcbnew: fix -Wmaybe-uninitialized in legacy PCB plugin
In the failure case, the "makeType" is uninitialised. In a non-debug
build, wxFAIL will compile out and the uninitialised behaviour will
happen silently. In a debug build, it'll assert, and then do the
uninitialised behaviour anyway.

Continue explicity to avoid this.
2019-04-18 15:28:33 +01:00
Jon Evans 7030c7d948 Don't show added nets multiple times during dry run update 2019-04-17 22:57:20 -04:00
Jon Evans 105825c058 Refactor Import Netlist to use the same codepath as Update PCB 2019-04-17 22:57:19 -04:00
jean-pierre charras c1c5afad67 fix in qfn_wizard.py 2019-04-17 18:02:22 +02:00
jean-pierre charras 68e6308066 Fix qfn_wizard.py wizard.
(a parameter controlling pad position offset was also used in pad size, that creating incorrect pad size).
2019-04-17 13:46:35 +02:00
jean-pierre charras acf6c0ae2c BOARD_NETLIST_UPDATER: fix 2 serious issues in dry run (memory leak and incorrect single pad nets deletion)
Single pad nets deletion in dry run was incorrect when a new footprint was added, because in dry run it is not actually added,
and the single pad nets deletion does not see these new pads, and can (incorrectly) delete some nets.
2019-04-17 13:39:55 +02:00
Jeff Young ecfa05e2ca Allow adding symbols/footprints from editors and browsers.
This was always possible from modal browsers and from the footprint
editor, but it's now also possible from non-modal browsers and the
symbol editor.

Fixes: lp:920380
* https://bugs.launchpad.net/kicad/+bug/920380
2019-04-16 16:20:51 +01:00
Jeff Young 32c86a4ca4 Move place symbol to modern toolset. 2019-04-16 16:20:51 +01:00
jean-pierre charras a07caac85a Pcbnew, Netlist inspector: fixes and enhancements. 2019-04-15 10:10:51 +02:00
Jeff Young ef3f773f84 Code formatting cleanup. 2019-04-14 23:13:46 +01:00
Jeff Young d5f136cd7e Polish export-related changes to List Nets Dialog. 2019-04-14 22:29:52 +01:00
Andrey Fedorushkov dacab4abe0 pcbnew: add tracks length and export netlist to file in netlist inspector 2019-04-14 20:39:29 +01:00
Jon Evans 1d2db311b2 Set new module parent early enough to allow pad clearance to be shown
Fixes: lp:1824587
* https://bugs.launchpad.net/kicad/+bug/1824587
2019-04-14 14:25:38 -04:00
Jeff Young b63fab92cf Move Eeschema net highlighting to modern toolset. 2019-04-14 12:10:48 +01:00
Jeff Young 94a948fdd1 Move grid selection for both Eeschema and Pcbnew to COMMON_TOOLS. 2019-04-13 18:43:35 +01:00
Jeff Young fc7f5630c7 Move eeschema zoom operations to modern toolset. 2019-04-13 18:43:26 +01:00
Jon Evans dec5d80180 Veto mouse warping from DRC dialog
Fixes: lp:1824630
* https://bugs.launchpad.net/kicad/+bug/1824630
2019-04-13 11:23:57 -04:00
jean-pierre charras 2529346940 Some fixes for I18N. Mainly do not translate debug messages or strings giving only a print format (like "%d"). 2019-04-13 10:12:24 +02:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
John Beard ab2281d26f GAL opts: move config reading into GAL_DISPLAY_OPTIONS
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.

This means that the configs are loaded consistently, which fixes
the symbol-chooser preview window, which previously didn't use the
same config routine as other GAL canvases.

Future work could move these functions to free functions that
act on the public interface of GAL_DISPLAY_OPTIONS to avoid
GAL_DISPLAY_OPTIONS having to know about wxConfig and wxWindow.

Fixes: lp:1824524
* https://bugs.launchpad.net/kicad/+bug/1824524
2019-04-12 16:08:11 +01:00
Jon Evans 3d9b5daf9c Improve selection behavior of DRC markers in DRC dialog list
Fixes: lp:1813373
* https://bugs.launchpad.net/kicad/+bug/1813373
2019-04-12 11:01:38 -04:00
jean-pierre charras c162ff9076 Curved airwires: set the default to straight lines (i.e. the legacy behavior)
Add also missing comments.
2019-04-12 14:17:55 +02:00
Jon Evans 69a66fc826 Fix polarity of curved ratlines button 2019-04-11 21:49:45 -04:00
Jeff Young 0021ecf51e Don't double-escape netnames.
Netnames in wxChoice or wxListBox are already in internal format
and don't need escaping again.

Fixes: lp:1823863
* https://bugs.launchpad.net/kicad/+bug/1823863
2019-04-12 00:28:58 +01:00
Jeff Young 76e0622222 Redraw and Position Relative can't share the same hotkey. 2019-04-12 00:28:58 +01:00
Jeff Young 8ae0579436 Reorder global edit dialogs for better comprehension.
Fixes: lp:1818087
* https://bugs.launchpad.net/kicad/+bug/1818087
2019-04-12 00:28:58 +01:00
MaPePeR e7d32c54b9 pcbnew: Draw Ratsnest with arcs to avoid overlap
Adds a toggle button that allows switching between straight lines and
curves for the ratsnest lines.

Fixes: lp:1766597
* https://bugs.launchpad.net/kicad/+bug/1766597
2019-04-12 00:28:58 +01:00
Jeff Young 3c11b89e4c Hook up refresh buttons to library tree synchronisation.
Fixes: lp:1820057
* https://bugs.launchpad.net/kicad/+bug/1820057
2019-04-11 19:45:10 +01:00
John Beard 17e88d0944 Pcbnew: FOOTPRINT_PREVIEW_PANEL passes reference to local
Previously, the GAL_DISPLAY_OPTIONS object in FOOTPRINT_PREVIEW_PANEL::New
was passed by reference in the ctor, down to EDA_DRAW_PANEL_GAL, which stored
it as a reference. The object in New() then goes out of scope, so the
referencing panel outlives the options.

Fix this by making a copy in a std::unique_ptr of the options, and giving
ownership to the panel.

There is another issue here: when the Pcbnew options are copies, the
OBSERVABLE subscriber list is copied too. This means if the panel called
NotifyChanged() on the options, Pcbnew would get updates, even though a copy
of the options changed. However, the panel doesn't change the options or
notify, so it's OK for now.
2019-04-11 17:01:23 +01:00
jean-pierre charras 0fae86b1ba Pcbnew: suppress incorrect wx alert when opening the plot dialog from File/Plot menu 2019-04-11 17:36:51 +02:00
Jeff Young 2144c6c97d Save a bit of space in the copper zone dialog. 2019-04-10 18:12:14 +01:00
jean-pierre charras aa53b5508e Zone filler: fix missing calculation of filled polygons when fill mode is ZFM::SEGMENTS 2019-04-10 17:49:40 +02:00
Seth Hillbrand 7cf394e34f pcbnew: Handle missing footprint wizards
When we do not have any footprint wizards to display, we cannot select
the grid rows.

Fixes: lp:1823608
* https://bugs.launchpad.net/kicad/+bug/1823608
2019-04-09 11:54:01 -07:00
Wayne Stambaugh f056777e6a Pcbnew: fix Hyperlynx export reporting string formatting. 2019-04-09 13:56:36 -04:00
jean-pierre charras 37ae0bf809 Pcbnew: fix a serious issue in ZONE_FILLER. 2019-04-09 11:38:18 +02:00
jean-pierre charras 0b33df8831 Pcbnew,DIALOG_SELECT_NET_FROM_LIST: fix a crash and the not working net selection.
It was due to changes in code, and related to escaping the '/' in net labels.
2019-04-08 15:36:55 +02:00
John Beard 124dd5e59a 3D viewer: use hi-DPI settings for canvases
The 3D viewer also uses OpenGL, so it also needs to
adjust based on DPI scale factors.

This patch moves the 3D viewer common config code solely
within the 3D viewer, and adds handling of the DPI scale. This
also avoids duplicated logic in PCB_BASE_FRAME::CommonSettingsChanged.

For now, as EDA_3D_VIEWER is not included in the Kiway settings
dispatch, still manually invoke the settings update from
PCB_BASE_FRAME.

The PANEL_3D_PREV gets a similar function to read the config, but
it doesn't have a listener for the update, so it's set just once
at dialog init, just like the existing pan settings.

Fixes: lp:1823681
* https://bugs.launchpad.net/kicad/+bug/1823681
2019-04-08 14:29:15 +01:00
Jeff Young d361e68d0e Condense the DRC dialog a bit.
The messages title doesn't really provide useful info anyway.
2019-04-08 13:26:26 +01:00
Jeff Young a1c162e59f Reimplement footprint checking on top of DRC architecture.
This allows Import Netlist and Update PCB from Schematic to
share the same checking code, and expose it through the DRC
dialog.

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

Fixes: lp:1809293
* https://bugs.launchpad.net/kicad/+bug/1809293
2019-04-08 13:26:17 +01:00
Jeff Young 77f15eeeaf Support synchronous messaging over KIWAY EXPRESS.
This allows us to make the various netlist and pcb update routines
more atomic and less reliant on carefully sequenced asynchronous
messages.

This is also a prelude to adding support for footprint testing
without a netlist.
2019-04-08 13:26:09 +01:00
Jeff Young 52e3a1d7c4 Trim zone fills to board outline.
Fixes: lp:1820306
* https://bugs.launchpad.net/kicad/+bug/1820306
2019-04-08 13:10:29 +01:00
Seth Hillbrand cf63ae7ae2 pcbnew: Show clearance when editing tracks
When requested by display options, we should show the track clearance
when dragging tracks.

Fixes: lp:1818343
* https://bugs.launchpad.net/kicad/+bug/1818343
2019-04-07 21:25:28 -07:00
Seth Hillbrand c8118e3ce4 pcbnew: Allow click+drag of tracks
This behavior existed in 5.0.x but did not properly exit the edit tool
in 5.1.  This removes stops the edit tool when we begin dragging a track
using the interactive router.

Fixes: lp:1820312
* https://bugs.launchpad.net/kicad/+bug/1820312
2019-04-07 20:59:06 -07:00
Tomasz Włostowski e5753b79d4 pcbnew: Hyperlynx Exporter - initial version 2019-04-08 02:56:02 +02:00
Jeff Young a81512ca96 Adjust justified text for rotation.
Fixes: lp:1823090
* https://bugs.launchpad.net/kicad/+bug/1823090
2019-04-07 22:17:59 +01:00
Michael Kavanagh 27e6f5b9e8 Change "Switch track width to previous" default hotkey from Ctrl+W to Shift+W
Tiny improvement in consistency.

Fixes lp:1785842
https://bugs.launchpad.net/kicad/+bug/1785842
2019-04-07 10:50:59 -07:00
Seth Hillbrand a300ae105d pcbnew: Freeze the netclasses dialog on init
Prevents the size events from firing on Mac when we set up the netclass
panel

Fixes: lp:1819426
* https://bugs.launchpad.net/kicad/+bug/1819426
2019-04-07 07:07:55 -07:00
Seth Hillbrand 24bf838392 pcbnew: Allow arc editing via midpoint
This permits changing the radius of the arc by adjusting the center
point of the arc.  The arc end points are fixed in this operation.
2019-04-07 06:50:25 -07:00
Jeff Young 4a9f82109a Uniformly quote strings which may have user content.
Fixes: lp:1655193
* https://bugs.launchpad.net/kicad/+bug/1655193
2019-04-07 00:24:10 +01:00
Jeff Young 684bb62fd8 Escape slashes in labels and netnames.
Also re-allows spaces, as they can already come in through sheet
names.

Fixes: lp:1798621
* https://bugs.launchpad.net/kicad/+bug/1798621
2019-04-07 00:24:10 +01:00
Jeff Young 97063440bb Adjust left- or right-justified text for mirroring. 2019-04-07 00:24:10 +01:00
Jeff Young 1ae47b6069 Implement a copper-to-edge-clearance setting.
For legacy boards, the setting is picked up from the board outline
thickness.  If the board outline has mixed thicknesses, then the
max is used and a warning is displayed.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2019-04-05 22:18:44 +01:00
Wayne Stambaugh b6a0bf1142 Minor drill file dialog improvements. 2019-04-05 16:49:08 -04:00
Wayne Stambaugh dfee7bddd3 Minor footprint position dialog improvements. 2019-04-05 16:15:16 -04:00
Jeff Young 87f303319c Implement a dry run for Cleanup Tracks and Vias.
Uses the DRC architecture to support inspection of the changes to
be made (right click on items, hover over them in the menu to
highlight them on the board).

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

Fixes: lp:1809474
* https://bugs.launchpad.net/kicad/+bug/1809474
2019-04-05 18:52:51 +01:00
Jeff Young e563184eac Add Gerbers to Fabrication Outputs menu.
Fixes: lp:1817124
* https://bugs.launchpad.net/kicad/+bug/1817124
2019-04-05 16:12:45 +01:00
Jeff Young ea43866563 Move legacy netlist read/write to import/export.
Fixes: lp:1610529
* https://bugs.launchpad.net/kicad/+bug/1610529
2019-04-05 16:11:15 +01:00
Jeff Young 2aad4a5e57 Remove dead code from removal of eeschema legacy canvas. 2019-04-05 15:54:31 +01:00
jean-pierre charras 0aa8458d04 DIALOG_PAD_PROPERTIES: Fix incorrect calculation of Round Rect Radius Ratio, when inches are selected.
Fixes: lp:1822720
https://bugs.launchpad.net/kicad/+bug/1822720
2019-04-04 15:40:29 +02:00
jean-pierre charras de4b2dea77 Pcbnew: DIALOG_IMPORT_GFX_BASE: fix a minor wxWidgets alert. 2019-04-04 13:46:09 +02:00
Seth Hillbrand ce254d1061 pcbnew: Allow Missing legacy option
LEGACY is disabled for GTK3, so we may not find the menu item

Fixes: lp:1822877
* https://bugs.launchpad.net/kicad/+bug/1822877
2019-04-03 15:54:54 -07:00
Jon Evans a6a6785316 Fix a wxString reference warning 2019-04-03 16:28:23 -04:00
Jeff Young d8cc2f8280 More cleanup from non-reference return from GetText(). 2019-04-03 19:35:25 +01:00
Jeff Young d90d0780ae Fix some fall-out from the non-reference GetText(). 2019-04-03 19:14:45 +01:00
Jeff Young 77284e82c8 Replace switch-to-non-copper-layer for DIMENSION and POLYGON.
These still aren't handled by DRC.

Fixes: lp:1796500
* https://bugs.launchpad.net/kicad/+bug/1796500
2019-04-03 19:14:45 +01:00
Wayne Stambaugh 75366bce74 Remove debugging code added in commit d2cb0ca7. 2019-04-03 12:19:50 -04:00
Wayne Stambaugh 120ab06db4 Pcbnew: fix DXF import line width bug.
There is a circular dependency between the GRAPHICS_IMPORTER object and
the GRAPHICS_IMPORT_PLUGIN object which makes sharing the settings in
the GRAPHICS_IMPORTER unwieldy.  This fix is a ugly hack that resolves
the issue.  The underlying issue will require some major refactoring.

Fixes lp:1821234

https://bugs.launchpad.net/kicad/+bug/1821234
2019-04-03 11:29:17 -04:00
Wayne Stambaugh d2cb0ca75f Pcbnew: fix import graphics dialog issues.
Improve padding, spacing and alignment of dialog layout.

Fix title capitalization.

Make file dialog wildcard string translatable.

Remove fixed initial dialog size to allow sizers to work their magic.

Replace OK button event handler with TransferDataFromWindow.

Remember last line width units between dialog instances and sessions.

Save configuration file settings in a separate group and remove GfxImport
prefix from the entry names.

Add fencing to dialog header file to prevent nested includes.

Fixes lp:1822568

https://bugs.launchpad.net/kicad/+bug/1822568
2019-04-03 09:57:31 -04:00
Jeff Young 920d9e3d46 Don't switch to non-copper layer when drawing text & graphics.
We now allow these items on copper layers (and do the necessary
DRC, etc.)

Fixes: lp:1796500
* https://bugs.launchpad.net/kicad/+bug/1796500
2019-04-03 10:18:11 +01:00
Jeff Young ca25f352ce Make Footprint Editor save command context-sensitive.
Fixes: lp:1795961
* https://bugs.launchpad.net/kicad/+bug/1795961
2019-04-03 10:18:11 +01:00
Seth Hillbrand 7ee12d674e pcbnew: Clear items before deleting vertex
Reverting changes causes the item to become invalid.  This can cause
issues when we have dangling pointers for the VIEW routines left over.
Until we implement a method of passing the reverted element back up to
the calling routine, we need to remove the selection for each Revert()
call.

Fixes: lp:1821909
* https://bugs.launchpad.net/kicad/+bug/1821909
2019-04-02 13:15:10 -07:00
Michael Kavanagh b0674b8802 Add Ctrl+, hotkey to preferences dialog
Also change interactive router settings from Ctrl+, to Ctrl+Shift+,
2019-04-02 12:57:27 -04:00
Seth Hillbrand 940aef77af pcbnew: Update points before refresh
When removing a point from the polygon, the vertex is removed before it
is tested for validity.  If it fails validation, the edit is reverted
and the point count doesn't change, so the view update only modifies the
existing points.  But the revert may also have changed the shared
pointer to the point array, invalidating the view's copy.

Fixes: lp:1821909
* https://bugs.launchpad.net/kicad/+bug/1821909
2019-04-02 09:55:28 -07:00
Seth Hillbrand 32e82f8d87 Include zone include for zone_settings.cpp 2019-04-02 09:55:28 -07:00
jean-pierre charras abc605fcfa fix a compil warning.
Fix a few comments.
2019-04-02 09:05:42 +02:00
Seth Hillbrand 428e7a900b pcbnew: Prevent aux axis after-image
Grid helper in the router tool is persistent, so remember to turn off
the aux axes after setting.

Fixes: lp:1822577
* https://bugs.launchpad.net/kicad/+bug/1822577
2019-04-01 14:23:46 -07:00
Seth Hillbrand 6f4d1345f3 pcbnew: Handle old stable translated layers
This inserts a translation map in the layer names so that the old stable
files with Italian/French layer names get updated to the standard
English layer names (instead of not opening).

Fixes: lp:1370575
* https://bugs.launchpad.net/kicad/+bug/1370575
2019-04-01 13:54:25 -07:00
Seth Hillbrand 5eb2a33498 pcbnew: Ensure DRC circles have at least 4 points
This prevents invalid outline errors for small circles.

Fixes: lp:1822641
* https://bugs.launchpad.net/kicad/+bug/1822641
2019-04-01 11:47:58 -07:00
Jeff Young 33e594e63e Update description when tree item is in editor.
Fixes: lp:1820298
* https://bugs.launchpad.net/kicad/+bug/1820298
2019-04-01 13:23:37 +01:00
Jeff Young a8b8c73ab8 Set initial focus to track width / via size.
Fixes: lp:1822177
* https://bugs.launchpad.net/kicad/+bug/1822177
2019-04-01 13:23:37 +01:00
Jeff Young 8b2b06c926 Allow save after importing footprint.
Fixes: lp:1819777
* https://bugs.launchpad.net/kicad/+bug/1819777
2019-04-01 13:23:37 +01:00
Jeff Young 3da5396c8d Fixes for importing board setup properties.
Save/restore default netclass.
Read layers back in with correct syntax ('.' between keyword and layer name).
Write layers to project file.
Read/write layer enablement bits.
Don't set solder paste margin min to 0 (most of them are negative).

Fixes: lp:1811990
* https://bugs.launchpad.net/kicad/+bug/1811990
2019-04-01 13:23:37 +01:00
jean-pierre charras 9d97c053b4 Pcbnew: Graphic polygon items are now drawn in sketch mode when the sketch mode is selected. 2019-04-01 12:50:47 +02:00
Jon Evans 4d10183e78 Try harder to reassign copper zones on netlist import 2019-03-31 19:56:28 -04:00
Michael Kavanagh a611269975 Read Footprint Library Browser grid settings from Footprint Editor.
Implements commit 3a0dbf48c8 for Footprint Library Browser/Editor.

Fixes: lp:1822401
https://bugs.launchpad.net/kicad/+bug/1822401
2019-03-31 07:00:45 -07:00
jean-pierre charras d29ee13fda Due to new features (hatched zones, chamfered round rect pads) set SEXPR_BOARD_FILE_VERSION to 20190331 2019-03-31 08:46:36 +02:00
jean-pierre charras 7170720f3c Allow hatch pattern in filled zones
the filled areas can use a hatch pattern (crossing lines) using square holes.
The zone filler removes too small holes (truncated holes) from hatch pattern.
It avoid to create small holes when a hole pattern is truncated by the filled area base shape.
2019-03-31 08:21:40 +02:00
John Beard d6b8e9e037 Pcbnew: Improve tab traversal in text properties dialog
Tab through the grid vertically, then horizontally, as the fields
are laid out with "related" fields (like the co-ords) vertically.

Also neaten headers.

Fixes: lp:1821887
* https://bugs.launchpad.net/kicad/+bug/1821887
2019-03-27 13:56:03 +00:00
John Beard b7017167f0 Pcbnew: Align right margins in text properties dialog 2019-03-27 13:56:03 +00:00
John Beard dd3252445d Pcbnew: update text properties dialog wxFB version
No actual changes, but this keeps the diffs clean(er).
2019-03-27 13:56:03 +00:00
Michael Kavanagh bbcea3c98d Fix mnemonic typo in pcbnew menubar 2019-03-26 19:10:01 -04:00
jean-pierre charras fdfe5eabfb Fix incorrect detection of filled zones changes in DRC check.
Commit 6006703798 fixed a crash but broke the filled zones changes detection.
Filled zones were always seen as not up to date due to the fact the filled areas were cleared too early.

The up to date detection is also optimized: the old filled polygons are no longer stored.
Instead of, the MD5_HASH is calculated and stored before clearing the filled polygons.
2019-03-21 15:27:05 +01:00
jean-pierre charras 7c04b3dbeb Drc dialog: make track to copper zones test optional, because it can be really very time consuming 2019-03-19 18:18:20 +01:00
Seth Hillbrand 078320e2fb Unify and correct Autosave functions
Autosave was not working correctly, partly due to different
implementations in eeschema and pcbnew and partly due to a mistaken
refactor at some point during v5 development.  This unifies the expected
autosave prefix to _autosave- for both pcbnew and eeschema.  It also
unifies the expected suffix for the backup files to -bak.

Fixes: lp:1820433
* https://bugs.launchpad.net/kicad/+bug/1820433
2019-03-18 10:25:26 -07:00
jean-pierre charras b558366a4e Pcbnew: disable commit 3692c511 on non Windows platforms
A zone refill display progress bar is shown when deselecting the zone after geometry changes.
However, on Linux, there are some artifact between the progress bar refresh and the board view refresh:
the filled areas are incorrectly shown: the insulated islands remain displayed,
although they are removed from the actual filled areas list
So it is disabled until a fix is found.
2019-03-17 08:31:00 +01:00
Seth Hillbrand 0de25e557b pcbnew: Adjust drag snapping to avoid start
When dragging, you will seldom want to snap to the original item.  This
commit prevents the "size of track" snap to the original item and
replaces it with an auxilary grid origin for the snap.  This means
effectively that the snap will happen to grid for the original item
unless the cursor is closer to the original item line than it is to the
grid crossing.

Fixes: lp:1820248
* https://bugs.launchpad.net/kicad/+bug/1820248
2019-03-16 20:37:14 -07:00
Seth Hillbrand f96d16eba3 Restore LINK_MAP linker options
Removing invalid TO_LINKER missed a few segments where it was used.
This fixes the ability to enable link maps
2019-03-16 20:37:14 -07:00
Wayne Stambaugh 59d9a9f454 Minor board editor menu fixes.
Correct menu string capitalization.

Remove duplicate mnemonic characters.

Fixes lp:1818906

https://bugs.launchpad.net/kicad/+bug/1818906
2019-03-16 10:36:22 -04:00
jean-pierre charras 353d9d7c9e Pcbnew, Zone refill: avoid useless refilling, when zone parameters are not modified.
Previously, in many cases the selected zone was refilled on exit selection, even if the zone was not modified.
This is annoying, because the zone fill can be really time consuming, and cannot be called without a good reason.
Now the refilling is made only if a zone parameter is actually modified.
2019-03-14 17:33:25 +01:00
Seth Hillbrand ec24981cc8 pcbnew: Don't refresh S_CURVE in bbox()
The bounding box calculation needs to be fast and is threaded in many
places in pcbnew.  We cannot invalidate items (the function is const but
this wasn't caught at compile-time for some reason) when getting the
bbox. This shouldn't be an issue as the m_BezierPoints is rebuilt each
time the curve is updated, so rebuilding during the bbox seems extra.

Fixes: lp:1819984
* https://bugs.launchpad.net/kicad/+bug/1819984
2019-03-14 05:47:05 -07:00
jean-pierre charras 3692c511d0 Zone fill: display progress bar when refilling a zone after edition.
Previously, refilling a zone after edition was made silently,
thus creating not understandable but very noticeable freeze time for complex zones.
2019-03-14 10:18:50 +01:00
jean-pierre charras 23086deccd Pcbnew fix: chamfered corners settings not copied with copy/paste pad properties
Fixes: lp:1819595
https://bugs.launchpad.net/kicad/+bug/1819595
2019-03-12 11:28:07 +01:00
Seth Hillbrand 6006703798 pcbnew: Remove fills prior to updates
Removing existing fills will prevent re-drawing invalid polygons before
they are ready.  This seems to happen on Macs more easily due to redraw
timing.

Fixes: lp:1819553
* https://bugs.launchpad.net/kicad/+bug/1819553
2019-03-11 16:25:43 -07:00
jean-pierre charras 80cf4ec5cb Add comments about SVG import. 2019-03-11 19:25:52 +01:00
jean-pierre charras 61567d3917 Pcbnew: Enable SVG import in DIALOG_IMPORT_GFX. 2019-03-11 18:30:59 +01:00
jean-pierre charras d259459a14 Pcbnew: add a new primitive pad shape: chamfered round rect pad.
Allows 0 to 4 chamfered corners, not only one.

A custom shape allow this kind of shape. However because it is a primitive,
it is easier to edit and it support thermal reliefs.
2019-03-11 10:26:15 +01:00
jean-pierre charras b9944e2c06 Thermal reliefs: fix a corner case that wrongly removes a stub in a thermal shape.
This was due to the stub removal tests if a stub end is outside a solid area to remove it.
There is a corner case: is the stub end is exactly on a solid area outline extra segment
created by Fracture() used in calculations.

The stub removal tests are now made before fracturing.

Fixes: lp:1819317
https://bugs.launchpad.net/kicad/+bug/1819317
2019-03-10 19:14:53 +01:00
John Beard 26d04269ac Pcbnew: disable module numbering in pcbnew arrays
The module refdes always increment by one. This is problematic
for two reasons:

* It doesn't work when more than one FP is selected (say you have
  C1 and C2, you get C1, C2, C2, C3)
* It messes with simple panellisations

The 5.0.x behaviour is to not renumber in Pcbnew, so revert to
that behaviour.

Better refdes incrementation can come post 5.1, as this will need
new strings and UI.

Fixes: lp:1819106
* https://bugs.launchpad.net/kicad/+bug/1819106
2019-03-08 10:34:43 +00:00
John Beard b6916c490c Pcbnew: allow tab traversal of footprint orientation text control
Disable the text update event for the orientation cutom value field before
updating it when the radio buttons are selected. This allows to use the
conventional EVT_TEXT handler, rather than KEYDOWN, which has two effects:

* Tabbing though the dialog no longer sets custom orientation
* Click-driven clipboard actions trigger the update correctly.

Introduce a helper function in validators.h to assist in updating
validated fields without triggering further events.

Fixes: lp:1819006
* https://bugs.launchpad.net/kicad/+bug/1819006
2019-03-07 20:27:04 +00:00
John Beard 4574349539 UI: Automatic wxFB changes in pcbnew edit footprint dialog
Commit automatic changes to keep diffs clean when real changes are made.
2019-03-07 20:27:04 +00:00
jean-pierre charras 5eee88b78a Pcbnew, Draw zones in GAL mode: fix missing initialization of line color.
It is noticeable only in printing mode.

Fixes: lp:1818971
https://bugs.launchpad.net/kicad/+bug/1818971
2019-03-07 21:09:03 +01:00
jean-pierre charras 26acd39129 Fix a few Coverity warnings. 2019-03-07 20:01:47 +01:00
Seth Hillbrand 523b37d9ae pcbenw: Clear contours before regenerating in DRC
When checking for closed outlines, we generate a board area using the
pcb structure.  We now also check for overlapping outlines due to
lp:1818163 However, the DRC maintained its previous outline before
generating the new one, causing an overlap error.

This regenerates the board outline from zero for each DRC run.

Fixes: lp:1819012
* https://bugs.launchpad.net/kicad/+bug/1819012
2019-03-07 09:45:54 -08:00
Seth Hillbrand 5ba2a08366 pcbnew: Set filename in Page Layout template
pcbnew refreshes the viewItem for the worksheet multiple times.  This
requires setting the filename to get parameters displayed on the
worksheet correctly.

Fixes: lp:1819000
* https://bugs.launchpad.net/kicad/+bug/1819000
2019-03-07 06:01:53 -08:00
jean-pierre charras 200ff1cda6 Pcbnew: Fix incorrect polygonal shape of thermal reliefs of rect pads.
Depending on thermal reliefs size, the polygons could be self intersecting,
and these self intersecting polygons are unexpected in zone calculations.
Other fix: the width of thermal stubs is clamped to the size of pads.
Previously, a bug in clamping calculations prevents constraining thermal stubs width.

Fixes: lp:1818752
https://bugs.launchpad.net/kicad/+bug/1818752
2019-03-07 14:31:12 +01:00
Wayne Stambaugh 4612175da2 Pcbnew: better fix for dialog default button handler issues.
Use DIALOG_SHIM::SetInitialFocus() to fix default button handler issue
on all platforms.  Commit cabc33b4 only fixed the problem on windows.
2019-03-04 15:30:32 -05:00
Seth Hillbrand 3dfa57fe1d pcbnew: Clear highlight cross-probe
When highlighting a new net, clear the Eeschema highlight before
selecting items

Fixes: lp:1815147
* https://bugs.launchpad.net/kicad/+bug/1815147
2019-03-04 12:00:59 -08:00
Tomasz Włostowski 92e2aa31a9 pcbnew: router: fix non-45 degree tail merge in LINE_PLACER
Fixes: lp:1817795
* https://bugs.launchpad.net/kicad/+bug/1817795
2019-03-04 18:33:10 +01:00
Wayne Stambaugh cabc33b4cd Pcbnew: fix dialog default button handler issues.
Set the focus to some control in the copper zone, non-copper zone, and
keep out zone dialogs required for the default button action to work
properly.  This only seem to affect windows dialogs.

Fixes lp:1818397

https://bugs.launchpad.net/kicad/+bug/1818397
2019-03-04 11:34:04 -05:00
Jeff Young cedef13bb1 Enable default OK button.
Fixes: lp:1818397
* https://bugs.launchpad.net/kicad/+bug/1818397
2019-03-04 12:06:40 +00:00
Jeff Young 69f003ba4a Remove previous cell selection fixes in favour of slow-click hack.
wxWidgets has several bugs that result in cell editors being closed
right after they're opened.  There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack.  We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.

Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
2019-03-04 11:09:33 +00:00
jean-pierre charras 643d884fde Pcbnew: fix issue in legacy canvas when dragging a footprint (connectivity not updated)
Fixes: lp:1818388
https://bugs.launchpad.net/kicad/+bug/1818388
2019-03-03 19:11:25 +01:00
Wayne Stambaugh 8d26b07f67 Fix potential string iterator issue.
Added checks to StrCmpNum() function in common/sting.cpp to prevent
iterating past the end of the sting.  Also removed length of string
parameter since it did not seem to be used anywhere.

Fixes lp:1818157

https://bugs.launchpad.net/kicad/+bug/1818157
2019-03-02 08:20:53 -05: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
jean-pierre charras 1ba1c6dbf3 DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE: fix minor wxWidgets alerts. 2019-02-28 18:56:48 +01:00
jean-pierre charras a391e5a236 Add comments 2019-02-28 13:35:37 +01:00
Jeff Young e25970592c Tighten up spacing a bit for 1024x768 monitors.
Fixes: lp:1817974
* https://bugs.launchpad.net/kicad/+bug/1817974
2019-02-28 11:36:09 +00:00
jean-pierre charras 16cbd25ed2 DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE: fix a minor wxWidgets alert. 2019-02-28 09:14:11 +01:00
jean-pierre charras 2768b3ddbe Pcbnew: fix check zone fills before plotting doesn't test no net zones.
Fixes: lp:1817797
https://bugs.launchpad.net/kicad/+bug/1817797
2019-02-27 11:27:18 +01:00
Jeff Young 73f0b3087c Initialize grid visibility correctly when opening project files. 2019-02-26 18:24:07 +00:00
jean-pierre charras 4d08906288 Pcbnew: fix 2 minor issues
* fp editor: ensure axis are drawn after switching the backend
* DIALOG_PNS_SETTINGS: ensure violate DRC option is correctly enabled/disable when opening the dialog.
2019-02-25 11:34:32 +01:00
Seth Hillbrand 1be759c5c1 pcbnew: Force rotation to grid
When setting the modification point of a group, we get the grid-snapped
coordinate

Fixes: lp:1674835
* https://bugs.launchpad.net/kicad/+bug/1674835
2019-02-23 14:48:12 -08:00
Seth Hillbrand d36fbba1f3 pcbnew: Violate DRC only enabled in Highlight mode
Violating the DRC cannot happen in shove or walk around mode as we use
the DRC to calculate these actions.  The tooltip explains this as well
but we need to explicitly disable the checkbox to prevent users from
thinking that they can complete DRC violating tracks in other modes.
2019-02-23 08:19:50 -08:00
Seth Hillbrand f47089a804 pcbnew: Enforce router settings
When the user selects "Ignore DRC" in the Highlight collisions mode,
they should be allowed to start drc violating tracks as well as end
them.
2019-02-23 08:19:50 -08:00
John Beard 82734e7116 Adjust tab ordering in some dialogs
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:

* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative

Also set some initial focus fields in the same dialogs.

Tidy a few includes.

Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
2019-02-23 14:49:38 +00:00
John Beard 498a566ca3 Pcbnew: fix spacing in move exact dialog
The middle text ctrl has borders on both top and bottom, should be just
one for even spacing.
2019-02-23 14:49:38 +00:00
jean-pierre charras 0421335ac1 Minor fix in DIALOG_PAD_PROPERTIES: set show grid to false. 2019-02-23 12:31:00 +01:00
Jeff Young f14cf5cbc7 More uniform handling of state saving in global edit dialogs.
Includes Edit Text and Graphics Properties and Edit Track and Via
Properties.  It's also no longer board-specific as it turns out the
board timestamp is always 0 anyway.
2019-02-21 15:11:16 -07:00
Seth Hillbrand dae7b03465 gal: re-enable arc outline mode
Fixes: lp:1816373
* https://bugs.launchpad.net/kicad/+bug/1816373
2019-02-21 10:52:54 -08:00
jean-pierre charras 9ff0868813 pcbnew: fix incorrect sizing of net list display in DIALOG_SELECT_NET_FROM_LIST 2019-02-19 20:07:38 +01:00
Seth Hillbrand b426b9e784 pcbnew: Re-add missing user units python
When moving user user units out of the global, we missed that Python
calls were using it.  This re-adds a function to retrieve user units
allowing the python scripts to show users dialogs in their preferred
units.
2019-02-19 10:52:39 -08:00
Wayne Stambaugh de625e81cb Fix footprint editor library tree filter text control issue.
The default hot key definition for toggle high contrast mode was 'H'.
On windows, the menu accelerator handler code was grabbing the character
so it would not appear in the filter text control.  This is expected
because the windows wxWidgets code hooks this at the application level
so that once a menu accelerator key is found, all further event handling
for that key stops.  Changing the hot key definition to 'Ctrl+H' resolves
the issue.

Fixes lp:1803556

https://bugs.launchpad.net/kicad/+bug/1803556
2019-02-19 12:52:38 -05:00
Seth Hillbrand 4597979d18 cairo: Draw ovals with filled half-arcs
The circle at the end only ever looked right with 100% opacity.

Also fixes double-drawn arc fills in Cairo
2019-02-18 16:09:44 -08:00
Seth Hillbrand 525b9bd550 pcbnew: Correctly set the radio buttons in fpeditor
Radio buttons always have one set, so we need a single path to setting
the correct button.
2019-02-18 15:16:00 -08:00
jean-pierre charras 2dd653a327 WX_GRID: revert GetVisibleWidth() and add EnsureColLabelsVisible() to fix column label height of our wxGrid, for multiline column labels 2019-02-18 20:34:44 +01:00
jean-pierre charras e798cbe6c7 Fix a minor wxWidgets assert in DIALOG_SELECT_NET_FROM_LIST_BASE. 2019-02-18 11:33:53 +01:00
jean-pierre charras d62163cc7c Netclass panel: fix incorrect column sizes, that happens in a few languages.
The best size was calculated from a default size.
This default size (calculated by wxWidgets) was fully broken with some texts in a few languages.
So now this best size does not use this default size.

Fixes: lp:1816315
https://bugs.launchpad.net/kicad/+bug/1816315
2019-02-18 10:09:22 +01:00
Seth Hillbrand 27b4f2fbe9 pcbnew: Fix incorrect Type settings
Fixes: lp:1816259
* https://bugs.launchpad.net/kicad/+bug/1816259
2019-02-17 07:46:47 -08:00
Jeff Young dc5ae574e2 Restore ability to hide grid columns.
wxGrids stupidly does this by setting the width to zero, so you
have to be careful when adjusting minimum widths.
2019-02-17 14:09:35 +00:00
Jeff Young 076f07c683 Be more forgiving of large fonts in grids. 2019-02-17 10:38:06 +00:00
Jeff Young d751fecd8a Tooltip and error message improvements. 2019-02-17 10:20:29 +00:00
Jeff Young f1fb61202a Spelling fixes. 2019-02-17 10:18:42 +00:00
Jeff Young f5369c9d2c Clean up some extraneous TEXT_CRTL_EVAL references.
(UnitBinder gives you evaluation for "free".)
2019-02-17 10:16:09 +00:00
Tomasz Włostowski bbee30671a gal: pixel alignment hacks, works for Retina display too now.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL

Cleanup of pixel alignment patches

gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends

GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing

Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use).  Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.

gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
jean-pierre charras 303b7ac7f8 Pcbnew: fix delete dangling tracks only removes the last segment of tracks.
Fixes: lp:1816234
https://bugs.launchpad.net/kicad/+bug/1816234
2019-02-16 16:05:29 +01:00
jean-pierre charras ec59361f75 Fix a few coverity errors 2019-02-16 14:09:21 +01:00
Seth Hillbrand 79f990266b drc: Allow graphical items to connect pads
This permits footprints like solder jumpers and net-ties.  (originally
from 3439551543 from Jeff Young)
2019-02-15 11:22:55 -08:00
jean-pierre charras c8d44b86e2 Fix a compil issue with some compilers. 2019-02-15 08:47:03 +01:00
Seth Hillbrand 5e5167f198 pcbnew: Adjust footprint properties columns
Size based on text width in 3d and check for overflow before expanding
the first column.
2019-02-14 22:09:01 -08:00
Seth Hillbrand 8b46c99c60 modedit: Fix footprint properties dialog
Checks for text in the dialog before setting width.  Also prevents
resizing beyond the width of the window (in the case of large fonts)
2019-02-14 22:02:34 -08:00
Seth Hillbrand a02f447daa pcbnew: Do not auto edit the 3d-model grid
Auto-selecting of the first grid element is performed in the footprint
editor to facility rapid editing.  Rapid editing of the 3d-model fields
is not as useful and requires multiple esc-keys to cancel.  This limits
the auto-edit to only the reference tab.

Fixes: lp:1815456
* https://bugs.launchpad.net/kicad/+bug/1815456
2019-02-14 16:29:51 -08:00
Seth Hillbrand 1f7022cb64 pcbnew: Do not source highlight from non-copper pads
Highlight connections is meant to show the copper connections on a
board.  We remove the non-copper pads from our selection when attempting
to source the net for highlighting.

Fixes: lp:1815898
* https://bugs.launchpad.net/kicad/+bug/1815898
2019-02-14 15:20:49 -08:00
Seth Hillbrand 2c61b7d7d6 pcbnew: Prevent invalid values from loading
Items that are located at the edge of or outside of integer limits will
not be shown on screen as they don't fit in the VIEW RTree.  This
prevents them from being edited and can corrupt data output.  Instead,
we place them at the largest value that is representable on the RTree
(INT_MAX/SQRT(2)).  This allows the user to correctly utilize DRC as
well as interact with and remove the offending items.

Fixes: lp:1815642
* https://bugs.launchpad.net/kicad/+bug/1815642
2019-02-14 14:28:42 -08:00
jean-pierre charras e6a200b09e Pcbnew: avoid integer overflow when displaying local coordinates.
Minor cleanup in code.
2019-02-14 10:57:22 +01:00
Seth Hillbrand 2cbbcfd3e0 Doxyfiles: Remove local debug lines 2019-02-13 17:22:07 -08:00
Seth Hillbrand 5c855a097b Doxygen: Update doxyfiles
Adds/updates commentary and removes empty, obsolete DTD tags
2019-02-13 10:18:07 -08:00
jean-pierre charras b6027e0815 Drill dialog: fix incorrect parent window when called from the Plot dialog.
The parent window was always the board edit frame,
but this is incorrect when this dialog is called from the Plot dialog.

Fixes: lp:1815530
https://bugs.launchpad.net/kicad/+bug/1815530
2019-02-13 11:41:52 +01:00
Seth Hillbrand 3524bed75a libtree: Remember pane width
Stores the library pane width in settings to keep user preferences
2019-02-12 10:06:36 -08:00
Seth Hillbrand 7b3ef1b7ed colors: Add HSL conversion and tune colors
When adding colors to length tuner, we depend on the window background
color, which can be set by the user, resulting in an unreadable text.
This uses the HSL conversion to detect which shade it should use for the
coloring.

Also adds test cases for round-trip HSL and HSV conversion

Fixes: lp:1814530
* https://bugs.launchpad.net/kicad/+bug/1814530
2019-02-11 22:08:41 -08:00
Wayne Stambaugh fe5d2b8710 Pcbnew: fix footprint properties dialog 3D model visibility issue.
Update 3D model panel on initial dialog load to reflect the current
visibility state of the 3D model.

Fix a few minor footprint properties dialog spacing issues.

Fixes lp:1815184

https://bugs.launchpad.net/kicad/+bug/1815184
2019-02-10 12:00:19 -05:00
jean-pierre charras a703c53312 Fixes in dialogs: mainly better sizes for grid columns, but more other minor fixes.
Fix wxGrid column minimal widths on Windows in dialogs (just fixing the size is not enough).
WX_GRID::GetVisibleWidth(): make width bigger for labels, because they usually use a bold font.
(However, the fix is just a workaround: a better code is welcome)
2019-02-10 16:40:47 +01:00
jean-pierre charras 5e318dc08a Pcbnew, PANEL_PCBNEW_ACTION_PLUGINS: make strings translatable.
Fix also a minimal size for grid columns.
2019-02-10 11:39:07 +01:00
jean-pierre charras 8dc4077d58 Fix compatibility issues with wxWidgets 3.1.1 2019-02-10 07:59:27 +01:00
Seth Hillbrand 8ff764376a wx_grid: abstract visible column width
Cleanup code for checking visible extents of grid text.  Places single
routine to extract the current spacing from the grid in WX_GRID.
2019-02-09 15:31:31 -08:00
jean-pierre charras 1c8077148a Pcbnew: legacy plugin: avoid crash when reading malformed files (old .brd kicad files).
Fixes: lp:1815292
https://bugs.launchpad.net/kicad/+bug/1815292
2019-02-09 18:12:42 +01:00
jean-pierre charras c0a86d734d Pcbnew, Excellon drill file creation: for oval holes allows selection of an alternate command, when the normal command is not accepted.
Using the normal command, oval holes are "drilled" by a route command.
Some board houses do not accept this normal command.
In this case, the drill dialog allows using an other Excellon drill command (a slotted hole).
Note also some board houses do not understand this alternate command!
2019-02-09 14:56:02 +01:00
jean-pierre charras 756b20ace8 Fix column minimal sizes in panel_setup_text_and_graphics.cpp on Windows. 2019-02-09 14:47:45 +01:00
jean-pierre charras 61a95c5440 Fix compatibility with wxWidgets 3.1.1 2019-02-09 11:21:09 +01:00
Seth Hillbrand 76600e3436 pcbnew: Force grid sizing based on text extents
GTK does not handle enlarged text layouts automatically, so we need to
get the screen size before choosing the correct grid width for the
dialog

Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
2019-02-08 20:03:45 -08:00
Jeff Young 076499f3ad Set modify flag for immediate block commands.
Fixes: lp:1812124
* https://bugs.launchpad.net/kicad/+bug/1812124
2019-02-08 19:15:16 +00:00
Seth Hillbrand c0008bc757 pcbnew: Change track width should allow no changes
When doing a global edit of the tracks and vias, we need to allow for
the possibility that the track size doesn't change and that this is
explicitly allowed without DRC error.
2019-02-08 10:49:00 -08:00
Seth Hillbrand e1bce7dccd pcbnew: Prevent using "edit width" in dialogs
Editing predefined tracks/nets/vias sizes makes sense in the toolbar but
not inside the submenu.
2019-02-08 09:50:20 -08:00
John Beard edc73de023 Pcbnew: ignore start values in "first available" grid numbering
The using the "first available" numbering option, force an
artifical linear numbering scheme starting at '1'.

Start the pad name provider at the 0'th pad index.

Also adds a few related tests and adjusts tests affected by
this change to reflect that the offset still applies.

This can be expanded in future to be more general by skipping
pad (which would allow a custom start and numbering scheme
while still avoiding duplication), but for now,
this does what the UI says and avoids string changes in 5.1rc.

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

Fixes: lp:1814917
* https://bugs.launchpad.net/kicad/+bug/1814917
2019-02-08 12:15:02 +00:00
John Beard 0c6ec7dbb3 LIB_TABLE_BASE: Const and unsigned fixes
* Make LIB_TABLE_BASE::GetCount() return unsigned. This is more
  consistent with the behaviour of STL containers (especially the
  boost::ptr_vector this is really accessing). Sadly
  wxGridTableBase() forces an int, so a cast is still required
  at the WX interface.
* Make LIB_TABLE_BASE::At() return a reference. First, this is more
  consistent with normal STL indexing operator[]'s, and secondly, it
  allows an idiomatic const index method (so you can access const
  LIB_TABLE_ROWs from a const LIB_TABLE_BASE).

The motivation is to allow use of this class and LIB_TABLE_ROW
in a test program, where the LIB_TABLE_BASE is const.
2019-02-05 08:49:52 -08:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
John Beard bb2ae8e13b Bitmaps: move bitmap defs to bitmaps library
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.

Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.

This avoids a circular dependency that was previously reported
by static analysis.

Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)

Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
2019-02-04 19:29:31 -08:00
jean-pierre charras 73a0cbff62 pcbnew, export to STEP: fix error in command line tolerance option (--min-distance="0.0100 mm") is some countries
In countries using a comma as floating point separator, the --min-distance="0.0100 mm" was passed as --min-distance="0,0100 mm"
This is incorrect and broke the command line.

Fixes: lp:1814559
https://bugs.launchpad.net/kicad/+bug/1814559
2019-02-04 18:05:49 +01:00
Seth Hillbrand d7272b7f5e eagle: Handle DRC rule-based pad shapes
Circles and Squares are handled correctly.  Octagons are converted to
circles.  Pad 1 is identified by the "1" string in the Eagle name.

Fixes: lp:1784126
* https://bugs.launchpad.net/kicad/+bug/1784126
2019-02-04 07:06:49 +01:00
Seth Hillbrand 1d09f84303 router: Take track width in dp from dp
Fixes and issue where forces were calculated using the current track
width even in differential placer mode where the tracks are specified by
the differential pair width.

Fixes: lp:1814480
* https://bugs.launchpad.net/kicad/+bug/1814480
2019-02-04 03:48:08 +01:00
Tomasz Włostowski 5d712716e6 router: don't create incorrect non-45 degree connections when routing a track that doesn't have a net assigned
Fixes: lp:1814433
* https://bugs.launchpad.net/kicad/+bug/1814433
2019-02-03 12:37:27 +01:00
Seth Hillbrand 08c944a467 cairo: Ensure Courtyard drawing order
Prevent courtyard from being raised twice

Fixes: lp:1811821
* https://bugs.launchpad.net/kicad/+bug/1811821
2019-02-03 11:27:31 +01:00
Seth Hillbrand a8e920bdef std-ize layer lists
Cleanup of list work to use std models.
2019-02-03 11:27:31 +01:00
Tomasz Włostowski 313ebb9dff router: correct walkaround corner case when both ends of the line lie on the hull edge
Fixes: lp:1810935
* https://bugs.launchpad.net/kicad/+bug/1810935
2019-02-03 11:22:18 +01:00
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
Seth Hillbrand b461fc44ef pcbnew: Ensure source snapping
Choosing the drag origin should not be dependent on the snap settings in
pcbnew.  Snap settings are sensible when you are designating a target
only.  Additionally, when dragging a module, we do not want the
footprint's pads to be used as targets for snapping.

Fixes: lp:1814402
* https://bugs.launchpad.net/kicad/+bug/1814402
2019-02-03 04:23:24 +01:00
Seth Hillbrand c0cd4c03fb pcbnew: Handle cancel action in fp load
When the user cancels the footprint load, we should assume they are
canceling the placement of a new footprint.  This also adds sanity check
when populating the list

Fixes: lp:1814181
* https://bugs.launchpad.net/kicad/+bug/1814181
2019-02-01 15:48:36 +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
Jeff Young b6a06aa129 Improve default canvas handling.
Fixes: lp:1813973
* https://bugs.launchpad.net/kicad/+bug/1813973
2019-01-31 19:43:31 +00:00
Seth Hillbrand 37741048ce plot: Correct a couple SVG output errors
Plotting to closed lines for polygons in SVG.  Also correct the filled
polygon line width for non-copper zones.

Fixes: lp:1813964
* https://bugs.launchpad.net/kicad/+bug/1813964
2019-01-30 15:41:36 -08:00
John Beard 88f9f6f072 Break out ref-des-centric functions to own header
This breaks the following functions out to a general-purposed refdes utils
header:

* MODULE::GetReferencePrefix()
* kicad_string.h RefDesStringCompare()

This acheives:

* Slimming of MODULE interface
* Placement of refdes code in common rather than pcbnew
** Testing of this code in qa_common
* Tighter and smaller includes for code that only needed refdes functions

Note: there are failing tests commited (as expected failures). These
are the cause of lp:1813669 and will be fixed as a follow-up commit.
2019-01-30 15:41:36 -08:00
John Beard dc20521cb9 Break out getTrailingInt from MODULE
This is not logic specific to MODULE. Breaking it out to
kicad_string.h acheives:

* Slimming of the MODULE interface
* Enables reuse of the function
* Enables testing of the function

Also add a test under qa_common for this function.
2019-01-30 15:41:36 -08: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 6558bd9381 Pcbnew: Also transform and number the original item
The original item is part of the array, so give it a number
and put it in the right place (all current array tools have
a null transform for the first item, but it's not part of the
contract. For example, a circular array with an angle offset
might want to move the first point).
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 453a91f661 Pcbnew: arrays skip existing names
The current module cannot be queried for existing pads as we
add them (because we never commit, until we finish the whole array).

Instead, pre-gather the names and check as we add, skipping any existing
names.

Note: this will not prevent arrays becoming "mis-ordered", but there
is not a lot we can do to prevent all possible errors.

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

The same principle could be used to skip existing ref-des'es on PCBs.
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 ca0164aa07 Unify library browser terminology.
Fixes: lp:1813882
* https://bugs.launchpad.net/kicad/+bug/1813882
2019-01-30 19:52:15 +00:00
Jeff Young 2dea3a49c8 Fix compile error in std::pow useage. 2019-01-30 16:38:34 +00:00
Jeff Young b3319d29c1 Init footprint chooser with current footprint.
Fixes: lp:1813882
* https://bugs.launchpad.net/kicad/+bug/1813882
2019-01-30 15:45:29 +00:00
Seth Hillbrand f1fed08fa7 pcbnew: Finalize previous snapping preferences
Snap/Grid modifier follow preferences from 05483a06c6.  Brings Shift/Alt
modifiers into alignment with drawing tools.  Shift modifier still
conflicts when choosing end item with the complete track click-modifier.
This will be addressed in v6 with a larger preference setting.
2019-01-29 17:10:58 -08: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
jean-pierre charras a4d4d9a241 Fix not working sdip_wizard.py 2019-01-29 08:42:28 +01:00
Seth Hillbrand cf6ba6ad94 pcbnew: Get correct end when dragging
The selection for interactive drag uses cursor position  off grid to
choose the element for dragging.  We pass the same value into the start
dragging routine to choose the correct end of the element.

Fixes: lp:1813665
* https://bugs.launchpad.net/kicad/+bug/1813665
2019-01-28 15:16:07 -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
Tomasz Włostowski fd0381ea09 router: fix dragging when dragged segment has adjacent segment(s) at 180 degree angle
Fixes: lp:1812535
* https://bugs.launchpad.net/kicad/+bug/1812535
2019-01-28 10:31:50 +01: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
Thomas Pointhuber 4fc692f04b fix handling of filled circle and default layer width 2019-01-26 07:42:35 -08:00
jean-pierre charras 90178eb681 Optimize DRC calculation for copper texts. fix also a bug in SHAPE_POLY_SET::Distance( const SEG& aSegment, int aSegmentWidth ).
This bug calculate incorrectly the distance between aSegment and the SHAPE_POLY_SET for the first segment of the SHAPE_POLY_SET.
2019-01-26 13:01:48 +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