Commit Graph

5757 Commits

Author SHA1 Message Date
Jeff Young 88d76eaf62 Enforce Apple's destructive button distance guideline.
Also fixes a few errant icon buttons that were still setting a fixed
size.
2020-08-17 23:55:31 +01:00
Ian McInerney 4491f24d5e Ripout the old SyncToolbars infrastructure reminants
The tool framework no longer needs to request updates of the UI
state for the controls, wxWidgets will do it for us.
2020-08-16 19:10:26 +00:00
Ian McInerney fd4388710d Migrate eeschema, libview and libedit to the UI condition framework
Also, fix some issues in other frames identified along the way.
2020-08-16 19:10:25 +00:00
Ian McInerney 3b05d7cddd Move more frames to the new UI condition framework
* Frames moved: cvpcb, cvpcb footprints frame, gerbview, pagelayout editor

This also introduces new EDITOR_CONDITIONS that are used to set the
conditions of very common editor settings.

Also, some IDs were converted to tools in the pagelayout editor.
2020-08-16 19:10:25 +00:00
Ian McInerney 72a1c71e07 Implement a framework to handle wxUpdateUIEvents for tool actions
This allows for the tool framework to keep track of a universal
set of conditions for the UI state (enabled/checked/shown) for
controls of actions. It removes the need for the main menubar
menus to be CONDITIONAL_MENUs and be rebuilt on each open,
and instead makes the updates of the check and enabling of
items handled in the native wxWidgets way.

This commit switchs the 3d viewer and kicad project manager window
over to this system.
2020-08-16 19:10:25 +00:00
Ian McInerney 61cdf3436b Ensure PAINTER::Draw routines properly handle EDA_ITEM casting
EDA_ITEM is a child of VIEW_ITEM, so a static_cast is not appropriate,
since in some cases it could be called with a non-EDA_ITEM argument.
This was triggering an ASAN heap-buffer-overflow in GerbView.
2020-08-16 12:37:51 +01:00
Ian McInerney ade7f529b8 Switch shared_ptr creation to using make_shared 2020-08-16 12:37:50 +01:00
PJM f58221ca98 Add 'GetBoundingBox' that optionally only calcs w visible fields
Cross-probing from Pcbnew to Eeschema revealed that EEschema was
including all fields, visible or not, when calculating the bounding
box of the probed componentt.  This caused problems with long strings
such as URLs that were not set as visible.  The cross-probing code
tries to minimize 'Zoom to Fit' operations when it's not necessary,
and the overly large bbox values often resulted in zooms not being
performed and components displayed very small.

This code adds a version of 'GetBoundingBox' that takes a boolean
to tell it to include invisble fields or not.

Addresses issue: https://gitlab.com/kicad/code/kicad/-/issues/5149
2020-08-15 22:15:30 +00:00
Jeff Young 57c3d8e8d8 Make sure preview group gets added to view after a clear. 2020-08-15 21:13:44 +01:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04:00
Seth Hillbrand 275e810573 eeschema: Use recursive mutex for SCH_PIN
We need to be able to lock individual actions while keeping the code
modular.  The recursive mutex keeps this thread-local.

Fixes https://gitlab.com/kicad/code/kicad/issues/5186
2020-08-14 18:42:11 -07:00
Kevin Lannen e54363524c lib_manager: Do not make a copy of the parent symbol to save
The parent symbol needs to be the same pointer as the symbol that is
saved to the cache otherwise the derived symbol will have it's parent
set to a parent that is not in the cache so it will not be saved.

Signed-off-by: Kevin Lannen <kevin.lannen@gmail.com>
2020-08-14 18:37:44 +00:00
Kevin Lannen 13f9478a76 Symbol Editor: Allow changing parent for derived symbol
The symbol editor did not actually update the parent symbol when the
dropdown in the properties editor was changed. This fixes that defect.

Signed-off-by: Kevin Lannen <kevin.lannen@gmail.com>
2020-08-14 18:37:43 +00:00
Jeff Young 2b0b7a5153 Clear pin net-name-driving cache when changing annotation.
Also update connectivity after clear annotation, annotate or back
annotate.

Also update status bar for highlighted nets.

Fixes https://gitlab.com/kicad/code/kicad/issues/5170
2020-08-14 12:41:20 +01:00
Jeff Young cda155ca30 Remove last exposure of GUIDs in UI.
Also makes the hierarchical path box bigger so it won't clip on some
themes.

Fixes https://gitlab.com/kicad/code/kicad/issues/5171
2020-08-13 20:59:18 +01:00
Wayne Stambaugh 0bb175a028 Eeschema: Add change and update symbol from library support.
ADDED: Add support to to Eeschema to change and update symbols from a
symbol library.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/4565
2020-08-13 13:53:49 -04:00
Tomasz Wlostowski d937fadd6f Migrate RC_ITEM to use shared_ptr 2020-08-13 14:50:59 +02:00
Jeff Young e05cd0e914 Raise limit to prevent zooming on cross-probing.
Fixes https://gitlab.com/kicad/code/kicad/issues/5149
2020-08-12 22:28:18 +01:00
Seth Hillbrand 826f81f57d eeschema: Don't error when replacing references
Avoids an unneeded error message when checking the validity of the
replace action
2020-08-12 07:04:51 -07:00
Jon Evans 433616cbf0 Prevent segfault on schematic frame close
We are seeing multiple events firing when closing via the manager frame.
Cleaning up the schematic should only happen once.
2020-08-11 18:56:47 -04:00
Ian McInerney 259cacf648 Entries typed into the text size field should be read as mils
Previously, they were being interpreted as inches, and then being
displayed as mils - leading to a multiplication by 1000 if there
was no unit string included.

Fixes https://gitlab.com/kicad/code/kicad/issues/5117
2020-08-11 00:14:58 +01:00
Jeff Young e1c449902d Ask user before throwing away changes to DRC Rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/5135
2020-08-10 23:43:24 +01:00
Jeff Young 827138f6b4 Remove left-over debug code. 2020-08-10 14:17:17 +01:00
Jeff Young f4ab14f32d Performance improvements for SchematicCleanup().
Fixes https://gitlab.com/kicad/code/kicad/issues/4563
2020-08-10 12:41:52 +01:00
Ian McInerney 265c6fa3b7 Improve color theme support in the footprint preview widget
This ensures the colors used by the status text pane in the preview
widget are the same as the canvas, so there is a seemless transition
between the two.

Additionally, remove the scrollbars from the symbol preview widget
in the place symbol dialog - they are pointless.
2020-08-10 02:29:15 +01:00
Ian McInerney 63f777b620 Fixup the UI for the symbol preview widget
This is the proper fix for the symbole preview widget. It will ensure
there are no size changes between the two panels (preview and status),
and also ensure that the status panel has the same background color as
the preview panel.

Fixes https://gitlab.com/kicad/code/kicad/issues/4997
2020-08-10 00:55:36 +01:00
Jon Evans 2fc9c7233d Add color layer for schematic aux items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4825
2020-08-09 17:39:52 -04:00
Jeff Young e910dc0092 Make sure lines/wires/busses get default widths if not spec'ed.
Fixes https://gitlab.com/kicad/code/kicad/issues/4854
2020-08-09 21:52:36 +01:00
Jon Evans 5abc85aa80 Cleanup re-annotation code style 2020-08-09 12:43:05 -04:00
bjpiccioni d08bf90576 ADDED: Geographic Reannotation 2020-08-09 12:43:05 -04:00
Mark Roszko c6e388db14 Implement an app progress indicator in the taskbar
ADDED: Progress indicator in the taskbar

This adds a progress indicator to the Windows and macOS taskbar
icons to display the progress of some operations.

Note, this requires wxWidgets 3.1+
2020-08-09 10:55:00 +00:00
Jeff Young 6b7503be8e ADDED properties passed between eescema and pcbnew.
And referencable from textVars.

Fixes https://gitlab.com/kicad/code/kicad/issues/5079
2020-08-08 22:49:04 +01:00
Jon Evans 32a7d00256 Make sure projects are cleaned up nicely when frames close
PROJECT objects will be deleted by SETTINGS_MANAGER::UnloadProject
so we need to make sure that this is called at an early enough point
in the closing process that anything needed by the PROJECT dtor
is still around.

Also fix an issue where the schematic worksheet was depending on
the project existing after the schematic had been reset.
2020-08-08 16:52:57 -04:00
jean-pierre charras 111ed6c4ac Fix simulator: op results are not printed correctly when numbers are very small
Was due to an overflow in units calculation.

Fixes #5074
https://gitlab.com/kicad/code/kicad/issues/5074
2020-08-08 15:18:50 +02:00
Jon Evans dcc484e114 CHANGED: Library editors are now usable with no project loaded
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3688
2020-08-07 18:02:34 -04:00
Jon Evans 413c2cc2c6 Don't use the schematic grid for page border in pcbnew
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5105
2020-08-07 17:12:21 -04:00
Jeff Young 76bd344730 Preview for PCBNew colour settings editor. 2020-08-06 19:38:06 +01:00
Jeff Young 3522fd0535 Refresh for colour changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/4983
2020-08-05 22:56:07 +01:00
Jon Evans b3b567e591 A better approach to clearing color overrides 2020-08-04 19:50:26 -04:00
Jeff Young 9cc6a77cc0 Fix bug where preview wasn't getting re-added after view cleared. 2020-08-04 20:40:40 +01:00
jean-pierre charras c01bf9c911 Refinement in NETLIST_DIALOG, spice panel.
The run simulator button is enabled only if the command line is not empty.
2020-08-04 13:57:41 +02:00
jean-pierre charras 7f91a1f5da Eeschema, export netlist dialog: re-add a commane to run spice from this dialog.
Fixes #5025
https://gitlab.com/kicad/code/kicad/issues/5025
2020-08-04 12:52:14 +02:00
Jeff Young be6e2e6308 Add hierarchical sheet (and pin) to color preview.
Fixes https://gitlab.com/kicad/code/kicad/issues/5029
2020-08-04 11:45:07 +01:00
Jeff Young 9c9fdb2569 More performant (and more correct) deletion of DRC markers.
Fixes https://gitlab.com/kicad/code/kicad/issues/5057
2020-08-04 11:45:07 +01:00
jean-pierre charras 5982626a80 Eeschema: fix a minor wxWidgets alert.
Fixes #5066
https://gitlab.com/kicad/code/kicad/issues/5066
2020-08-04 08:27:31 +02:00
Jeff Young dcd02539e3 Remove linked-pin processing from LIB_PIN's setters.
It belongs in the tool layer (specifically LIB_PIN_TOOL).
2020-08-03 22:21:35 +01:00
Jeff Young c56599ab07 Allow ERC/DRC markers to be deleted without deleting exclusions.
Fixes https://gitlab.com/kicad/code/kicad/issues/4953
2020-08-02 22:45:48 +01:00
Jeff Young f3b92903e2 Evidently the sheet client list isn't kept up-to-date.
Fixes https://gitlab.com/kicad/code/kicad/issues/5021
2020-08-02 19:58:15 +01:00
Jeff Young ee6acb983a Build out the rest of the schematic preview for colors editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/5029
2020-08-01 21:07:14 +01:00
Jeff Young d586495c0a Preview fp edges & text while dragging in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/5037
2020-08-01 15:40:34 +01:00
Jeff Young e86fc64e7d Check envvars as well before flagging as un-resolved.
Fixes https://gitlab.com/kicad/code/kicad/issues/4644
2020-08-01 00:24:26 +01:00
Jeff Young 173493b1a8 Try to store the actual sheet #, but don't store 1 for non-root sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/5021
2020-07-31 22:29:05 +01:00
Jeff Young 5f3fd43b29 Fix uninitialized variable.
Fixes https://gitlab.com/kicad/code/kicad/issues/4948
2020-07-31 17:19:21 +01:00
Jeff Young 1be39195ab Remove UUIDs from the GUI.
Fixes https://gitlab.com/kicad/code/kicad/issues/5018
2020-07-31 16:06:54 +01:00
Jeff Young 047e95ccc4 Fix crash on Preferences > Colors. 2020-07-31 12:04:01 +01:00
Jeff Young 4c5fe7e651 Only update relative paths in nested subsheets.
Fixes https://gitlab.com/kicad/code/kicad/issues/4366
2020-07-31 12:04:01 +01:00
Jeff Young 310613a941 Pin junction dot size to no less than 170% of wire width.
Fixes https://gitlab.com/kicad/code/kicad/issues/4917
2020-07-30 20:04:12 +01:00
Jeff Young 0804f487ec Add text var cross-reference processing to SCH_FIELDs. 2020-07-30 14:27:42 +01:00
Jeff Young cdaa866428 Put UUID on own line. 2020-07-30 14:27:42 +01:00
Seth Hillbrand 0a4ce183a4 ADDED: polygon newlines every point
By default KiCad will now print each polygon point on its own line.
This adds to the vertical distance for large polygons but makes revision
control much cleaner as single point addition to a polygon does not
propagate to a diff over the full polygon.

Users/developers who want to save the files using the 4-points per line
have the ADVANCED_CONFIG setting 'CompactSave' which will provide the
original save method
2020-07-30 01:18:44 +00:00
Jon Evans b0c6a0f9ef Allow sheet colors to remain unspecified if not manually set
This way, when the user changes their color theme, any sheets
that did not have a specific color set will change with the theme.

Also add a button to clear color overrides from a sheet, because
any schematics that have been saved before this change will have
the colors set to something other than UNSPECIFIED.
2020-07-29 21:16:07 -04:00
jean-pierre charras 98b1f55e29 Eeschema: minor fixes: fix incorrect label in DIALOG_LIB_EDIT_PIN, electrical pin list.
Gives also to functions GetText() and GetBitmap() a more significant name.

Fixes #5007
https://gitlab.com/kicad/code/kicad/issues/5007
2020-07-29 17:04:52 +02:00
jean-pierre charras f00c59c446 Fix a few Coverity warnings. 2020-07-29 09:26:57 +02:00
Marek Roszko 9278660b10 Add support for the windows application restart api 2020-07-28 14:32:39 -04:00
Jeff Young 55784afbfe Allow text variables to reference parent sheet's fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/2466
2020-07-28 13:35:37 +01:00
jean-pierre charras 039b6fd5cf Eeschema plot: do not plot the hierarchy sheet symbol background in B&W mode.
if the the hierarchy sheet symbol background is not white, in B&W mode it is black,
and texts are not readable.

Fixes #4987
https://gitlab.com/kicad/code/kicad/issues/4987
2020-07-28 10:13:56 +02:00
Jeff Young b74e125264 Read/write schematic netclass properties.
Fixes https://gitlab.com/kicad/code/kicad/issues/4990
2020-07-27 23:10:46 +01:00
Jeff Young 4479fcc6dc Give HardReset() a better chance of success. 2020-07-27 21:55:08 +01:00
Jeff Young 97964b2a4c Use netclass colour for junction dots and when printing/plotting.
Fixes https://gitlab.com/kicad/code/kicad/issues/4986

Fixes https://gitlab.com/kicad/code/kicad/issues/4982
2020-07-27 21:47:05 +01:00
Jeff Young 8a9fa53cd7 Clear annotations by default on copy/paste.
Folks didn't seem to like the "only clear when there are collisions"
behaviour.  Paste Special remains available to "force keep".

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

Fixes https://gitlab.com/kicad/code/kicad/issues/4744
2020-07-27 19:53:42 +01:00
Mark Roszko 8324cb30b7 Save the wxDisplay index to set the position of windows correctly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4338
2020-07-27 02:53:56 +00:00
Mark Roszko 7bdb98f961 libedit: Make context menu follow context 2020-07-26 20:16:38 +00:00
Jeff Young 864087890b Fix typo assuming new field value was always the name.
Fixes https://gitlab.com/kicad/code/kicad/issues/4936
2020-07-22 15:10:54 +01:00
Jon Evans 9a801d8b72 Don't disrupt diff pairs when auto-renaming buses
With bus groups we can use the prefix to disambiguate

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4916
2020-07-20 20:41:56 -04:00
Fabien Corona a1437f4a95 Eeschema : Add A5 sheet size 2020-07-21 00:00:36 +00: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
jean-pierre charras 1d450adfdf Eeschema: fix crash when trying to save as a library in a non writable folder.
The crash was due to a non caught thrown error.

Fixes #4914
https://gitlab.com/kicad/code/kicad/issues/4914
2020-07-19 18:27:19 +02:00
Ian McInerney ae45c08ce4 Fix label creation for new netname driven from a pin
LIB_PIN is never used in the connectivity calculation,
so it should use SCH_PIN instead. Additionally, the label
orientation should take into account the orientation of
the component to ensure they don't overlap.
2020-07-19 01:52:34 +01:00
Ian McInerney 50b2271f84 Fix missing variable initialization 2020-07-18 23:56:39 +01:00
Jeff Young 1e9d947598 Save MRU path when doing a library Save As....
Fixes https://gitlab.com/kicad/code/kicad/issues/4910
2020-07-18 15:26:11 +01:00
Ian McInerney cc688a3e1d Initialize variables properly
Fixes https://gitlab.com/kicad/code/kicad/issues/4919
2020-07-18 00:36:47 +01: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
Jeff Young 33480ecad1 Show all symbol libraries by default.
Also fixes an issue where the plugin wasn't getting reset if the
library type was changed.
2020-07-17 18:33:14 +01: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
jean-pierre charras 6296b4e20b Kicad manager: create a minimal .kicad_pro file when creating a project from scratch.
Fixes #4889
https://gitlab.com/kicad/code/kicad/issues/4889
2020-07-16 11:31:39 +02:00
Wayne Stambaugh 0ab8b9a2d9 Symbol editor: fix assertion attempting to copy an inherited symbol.
Copying or cutting an symbol to the clipboard using the context menu
in the library tree requires a root symbol.  Inherited symbols must
be flattened in order to properly be added to a symbol library.

Fixes https://gitlab.com/kicad/code/kicad/issues/4901
2020-07-15 20:57:34 -04:00
Jeff Young 11ca21039a Clear new flag when creating image pins.
Otherwise if you then move it we'll think it needs to be inserted
and end up with a circular drawings list.

Fixes https://gitlab.com/kicad/code/kicad/issues/4622
2020-07-16 01:39:29 +01:00
Jeff Young e8079bf655 Make sure UI gets adjusted for Symbol property changes.
For instance, if the number of units is changed from 1 to not-1
or vice versa then we need to rebuild the units selector.

Fixes https://gitlab.com/kicad/code/kicad/issues/4622
2020-07-16 01:39:29 +01:00
Wayne Stambaugh 729dc75396 Symbol editor: fix copy/cut and paste bug.
Use the s-expression symbol library file format for copy/cut to clipboard
instead of legacy symbol file format when using the library tree context
menu copy and cut entries.  Also use s-expression file format for parsing
clipboard contents using the context menu.

Fixes https://gitlab.com/kicad/code/kicad/issues/4900
2020-07-15 20:23:10 -04:00
Ian McInerney af729d578f Unify settings reset buttons into one location 2020-07-16 00:08:16 +01:00
Jeff Young 19d0899a80 Fix previous botched attempt to deal with duplicate field ids.
Fixes https://gitlab.com/kicad/code/kicad/issues/4821

Fixes https://gitlab.com/kicad/code/kicad/issues/4891
2020-07-15 13:51:12 +01:00
Jeff Young 1dc804232c Fix issue with duplicate field IDs getting saved out.
Fixes https://gitlab.com/kicad/code/kicad/issues/4821
2020-07-14 16:00:38 +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
Jeff Young dd61f6f019 Use pin graphic only for rubber-band selection hit-testing.
Fixes https://gitlab.com/kicad/code/kicad/issues/4138
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 fa9937701f Undo for Edit Component's LibId. 2020-07-13 14:16:21 +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