Commit Graph

9310 Commits

Author SHA1 Message Date
Simon Richter fdaaa0a704 Make PCB_EXPR_UCODE final
This avoids a warning about its non-virtual destructor during deletion, as
polymorphic classes are expected to be deleteable through any pointer.

Possibly not entirely correct -- might be problematic if UCODE objects are
deleted through a base pointer.
2020-07-25 19:41:16 -07:00
Jeff Young 4153309fba Add defensive code.
Fixes https://gitlab.com/kicad/code/kicad/issues/4941
2020-07-25 23:54:04 +01:00
Seth Hillbrand ad625d8d76 Add missing KIID to edge_module
In order to support grouping in the footprint editor, we need full KIIDs
stored with the footprint elements.
2020-07-25 14:10:53 -07:00
Seth Hillbrand 0a5f11fb37 Keep item ordering as much as possible
The ordering goes first by type and then by uuid.  In the case of
DRAWSEGMENT and EDGE_MODULE, we also sort by shape type before UUID.

Fixes https://gitlab.com/kicad/code/kicad/issues/4068
2020-07-25 12:56:19 -07:00
Jeff Young 2af6d01fdf Add some defensive code for empty polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/4947
2020-07-25 17:35:05 +01:00
jean-pierre charras 6f7d5f5e2b Footprint editor: fix some issues in flip and mirror commands.
more about fixes #4958
https://gitlab.com/kicad/code/kicad/issues/4958
2020-07-25 18:10:24 +02:00
Jeff Young bf445c1a95 Performance enhancements.
1) cache pad polygon outlines
   huge improvement in connectivity performance and a decent
   improvement in DRC performance
2) don't pre-allocate CONTEXT stack
   significant improvement in DRC rule performance
2) don't keep re-encoding strings
   decent improvement in DRC rule performance
2020-07-25 13:03:33 +01:00
Jeff Young d1d7f5e7fa Fix text size in Edit Footprint dialog. 2020-07-25 13:03:33 +01:00
jean-pierre charras 377da31fcc D_PAD copy ctor and operator = : fix missing copy of pad name and pin function members. 2020-07-25 13:28:20 +02:00
jean-pierre charras bebba1df61 D_PAD copy ctor and operator = : fix missing copy of m_LengthPadToDie member. 2020-07-25 08:29:33 +02:00
jean-pierre charras b5960dfb40 class D_PAD: add Copy ctor and operator =.
Due to the fact basic primitives for custom pads are now managed by
a list of pointer, the default copy ctor and default  operator = do not work
(the basic primitives list must be duplicated).
It fixes issues related to primitives list id pad edition, footprint edition
and undo/redo

Fixes #4958
https://gitlab.com/kicad/code/kicad/issues/4958
2020-07-24 18:02:56 +02:00
Jeff Young f97c50bfde Give excluded DRC items their own layer.
(And fix a bug with the new mulit-layer zones and rule-based keepouts
at the same time which prevented me from testing it.)

Fixes https://gitlab.com/kicad/code/kicad/issues/4954
2020-07-24 01:28:25 +01:00
Jeff Young 6529e339a9 Don't store context in the uCode. (It's not thread-safe.)
Although it does give some pretty funny results when filling zones.
2020-07-23 22:21:13 +01:00
Jeff Young b60303efdb Fix crash due to uninitialised variable. 2020-07-23 17:20:32 +01:00
Jeff Young f2812773d4 Better handling of undefined values in Rule expressions.
This is particularly important to keep the user from having to
enter overly verbose statements such as:
A.Type == 'via' && A.Via_Type == 'buried'
when:
A.Via_Type == 'buried'
is perfectly clear.
2020-07-23 16:41:58 +01:00
jean-pierre charras c254b331f3 Pcbnew: Activate pad fabrication property in pad properties dialog.
It was previously an option of advanced config since 6 months.
It is now not optional.
2020-07-23 14:33:24 +02:00
Jeff Young 86c9adbcba Add auto-completion for DRC rule function calls. 2020-07-22 21:28:02 +01:00
Tomasz Wlostowski 70b98c3b49 router: dump entire event log + annotated PCB upon user request 2020-07-22 18:05:54 +02:00
Tomasz Wlostowski 379aa8f3b5 router: clearer distinction between LOGGER and DEBUG_DECORATOR classes.
The first one keeps a log of events (start routing, mouse motion, etc).
The second allows for adding temporary debug drawings and messages which are stored synchronously with the events in LOGGER.

The event stream together with the PCB design (now with UUIDs) can be used to deterministically replay routing bugs as the user sees them.
2020-07-22 18:05:54 +02:00
Tomasz Wlostowski 2a2e389a94 router: auto-guess track posture from mouse movements, experimental! 2020-07-22 18:05:50 +02:00
Tomasz Wlostowski fd07e94760 router: abstract segment links into a LINK_HOLDER interface. DIFF_PAIRS are now also linkable 2020-07-22 17:04:42 +02:00
Jeff Young a6b6084a60 Add preflighting for DRC rule function calls. 2020-07-22 14:33:32 +01:00
jean-pierre charras a61ea1fb0c Fix a compil warning 2020-07-22 09:02:30 +02:00
Ian McInerney 450107e453 Remove if statement with duplicated branches in router 2020-07-22 00:18:30 +01:00
Jeff Young fd647a1fa9 Code completion hookup to property manager. 2020-07-21 23:43:10 +01:00
Jeff Young c52df811ae Add expression eval to constraint min/max/opt values.
Also adds error reporting for above.
2020-07-21 23:43:10 +01:00
Jeff Young 7cbd166df7 Don't complain about duplicate names when the name didn't change. 2020-07-21 23:43:10 +01:00
Jeff Young beb5bad9b7 Initialize Scintilla with correct braces for sexpr grammar. 2020-07-21 23:43:10 +01:00
Ben Ellis 42a2f13464 Added a check that sexprs isn't empty before popping
This fixes a crash on malformed sexprs in the DRC rules panel
2020-07-21 14:52:48 +00:00
Jeff Young 1790c536ef Allow user layer names to be used in DRC rules.
I imagine this will also fix the property inspector, once it
gets merged.
2020-07-20 23:28:54 +01:00
Jeff Young 095937563b Hook libeval compiler up to rule parser
- convert expression string tokens to single-quote-delimited
- fix bug where netclass assignments weren't getting updated after
  board setup dialog
- move property manager rebuild to lazy evaluation
- improve performance with wider use of const&
- retire DRC_SELECTOR stuff
- use wxString for GUI stuff (particularly translated stuff)
- fix EqualTo() to return false instead of asserting when op types
  don't match
- fix buffer overruns with fixed-size string buffers
- make expression function calls case-insensitive
- integrate expression errors into rule parser
- produce more and better error messages
- keep BOARD_ITEM ptrs const as long as possible
- fix a couple of uninitialized variables
2020-07-20 22:11:53 +01:00
Mark Roszko 3b727b5d16 Make preference groups not selectable 2020-07-20 13:45:46 +00:00
Ian McInerney 20c1492b6a Initialize pointers to nullptr in copy constructor
Fixes https://gitlab.com/kicad/code/kicad/issues/4940
2020-07-20 11:31:34 +01:00
jean-pierre charras ba90416096 Pcbnew, legacy plugin (for .brd files): remove non working code.
This code controls the visibility of items, is not useful and does not
make sense for some items in current Pcbnew version.
2020-07-19 09:32:53 +02:00
Ian McInerney 967587adcc Guard against dynamic cast failure 2020-07-19 01:47:03 +01:00
Ian McInerney 50b2271f84 Fix missing variable initialization 2020-07-18 23:56:39 +01:00
Ian McInerney 2542d41481 Fix copy constructors for BOARD_DESIGN_SETTINGS and ZONE_CONTAINER 2020-07-18 23:55:06 +01:00
Seth Hillbrand 4aef369ca2 Remove accidentally committed test file 2020-07-18 13:03:22 -07:00
Ian McInerney 7b705af038 Refactor common QA components to create a single common library
This moves the program-specific code (e.g. BIU files) into
the program tests.

Also, create title_block.cpp to break a dependency that pulled
in eda_text.cpp when using the TITLE_BLOCK object.
2020-07-18 16:21:15 +01:00
jean-pierre charras a25f7cc0a4 Pcbnew, footprint editor: make switching layers visibility on/off working.
In footprint editor the board is a dummy board not managed by project settings,
so using its settings to manage layers visibility does not work.

Fixes #4924
https://gitlab.com/kicad/code/kicad/issues/4024
2020-07-18 10:31:06 +02:00
Jeff Young 3fd0a3f842 Update text variables even when they're changed from other binary.
For instance, you might have PCBNew open but change the variable
value through EEschema > Schematic Setup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4918
2020-07-17 21:05:11 +01:00
jean-pierre charras e7e1d5140e Pcbnew, DRAWSEGMENT plot function: add missing plot code for S_RECT shape.
Fixes #4905
https://gitlab.com/kicad/code/kicad/issues/4905
2020-07-17 11:26:35 +02:00
Jon Evans 5401f06fce Don't nag when we can't save project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4164
2020-07-16 22:56:02 -04:00
Jon Evans 5444a1b4b0 Only init display options after creating a canvas
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4909
2020-07-16 22:27:03 -04:00
Jeff Young 944c9eac7c Allow Update Schematic from PCB to re-link based on refdes.
Fixes https://gitlab.com/kicad/code/kicad/issues/4306
2020-07-16 18:32:49 +01:00
Ian McInerney da6d0c9de6 Add cancel to the selection context menu if a tool is running
The selection tool's context menu is displayed during the move tool,
so it should contain the ability to cancel the current action.
2020-07-16 15:12:58 +01:00
Ian McInerney 5ba0855c36 Add move operators to MODULE
This fixes a memory leak in the std:: containers in MODULE
that is noticable when moving a module on the board and cancelling
the operation.
2020-07-16 02:11:51 +01:00
Ian McInerney af729d578f Unify settings reset buttons into one location 2020-07-16 00:08:16 +01:00
Ian McInerney b428364a98 Fix memory leak in color settings panel 2020-07-16 00:04:17 +01:00
Seth Hillbrand 7f991ce855 Revert "Set DoubleBuffering to reduce flicker"
This reverts commit 106259f6e6.
2020-07-13 20:23:12 -07:00
Seth Hillbrand e19a7910f8 Revert "Revert "Set DoubleBuffering to reduce flicker""
This reverts commit c18cab6154.
2020-07-13 20:19:10 -07:00
Jon Evans d349b24f7a Unlink board from project before close
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4876
2020-07-13 20:48:18 -04:00
Jeff Young efc3f8c29d Remove unused nets when updating PCB.
Fixes https://gitlab.com/kicad/code/kicad/issues/4247
2020-07-13 22:41:56 +01:00
Jeff Young 1cd2a51db2 Make undo/redo lists protected. 2020-07-13 15:53:36 +01:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

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

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

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Seth Hillbrand 9f09c3872f Ensure file reads always use the C-locale variant
Str2Double assumes current locale.  We usually switch the locale when
reading files but we should be using the function that explicitly gets
the C-locale conversion.
2020-07-12 20:03:50 -07:00
Jon Evans a2041073ee Skip project backup in standalone mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4867
2020-07-12 11:42:05 -04:00
Jon Evans 2ea42196ed Ensure high contrast mode gets a proper default value
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4864
2020-07-12 11:34:58 -04:00
Jon Evans 2f31bf278b Fix layer hotkey dispatch
Hotkeys received by more than one tool need AF_NOTIFY
2020-07-11 21:59:16 -04:00
Jon Evans 5d118b0700 More visibility settings infrastructure
ADDED: Three-state high contrast mode action
ADDED: Save contrast mode in local settings

Also some initial infrastructure for layer presets
2020-07-11 21:59:07 -04:00
Jeff Young 9b92b275de Remove vestiages of old open-PCB-for-settings hack.
We used to have to open a PCB_EDIT_FRAME to get the settings for
the footprint editor and footprint viewer.  This necessitated some
special processing when opening a PCB_EDIT_FRAME to actually edit
a board as it might already be open but unloaded.

Since the new settings architecture allows the footprint editor and
footprint viewer to init themselves we no longer need the special-
case code.
2020-07-11 21:19:49 +01:00
Jeff Young e325d2e18f Allow Net Inspector to create, rename and delete nets.
ADDED: create/edit/delete nets in PCBnew Net Inspector
ADDED: update from PCB now allows updating of changed nets

Fixes https://gitlab.com/kicad/code/kicad/issues/1996
2020-07-11 21:19:49 +01:00
Seth Hillbrand c18cab6154 Revert "Set DoubleBuffering to reduce flicker"
This reverts commit 106259f6e6.

In its place, we set double buffering to only menubars in an attempt to
find a soluton to #4785

Fixes https://gitlab.com/kicad/code/kicad/issues/4863
2020-07-11 09:43:30 -07:00
Ben Ellis 4486b0b6d6 Fixed bounds checking. Not the root cause but keeps things from crashing. 2020-07-11 02:24:48 +00:00
Jon Evans d248736f08 Draw ratsnest with colors if color data is available 2020-07-10 21:37:53 -04:00
Jon Evans 72b08f2b18 ADDED: Hide ratsnest for specific nets
List of hidden nets stored in project local settings
Hide/Show actions in context menu only for now, will
add them to some more GUI places soon.

Ref https://gitlab.com/kicad/code/kicad/-/issues/1951
2020-07-10 21:06:17 -04:00
Seth Hillbrand 106259f6e6 Set DoubleBuffering to reduce flicker
This sets double buffering for GTK and MSW to minimize flicker when
redrawing window elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/4785
2020-07-10 09:29:42 -07:00
jean-pierre charras 2675f69479 Hyperlynx export: use the board current stackup parameters instead of fixed prms
Fixes #4856
https://gitlab.com/kicad/code/kicad/issues/4856
2020-07-10 17:30:56 +02:00
Seth Hillbrand 7201e9d7eb pcbnew: adjust component hash for GenCAD export
The previous hash was not unique for changes in integer/boolean values.
Generic hash_combine routines provide decent coverage for limited extra
cycles.
2020-07-09 17:40:30 -07:00
Jon Evans bb596ac139 Add Move with Reference to Special Tools menu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4838
2020-07-09 12:02:26 -04:00
Jeff Young 998c216487 Remove some nag tests which keep you from doing a DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/4845
2020-07-09 16:22:59 +01:00
Jon Evans b1b9cef5fb Full-project automatic backup system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4763
2020-07-09 13:55:19 +00:00
jean-pierre charras 5226d6b4df libcommon build: add NGSPICE_INCLUDE_DIR in include list (similar to Eeschema build).
Useful when ngspice is build by the developer in a specific folder.
Fix also an other minor compil warning.

Fixes #4851
https://gitlab.com/kicad/code/kicad/issues/4851
2020-07-09 08:46:59 +02:00
Jon Evans afd432e687 Infrastructure for net hiding
LoadProjectSettings changed to take place after the board
has been loaded so that board-specific project settings can
be applied (such as net visibility and color overrides)
2020-07-08 21:59:34 -04:00
Jeff Young 741481591e NetClass settings for Eeschema.
ADDED Eeschema-specific netclass settings including wire and bus
thickness, color, and line style.

Netclasses override individual wire & bus colors and line styles.
If that proves an issue we might look at something more sophisticated
with inheritance.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-08 21:23:25 +01:00
Michael Kavanagh 841b08f9a6 Pcbnew: add Eeschema and Fp editor to tools menu
Unify with the Eeschema tools menu.

Fixes https://gitlab.com/kicad/code/kicad/issues/4840
2020-07-08 11:17:27 +01:00
Jon Evans 961fbadd23 Initial infrastructure for net/netclass colors in board 2020-07-07 22:21:45 -04:00
Ian McInerney ccc0ceb32f Remove deleted item global variables
Fixes https://gitlab.com/kicad/code/kicad/issues/4819
2020-07-07 23:12:17 +01:00
Seth Hillbrand 7cea4b23f1 ADDED: Expand selection in context menu
Break out the context menu with heuristically limited choices being
appended to the main list rather than re-selecting

Fixes https://gitlab.com/kicad/code/kicad/issues/4799
2020-07-07 14:18:35 -07:00
Jeff Young e66523586b Add Assign Netclass... to context menu.
ADDED Assign Netclass feature to EEschema.

Netclass assignments also now shown in status bar.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-07 14:23:39 +01:00
jean-pierre charras eab98eee1d 3D viewer: use the full board bounding box to define the visible area.
Remove also a printf now useless, used for debug.

Fixes #4815
https://gitlab.com/kicad/code/kicad/issues/4815
2020-07-07 11:40:35 +02:00
Jon Evans b084305b12 Clean up some pcbnew file handling bugs 2020-07-06 21:53:28 -04:00
Jon Evans a3655225cd Save selection filter state in project local settings 2020-07-06 21:53:12 -04:00
Jon Evans 707ce66cc6 ADDED: Move with Reference action
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/4755
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2304
2020-07-06 19:33:14 -04:00
Jeff Young 3939b31027 Integration of netclasses into Eeschema.
This is mostly architecture, with the hookup of the Schematic Setup
dialog's Net Classes page.  Things like assigning to a net on the
canvas to follow.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-06 20:00:50 +01:00
Jeff Young b0ca7d5140 Netclass setup for Eeschema.
ADDED netclass panel in Schematic Setup dialog.

Fixes https://gitlab.com/kicad/code/kicad/issues/2132
2020-07-06 20:00:50 +01:00
Jeff Young 2819570d1e Push panel_setup_netclasses down into common. 2020-07-06 20:00:50 +01:00
Jeff Young d85a707385 Move rest of DRC to SHAPE collision architecture. 2020-07-06 20:00:50 +01:00
Jon Evans 2a1550d1d2 Don't crash when failing to deserialize old exclusions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4820
2020-07-06 12:53:55 -04:00
Jon Evans db4502e2ae Add copy ctor for BOARD_DESIGN_SETTINGS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4817
2020-07-06 12:45:57 -04:00
Jon Evans 4e54b773e9 Fix some asserts with the property system
It seems like there may be some race between BOARD_CONNECTED_ITEM_DESC
and BOARD_ITEM_DESC

https://gitlab.com/kicad/code/kicad/-/issues/4816
2020-07-06 12:17:36 -04:00
jean-pierre charras 0ff866895a module and pad display info: add rotation angle.
This is a useful parameter, so it must be displayed on the pmessage panel.
2020-07-06 15:00:36 +02:00
jean-pierre charras 0d8c6d43a8 fix minor I18N issues. 2020-07-06 13:47:42 +02:00
Ian McInerney 476558ece7 Cleanup some memory leaks 2020-07-06 02:11:17 +01:00
Tomasz Wlostowski 49c37014f7 Updated copyright headers in expression evaluator code 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 0423fa1ec1 MARKER_PCB: include DRC_ITEM 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski a4eb92993a D_PAD: remove const causing introspection build issues 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 8ffa86a63f get it to compile after rebase 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski b3ce23f0e2 PCB_EXPR_EVALUATOR: implement isPlated virtual property 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 4e00ad9ca9 PCB_EXPR_EVALUATOR: implement onLayer() method 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 5372daaedf OnLayer virtual property in PC_EXPR_EVALUATOR 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski af5afb5dd7 pcbnew: initial version of PCB-specific expression evaluator 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 8bb442ac37 pcbnew: try to compile 'old' DRC alongside the new prototype 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 539984229d Temporarily disable D_PAD/MODULE GetLocalClearance property in introspection engine 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski e60055dcc5 BOARD_CONNECTED_ITEM: Don't use spaces in property nameS 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski c1d5394e46 properties: post-rebase fixes 2020-07-05 22:44:38 +02:00
Maciej Suminski 04728278c0 Updated classes meta-data to take advantage of property replacement 2020-07-05 22:44:38 +02:00
Maciej Suminski a988cab84e Net & net class properties 2020-07-05 22:44:38 +02:00
Maciej Suminski a289056a9e Properties meta-data for pcbnew classes 2020-07-05 22:44:38 +02:00
Maciej Suminski 89698a727b Removed const modifier for returned non-reference types 2020-07-05 22:44:38 +02:00
Jeff Young 5bc6389477 Comments. 2020-07-05 19:53:04 +01:00
Jeff Young 40d8cb1a19 Fix missing reference found in code review. 2020-07-05 19:53:04 +01:00
Jeff Young edecfaa433 Minor code cleanup. 2020-07-05 19:53:04 +01:00
jean-pierre charras 82da739786 Better calculations in TransformRoundChamferedRectToPolygon().
the old calculations was creating a slightly too small shape for rounded corners.

Now the polygon is outside the perfect shape (as required to create a shape with clearance)

Fixes #4805
https://gitlab.com/kicad/code/kicad/issues/4805
2020-07-05 19:32:07 +02:00
Jon Evans 3ebd5b317b Don't try to switch projects during autosave
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4800
2020-07-05 11:02:48 -04:00
jean-pierre charras 1463dd10b2 Pcbnew fix: Select/Expand Connection can be used only once on the same segment
Was due to a incorrect cleared flag in calculations.

Fixes #4767
https://gitlab.com/kicad/code/kicad/issues/4767
2020-07-05 12:42:12 +02:00
Jon Evans 2f4a14a57b Properly exclude colorless GAL layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4793
2020-07-03 23:23:58 -04:00
Jon Evans 0148c1db84 Support layer switch hotkeys while routing
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4699
2020-07-03 19:49:19 -04:00
Jon Evans 3d7610d6b9 Hide PNS debug graphics behind an AC key
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4061
2020-07-03 19:33:36 -04:00
Jon Evans a9e97848dd Fix use after free on BOARD_DESIGN_SETTINGS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4792
2020-07-03 19:13:06 -04:00
jean-pierre charras 286c36b7da gl_utils.h: fix compil issue on Windows
__WINDOWS__ is defined in wxWidgets.
the right preprocessor symbol is _WIN32 for Windows 32/64 bits
2020-07-03 17:12:36 +02:00
Thomas Pointhuber 7ba6a77c94 Improve arc geometry manager to choose the direction which makes more sense
As long as the arc angle stays below <60°, it will automatically choose between
clockwise and counter clockwise. This allows the user to choose the direction
with a simple mouse movement.
2020-07-03 15:05:17 +00:00
Jon Evans 4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00
Jon Evans fe5959b625 Remove the schematic and board backup file system
Per discussion on the developers list, this old system
no longer provides much value and is seen as annoying
by many users.  The new save logic should prevent any
cases of file corruption on save, which was a major
reason for the backup file system existing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2012
2020-07-02 22:08:54 -04:00
Jon Evans b592a4169f Update project template system for new format 2020-07-02 22:08:54 -04:00
Jon Evans 12b4a55ae8 Port Eeschema to new project settings
DRC/ERC error serialization changed to use explicit tokens
Old stored severities and ignored errors are discarded
2020-07-02 22:08:54 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Jon Evans a4fadfcdf2 Begin moving project file load to new system 2020-07-02 22:08:54 -04:00
Jon Evans a7708fa6dc Add PROJECT_FILE and basic load/unload methods 2020-07-02 22:08:54 -04:00
Ian McInerney c27207500d Cleanup some compiler warnings 2020-07-03 00:10:31 +01:00
Jeff Young 2cfd6ba978 Fix a couple of integer overflows. 2020-07-02 22:52:37 +01:00
Jeff Young eb1ff80d57 SHAPE collision fixes.
1) An actual distance of 0 is still a collision, even if the allowed
distance is 0.
2) Be consitent about edges and interiors.  Everyone expect the edge
of a RECT to be part of the RECT; same with a CIRCLE.  SHAPE_POLY_SET
shouldn't be any different.  (And SHAPE_LINE_CHAIN was a split-
personality with the edge considered part of it for Collide() but not
for PointInside()).
2020-07-02 21:38:37 +01:00
Seth Hillbrand 54aaade47e 'const void' is not a return type 2020-07-02 11:43:18 -07:00
Seth Hillbrand d663be853f Explicitly add signed/unsigned comparison to warnings 2020-07-02 10:54:34 -07:00
Jeff Young 441dfa30f0 Return individual custom pad shapes instead of a SHAPE_POLY_SET.
Also implements an optional pointer to return the actual distance
from all the SHAPE collision routines.

Fixes https://gitlab.com/kicad/code/kicad/issues/4774
2020-07-02 17:09:15 +01:00
jean-pierre charras af8f05d570 Fix incorrect calculation of pad bounding box
Fixes #4776
https://gitlab.com/kicad/code/kicad/issues/4776
2020-07-02 11:33:07 +02:00
Jon Evans f8bfb2bc16 Fix several issues with multilayer zones
- Properly refill if layer set is modified
- Fix some threading issues with island removal
- Fix copy constructor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4765
2020-07-01 20:51:44 -04:00
jean-pierre charras bba5cfe17e fix a minor compil warning 2020-07-01 18:52:42 +02:00
jean-pierre charras 8d18f289c7 remove a message printed only for debug/test. 2020-07-01 18:52:42 +02:00
Jeff Young 424d551054 Cache pad bounding boxes for performance.
Also allows us to return to a LOD test for pad numbers which treats
round and square pads the same.
2020-07-01 16:57:00 +01:00
Jeff Young 3b764d6357 Minor dialog spacing issues. 2020-07-01 16:57:00 +01:00
Jeff Young 8c4bfed001 Slight improvement on function names. 2020-07-01 16:57:00 +01:00
jean-pierre charras 3993181de5 D_PAD::BuildEffectiveShapes(): fix incorrect rect shape size for rect pads
rotated by +-90 deg
Noticeable in PnS router.

Fixes #4771
https://gitlab.com/kicad/code/kicad/issues/4771
2020-07-01 16:06:31 +02:00
Jeff Young 7b042f4a75 Add rectangle tool to PCBNew toolbar in favour of Aux Origin.
ADDED new rectangle graphics tool for PCBNew and Footprint Editor.

Also adds rectangle tool to both Footprint Editor and PCBNew Place
menus.

The Aux Origin tool can come back once we have multi-select toobar
buttons.

Also collapses an unnecessary level out of the auxOrigin and gridOrigin
settings.

Fixes https://gitlab.com/kicad/code/kicad/issues/2246
2020-07-01 13:31:30 +01:00
Jon Evans 32b7b0c617 Fix filled zone rotation and move operations 2020-06-30 22:26:30 -04:00
Jeff Young 40847c055d Check final corner of rectangle before merging.
Fixes https://gitlab.com/kicad/code/kicad/issues/4766
2020-06-30 21:01:51 +01:00
Jeff Young 40a72d9530 Add SH_RECT handling to 3D shape conversion.
Also add some debugging for not-implemented shape cases in other
places to catch simmilar issues in future.

Fixes https://gitlab.com/kicad/code/kicad/issues/4757
2020-06-30 18:32:31 +01:00
jean-pierre charras 42296d7eb9 fix issues in DRC and fill zone, related to recent changes in code.
Note also: the actual clearance between 2 pads when < minimal clearance
is incorrectly calculated.
2020-06-30 12:59:26 +02:00
Jon Evans 49c7ba6724 Make it easier to select keepouts 2020-06-29 20:37:57 -04:00
Jeff Young e91b7cf18f Separate the two offset strategies for PointEditor Pad editing.
This doesn't indicate what I think we should do with them; it will
just make whatever we decide easier to do.
2020-06-29 23:25:13 +01:00
Jeff Young d67f404dec Fix undo issue with merging lines into rectangles. 2020-06-29 22:58:05 +01:00
Jeff Young 36e94773a3 Adjustments to point-editing of pads.
1) Don't offset pad with no hole and no offset: move them instead.
2) Don't allow editing of locked pads in board editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/2153
2020-06-29 19:22:38 +01:00
Jon Evans 44f3cdb31e Fix a few issues with zone islands 2020-06-29 12:16:37 -04:00
Jeff Young 9cbcf3fe56 Improve pad annotation for custom-shaped pads.
Use the bounding box instead of the anchor pad size for determining
LOD and size/location of annotations.
2020-06-29 12:48:55 +01:00
Jeff Young 8ac3a3cbc0 Replace missing "sketch text" option from ModEdit View menu. 2020-06-29 12:08:11 +01:00
Jeff Young 516de9c85e Point editor hookup for non-custom-shaped pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/2153
2020-06-29 11:50:44 +01:00
jean-pierre charras a229e51962 Pcbnew: fix incorrect clearance of oval pads in zone fill.
(The clearance value was only half of the correct value)
2020-06-29 09:57:36 +02:00
Seth Hillbrand 224b41e8b1 Fix a threading segfault when filling zones
The shape cache gets reset by the zone fill algorithm.  This needs to be
cleaned before multiple threads are created and cannot be modified when
threading.

Fixes https://gitlab.com/kicad/code/kicad/issues/4723
2020-06-28 11:12:31 -07:00
Jon Evans 65f5ebd8f2 ADDED: Persistent selection filter UI for PcbNew 2020-06-28 15:12:47 +00:00
Jon Evans 1d5e4f86af ADDED: Copper zone island removal is now configurable
ADDED: Zones and keepouts can now be named (for DRC)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4392
2020-06-28 09:09:38 -04:00
Jon Evans 0d4ee39f75 CHANGED: Copper zones can be on more than one layer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1963
2020-06-28 08:52:37 -04:00
Jon Evans 0b34cea3d5 Add an optional name property to zones 2020-06-28 08:51:57 -04:00
jean-pierre charras 67f46a0bb1 Gerber plotter: Better object attributes handling when plotting a zone
- Clear object attributes before and after plotting a zone.
It avoid using previously defined object attributes when plotting the next zone,
and using therefore incorrect attributes.
- Add aperture attribute to filled zone solid polygons (regions in Gerber)
2020-06-28 12:29:36 +02:00
Jon Evans bd19c580f4 Add configuration for cross-probing behavior
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2317
2020-06-27 22:48:48 -04:00
Jon Evans 9795d30f12 Fix iteration issue in physical stackup editor
Also switch to KiCad color chooser

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4735
2020-06-27 21:42:09 -04:00
Jeff Young 304328ca13 Fix Linux compile error. 2020-06-27 22:27:49 +01:00
Jeff Young 367fd79b5f Don't try and second-guess the user.
(Especially now that polygons are useful on copper layers for custom
pad shapes.)
2020-06-27 22:08:13 +01:00
Jeff Young 6acd35c981 Cleanup. 2020-06-27 20:07:26 +01:00
Jeff Young 32c3ea4edd Flags cleanup.
Remove extraneous use of FLAG0 from tracks cleaner (it was checked but
never set).

Fix issue in expand connections where two parts of it couldn't agree
on the same flag (BUSY vs SKIP_STRUCT), and where the second part was
clearing the flag instead of setting it.

Remove obsolete HIGHLIGHT infrastructure (we now use selection).

Remove extraneous use of BUSY flag in several places (it was never
set).
2020-06-27 17:53:04 +01:00
Jeff Young da2b7071b4 WYSISYG custom pad editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2153

Fixes https://gitlab.com/kicad/code/kicad/issues/2305
2020-06-27 14:37:01 +01:00
Jon Evans 129c16cf7d Fix unselected event not firing when clicking empty space 2020-06-26 22:00:12 -04:00
Ian McInerney 17adb6c3c6 Add context menu to route and zone toolbar items
ADDED: Context menu for route and zone toolbar items
2020-06-26 21:29:03 +00:00
Ian McInerney fb10406e67 Add right-click context menus for toolbar items 2020-06-26 21:29:03 +00:00
Ian McInerney 52856a8ce4 Move scaled toolbar separator into ACTION_TOOLBAR
* Ensure all separators are scaled separators
* Clean up toolbar creation functions
2020-06-26 21:29:03 +00:00
Peter Montgomery 19b7755ab7 Coverted Gerbview files to version in master so hotkey_rollover repo only contains changes for the hotkey fix 2020-06-25 22:43:29 +00:00
Seth Hillbrand 4ef02fd699 Replace TTL delauney triangulator
Removes the TTL triangulator in favor of the delaunator triangulator.
This removes the only AGPL code in the KiCad codebase and therefore
allows the full project to be licensed under the GPLv3.
2020-06-25 18:45:27 +00:00
jean-pierre charras c9715ce304 class_pad.h: mark m_shapesDirty true after a move to force rebuild shapes after a move.
Fix also a few comments.

Fixes #4719
https://gitlab.com/kicad/code/kicad/issues/4719

Fixes #4720
https://gitlab.com/kicad/code/kicad/issues/4720
2020-06-25 20:07:51 +02:00
Seth Hillbrand a893d19d26 pcbnew: Allow slow ratsnest to turn off
Depending on where you move the selection, the slow ratsnest might turn
on.  This prevents that setting from being sticky, reverting to smooth
movement.
2020-06-24 17:16:07 -07:00
Seth Hillbrand b02d3f683f Adding documention comments for dynamic ratsnest 2020-06-24 15:17:01 -07:00
Seth Hillbrand 4c5f3cb5be Fix crash when moving non-connected
Non connected items do not have netcodes, so shouldn't be included in
the calculation for ratsnest
2020-06-24 14:22:01 -07:00
Jeff Young e376750f62 Flatten CS_PAD_PRIMITIVE out in favour of reusing DRAWSEGMENT.
(In prep for the eventual replacement of DRAWSEGMENT internals with
SHAPE.)
2020-06-24 12:22:42 +01:00
Seth Hillbrand 1a7c270dcd Fix invalid dereference on first highlight
When highlighting nets we don't save the previous net when there isn't a
previous net highlighted.
2020-06-23 20:36:05 -07:00
Seth Hillbrand 141bf4f579 Tighten the bicolored routine
Eliminates some duplicate code into a lambda
2020-06-23 16:48:24 -07:00
Seth Hillbrand e8fc421a39 Update NearestBicoloredPair to m log(n) search
Instead of iterating over full set, use sweep line algorithm to limit
the number of nodes needed to be searched.  This improves the speed of
the dynamic ratsnest.
2020-06-23 16:17:35 -07:00
Seth Hillbrand 214a9d53b0 Update ratsnest conn to multiset 2020-06-23 14:39:45 -07:00
Seth Hillbrand a2ad84f84d Revise Kruskal implementation
This updates the Kruskal algorithm to a faster variant utilizing a
compressed disjoint set and heap
2020-06-23 14:35:23 -07:00
Jon Evans 2ab9ceaf02 Pick up net for new zone from selection if no net is highlighted
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4706
2020-06-23 17:16:34 -04:00
Jeff Young 18ab3c4714 Fix missing user grid in COMMON_TOOLS.
Fixes https://gitlab.com/kicad/code/kicad/issues/4702
2020-06-23 11:17:15 +01:00
Seth Hillbrand 104ff29e5f Remove delauney computations from dynamic ratsnest
Avoids additional calculations on movement by using cached ratsnest for
internal nets and keeping bicolored line calc for others.

Fixes https://gitlab.com/kicad/code/kicad/issues/1865
2020-06-22 20:37:31 -07:00
Jeff Young d01b29ab37 Cleanup pad geometry handling.
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.

This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
2020-06-22 22:28:37 +01:00
Jeff Young c57c21f577 Pad bounding radius is from pad centre, NOT shape centre. 2020-06-22 20:36:54 +01:00
Jon Evans c0175c48af ADDED: Setting to control track mouse drag behavior
Default is now to perform a 45-degree drag
2020-06-21 15:39:39 -04:00
jean-pierre charras 55e283634a Pcbnew, DIALOG_PLOT_BASE: better warning message about non null solder mask margins. 2020-06-21 20:41:06 +02:00
Jon Evans 713cd4a47a Point editor: show dragged points with a highlight
Take points editor colors from color theme

Also fix an issue where the edited object sometimes didn't
update when a point is dragged.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4600
2020-06-21 14:43:41 -04:00
jean-pierre charras 7240b3e4d3 PCB_PAINTER for D_PAD: for round and oval shapes, use native gal draw functions,
instead of convert shapes to polygons.
For small pad sizes (< 0.5mm) the polygonal shape is really ugly.
Moreover, circles and oblong shapes are native in gal and give a much better look.
2020-06-21 19:47:26 +02:00
Jon Evans a16c9df79c Delete the right object in arc cleanup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4694
2020-06-21 13:03:14 -04:00
jean-pierre charras ad69e449fe Fix a collision name in drawing_tool.h with a msys2 header 2020-06-21 10:36:01 +02:00
Jeff Young 970921f88b Support for filled DRAWSEGMENT::S_RECT and S_CIRCLE.
One more step in unifying pad primitives and draw segments.
2020-06-20 14:34:53 +01:00
Jeff Young 986c1a27cd Make sure line widths (and clearances) are handled on rectangles. 2020-06-20 14:34:53 +01:00
Jeff Young 7877e4083e Don't match to an unknown layer. 2020-06-20 14:34:53 +01:00