Commit Graph

284 Commits

Author SHA1 Message Date
jean-pierre charras b4fc78fc0d kicad_plugin.cpp: fix incorrect detection of existing footprints in PCB_IO::FootprintExists(), when fp names contain a point.
Fixes: lp:1837221
https://bugs.launchpad.net/kicad/+bug/1837221
2019-07-19 18:16:07 +02:00
Seth Hillbrand 5ff7c61003 eagle: Fix segfault importing flipped footprints
We don't have a board reference when importing, so we don't get settings
for flip orientation.
2019-07-16 09:08:58 -07:00
Jeff Young 37af3adffb Add preference for flip axis.
Fixes: lp:1836267
* https://bugs.launchpad.net/kicad/+bug/1836267
2019-07-14 10:36:48 +01:00
Jeff Young 20036f8105 Add FootprintExists() which can be more careful about FS differences.
(And in particular, MSW's case-insensitive FS.)

Fixes: lp:1835999
* https://bugs.launchpad.net/kicad/+bug/1835999
2019-07-11 23:00:01 +01:00
Jeff Young 13d61e4b2b Cleanup. 2019-07-10 01:14:21 +01:00
Jeff Young 562ab0bdea Move layer defaults and diff-pair dimensions to board file. 2019-07-06 00:04:54 +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
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
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -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
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
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
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
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
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
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
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 65a967dca1 Fix minor I10n issues. 2018-11-18 14:40:36 +01:00
jean-pierre charras 8c8ccf83e6 Fix a few I18n minor issues. 2018-11-16 09:43:40 +01:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Jeff Young 9b44100e04 GetFullPath() includes filename; we just want GetPath()
Fixes: lp:1785891
* https://bugs.launchpad.net/kicad/+bug/1785891
2018-08-07 22:04:09 +01:00
Jeff Young be1d6113d6 More performance enhancements.
Be more intelligent about sorting lib tree items.  (Footprint
entries, for instance, come out of an already-sorted list.)

Don't recreate menus twice when laoding Footprint Editor.

More pervasive use of WX_FILENAME to avoid expensive calls to
wxFileName::SplitPath() and string concatenation.

For POSIX kernels do all the work on the file-system side so we
don't have to keep converting back and forth between encodings.
2018-08-06 13:49:27 +01:00
Jeff Young f3f814e622 Performance enhancements for footprint info list.
Cache the footprint info on disk (in the project).
Move timestamp-generation (and checking) to the filesystem so the
above will be bullet-proof.
Rewrite some wxWidgets classes for performance (see common.h).
2018-08-04 10:29:17 +01:00
Jeff Young f8a5e2c1c8 Performance enhancements in fp loading, string cmp, etc.
Knocks about 1/3 off the first footprint load, and more than 1/2
off subsequent loads.
2018-08-01 09:35:46 +01:00
Jeff Young cb61525394 Handle separate parsing rules for ID_SCH and ID_PCB.
This removes the existing constructors so that all parsing must
be explicit and callers are made aware that they need to think
about illegal characters, malformed ids, etc.

Fixes: lp:1783474
* https://bugs.launchpad.net/kicad/+bug/1783474
2018-07-26 15:43:53 +01:00
Jeff Young f79ca271e3 Replace missing #ifndef's.
We only process symlinks on POSIX kernels (Linux and OSX).

Fixes: lp:1548798
* https://bugs.launchpad.net/kicad/+bug/1548798
2018-07-24 09:05:39 +01:00
Jeff Young bc47f085df Support symlinks for .pretty and .lib files.
Fixes: lp:1548798
* https://bugs.launchpad.net/kicad/+bug/1548798
2018-07-23 23:50:13 +01:00
jean-pierre charras 72d1597201 DXF import: add import of DXF splines that are converted to Bezier curves.
Fix also a lot of bugs related to Bezier curves (S_CURVE shape in DRAW_SEGMENT class) in Pcbnew code.
Add missing code to handle these Bezier curves
2018-07-22 18:39:47 +02:00
Jeff Young aab97c8385 Consolidate design rules UI.
Implement new Board Setup paged dialog which includes:
  Layers Setup
  Design Rules
  Solder Mask & Paste
  Text & Drawings

Moves line width and text properties to a layer-class-based
system.  Renames unlocked to upright (which also reverses the
logic).

New Edit Text and Graphic Properties dialog which replaces
Edit Footprint Text and adds layer-class-based editing and the
italic, upright and visibility properties.

Adds Import Settings functionality which allows settings to
be imported from another project at page granularity.

Also UNIT_BINDERizes the dialog and adds editing of pcb text.

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

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

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

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

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

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

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

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

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

(cherry picked from commit 3944a5e)
2018-07-17 15:12:34 +01:00
Jeff Young eacaa39aa2 Remove global units usage from GetSelectionText...
... and GetMsgPanelInfo.

Step 4 in the g_UserUnit eradication effort.

Also removes a couple of conversion routines that were close
enough to extinction.

(cherry picked from commit c75da51)
2018-07-17 15:11:09 +01:00
Seth Hillbrand bfe636d327 Query user to create library on save
Revising 5ca6864a4, this prompts the user to create the missing library
directory when attempting to save to a non-existent library.
2018-05-04 09:59:35 -07:00
Seth Hillbrand 5ca6864a40 Improve error message granularity
When saving a library, check and report on libraries that do not exist
as well as those that exist but are read-only.

Fixes: lp:1769190
* https://bugs.launchpad.net/kicad/+bug/1769190
2018-05-04 09:12:08 -07:00
Wayne Stambaugh 7c7a6ea979 Fix board file formatting bug.
The roundrect_rratio token was missing a leading space which made the
file formatting different from all other formatting when using rounded
rectangle pads.

Fixes lp:1768355

https://bugs.launchpad.net/kicad/+bug/1768355
2018-05-03 10:21:40 -04:00
Simon Richter 7e47ef7471 Fix warnings for unreferenced local variables 2018-04-18 15:08:37 -04:00
Wayne Stambaugh 81843c37a4 Organize trace debugging code for ease of maintenance. 2018-04-13 09:59:01 -04:00
Seth Hillbrand 532bf09817 Don't save broken polygon
If a polygon has fewer than 3 points, it is invalid.  We need to
register this as failure, otherwise we save the formatting/closing
s-expr for the polygon without the actual polygon points. This breaks
the footprint and board.
2018-04-02 10:18:10 -07:00
Seth Hillbrand d1ab62fb4d pcbnew: Save only edited footprint when saving
Don't re-save all files in a library when editing a single footprint.
This creates issues with formatting in version control systems where
unmodified files are re-written without being explicitly changed by the
user.

Fixes: lp:1752991
* https://bugs.launchpad.net/kicad/+bug/1752991
2018-03-28 14:42:32 -07:00
Seth Hillbrand fb882633b2 Save layers regardless of view
We do not modify the underlying board when saving.  Previously only the
visible layers were saved.  This created a discrepancy between the board
that the user was editing and the board that was saved to disk.

Fixes: lp:1754049
* https://bugs.launchpad.net/kicad/+bug/1754049
2018-03-23 09:32:56 -07:00
Jeff Young 284c346828 Don't cache github libraries above nginx server.
It's too expensive to fetch the timestamps when the github
server is busy.  See Dick Hollenbeck's comments at the top of
github_plugin.cpp for more info.

Also adds some safety to the other caching algorithms after
seeing github_plugin's wild-west usage of the kicad_plugin.

Fixes: lp:1753143
* https://bugs.launchpad.net/kicad/+bug/1753143
2018-03-04 01:16:59 +00:00
Jeff Young 33d925f631 Add GetLibraryTimestamp to other plugins.
Fixes: lp:1752719
* https://bugs.launchpad.net/kicad/+bug/1752719
2018-03-02 20:53:48 +00:00
Jeff Young 9453a7e186 Fix segfault when not all libraries loaded.
Fixes: lp:1751464
* https://bugs.launchpad.net/kicad/+bug/1751464
2018-02-24 15:49:09 -05:00
Jeff Young 7bd2f14342 Go back to checking individual file timestamps.
Too many external applications fail to touch the parent directory.

Also removes FP_CACHE_ITEM lastMod times and dirty flags as we've
always loaded libraries atomically anyway.

Claws back some of the performance lost by being more efficient
with cache management for sequential calls to Enumerate and then
Load.

Fixes: lp:1750936
* https://bugs.launchpad.net/kicad/+bug/1750936
2018-02-23 10:56:12 -05:00
Jeff Young 809093acd0 Don't bail out of loading when one library couldn't be found.
Also includes some cleanup to the error dialog (removing
sunken border, fixing OK button, etc.)

Fixes: lp:1749572
* https://bugs.launchpad.net/kicad/+bug/1749572
2018-02-15 10:53:03 +01:00
Jeff Young 916f79d5a1 Performance fixes for the place footprint list all dialog.
Smartens the cache freshness checking, and adds checksums of
constituent-directory last-mod-dates to the footprint info
list.

Also inserts the dataPtrs into the list at the same time as
the text to keep wxWidgets from measuring the width of the
text twice (yes, really).  And converts the list to default-
column widths in case the wxWidgets patch is present to
greatly speed list creation (by not measuring all that text).

On my machine drops the first-load time from 4s to 2.5s and
the subsequent-load times from 2.5s to < 1s.  With the
wxWidgets patch subsequent-loads become near-instantaneous.
2018-02-11 11:51:48 -05:00
Wayne Stambaugh e832212d89 Pcbnew: fix bug in footprint library plugin cache reloading.
Check the footprint library path modification against the last load
time and reload the cache if the path modification time has changed
when a new file is added to the footprint library path.

Fixes lp:1727977

https://bugs.launchpad.net/kicad/+bug/1727977
2018-02-10 17:14:53 -05:00