Commit Graph

9037 Commits

Author SHA1 Message Date
Jeff Young 058108dd6d There are 3 courtyard DRC checks, not 2. 2020-05-01 18:49:42 +01:00
Jeff Young 10614a9ebc Implement changes for Sketch Pads to Fab Layers.
Includes adding Fab Layers to default text & graphic settings.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/2274
2020-05-01 18:49:42 +01:00
Jeff Young 4a60b8a776 Improve DRC error reporting and fix some bugs. 2020-05-01 18:49:42 +01:00
Jeff Young 068874a626 Add clearance source for zone-to-zone clearance violations. 2020-05-01 18:49:42 +01:00
Jeff Young bba2fa3028 Fix bug with doubling the pad corner radius twice. 2020-05-01 18:49:42 +01:00
Jeff Young dfe4a00d43 Add distance reporting for copper item DRC tests.
Also adds some performance improvements.
2020-05-01 18:49:42 +01:00
Jeff Young 932fdf8674 Fix issue with default netclass vs orphaned net netclass. 2020-05-01 18:49:42 +01:00
Jeff Young 0c20c0b4af Fix broken hole-to-track test. 2020-05-01 18:49:42 +01:00
Jeff Young 874f13e29e Fix some issues with rotated oval pads. 2020-05-01 18:49:42 +01:00
Jeff Young 5c8d712a56 Fix some issues with rotated rectangular pads. 2020-05-01 18:49:42 +01:00
Jeff Young 1280a4d2f3 Add pre-flighting to DRC checks for performance. 2020-05-01 18:49:42 +01:00
Jeff Young c955f45728 Fix compile error on gcc. 2020-05-01 18:49:42 +01:00
Jeff Young f7e518dbc6 Add clearance sources to some DRC violation reports. 2020-05-01 18:49:42 +01:00
Jeff Young a56191b658 Add distances to a bunch of DRC violation reports. 2020-05-01 18:49:42 +01:00
jean-pierre charras 7e1294a4b7 Pcbnew, Preferences: fix not working panel color widgets.
Fixes #4290
https://gitlab.com/kicad/code/kicad/issues/4290
2020-05-01 15:03:26 +02:00
jean-pierre charras 86b5971de6 Pcbnew: minor enhancement: For pads: display netclass and clearance in msg panel. 2020-04-30 17:09:40 +02:00
jean-pierre charras 36d1d57505 Pcbnew: fix a minor wxWidget alert 2020-04-30 16:41:10 +02:00
Michael Kavanagh b67f18b394 EAGLE import tKeepout/bKeepout to F_CrtYd/B_CrtYd
Also move Pcbnew import menu to correct sub menu.

Fixes https://gitlab.com/kicad/code/kicad/issues/2347
2020-04-27 19:33:17 +00:00
Jeff Young d2046b17d7 More shrinking of Footprint Properties. 2020-04-27 00:24:57 +01:00
Jeff Young fec0c235d9 Hook up Footprint Text Line Mode action to handler. 2020-04-27 00:24:57 +01:00
Jeff Young 2e73703cc8 Shrink the Footprint Properties dialogs a bit. 2020-04-27 00:24:57 +01:00
Ian McInerney d006acecf4 More window sizing fixes
* Push all sizing operations into EDA_BASE_FRAME
* Save the unmaximized window size when maximizing
  so that we can then save it in the config if the
  window is maximized. Otherwise the config ends up
  with the maximized size saved, and weird behavior
  occurs when unmaximizing on the next opening.
2020-04-27 00:14:12 +01:00
Michael Kavanagh e05f36f9a7 Convert graphic polygons on CrtYd layers to lines
Same restriction as Edge_Cuts, due to their intended purpose polygons
don't make sense.
2020-04-26 18:51:47 +00:00
jean-pierre charras 3759799d1e Pcbnew, PANEL_SETUP_FEATURE_CONSTRAINTS: cosmetic enhancements: add a few icons.
Fixes #4263
https://gitlab.com/kicad/code/kicad/issues/4263
2020-04-25 15:22:20 +02:00
jean-pierre charras 4f369801f2 Fix a few compil and Coverity warnings. 2020-04-25 08:49:16 +02:00
Jon Evans 9af88d79ea Fix copy/paste error
Fixes https://gitlab.com/kicad/code/kicad/issues/4261
2020-04-25 00:36:46 -04:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young ed3ec0aa10 Make sure marker pos gets set in constructor. 2020-04-24 23:12:06 +01:00
Jeff Young fd6dffe170 Only save changed severities etc. if the modify bit is set.
(Also means we need to set said bit when changing them.)

Fixes https://gitlab.com/kicad/code/kicad/issues/4164
2020-04-24 23:09:10 +01:00
Jeff Young 2fb2eac4d5 Performance enhancements. 2020-04-24 22:17:45 +01:00
Jeff Young 32db9eb0f1 Add some distances to a few DRC errors. 2020-04-24 22:17:45 +01:00
Ian McInerney f649204c04 Allow graphic polygons/keepouts to be closed automatically
ADDED: Auto close option for graphic polygons/keepouts/cutouts
ADDED: Delete last point option for graphic polygons/keepouts/cutouts

Fixes https://gitlab.com/kicad/code/kicad/issues/2350
2020-04-24 18:35:43 +01:00
Ian McInerney 3f9b3e505e Add some virtual destructors 2020-04-24 18:24:39 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jon Evans 69db66e1ea Fix saving of pcbnew colors when edited from layers widget 2020-04-23 22:33:02 -04:00
Jon Evans 2d95270a31 Add color theme settings to pcbnew 2020-04-23 21:55:29 -04:00
jean-pierre charras fd59660ec8 Save new svg plot options in the board plot parameters section. 2020-04-23 10:02:59 +02:00
jean-pierre charras 825d202480 Fix some strings to help translation.
Remove translation mark for strings used in debug, or strings
that cannot be translated (for instance because they are char strings
instead of wide char strings)
2020-04-23 07:40:19 +02:00
Michael Kavanagh e800c47406 NPTH pads can have the hole offset from centre
Fixes https://gitlab.com/kicad/code/kicad/issues/3671
2020-04-22 21:50:51 +00:00
Michael Kavanagh e4cbeeab4c Remove dead code in pcbnew
* Remove dead zone printer
* Remove old canvas in pad properties window
2020-04-22 21:50:15 +00:00
Ian McInerney 806e661ab3 Make ordering in the pcb layer widget context menu uniform 2020-04-22 22:42:13 +01:00
Jeff Young c8140ddb4a Fix a typo that was keeping units refresh from working.
Fixes https://gitlab.com/kicad/code/kicad/issues/4249
2020-04-22 22:41:00 +01:00
Stefan 7ce0b11600 Pcbnew: change order of layer selector buttons, add more separators 2020-04-22 21:25:58 +00:00
Jon Evans b22ff26688 Rename List Nets to Net Inspector to better reflect function 2020-04-21 20:24:27 -04:00
Jeff Young fbd68722b2 Fix a couple of problems with text stroke thickness. 2020-04-21 21:17:59 +01:00
Jeff Young f113370e1e Edit worksheet properties when no other selection is available.
Fixes https://gitlab.com/kicad/code/kicad/issues/4044
2020-04-21 21:17:59 +01:00
Oleg Endo 60cad7d526 use dynamic_cast instead of dyn_cast 2020-04-21 13:23:56 +00:00
Oleg Endo ff5828fc33 fix formatting and update comments 2020-04-21 13:23:56 +00:00
Oleg Endo 80e40b862c destroy window when list nets dialog is closed
avoid potential performance issues when the dialog is still listening to
the board updates and refreshing its data and view structures.

it seems useful to keep the settings of the dialog across dialog
open-close cycles.
2020-04-21 13:23:56 +00:00
Oleg Endo 980f4a1f6a make select net dialog non-modal
also make sure to call BOARD::HighLightON before/after calling
BOARD::SetHighLightNet
2020-04-21 13:23:56 +00:00
Oleg Endo 137fe48d88 rewrite select net dialog 2020-04-21 13:23:56 +00:00
Oleg Endo 2f1d23312f add BOARD_CHANGED and UNITS_CHANGED events 2020-04-21 13:23:56 +00:00
Oleg Endo 7bf8a744f1 add support for board listeners 2020-04-21 13:23:56 +00:00
Oleg Endo e3aec20f82 move PCB_INSPECTION_TOOL::ListNets into pcb_inspection_tool.cpp, split out dialog_select_net_from_list.h 2020-04-21 13:23:56 +00:00
Oleg Endo 4c7471eb79 add more constness to connecivity algo
also make ForEachAnchor inlineable, like ForEachItem.
remove some unused function declarations.
2020-04-21 13:23:56 +00:00
Oleg Endo 3de5b98316 improve performance of CONNECTIVITY_DATA::GetNetItems
- CN_CONNECTIVITY_ALGO::ForEachItem
move implementation to header, so that a lambda can be inlined by the
compiler.  improves iteration performance x2

- CN_ITEM::Net
move implementation to header, so that it can be inlined by the
compiler.

- CONNECTIVITY_DATA::GetNetItems
don't use std::set to filter out duplicates.  use std::unique on sorted
vector.  use a bitset to perform type check.
2020-04-21 13:23:56 +00:00
jean-pierre charras 83cb9c0d14 Fix a few Coverity and compil minor warnings. Remove dead code 2020-04-21 12:47:48 +02:00
Ian McInerney e57c495d05 Fix remaining python method name error
The method was renamed to SetTextThickness in
9c8941e040.
2020-04-20 23:24:55 +01:00
Matt Huszagh 300de7e74c fix footprint wizard for rename from SetThickness to SetTextThickness 2020-04-20 22:09:41 +00:00
Johannes Pfister e5042a46ba Add ability to set SVG plot units and precision
ADDED: Ability to set SVG to metric or imperial units
and made it possible to change the size of a step
2020-04-20 22:02:03 +00:00
Ian McInerney a23747c640 Cleanup the menu processing in the pcbnew layer widget 2020-04-20 22:43:55 +01:00
nopeppermint 0580b60ec1 add Show All Inner Layer button to layer selector 2020-04-20 19:54:26 +00:00
Jeff Young 7f1b409305 Remove dead legacy print code. 2020-04-20 17:03:38 +01:00
Jeff Young dce42612d3 Fix via printing.
LAYER_VIAS needs to get set for them to print at all, and GetLOD
needs too look at the view layer visibiilties, not the board layer
visibilities.

Also implements a more pad-like strategy for printing blind/buried
vias when printing one layer per page (where the top/bottom arcs
don't make sense).

Fixes https://gitlab.com/kicad/code/kicad/issues/1938
2020-04-20 17:02:38 +01:00
Stefan 02bdec1c57 Pcbnew: Fix wrong show front/back layer icons in layer selector 2020-04-19 22:56:30 +00:00
Michael Kavanagh 7db355e34a ADDED: TOOL_ACTION for switching PNS router mode.
Fixes https://gitlab.com/kicad/code/kicad/issues/2249
2020-04-19 22:44:05 +00:00
Jeff Young b2cd66f0a3 Add specific selection updating when adding 3D models.
This keeps us from being at the receiving end of wxWidgets' vagaries.

Fixes https://gitlab.com/kicad/code/kicad/issues/3760
2020-04-19 22:42:27 +01:00
Jeff Young 7e4d255cdd Apply Scintilla hack to get auto-sizing canvas.
Fixes https://gitlab.com/kicad/code/kicad/issues/4207
2020-04-19 20:09:43 +01:00
Jeff Young c08a6adb2a Implement GUI and file R/W for 3D model opacity.
Fixes https://gitlab.com/kicad/code/kicad/issues/2087
2020-04-19 18:24:39 +01:00
jean-pierre charras d28fea5502 Dxf import: fix a bug that disable import of data inside blocks
Provide also a minimal debug info when enabled in code (and only in debug version)
2020-04-19 13:41:54 +02:00
Ian McInerney 7bda8178d1 Move library includes to main CMake file
Placing them behind the SYSTEM directive tells CMake to tell
the compiler they are system libraries, so it shouldn't show
warnings created from them.
2020-04-19 01:11:56 +01:00
Jeff Young 895f46da8f Another attempt to fix the textbox scrollbars on GTK.
Fixes https://gitlab.com/kicad/code/kicad/issues/4207
2020-04-18 21:41:20 +01:00
Jeff Young 2b6089240a Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
Stefan 8abe07f6e7 altium importer: Fix size of record
Previous size led to incorrect import of some boards.

From https://gitlab.com/kicad/code/kicad/-/merge_requests/172
2020-04-18 01:00:11 +00:00
Ian McInerney 3b67e3d0a4 Rewrite window positioning logic
Now only reposition a window if it is completely on a
disconnected display or if only one corner is on screen
and it is within a region close to the screen border.

CHANGED: Window position on startup should be preserved more
2020-04-18 00:47:38 +01:00
Seth Hillbrand 6af21703fe P-CAD: Support Rounded Rect import
The P-CAD import supports rounded rectangles but doesn't allow
modification of the radius.
2020-04-17 10:48:37 -07:00
Thomas Pointhuber 2703bd6b81 alitum: set layer name, fix handling of odd layercount 2020-04-17 11:06:55 +00:00
Thomas Pointhuber ff5a0f61b2 altium: trim property string to avoid things like spurious newline characters 2020-04-17 11:06:55 +00:00
Thomas Pointhuber a29e55fe7e altium: Fix handling of odd layercount (otherwise, saved *.kicad_pcb file would no longer load) 2020-04-17 11:06:55 +00:00
Jeff Young cb708aaadb Fix some memory leaks. 2020-04-16 21:57:07 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
Michael Kavanagh 7513303cf4 Remove pad properties wxNotebook background
Fixes https://gitlab.com/kicad/code/kicad/issues/3920
2020-04-16 15:06:43 +00:00
Mikołaj Wielgus 5049214f33 Pcbnew statistics: remove horizontal margin in drill table
This margin caused a horizontal scrollbar to appear on Debian Buster
Xfce.
2020-04-16 12:58:02 +00:00
jean-pierre charras e1af9df83e Pcbnew, legacy_plugin.cpp: fix broken conversion of pad layers.
Fix also incorrect copper layer count setting
2020-04-16 14:40:51 +02:00
Simon Richter 5aac36dba9 New enum for trace selection mode
This avoids giving KICAD_T another meaning, which is especially messy here
as "select up to the next via" is encoded as SCH_JUNCTION_T, which belongs
to eeschema.

Also, document what is happening.
2020-04-15 11:17:51 +00:00
Tomasz Wlostowski 4a3cd77416 router: smarter way to check the shove direction without using silly heuristics 2020-04-15 13:00:48 +02:00
Tomasz Wlostowski c121f8f52c pcbnew: speed up ZONE_CONTAINER bounding box calculation 2020-04-15 13:00:48 +02:00
jean-pierre charras 5143f87678 Kicad2step: Many fixes in oce_utils.
- Better code and messages.
- Speedup calculations when removing cutouts and holes from main board.
- Do not stop step generation when trying to load a 3D modele having issues.
2020-04-15 11:44:12 +02:00
jean-pierre charras b68bdc22d7 Fix in kicadpcb reader. Update dialog export step
kicad2step: code cleanup, and more activity messages displayed
2020-04-15 10:51:35 +02:00
jean-pierre charras 110b05fe78 kicad2step: convert it from a wxAppConsole to a wxApp, using a wxFrame/wxPanel 2020-04-15 10:51:35 +02:00
Ian McInerney 45dabde68e Small cleanup in zone class 2020-04-14 18:00:09 +01:00
Ian McInerney 37a4dd927b Allow deletion of zone cutout areas
ADDED: Ability to delete zone cutout areas

Fixes https://gitlab.com/kicad/code/kicad/issues/4188
2020-04-14 17:57:47 +01:00
Ian McInerney 7068b6453e Fix latent bug in zone area calculation
The filled polygons don't have holes, so this was never hit,
but it still needs to be fixed.
2020-04-14 17:32:47 +01:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
jean-pierre charras bdada70ee7 Cosmetic enhancements: add bitmaps to a few context menus.
Fix also a minor compil warning.
2020-04-12 10:29:28 +02:00
Jeff Young 350696ecdd Only convert references to KIIDs if the variable resolves.
Fixes https://gitlab.com/kicad/code/kicad/issues/2458
2020-04-11 20:47:44 +01:00
Jeff Young 505d8bf56e Allow ':'s in field name references in text variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/2458
2020-04-11 20:47:44 +01:00
Jeff Young a8b025ab06 Fix "show" column label. 2020-04-11 13:02:18 +01:00
jean-pierre charras 096564ec0c Fix some typos and I18n issues 2020-04-11 08:57:46 +02:00
Jeff Young 174856bac5 Promote 3D model "preview" flag to a persisted "show" flag.
Fixes https://gitlab.com/kicad/code/kicad/issues/2061
2020-04-10 22:49:56 +01:00
Jeff Young 84944524cc Fix crash on OSX when page was changed before hack array was alloc'ed. 2020-04-10 22:49:56 +01:00
jean-pierre charras dac78d2562 fix a few minor Coverity warnings. 2020-04-10 18:28:12 +02:00
jean-pierre charras 2c8ada42a0 Arc shaped track segments: fix 3D viewer and track to polygon converter. 2020-04-09 10:37:17 +02:00
Jeff Young e016b629d3 Be smarter about determining if there are modules in the selection list.
The old algorithm would delete modules if another module was in the
list, which was not the intention.

Fixes https://gitlab.com/kicad/code/kicad/issues/4175
2020-04-09 00:06:17 +01:00
Jeff Young 317e98b344 Simplify user model for editing color themes. 2020-04-08 22:34:56 +01:00
jean-pierre charras c877cb967f Arc shaped track segments: fix plotters and export vrml.
Export Hyperlinx is not fixed.
2020-04-08 17:30:20 +02:00
Simon Richter 0c2d081925 Remove unused class and friend declarations
This forward declaration doesn't match the class defined inside the
function, so the friend declaration does nothing. The friend declaration is
also unneeded, because the function is a member of the class (and so are
types defined within it), so these already have access to private members.
2020-04-07 22:14:39 +00:00
Jeff Young 840cab4eec Allow user to show layer if DRC object is hidden.
Fixes https://gitlab.com/kicad/code/kicad/issues/3686
2020-04-07 17:29:58 +01:00
Jeff Young aba0fa7bf8 Allow cross-referencing text substitutions. 2020-04-07 17:29:58 +01:00
Jeff Young 76bbb71402 Correct some formatting issues. 2020-04-07 17:29:58 +01:00
Thomas Pointhuber 05d070a0c9 altium: update to new string replacement variables 2020-04-07 14:52:55 +00:00
Thomas Pointhuber 13eb4d73da altium: fix segfault due to incorrect check 2020-04-07 14:52:54 +00:00
Thomas Pointhuber a433d9ea55 altium: improve property reading code, do not rely on exceptions 2020-04-07 14:52:54 +00:00
Jeff Young 322ab60cc5 Fix some Coverity issues. 2020-04-06 12:31:59 +01:00
Simon Richter 710e93bc53 Drop <zconf.h> include
It doesn't seem to be required, and it makes the directory depend on
zlib.
2020-04-05 23:34:13 +00:00
Ian McInerney cb380cda0c Fix some build warnings 2020-04-06 00:31:45 +01:00
Jeff Young 7bce0e17f2 Refresh netlist popups after import settings from.
Fixes https://gitlab.com/kicad/code/kicad/issues/4075
2020-04-06 00:05:34 +01:00
Jeff Young 9a258df58a Fix layout issues in Gen FP Positions dialog and add text var support.
Also adds text var support to Export SVG dialog.
2020-04-05 23:56:24 +01:00
Jeff Young b13559c926 Add envVar and text variable resolution to plot directory paths.
Fixes https://gitlab.com/kicad/code/kicad/issues/3808
2020-04-05 23:56:24 +01:00
Thomas Pointhuber 78159c6744 Altium importer bug fixes
altium: add missing "layer name" -> "layer" mapping
altium: some coverty fixes towards file reading
altium: improve zone handling, fix coverty issues
2020-04-05 22:26:29 +00:00
Jeff Young cc9ac37a0e Add text variable support to envVar processing. 2020-04-05 20:52:26 +01:00
Ian McInerney 4ff61318af Push pcbnew grid visibility storage into EDA_DRAW_FRAME
Fixes https://gitlab.com/kicad/code/kicad/issues/4154
2020-04-05 18:49:10 +01:00
jean-pierre charras 5097d14875 More about do not mark translatable strings used in debug messages. 2020-04-05 14:10:06 +02:00
jean-pierre charras 34651693c1 Altium importer: more about do not mark translatable strings used in debug messages. 2020-04-05 13:45:55 +02:00
jean-pierre charras 70afd12524 Altium importer: do not mark translatable some strings used in debug messages. 2020-04-05 11:22:52 +02:00
Ian McInerney 0dac0c9a47 Cleanup some dynamic casts
From Coverity scan
2020-04-04 12:41:45 +01:00
Thomas Pointhuber b707c84b62 Use Record handling for parsing
Now, we know how big a record is, and should be able to parse all boards without missing bytes?
2020-04-03 23:22:24 +00:00
Jeff Young 78dfbca9a3 Save pre-eval values for Move Exactly dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/4088
2020-04-03 21:47:47 +01:00
Wayne Stambaugh 082944ad06 Minor build warning fixes. 2020-04-03 13:03:23 -04:00
Ian McInerney de66c65f3c Don't immediately read back clipboard data on OSX
This causes an ASAN error because something in the wx
clipboard cache is incorrect (so it tries to copy more
data than it has available). Closing the clipboard and
reopening to read works (since close clears the cache).
2020-04-03 15:54:09 +01:00
jean-pierre charras 161b73e55b Enable storing pin function (pin name) in pads.
This is useful in board routing.
It is plotted in pad attribute TO.P in Gerber files.
2020-04-02 20:14:45 +02:00
Jeff Young b59da3e4dc Overridden versions of GetShownText() still need to call EDA_TEXT version.
Fixes https://gitlab.com/kicad/code/kicad/issues/4151
2020-04-02 18:27:54 +01:00
jean-pierre charras 25fb2595c8 Fix fully broken selection of items of the same sheet, in pcbnew and from eeschema.
Previously, the full UUID path used to select footprints was full broken.
2020-04-02 14:21:09 +02:00
jean-pierre charras ffe0b4aba1 Fix a few Coverity warnings. 2020-04-02 14:21:09 +02:00
jean-pierre charras ddb7b2b2b7 pns router: fix possible hang when using "end" key to finish the current track.
Add also left double click (same as "end" key) to finish the track.

Fixes #4116
https://gitlab.com/kicad/code/kicad/issues/4116
2020-04-02 14:21:09 +02:00
Ian McInerney 0d79ada3ec Show the pencil cursor when placing an item, but it isn't created yet 2020-04-01 18:24:58 +01:00
Ian McInerney 4b647ba6b1 Refactor microwave parts into the microwave tool 2020-04-01 18:24:31 +01:00
jean-pierre charras e811101567 fix a few Coverity warnings. 2020-04-01 09:34:44 +02:00
jean-pierre charras 3a107e5484 Better generation of drill maps in PS, PDF, SVG formats.
These formats use a defined page size (currently A4), and therefore
the drill list cannot be outside the page.
When there are a lot of drill diameters it can happen.
Now the long lists are plotted on more than one column.
2020-03-31 16:48:03 +02:00
Jeff Young 13d3f57fce Implement a different solution to refreshing lib trees.
Fixes https://gitlab.com/kicad/code/kicad/issues/4110
2020-03-31 02:09:31 +01:00
Jeff Young 41b5872f12 Add ERC & DRC checks for unresolved variables. 2020-03-30 14:15:59 +01:00
Jeff Young 4990d1e7b2 Variable substitution framework.
This implements editing of variables and moving SCH_FIELDs,
TEXTE_MODULEs, TEXTE_PCB and worksheet items over to the new
framework.
2020-03-30 14:15:59 +01:00
jean-pierre charras 6e47f147aa A few Coverity fixes. 2020-03-30 09:50:26 +02:00
Jon Evans 34aee50ae1 Rework plotting colors to ensure color settings are always available 2020-03-29 21:43:18 -04:00
Michael Kavanagh 570ea62b64 Fix discrepancy between ASCII and CSV fp pos files
Fixes https://gitlab.com/kicad/code/kicad/issues/3897
2020-03-29 16:55:01 +00:00
jean-pierre charras 9d2712a824 Fix a few Coverity warnings.
It also fix:

Fixes #4082
https://gitlab.com/kicad/code/kicad/issues/4082
2020-03-29 18:42:24 +02:00
jean-pierre charras 259d7a47d4 Pcbnew: enhancements:
Plot Gerber format default values:  X2 attributes enabled.
Gerber job file: use a trick to truncate floating values to 4 digits in mantissa.
It gives a much better readability and 0.1 micron is enough for
mechanical dimensions
2020-03-29 15:35:47 +02:00
Jeff Young 5134856f18 Rationalise 3D settings data-structure.
Move the camera out to its own so that everything else is board-
related, and then rename BOARD_ADAPTER.

At some point the flags should probably be moved out too, and they
can have the EDA_3D_SETTINGS name.
2020-03-28 16:09:40 +00:00
jean-pierre charras 3e247a70d5 Gerber plot: new algo to generate solder mask layers with non 0 min thickness mask
Previously, all overlapping polygons (pads and min thickness areas to remove) were
merged.
Drawback: pads attributes are lost. In Gerber this is annoying.
Now the pads are plot as flashed or Regions items, and min thickness areas are added
but shapes are not merged and keep their attributes.
2020-03-28 16:32:46 +01:00
jean-pierre charras 74957bc7e3 Footprint editor: re-enable a internal copper layer to add/edit keep-out zones
on internal layers in footprints.

Fixes #4096
https://gitlab.com/kicad/code/kicad/issues/4096
2020-03-26 16:53:46 +01:00
Jeff Young ba36fc0009 Fix some Coverity issues. 2020-03-25 14:38:43 +00:00
Jon Evans 18ad186b99 Fix plotting without Pgm context 2020-03-24 21:45:58 -04:00
Jeff Young d69ebfae49 Push tool framework base down into TOOL_HOLDER.
This allows us to use it outside of EDA_BASE_FRAMEs (in this case, in
PANEL_PREVIEW_3D.)
2020-03-24 19:00:25 +00:00
jean-pierre charras 5f60d955be minor fix for commit eb250b4cb 2020-03-24 18:43:15 +01:00
jean-pierre charras eb250b4cb0 PCB_PAINTER: minor fix: display better pad shapes on solder paste layers.
the parameter margin percent was badly handled for rectangular/oval pads,
giving an incorrect solder paste shape for non 0.0 values
now it is is correctly handled.
2020-03-24 18:29:12 +01:00
jean-pierre charras cc47062b17 Fix a few Coverity issues 2020-03-23 16:17:22 +01:00
jean-pierre charras 4d9d1a5380 Fix a few compil minor warnings and Coverity minor issues 2020-03-22 09:45:51 +01:00
Jeff Young 93b7eacfb2 Fixup some Coverity issues. 2020-03-21 16:32:22 +00:00
jean-pierre charras 9cb3333d05 Gerber plotter: plot round rectangle pads using a region with arcs.
Previously, the region was a usual polygon with arc approximated by segment.
Using a region with arcs is a better way because it allows CAM tools to
identify this region as a round-rect pad.

A side effect is a better shape and smaller files, however not really noticeable in fact.
2020-03-20 19:45:05 +01:00
Jeff Young e9cd9ee8ff Actionize the rest of the 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/issues/2228
2020-03-19 15:10:32 +00:00
jean-pierre charras 64d217edda drc.h: replace a list of #define by an enum.
Due to changes in code, the reason for using #define does not exist
since a long time.
2020-03-18 10:19:46 +01:00
Jeff Young 204f2cd580 Reference -> reference designator.
Fixes https://gitlab.com/kicad/code/kicad/issues/4012
2020-03-17 16:09:25 +00:00
Jeff Young 847de9143e Add some tooltips.
Fixes https://gitlab.com/kicad/code/kicad/issues/4012
2020-03-16 22:43:16 +00:00
Jeff Young 3b97993daf Another attempt to fix offset issues when pasting board items to ModEdit.
Fixes https://gitlab.com/kicad/code/kicad/issues/4032
2020-03-16 18:45:55 +00:00
Wayne Stambaugh 7dc64f08b7 Eeschema: implement s-expression schematic file formatter.
Please note that the symbol cache is not embedded in the schematic file
to allow for round robin testing with the existing file format.  Once
the parser round robin testing is complete, the symbol cache will be
embedded in the schematic file.
2020-03-16 09:05:16 -04:00
Jeff Young cee973dc04 Move ERC error reporting over to the new framework.
Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-16 11:06:15 +00:00
Jeff Young 222b222299 Improve ease of understanding around PCB <-> schematic links.
Includes improvements to Update PCB from Schematic dialog and
corresponding changes to Symbol Properties, Sheet Properties and
Footprint Properties.

Fixes https://gitlab.com/kicad/code/kicad/issues/4012
2020-03-16 11:06:15 +00:00
jean-pierre charras 1e40753d33 FOOTPRINT_EDIT_FRAME: fix missing saving/loading a few config params. 2020-03-15 19:51:41 +01:00
jean-pierre charras 76b64afc26 ZONE_CONTAINER copy ctor: add missing members in copy code.
Fixes #4050
https://gitlab.com/kicad/code/kicad/issues/4050
2020-03-15 09:39:42 +01:00
Jeff Young 085d80e3f3 Remove duplicated settings from preferences.
These have now moved to project-specific settings.
2020-03-13 17:28:53 +00:00
jean-pierre charras 741783c6d1 Pcbnew: Set default solder mask min size to 0.
When the solder mask min size is > 0, pads are no longer flashed or regions items.
Good Gerber files need pads flashed or regions items.

Non 0 solder mask min size is reserved to special cases (home made PCBs for instance)
2020-03-12 20:05:08 +01:00
jean-pierre charras 78a7c7dfe0 Zones: fix a crash when adding a zone cutout to a zone having already holes.
Fixes #4039
https://gitlab.com/kicad/code/kicad/issues/4039
2020-03-12 14:42:32 +01:00
Seth Hillbrand 61704cb508 Initialize missing variable 2020-03-11 15:24:08 -07:00
jean-pierre charras fbd01f2f7d DRC_TREE_MODEL: Fix incorrect display of DRC errors on linux+wxGTK 3.0
Fixes #4038
https://gitlab.com/kicad/code/kicad/issues/4038
2020-03-11 10:46:08 +01:00
Jeff Young 51b9944667 Fix pasting of items from board to Footprint Editor.
In particular, map the netlist info to the orphaned item, and
adjust the position of module graphic items to no longer be
module-relative.

Fixes https://gitlab.com/kicad/code/kicad/issues/4032
2020-03-10 23:07:01 +00:00
Jeff Young 437f888c25 Schematic Setup dialog.
Includes:
- moving some of the project settings from the Preferences dialog
- ERC severites
- project-specific field-name templates

Fixes https://gitlab.com/kicad/code/kicad/issues/2145
2020-03-10 18:54:17 +00:00
Ian McInerney f079c41118 Prevent the board setup dialog from opening when DRC is open
The board setup dialog controls DRC error visibility, so the
two dialogs shouldn't be open at the same time to prevent
data contention.

Follow-up to https://gitlab.com/kicad/code/kicad/-/issues/4023
2020-03-08 15:55:14 +00:00
jean-pierre charras c3beeac977 fix a minor wxWidgets alert. 2020-03-08 10:53:36 +01:00
Ian McInerney 67678faa11 Make the board setup window quasimodal
By making it quasimodal, it allows the main KiCad window and Eeschema
to be used still, if it were just modal then it blocks out all other
windows.

Fixes https://gitlab.com/kicad/code/kicad/issues/4023
2020-03-07 19:29:18 +00:00
Jeff Young 1e4ae5d526 Bug fix for DRC tree view on MSW. 2020-03-07 18:52:30 +00:00
Jeff Young 535033c5c9 Enable editing of sheet fields. 2020-03-07 18:52:30 +00:00
Seth Hillbrand 4dfe630b28 PNS: Moving the rest of the placer to Fix/Commit
Springback introduced a new PNS structure to check for valid placement
as well as separating the Fix/Commit routines.  This updates the
remaining placers to utilize the new structure.

Fixes https://gitlab.com/kicad/code/kicad/issues/4008
2020-03-06 09:56:44 -08:00
Seth Hillbrand f6317fba82 PNS: Protect drag from null deref
Items that do not have nets will not be in the index, so we need to
avoid the null pointer when adding drag tagets

Fixes https://gitlab.com/kicad/code/kicad/issues/4009
2020-03-06 09:32:04 -08:00
Jeff Young 44b8bb8f60 Fix a bug when deleting DRC markers from their child items. 2020-03-06 16:23:44 +00:00
Jeff Young fe3e0307d8 Move sheet name and filename to SCH_FIELD architecture.
Only internal storage architecture has changed (so far).
2020-03-06 16:23:44 +00:00
Jeff Young 2f17cbf242 Flag known DRC violations and exclusions in Plot dialog. 2020-03-06 16:23:44 +00:00
Seth Hillbrand 058fb3afa1 PCAD: Handle mirrored text
Mirrored text rotates clockwise in the mirror, so we need to invert the
sign for aligning mirrored PCAD text

Fixes https://gitlab.com/kicad/code/kicad/issues/3992
2020-03-05 15:29:02 -08:00
Seth Hillbrand 0417a6b409 PNS: Fix missing via on zero-length
The current node needs to be kept for zero-length lines when placing a
via.

Fixes https://gitlab.com/kicad/code/kicad/issues/4005
2020-03-05 15:02:40 -08:00
Seth Hillbrand 3d151ebd71 Cleanup connectivity parts
Removes unneeded casts from the connectivity algo.
2020-03-05 12:41:54 -08:00
Seth Hillbrand b0d9838fb4 PNS: Correct assertion when dragging
Dragging using highlight caused an assertion as the duplicated lines
were being re-added with their old links still inplace.  While this was
probably fine as the link references shouldn't be stale, we clear them
to allow for the possibibility that the dragger will adjust the links in
the future.
2020-03-05 08:47:06 -08:00
Seth Hillbrand 4c2626f6b0 PNS: Don't use PNS margin to calc bump direction
The bump direction should only be concerned with physical points to
calculate the heuristic for loop-back otherwise we get too many false
positives.

Fixes https://gitlab.com/kicad/code/kicad/issues/3971
2020-03-04 19:22:57 -06:00
Seth Hillbrand fe8524b9bb Update DIFF_PAIR_PLACER to new callbacks
Needs to handle changes to PNS_ROUTER.  This does not implement
springback or backspace in DIFF_PAIR_PLACER, only allows committing
lines as before

Fixes https://gitlab.com/kicad/code/kicad/issues/3988
2020-03-04 17:23:04 -06:00
Seth Hillbrand ecbfea68dd ADDED: Allow creation of nets in pcbnew
When editing pcb items, the creation of a new net to connect existing
pads or traces can be a useful shortcut.  This inserts the ability to
optionally create a new net from the Net Selector dropdown menu.
2020-03-04 16:11:47 -06:00
Jeff Young 2359d19cf4 Add menu item to DRC dialog to go to Board Setup / Violation Severities. 2020-03-04 21:52:30 +00:00
Jeff Young d20f36511f Fix issue with severities not get initialised in DRC_TREE_MODELs. 2020-03-04 21:52:30 +00:00
Jeff Young 0894674869 Save severities settings in the DRC dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/3978
2020-03-04 21:52:30 +00:00
Seth Hillbrand 12088f240d Fix a couple crashes with small canvases
The canvas size is not guaranteed to be strictly > 0, so we need to
enforce a minimum returned size before dividing by it or passing to GAL
initialization
2020-03-04 14:33:42 -06:00
Seth Hillbrand 011e4116d6 Remove assertion path on closing empty pcb
We don't need to save the project settings if we don't open a file or
project
2020-03-04 11:40:28 -06:00
jean-pierre charras b7cd0c54c2 Fix compil issues, especially on Windows:
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
2020-03-04 10:48:18 +01:00
Jeff Young 85c2e0d23a Add user-defined severities, exclusions and colors to DRC markers.
Exclusions are currently persisted in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-04 00:39:28 +00:00
Michael Kavanagh 265c1663f9 Remove empty choice in Via type dropdown
Fixes https://gitlab.com/kicad/code/kicad/issues/3968
2020-03-03 22:12:04 +00:00
Seth Hillbrand d4cbc348de PNS: avoid committing route with nothing
The node is not neccesarily populated when committing, so we need to
check for validity first.

Fixes #3984 | https://gitlab.com/kicad/code/kicad/issues/3984
2020-03-03 14:02:32 -08:00
Seth Hillbrand 9769e1020b PNS: Don't link unroutable items
The joint map only works for items that are routable, so don't bother
adding unroutable items as this only takes additional time to process

Fixes #3976 | https://gitlab.com/kicad/code/kicad/issues/3976
2020-03-03 12:42:56 -08:00
Seth Hillbrand d6706c257c PNS: clear via when fixing route
When fixing the route, we need to clear the via to avoid re-placing it
on each future click.

Fixes #3966 | https://gitlab.com/kicad/code/kicad/issues/3966
2020-03-02 16:22:34 -08:00
Seth Hillbrand 386147628e PNS: Initialize placement test 2020-03-02 16:22:34 -08:00
Andrew Downing a8dea9274f modify behavior of position relative tool
CHANGED: The reset buttons now set the X or Y offset to the current
offset from the reference position. Selecting individual pads as the reference item is now also possible.
2020-03-02 20:55:06 +00:00
Seth Hillbrand 842d680b5e Set Module Editor flag for tools
The commit takes the module edit flag when resetting the tool.  All
tools should reset this flag when we setup the Module editor.

Fixes #3973 | https://gitlab.com/kicad/code/kicad/issues/3973
2020-03-02 12:45:34 -08:00
Seth Hillbrand 3c19704349 PNS: Don't add null items to drag
Not all footprint pad items are connected to elements in the PNS, so if
we don't find the parent element, we avoid later crashes/assertions by
skipping their addition

Fixes #3972 | https://gitlab.com/kicad/code/kicad/issues/3972
2020-03-02 11:28:14 -08:00
Seth Hillbrand 18db471967 PNS: Line placer returns false when nothing committed
The true/false return should be triggered on whether any elements have
been commited to the line

Fixes #3969 | https://gitlab.com/kicad/code/kicad/issues/3969
2020-03-02 11:11:13 -08:00
jean-pierre charras 911c6eb781 Pcbnew, DIALOG_NETLIST: fix incorrect storage of wx_MessageWindow options.
Config values were not stored into the right variables.

Make also an option persistent during the session
in DIALOG_UPDATE_PCB and DIALOG_NETLIST

DIALOG_UPDATE_PCB and DIALOG_NETLIST match options: use same order in dialogs.
2020-03-01 20:49:56 +01:00
Jon Evans 90bd351807 Properly flush color settings after migration
Also fix missing gerbview migration

Fixes #3965
2020-02-29 21:49:35 -05:00
Simon Richter 866aac9737 Clean up a few unused names of caught exceptions 2020-03-01 00:33:45 +00:00
Tomasz Wlostowski a28f58d14d router: fix regression in PNS_KICAD_IFACE treating newly created items as invisible (side effect = non-45 degree angles due to incorrect snapping) 2020-02-29 20:41:31 +01:00
Tomasz Wlostowski 6850067182 router: commit traces made in single stroke/click (fixes regression introduced with Backspace support) 2020-02-29 20:40:19 +01:00
jean-pierre charras 2a026bd882 spread_footprints.cpp: try to avoid integer overflow when spreading footprints.
In rare cases (one known case) sizes of areas used as container when spreading
footprints can become negative, thus hanging pcbnew.
Happens if many footprints are very big (say 80cm).

Now if there is no room to place footprints, some are stacked.
2020-02-29 17:25:52 +01:00
jean-pierre charras e37c9f117d Fix memory leak when loading a 0 degrees arc in footprint 2020-02-29 17:20:37 +01:00
Andrew Downing 2f7ac2b5b4 Don't truncate polar coordinates in position relative dialog/move exact dialog 2020-02-29 02:21:18 +00:00
Seth Hillbrand 3e0ff72720 Drop invalid arcs on footprint load
In the case where the footprint arc has a non-normal angle, we cannot
represent this in pcbnew and it corrupts the gerber output.  Therefore
we drop the invalid arc and continue to load the footprint/board.

Fixes #3918 | https://gitlab.com/kicad/code/kicad/issues/3918
2020-02-28 15:02:17 -08:00
Tomasz Wlostowski e5fff302a3 router: fix arc drawing in ROUTER_PREVIEW_ITEM 2020-02-28 23:52:33 +01:00
Tomasz Wlostowski e0bad936bf router: enable inline dragging of components 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 44905e1b0a router: initial support for dragging components with traces attached 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski b2b1edbcd1 router: KICAD_IFACE can now commit changes to module positions 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski b6e059f018 router: use a common base class for all dragging algorithms 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 1d0ee66187 router: kill debug printf() 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 77478014d8 router: kill some warnings in OPTIMIZER 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 796aec6e6e router: SOLID::SetPos() should update the shape position too 2020-02-28 23:17:15 +01:00
Tomasz Wlostowski 5a16fda11a router: allow modification of SOLIDs in PNS::NODE 2020-02-28 23:17:15 +01:00
Seth Hillbrand 7cb3ed456e PNS: No free-angle drag at the moment.
Fixes #3954 | https://gitlab.com/kicad/code/kicad/issues/3954
2020-02-28 12:43:59 -08:00
Seth Hillbrand 84b1ab7ce0 PCad: Handle arbitrary PCad layer numbers
KiCad is limited to 32 signal layers but PCad can number the layers
higher than this.  Instead of a C-style array, we now hold the layer
numbers in a std::map to support arbitrary numbering.

Fixes #3949 | https://gitlab.com/kicad/code/kicad/issues/3949
2020-02-28 11:48:06 -08:00
Jon Evans 9cc5b4b3f9 Fix management of nested settings for PNS 2020-02-27 22:53:00 -05:00
Ian McInerney d5ceb8252e Clean up some warnings 2020-02-28 00:06:52 +00:00
Hufo 992a553d43 pcbnew: Refactor D_PAD::AddPrimitives() and allow use from python
Rename all the D_PAD::AddPrimitive methods to clean up their API,
and expose the vector<PAD_CS_PRIMITIVE> type in the python API.
2020-02-27 23:54:19 +00:00
Jeff Young 3860ab9f0c Fix issue returning pointers to items inside std::vector.
(When the vector is re-allocated your pointers become bogus.)
2020-02-27 22:00:51 +00:00
Tomasz Wlostowski f77d2f8cb8 router: option to enable optimization of the track being dragged 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 4525a17076 router: backspace key to undo last fixed segment(s) 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski b5c11f21e5 router: rounding mode context menu entry 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski d1a5d8c78b router: don't forget the tail when toggling via placement 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 8ddeb966ca pns: drag wip on walkaround via mode 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski cf4945afaa router: optimizer should now handle 'keep vertex' constraint correctly... 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 53c3f95ac4 router: initial attempt at walkaround mode for dragger 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski c0314dbb29 router: dragger can now optimize also the segment being dragged 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski a6d3ae3c5b router: NODE now can also query joints 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 6b767d50c3 router: initial support for user-provided constraints for the optimizer 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski c2d95a00c1 router: improved handling of corner cases in LINE::Walkaround 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 37a754c4dd router: initial attempt at improved 'aim at mouse cursor' strategy in walkaround mode, wip... 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 43b71cd9e3 router: Clear() method for PNS::LINE 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski dbe90e163e router: use one global logger object 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 4281bd8207 router: keep board in base Kicad Iface class 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 9e605d6958 router: DEBUG_DECORATOR now allows to name each primitive 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 065d634b30 router: put non-graphical part of ROUTER_IFACE into a parent class (for unit tests) 2020-02-27 22:02:56 +01:00
Ben Dooks 070c6b8ce0 Fix issue with DRC for through hole being applied to SMD pads
Commit d7272b7f5e fixed the use of
the eagle DRC to change the library pad shapes. This was also
applied incorrectly to SMD stacks.

Remove the references to m_rules in packageSMD() and the code
that deals with them. eagle 7.7 does not have any SMD pad options
other than rectangle with rounding.
2020-02-27 16:58:15 +00:00
Jeff Young 82ae9db262 Another variation on the wxDataViewCtrl issue.... 2020-02-26 17:56:47 +00:00
Jeff Young a2234b348d Another attempt to work around wxDataViewCtrl bug on GTK. 2020-02-26 17:35:10 +00:00
jean-pierre charras 2d0582daa7 Pcbnew, stack-up manager: allows 2 digits in mantissa for EpsilonR
Fixes #3942
https://gitlab.com/kicad/code/kicad/issues/3942
2020-02-26 18:12:24 +01:00
Jeff Young 4c563b541e Another attempt to get GTK wxDataViewCtrl to reload properly. 2020-02-26 14:41:12 +00:00
Jon Evans 5e9e46c7bd Fix crash opening footprint editor in debug mode with no board 2020-02-25 20:24:58 -05:00
Jon Evans 9f8ff236d6 Fix load and save of PNS settings 2020-02-25 19:36:36 -05:00
Seth Hillbrand 5b6a4d794f pcbnew: Avoid wx scaling error
When drawing to a scaled DC, the window doesn't reflect the expected
size if scaled after.  This causes elements drawn on the edge to reflect
back into the drawing area instead of being cut off.

We can simply scale our own values to avoid this issue.

Fixes #3849 | https://gitlab.com/kicad/code/kicad/issues/3849
2020-02-25 13:39:04 -08:00
Jeff Young 7c6f7e6b01 Try some undocumented wxWidgets call to fix DRC. 2020-02-25 18:26:42 +00:00
Jeff Young 0614bbc663 Silence a couple of compiler warnings. 2020-02-25 18:26:42 +00:00
Ian McInerney 879a8f4efb Rework the file history menus to not need references to the file history
Keeping a pointer to the actual file history inside a special
file history menu led to many cases of use after free crashes,
so instead rework the actual file history to add the menu
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/3741
2020-02-25 16:18:10 +00:00
Jeff Young 4e0cb3c1ad Another attempt at fixing Linux issue.
Note that I have no Linux machine, so this is shooting in the dark....
2020-02-25 13:51:59 +00:00
Jeff Young 4b380f0dc3 Fix compile issue on Linux & crash issue on Windows.
Fixes https://gitlab.com/kicad/code/kicad/issues/3937
2020-02-25 12:28:05 +00:00
Jeff Young cdad62022b Bug fix for double-click in DRC dialog.
Also better clean-up of highlighting in board editor window.
2020-02-25 12:18:24 +00:00
Jeff Young a4837f7d32 Move DRC dialogs to wxDataView.
This allows for hierarchy and better selection handling.
2020-02-24 23:19:17 +00:00
Jeff Young c5077aeb97 Move weak-reference stuff to UUIDs. 2020-02-24 23:19:17 +00:00
Jeff Young c7ec110fba Only center focused items when they're not visible.
This includes outside the window and behind an occluding dialog.
This keeps the view from jumping around when focusing on nearby
objects.
2020-02-24 23:19:17 +00:00
Jeff Young c68b554c8e Promote PathsAndReferences from wxArrayString to first-class-citizen.
Keeping the data in an un-serialized format greatly simplifies usage,
and should make it more robust.
2020-02-24 23:19:17 +00:00
jean-pierre charras fee5db80dc parseARC: parsing UUID: fix missing call to NextTok(), creating parse error. 2020-02-23 17:20:04 +01:00
Jeff Young 41b7c62c15 Delay initialisation of global EDA_ITEMs.
It causes issues with boost::uuid generation in some versions of
boost.
2020-02-22 13:42:28 +00:00
jean-pierre charras f206db2041 Pcbnew: fix crash on exit after using the track length tool.
This is due to the fact the PNS_TUNE_STATUS_POPUP was not hidden
before calling its destructor.
It is now fixed by setting its virtual destructor calling Hide().

TODO: see if it could be used for any class derived from STATUS_POPUP.
(We already have this issue in other places)
2020-02-22 10:34:11 +01:00
Seth Hillbrand 8c19b4b6ae pcbnew: Adding arcs to PNS
This is allows ARCs in tracks to be synchronized with
the PNS router.  Note this does not yet include the UI components
to route curved traces
2020-02-21 16:11:41 -08:00
Seth Hillbrand 3af868e3d1 Adding Arcs to TRACKS
This expands the TRACKS class to also include ARCS
2020-02-21 23:51:58 +00:00
Jeff Young ea025a35e5 Change KUUID to KIID. 2020-02-21 22:20:42 +00:00
Jeff Young 383403ef98 Push deprecation warning suppression down into boost.
Note: requires boost 1.67 or later.
Current boost version is 1.72.
2020-02-21 17:36:12 +00:00
Jon Evans e8e3b4f11e Rename UUID to KUUID to fix MSVC build
Also add another newly-required boost flag
2020-02-20 22:07:17 -05:00
Jon Evans affdaa8c33 Fix one more warning 2020-02-20 19:38:32 -05:00
Jeff Young 2778dc90f3 Cleanup. 2020-02-20 23:52:32 +00:00
Jeff Young e1d59337d1 Protect GCC #pragmas. 2020-02-20 22:20:44 +00:00
Jeff Young 81dd1d7a68 Timestamp-based paths were ugly. UUID-based ones are worse.
Show a human-readable path in the Edit Footprint dialog.
2020-02-20 21:29:52 +00:00
Jeff Young 129042f8a6 Convert timestamps to UUIDs. 2020-02-20 21:29:52 +00:00
Jeff Young 4014afad54 Remove unused functionality. 2020-02-20 21:29:52 +00:00
Jon Evans 1a216f3703 Change action plugin settings storage to preserve hidden buttons 2020-02-20 11:01:49 -05:00
Jon Evans 4f555e7794 Fix QA crash: Pgm is null in test suite 2020-02-20 07:47:50 -05:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
jean-pierre charras 625249322e Pcbnew: regroup drc files to the already existing drc folder. 2020-02-19 10:31:32 +01:00
jean-pierre charras 39c2c4e13b Zone filler: pads non connected in zone option: use same algo as the 5.1 branch
to calculate thermal clearance (antipad size) for pads having the same netcode
as the zone, the net clearance has no meaning
(net clearance between object of the same net is 0)
and the zone_clearance can be set to 0 (i.e. use the netclass clearance).
Therefore use the antipad clearance (thermal clearance) or the zone_clearance if bigger.
2020-02-17 18:21:49 +01:00
jean-pierre charras 021eb2f3a8 Fix incorrect usage of a UTF8 char in a C string in code.
Using a UTF8 char inside a C string can work on unix, but not on Windows.
It must be explicitly converted in a unicode value inside a wide string
(like a wxString)
2020-02-16 10:21:36 +01:00
Ian McInerney 4fef513a3f Fix library table panel path adding and cleanup duplicate dialog
When adding a .pretty library, if the actual .pretty folder were
selected then no folder would be added to the list of libraries.
This led to an assert when normalizing paths, and the library
not being added.
2020-02-14 19:07:27 +00:00
Jeff Young 3ec360f15c Save pinned libraries in project.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 14:22:54 +00:00
Ian McInerney 25b3cce474 Fix build error and cleanup overzealous refactor changes 2020-02-14 00:56:41 +00:00
Jeff Young 2017389f2d Pinning for library trees in FPEditor and SymbolEditor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 00:10:40 +00:00
jean-pierre charras 92af5531bc Fp editor: fix: Reference and Value default values aren't saved
in Footprint Editor preferences

Fixes #3889
https://gitlab.com/kicad/code/kicad/issues/3889
2020-02-11 16:19:00 +01:00
Simon Richter 8d6e5953aa Remove include path option hiding preprocessor definition
This variable is empty, so the argument evaluated to "-I", and the next
argument was then interpreted as a path (and thus ignored). This hides a
preprocessor definition (-D) from Swig.
2020-02-07 20:08:11 +01:00
Ian McInerney 8b7d4c2a55 Put tool graphics back on the stack
Now that the tool framework gracefully shutdowns the tools, graphics
can be created on the stack inside a tool function.

This reverts commit f6881ce3de.
2020-02-05 22:23:44 +00:00
Ian McInerney b1240b5b1e Gracefully shutdown tools when frames are closed
If the tools are not gracefully exited, then the stack variables are
never destroyed, so variable lifetime issues can occur.

Fixes https://gitlab.com/kicad/code/kicad/issues/1753
2020-02-05 22:23:24 +00:00
Jeff Young 1e6840ea8f Don't report Eagle errors on the Unrouted layer.
Fixes https://gitlab.com/kicad/code/kicad/issues/3398
2020-02-05 22:21:16 +00:00
Jeff Young d8cd48aa7f Allow duplication of module texts from board editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/3829
2020-02-05 22:21:16 +00:00
Ian McInerney 34e5b76c5f Add virtual constructors to some classes that should have them
This is more for safety from undefined deletion behavior than
anything else (it also silences the Clang -Wnon-virtual-dtor warning).
2020-02-05 22:19:14 +00:00
Seth Hillbrand e94f356ad5 pcbnew: Correct stop condition for expand
Typo in selection tool caused expansion past vias.
2020-02-05 14:14:50 -06:00
Ian McInerney 6b8d81e95d Add zone area to message panel
ADDED: Area of zone fill is displayed in the message panel

Fixes https://gitlab.com/kicad/code/kicad/issues/2412
2020-02-05 09:44:53 +00:00
Jon Evans ce4542cced ADDED: Allow exporting IPC-356D netlists from Python 2020-02-04 13:31:56 +00:00
Jeff Young fbeb0709ef Formatting cleanup. 2020-02-03 19:35:48 +00:00
Jeff Young f1b1c91961 Be a little more friendly towards SMD footprints.
Increase the coverage ratio a bit so that footprints that still
have 10% of their area available for selection won't bring up the
disambiguation menu.

Fixes https://gitlab.com/kicad/code/kicad/issues/3721
2020-02-03 19:35:48 +00:00
Jeff Young d02c0da3ab Remove preferred layer disambiguation for multiple modules.
The preferred list isn't actually in use anymore at this point, so
it currently has no effect other than to mess things up since we
aren't keeping track of which modules have been rejected when we
check the module count.

Fixes https://gitlab.com/kicad/code/kicad/issues/3721
2020-02-03 19:35:48 +00:00
Jeff Young 89dfee9ebe Employ an accuracy when hittesting (particularly for lines).
Also fixes a bug where the parent module was being hit-tested
for its children.

Fixes https://gitlab.com/kicad/code/kicad/issues/3750
2020-02-03 15:08:01 +00:00
Jeff Young 2286652abe Handle duplication of footprint ref and value.
Fixes https://gitlab.com/kicad/code/kicad/issues/3828
2020-02-03 15:08:01 +00:00
Jeff Young a04fdf64da Improve directory handling for Project Save As.
1) don't change directory names that we don't recognize
2) when we do, make sure the child files get copied to the
changed name.

Fixes https://gitlab.com/kicad/code/kicad/issues/3834
2020-02-03 15:08:01 +00:00
jean-pierre charras 8f3e8cf893 Dxf importer: fix issue when importing some "degenerated" splines.
Sometimes a dxf curve is a "degenerated" bezier curve having only 3 points.
(a control point is at same location as a end point)
This commit fix incorrect import of these curves.
2020-02-03 10:39:29 +01:00
jean-pierre charras fd0728becf Fix an other crash similar to f6881ce3. 2020-01-31 16:41:47 +01:00
jean-pierre charras f6881ce3de Fix crash after calling EDIT_TOOL::pickCopyReferencePoint()
An instance of STATUS_TEXT_POPUP was created on the stack.
But it crashes pcbnew when closing the current main frame,
perhaps due to stack switching in coroutines.
It is now created on the heap.
2020-01-31 16:08:18 +01:00
Alexander Shuklin 3d0b3a51f3 Eeschema: Adding back annotation
ADDED: Back annotation algorithm,
eeschema back annotation dialog

CHANGED: added some minor helper methods to SCH_REFERENCE_LIST and SCH_REFERENCE,
split SCH_REFERENCE_LIST::CheckAnnotation on 2 parts to reuse code
2020-01-29 16:33:57 +00:00
jean-pierre charras 418dba440d Pcbnew: DIALOG_FOOTPRINT_BOARD_EDITOR: minor enhancement.
The footprint sheet path (unique ID) is now displayed in this dialog.
2020-01-29 10:00:56 +01:00
jean-pierre charras 48ae188b15 Zone filler: fix a few issues, in Smoothed Polygons mode.
- Fix non optimal shape of solid polygons after inflate transform.
- Add a small extra clearance ((2 microns) when creating clearance areas
(especially, convert arc to polygons create small differences)
- Add a small threshold (1 micron) in drc test distances to avoid false positives
- fix a minor issue in TransformOvalToPolygon that created sometimes a not perfect shape

Fixes #3812
https://gitlab.com/kicad/code/kicad/issues/3812
2020-01-26 18:19:24 +01:00
Jon Evans 56a9670cf6 Fix running PcbNew from build dir on windows 2020-01-24 21:21:35 +00:00
jean-pierre charras a98195f650 fix a minor compil warning 2020-01-24 10:15:55 +01:00
jean-pierre charras d12e8479f2 Pcbnew: fix crash when trying to select the previous copper layer.
The function that calculates the previous layer id was using a illegal value
in some cases.

Fixes #3805
https://gitlab.com/kicad/code/kicad/issues/3805
2020-01-24 10:13:18 +01:00
Ian McInerney 06c979dfaa Convert all CMake paths to absolute instead of relative
It is cleaner and safer to handle the include and source paths
as absolute from the source directory instead of relative to every
path.
2020-01-22 23:27:20 +00:00
Ian McInerney 752bc5b7ba Update technical todo
Add a section mentioning C++20 and the new constexpr
std::string and std::vector that we can use.
2020-01-21 11:03:55 +00:00
Mark Roszko 10a862c458 Recursively add KiCad and GEDA libraries inside a folder
CHANGED: KiCad and GEDA libraries can now be added recursively by selecting a parent folder.
2020-01-21 10:39:07 +00:00
Jeff Young a91ca785e5 Better to warn user and orphan nets than refuse to open board. 2020-01-21 09:29:33 +00:00
jean-pierre charras dd46a918a8 Fix bug: Cross-probing of pins to pads selects entire footprint instead of desired pad.
Fixes #3791
https://gitlab.com/kicad/code/kicad/issues/3791
2020-01-20 18:35:20 +01:00
qu1ck 32674ef360 Fix polygon shape move
Move vector should not affect start/end points as they are assumed to
always be 0,0. Polygon is defined by outline only.
2020-01-20 03:49:41 +00:00
Seth Hillbrand 7c296fbcb7 GRID_HELPER: Provide alignment axes from snap points
ADDED: alignment lines from item snap points

Alignment lines are shown when moving the cursor horizontally or
vertically from a possible snap point.
2020-01-18 20:43:40 -08:00
Seth Hillbrand 73d6169338 pcbnew: Check before reading/writing cache
The open/create calls can fail so we need to account for this before
using the result that assumes success.
2020-01-17 18:30:17 -08:00
brian piccioni 8341398082 Save footprint errors in the DRC log
Fixes https://gitlab.com/kicad/code/kicad/issues/3754
2020-01-18 01:40:43 +00:00
Seth Hillbrand c4fff95078 PNS: Detect collisions including newline width
The new line collision search uses BBox() to check for colliding
objects.  BBox in the SHAPE_LINE_CHAIN did not include width as the
chains were assumed to be zero-width.  This is not the case for
PNS::LINE elements.

We mostly don't notice this because DRC checks for SEGMENT collisions
but it becomes obvious/annoying when we cannot place a track for unknown
reasons and the snap-back doesn't take line width into account.

Fixes #3776 | https://gitlab.com/kicad/code/kicad/issues/3776
2020-01-17 11:23:08 -08:00
Seth Hillbrand f7cb970a02 PNS: Modify MarkObstacles logic to select shorter
When routing where we hit multiple obstacles, we choose the shortest
path to allow overlapping hits to choose the shorter path, thus giving a
better chance of returning true for the DRC-compliant path.

Fixes #3773 | https://gitlab.com/kicad/code/kicad/issues/3773
2020-01-16 19:57:38 -08:00
Ian McInerney 56f6b529c8 Simplify 3D object cache class structure
Remove the CACHE_WRAPPER whose sole purpose was to allow the
cache to be stored in the project, and instead just have the cache
inherit the proper class.
2020-01-15 23:32:05 +00:00
Jeff Young 102f5f479c Handle uninitialized nets gracefully. 2020-01-15 19:40:20 +00:00
Jeff Young cfa407616f Don't allow degenerate arcs & circles. Trouble will follow. 2020-01-15 18:50:47 +00:00
Jeff Young dcfb7cadce Avoid divide-by-zero. 2020-01-15 18:21:42 +00:00
Jeff Young 9df2cfb328 More uninitialized variables. 2020-01-13 20:16:40 +00:00
Jeff Young 91d1508c16 Fix some Coverity identified issues. 2020-01-13 20:16:40 +00:00
Ian McInerney 3ab9db6ff1 Update cast in PNS since we are guaranteed to have text
We are guaranteed that the BOARD_ITEM will be a TEXTE_MODULE
since we have tested its type already, so just use a static_cast
to remove the overhead.
2020-01-13 19:42:49 +00:00
Ian McInerney 81ee5edcaf Test dynamic_cast for safety from future changes 2020-01-13 15:22:26 +00:00
Ian McInerney 34bc0a4e96 pcbnew_control: Replace C casts with C++ casting 2020-01-13 14:19:44 +00:00
Ian McInerney e2853862e5 Cleanup redundant type casting 2020-01-13 14:00:45 +00:00
Ian McInerney 8fc434be19 Formatting change for dynamic cast tests 2020-01-13 01:48:57 +00:00
Ian McInerney 36f6b4a9b4 Clean up redundant dynamic casts 2020-01-13 01:39:08 +00:00
Jeff Young 94f8aafec5 Fix missing variable initialization. 2020-01-13 00:18:49 +00:00
Jeff Young d24bd5c832 Fix a couple of Coverity issues. 2020-01-12 21:07:41 +00:00
Jeff Young 8d0f31f6f4 Clean a bunch of legacy code out of the Filter Selection dialog. 2020-01-12 20:53:56 +00:00
Jeff Young 127c66285b Rename old DIALOG_BLOCK_OPTIONS to DIALOG_FILTER_SELECTION....
... which is what it has done for some time now.
2020-01-12 20:30:58 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Ian McInerney b445ce6632 Clean up pointer casting
* Make note of when dynamic cast is actually needed
* Convert some to static cast when we know the type for sure
2020-01-12 19:45:37 +00:00
Ian McInerney 4ffbefb9dc Use the layer from the module item instead
They are both from the same argument, but this one make coverity happy.
2020-01-12 19:39:39 +00:00
Seth Hillbrand 52bfdb9703 PNS: Assume the current line is a base before optimizing
We use the cost of the current line before trying to improve the pad
breakout cost when optimizing the smart pads

Fixes #3759 | https://gitlab.com/kicad/code/kicad/issues/3759
2020-01-12 11:08:46 -08:00
Ian McInerney 3346f812a9 Cleanup error handling in VRML export (from coverity scan) 2020-01-12 17:18:08 +00:00
Ian McInerney 00e58cd974 Fix unintialized values (from coverity scan) 2020-01-12 13:00:42 +00:00