Commit Graph

10011 Commits

Author SHA1 Message Date
Roberto Fernandez Bautista 3d1b96d6ca Cleanup jobs handlers (+Fix build) 2023-06-11 00:12:53 +02:00
Jeff Young 61493b8489 Return all results with an empty search pane filter.
Also moves the EDA_EVT_SCHEMATIC_CHANGED event so it fires after the
schematic has been loaded.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14871
2023-06-10 23:05:57 +01:00
Roberto Fernandez Bautista 3f758711fd Use external REPORTER for EESCHEMA_JOBS_HANDLER / PCB_JOBS_HANDLER 2023-06-10 23:35:32 +02:00
Jeff Young 180c820678 More changes for SCH_COMMIT independence from frames.
Also fixes some bugs in Symbol Editor SCH_COMMIT::Revert().
2023-06-10 20:53:44 +01:00
Wayne Stambaugh a46657d802 Remove net navigator debugging code. 2023-06-10 14:04:02 -04:00
Jeff Young 5aa51bc967 Allow SCH_COMMIT to operate without a frame.
We'll want this at some point (presumably) for plugins.
2023-06-10 18:35:59 +01:00
Jeff Young f66b9f75a3 Allow EDA_COMBINED_MATCHER use in KiCad find architecture.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12532
2023-06-10 14:50:06 +01:00
Jeff Young 53be16f409 Stop confusing Covertiy. 2023-06-10 13:36:17 +01:00
Jeff Young 8f1b9119bf Upgrade some symbol editor stuff to SCHEMATIC_COMMIT.
Also renames SCHEMATIC_COMMIT to SCH_COMMIT since it's not schematic-specifc.
2023-06-09 22:41:47 +01:00
Jeff Young e698156975 Upgrade many editing actions to SCHEMATIC_COMMIT. 2023-06-09 22:41:47 +01:00
Jeff Young 73b653c276 Upgrade more dialogs to SCHEMATIC_COMMIT. 2023-06-09 22:41:47 +01:00
Jeff Young dcfd426333 Upgrade some dialogs to SCHEMATIC_COMMIT. 2023-06-09 22:41:47 +01:00
Wayne Stambaugh e9dc00cda3 Minor schematic net navigator improvements.
- Expand tree and highlight object selected with net highlight tool.
- Expand tree and highlight object that are currently highlighted with the
  selection tool.
- Use more descriptive object text rather than menu entry text for tree
  strings.
- Rebuild tree on unit changes.
2023-06-09 14:34:54 -04:00
jean-pierre charras 639da0eb5a Fix a wxWidgets alert when deleting the last entry in a lib table. 2023-06-09 08:09:22 +02:00
Jeff Young 90c14ecdf7 Upgrade a couple of schematic actions to SCHEMATIC_COMMIT. 2023-06-07 15:30:56 +01:00
Jeff Young d5b5a3eaf4 Add action info to Undo/Redo menus.
Note that this only works where a BOARD_COMMIT or SCHEMATIC_COMMIT is used.
(BOARD_COMMIT is used almost universally in PCBNew, but SCHEMATIC_COMMIT
has very little adoption in EEschema so far.)
2023-06-07 14:37:34 +01:00
Jeff Young 30cbfc794f Cross-probing from Pin Table to Symbol Editor canvas.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8301
2023-06-07 14:37:34 +01:00
Seth Hillbrand c33d1ab244 Don't dirty the item connectivity prematurely
Item connectivity changes once the elements are commited, not during the
process of moving.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14884
2023-06-05 09:12:20 -07:00
Mike Williams 6e2bea8128 Symbol Fields Table: fix grid tricks show/hide column corruption
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14874
2023-06-05 08:27:26 -04:00
Mike Williams fb7925806c Symbol Fields: allow hiding reference column 2023-06-05 08:27:26 -04:00
Alex 26c25c5475 Move bitmap setup to ctor in eeschema annotation options. 2023-06-05 15:03:03 +03:00
Jeff Young f3d3ade1dc Increased mutex safety.
Don't even query the size() without having at least a shared_lock.

*May* prevent KICAD-4S, but seems unlikely.
2023-06-05 11:01:10 +01:00
Jeff Young 1528f4700c Treat canvas item as current when tree view contains no selection.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12702
2023-06-04 20:52:12 +01:00
Mike Williams 039f23eba8 Symbol Fields Table: check against data model col for grouping
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14870
2023-06-04 14:42:55 -04:00
Mike Williams bb6555ff36 Symbol Fields Table: remember export filename
https://gitlab.com/kicad/code/kicad/-/issues/14872
2023-06-04 13:45:07 -04:00
jean-pierre charras 9e6c56525a EEschema, DIALOG_SYMBOL_FIELDS_TABLE: minor cosmetic fix
Fixes #14868
https://gitlab.com/kicad/code/kicad/-/issues/14868
2023-06-04 17:24:07 +02:00
jean-pierre charras 92018f0066 Fix minor compil warnings 2023-06-04 16:24:28 +02:00
Jeff Young 95d104ab65 Implement UI condition for search panel visibility.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14826
2023-06-04 15:13:39 +01:00
Jeff Young 2ffeca9f36 Formatting (no functional changes) 2023-06-04 15:13:39 +01:00
Jeff Young 5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
Seth Hillbrand 5756a7a0af Prevent makeup events from contaminating the system 2023-06-02 16:04:08 -07:00
Seth Hillbrand 4bc0822733 Connectivity: Correct alias-based bus resolution
Aliases in bus resolution were being resolved without a path, making
them effectively global nets.  This applies the corrected path to the
bus members and adds a QA to catch this error
2023-06-02 14:25:51 -07:00
Mike Williams 04532a61f4 Symbol Fields Dialog: don't change sheets on load
Late bind the range selection event so we don't lose our selection as a
result of loading data into the table, then jumping to the selected
value.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14186
2023-06-02 08:22:10 -04:00
Mike Williams 0eb45a7f27 Schematic: symbol fields dialog: restore size, not min size
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14861
2023-06-01 18:02:57 -04:00
Wayne Stambaugh d854e2bfe8 Schematic net navigator improvements.
Arrange connectivity items by sheet.  Complex nets which span many
sheets make finding objects difficult.  It also provides a higher
level of sheet view granularity.
2023-06-01 12:49:51 -04:00
Jeff Young 2300b0d2a3 Don't dim SCH_FIELDs when selecting them.
(They were only getting drawn on top of the selection shadow when
drawn by their parent symbol because LIB_FIELD was correctly
setting the view layers but SCH_FIELD was not.)
2023-06-01 15:07:29 +01:00
Marek Roszko c2d56eefb9 Fix blank symbol svg export file names
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14857
2023-05-31 20:56:20 -04:00
Seth Hillbrand 14f6e32c74 ADDED: Change watcher for libraries
When editing or viewing library symbols, the files are watched for
underlying changes.  If any occur, the user is either prompted to reload
(if reloading would overwrite their current edits) or the file is
silently updated to the current version on disk.

This also sets a custom assertion handler to avoid unneeded crashes when
recieving invalid SAMBA packets and turns off assertions entirely when
running in release (non-debug) mode
2023-05-31 13:46:00 -07:00
Seth Hillbrand 5370fdc718 Fix override lock behavior
We don't need to lock in import because we are creating a new file.  We
should, however, show the locking user/machine when opening in schematic
editor and take over the lock if they want to proceed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9347
2023-05-31 13:43:58 -07:00
Wayne Stambaugh f950354f99 Fix connectivity assertion in schematic editor.
https://gitlab.com/kicad/code/kicad/-/issues/14835
2023-05-31 13:29:47 -04:00
Jeff Young cfb45be71e Improved tooltips for all-unit-interchangeable and De Morgan.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14583
2023-05-31 17:54:19 +01:00
Jeff Young d3edad3c92 Formatting. 2023-05-31 17:26:54 +01:00
Jeff Young 421d6b2ef8 Retire LIB_ID_VALIDATOR as it prevents usage of text variables.
(We perform more complete checks in ERC anyway.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14764
2023-05-31 17:26:54 +01:00
Jeff Young 47bba3cbeb Correct logic errors in pin bounding box calculation.
The name and number are both centred, and either one can be long
enough to be the determining factor for either side of the bounding
box.
2023-05-31 12:51:56 +01:00
Jeff Young d827bb8a1f Leave back/forward/up nav buttons enabled so the action doesn't change.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14783
2023-05-31 11:13:35 +01:00
jean-pierre charras 6b845b9054 Fix compil warnings and a wxWidgets alert. 2023-05-30 09:00:46 +02:00
Mike Williams 7f250870fe schematic: fix crash in search pane when hit list is empty
std::all_of also returns true for an empty set
2023-05-29 09:50:09 -04:00
Jeff Young a4f16423c8 Push reference and value special cases down into LIB_FIELD::compare().
Use COMPARE_FLAGS::EQUALITY and COMPARE_FLAGS::ERC when doing
library diffs.

Also fixes a few more cases where we weren't checking for -1 when
doing a fieldID < MANDATORY_FIELDS.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14830
2023-05-29 12:40:20 +01:00
Roberto Fernandez Bautista 8493cc4c89 CADSTAR SCH LIB: Add plugin options + improve symbol caching 2023-05-28 23:56:42 +02:00
Roberto Fernandez Bautista 688a61df63 Add options editor to symbol library table + cleanup unused options 2023-05-28 23:56:42 +02:00
Roberto Fernandez Bautista a119bd604d Refactor: Move DIALOG_PLUGIN_OPTIONS to common and use enum for event ID 2023-05-28 23:56:41 +02:00
Jeff Young d526362d31 No sheet path has to be interpreted as the current sheet.
There's currently waaaay too much stuff that depends on it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14834
2023-05-28 20:46:50 +01:00
Jeff Young 8820df2187 Fix missing "else".
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14831
2023-05-28 19:49:19 +01:00
Jeff Young b8986709bf Every time I search for SCH_TEXT* it doesn't work.... 2023-05-27 21:25:36 +01:00
Jeff Young 81d7428fd2 Don't call OnPageSettingsChanges on Undo/Redo.
It's incredibly expensive (multiple seconds on a document with
lots of text in an outline font).
2023-05-27 20:35:05 +01:00
Jeff Young f35a88ce0b Cache LIB_PIN text extents for performance.
Also fixes a bug where we didn't triangulate at all when the char
count didn't warrant the likely overhead of spinning up a
thread_pool.

And fix another bug where EDA_TEXT::GetRenderCache() wasn't using
the given font.

Also reverts using the cache for drawing-sheet text.  The text
items are created from scratch from the data items each time
they're drawn, so there's never an existing cache to make use of.
Instead, we now check that the item is in the view, using a very
approximate bounding box generator (because even generating a
real bounding box shows up large in profiles).

And, lastly, fixes a bug where EndPos was never considered in
DS_DATA_ITEM::IsInsidePage().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14822
2023-05-27 16:32:11 +01:00
jean-pierre charras f2f014a27c Symbol editor: ensure a new derived symbol has the correct DeMorgan option displayed.
Derived symbols use the same graphics as their parent, so ensure the parent is
used to enable/disable the DeMorgan option and tool in toolbar
Fixes #13739
https://gitlab.com/kicad/code/kicad/-/issues/13739
2023-05-27 10:13:43 +02:00
Jeff Young 4ed267394a Outline font performance improvements.
1) Don't fracture font glyphs when generating them; we're going
   to fracture during triangulation anyway.
2) Don't check for self-intersection when deciding to fracture.
   It costs nearly as much as the fracture does.
3) Cache drawing sheet text.
4) Use the current font when checking for cache validity.
5) Parallelize glyph triangulation.
6) Don't invalidate bounding box caches when offset by {0,0}
7) Use the glyph cache when generating text effective shape.
8) Short-circuit NormalizeJustification() if its center/center.
9) Don't triangulate for GuessSelectionCandidates()
10) Avoid sqrt whenever possible.
11) Pre-allocate bezier and SHAPE_LINE_CHAIN buffers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14303
2023-05-27 01:35:40 +01:00
Jeff Young 6e127829f8 Cleanup formating and includes. 2023-05-26 18:44:33 +01:00
jean-pierre charras 68464a1993 Simulator: add missing ngspice models.
Fixes #14813
https://gitlab.com/kicad/code/kicad/-/issues/14813
2023-05-26 14:46:51 +02:00
Jeff Young 5114d3b8c3 Don't use GetValueFieldText from within text var resolution.
(It resets the recursion checker.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14815
2023-05-25 14:34:20 +01:00
Steve Bollinger 28b37ad020 Someone accidentally exchanged the x and y coordinates when flipping
components horizontally and vertically in
SCH_DRAWING_TOOLS::SingleClickPlace()

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14725
2023-05-25 12:11:48 +00:00
Jeff Young 1518ddde74 Push much of text var autocomplete down into SCINTILLA_TRICKS.
Shared code == fewer bugs.  Well, in theory anyway....
2023-05-25 10:24:50 +01:00
Jeff Young 14f004d2a5 Hook up text variable auto-complete for PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14777
2023-05-25 10:24:50 +01:00
Jeff Young 5a9ed66cfd Go back to using QuasiModal for TextBox Properties.
Also removes auto-closing of blocking dialogs when inserting
symbols from the Symbol Editor or Chooser, preventing the bug
that QuasiModel was removed for earlier.

Also fixes a non-initialized parent pointer when the TextBox
Properties dialog was called from DrawShape().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14777
2023-05-25 10:24:50 +01:00
Seth Hillbrand 48ecd742eb Maintain file permissions when renaming
Temporary and autosave files do not neccessarily have the correct
permissions set to replace existing project files.  This updates the
permissions to match the existing values where possible

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13574
2023-05-24 17:09:38 -07:00
Seth Hillbrand 122be418bb Upgrade file locking
wxSingleInstanceChecker is meant for running programs, not file locking.
This implements an RAII class for file locking that stores the lock
files next to the file being locked, allowing it to be easily found and
removed.  Also includes the ability to override the lock, with
information about the original owner

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14734
2023-05-24 13:51:54 -07:00
jean-pierre charras 03e846d8ea Eeschema: fix block mirroring of fields attached to labels (all types)
Fix incorrect orientation of the graphic shape of SCH_DIRECTIVE_LABEL items
after mirroring the item.
Similar to commit 898d88cc, but for block mirroring.
Fixes #14758
https://gitlab.com/kicad/code/kicad/-/issues/14758
2023-05-23 09:42:24 +02:00
Jeff Young 03486443c7 Fix more SPICE case-insensitivity bugs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793
2023-05-22 11:46:28 +01:00
Mark Visser 0d235ac64b fix bug whereby spice params with capital letters no longer cause an error and data loss
Spice parameters were converted to lower-case before comparison. This is incorrect, as it
is legal and common for spice parameters to contain capital letters (e.g. potentiometers
typically use Rt and SET as their parameters).
Spice parameters are not case sensitive, so the correct behaviour is to instead do a
case-insensitive comparison on the parameter name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793
2023-05-21 17:50:35 -04:00
jean-pierre charras c08f482ed4 Eeschema, panel color settings: minor fix: ensure color swatches are show/hidden
according to the option Override Colors state.
2023-05-21 14:16:11 +02:00
Jeff Young 502da2d03c Performance improvements. 2023-05-21 11:23:56 +01:00
Jeff Young d4c9d9d60a Fix issue with colours in the new lazy-loaded preference panels.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14784

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14782
2023-05-21 10:56:21 +01:00
Jon Evans c1d7fcf587 Remove very small grid sizes from schematic editor
See https://gitlab.com/kicad/code/kicad/-/issues/14756
2023-05-20 21:36:09 -04:00
Marek Roszko aa230b4e08 Breakup sim_model_ngspice_data.cpp into multiple files to avoid unreasonable compiler link times 2023-05-20 19:58:46 -04:00
Jeff Young 102d61ed39 Terminology cleanup. 2023-05-20 21:04:39 +01:00
Jeff Young 58f4943597 ADDED voltage- & current-controlled voltage & current sources
Added GUI support for ngspice VCVS, VCCS, CCVS and CCCS.
2023-05-20 21:04:39 +01:00
Wayne Stambaugh 24b04795fd Add net navigator panel to schematic editor.
[ADDED]: A panel to the schematic editor  that allows quick access to all
         of the items connected to the currently highlighted net.

This is an initial swag at implementing a full net navigator feature.  For
now it only shows the currently highlighted net nodes.  The incremental
net list advanced setting must be enabled in order to use this feature due
to performance reasons.  There are still some issues with saving the panel
position which will be addressed in the future.

Initial code for serializing wxAuiPaneInfo settings to and from JSON have
be implemented.
2023-05-20 13:48:03 -04:00
Marek Roszko ded099c07d Unreachable code warning 2023-05-20 08:08:22 -04:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.

Add updating of teardrops on BOARD_COMMIT::Push().

Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
2023-05-19 18:02:03 +01:00
Marek Roszko 7774b75172 Another set of C5266 warning fixes 2023-05-18 22:46:57 -04:00
Marek Roszko 573b66d243 Fix a bunch of C5266 warnings (pointless const on bool/int returns)
warning C5266: 'const' qualifier on return type has no effect
Microsoft doesn't even document C5266
2023-05-18 21:35:06 -04:00
jean-pierre charras 898d88cc11 Eeschema, directive labels: fix some issues:
- honor mirroring of fields attached to labels (all types)
- fix incorrect orientation of the graphic shape of SCH_DIRECTIVE_LABEL items
after mirroring the item.
Fixes #14758
https://gitlab.com/kicad/code/kicad/issues/14758
2023-05-18 10:28:27 +02:00
Seth Hillbrand 0de24bfd59 Cleanup text alignment between version 6 and 7
Version 7 text alignment changed subtly for stroke fonts from version 6.
Additionally, the output has been different between screen and plotting,
leading to offset text in plotted output relative to the text shown on
screen.

This introduces a fudge factor in FONT::getLinePositions to correct the
offset in the plotting output relative to v6.

This also changes the SCH_PAINTER and PCB_PAINTER to correct the
relative offsets between GAL and PLOTTER classes.  The source of these
offsets is atm unclear.

Fixes https://gitlab.com/kicad/code/kicad/issues/14755
2023-05-17 13:33:49 -07:00
Marek Roszko aeadd49a33 Fix windows builder broken by 831a6d5 2023-05-16 21:49:55 -04:00
Wayne Stambaugh 831a6d55fc Fix potential stale pointer bug in schematic highlight connection code.
SCH_CONNECTION objects are temporary and can become stale any time the
connectivity is updated.  Keeping them around to reference later is a
bad idea.  Even if the object pointer is still valid in an SCH_ITEM in
the undo/redo buffers, comparing the pointer against another pointer as
a test to see if they are the same connection is not valid.  Saving the
connection name is safe and ensures the connection is the same even if
the pointers differ.
2023-05-16 20:06:21 -04:00
jean-pierre charras be59e7d67f NETLIST_EXPORTER_SPICE: add space to the not allowed chars in netnames
Not allowed chars are replaced by '_'
Fixes #14724
https://gitlab.com/kicad/code/kicad/issues/14724
2023-05-16 17:59:01 +02:00
Marek Roszko 1adcb86e0b Initial schematic search pane 2023-05-14 22:41:56 -04:00
Marek Roszko 34ba343754 Add SCHEMATIC_LISTENER equivalent to BOARD_LISTENER 2023-05-14 21:35:51 -04:00
jean-pierre charras 3be8bfe193 Fix a few Coverity warnings (not initialized vars) 2023-05-14 10:11:38 +02:00
jean-pierre charras 94bd1c6025 Fix a few Coverity warnings. 2023-05-12 18:53:55 +02:00
Seth Hillbrand 2ffb58a7e2 Test for schematic type when changing
The schematic editor undo list may hold page layout types as well
2023-05-12 08:43:58 -07:00
Jeff Young ddc6ecf7be Lazy loading of Schematic Setup panels. 2023-05-11 11:43:10 +01:00
Jon Evans 3686c5b371 Use the right path for recursing in text var resolution
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14720
2023-05-10 21:46:05 -04:00
Graham Keeth df3560ab8e sim: fixup some diode parameter units 2023-05-10 23:09:13 +00:00
Graham Keeth 2970d97bf2 sim: fix diode model default breakdown voltage 2023-05-10 23:09:13 +00:00
Jeff Young 9ae8255202 Insta-prefs. 2023-05-10 18:14:14 +01:00
jean-pierre charras 31d613c746 Fix a few Coverity warnings (not initialized vars)
It also fixes a potential crash when closing Kicad.
2023-05-10 09:21:39 +02:00
Seth Hillbrand 6e4de18e15 Ensure _changed_ netlist is propagated
The propagation is currently (maybe not needed) limited to the global
name that is the source of the change.  We also need to propagate the
global name that is changed in case the global is set in a tree leaf and
not the root

Fixes https://gitlab.com/kicad/code/kicad/issues/14657
2023-05-09 12:13:06 -07:00