Commit Graph

45 Commits

Author SHA1 Message Date
Jon Evans a042d1aab4 Show all library children if library name matches search 2024-04-02 18:51:19 -04:00
Jon Evans 816e3efbd5 Fix a few LIB_TREE search issues
Don't apply pruning to libraries that don't have
any children, since the point of the pruning is to
hide libraries that don't directly match a search
term if they don't have any children that match.

Fix searching for full LIB_IDs that got broken by
the implementation of "AND"

Fix searching for library names alone

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17205


(cherry picked from commit 0c2a084a47)
2024-03-14 21:01:13 +00:00
Jon Evans ad311c33c6 Attempt to fix lib search again
The new bits will drop search results that
don't match all tokens in the search string,
which seems desirable.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16974


(cherry picked from commit 589e21cd3b)
2024-02-23 14:37:20 +00:00
Jeff Young df161c9886 Support parital matches for libraries.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16400
2023-12-20 12:46:22 +00:00
Wayne Stambaugh a4b38fbb80 Coverity warning fixes. 2023-12-18 16:09:13 -05:00
Mike Williams b3b7a41d51 Symbol Chooser: keep Recently Used at very top
Addition of Already Placed sorted it above Recently Used
2023-12-13 09:40:28 -05:00
Jeff Young a4a946ab75 Clearer naming. 2023-11-17 18:36:33 +00:00
Jeff Young 2f3c0a608d Score LIB_TREE_NODE_UNITs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16106
2023-11-17 18:36:33 +00:00
Jeff Young 78e00ade7a Clearer naming. 2023-11-09 14:05:35 +00:00
Jeff Young 72c985bc07 Rewrite scoring algo again. (Third time's the charm?)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16042
2023-11-08 12:33:09 +00:00
Jeff Young 64c692a42e Allow a:b to represent either lib:item_name or key:value.
Also changes the scoring algorithm to start at 0 and then increment
to 1 (the value that tells us to show, but not expand) only if the
search terms and lib filters are empty.
2023-10-31 23:20:59 +00:00
Jeff Young 0cf6679bfe Try to get the scoring logic right (again).
Also adds matching against a library name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15875
2023-10-23 18:24:25 +01:00
Jeff Young bc0fe74f72 Score initializing is done by LIB_TREE_NODE::ResetScore().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15875
2023-10-23 13:09:41 +01:00
Jeff Young 06446bb80e Only expand lib tree when filtering. 2023-10-02 16:24:53 +01:00
Jeff Young fa11e9138d ADDED support for pin and fp filtering in FOOTPRINT_CHOOSER.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7176
2023-09-29 17:03:50 +01:00
Jeff Young df7d62fdd3 Added a sort-order dropdown to lib-tree filters.
Also simplifies the scoring algorithm so that it only
differentiates between exact-match, match-at-start and
any-match.  The rest of the position-based matching
stuff is gone, as is the knowledge of the name vs the
keywords vs the description.  All that is left to the
provider of the weighted search terms array.
2023-05-01 21:26:43 +01:00
Jeff Young bc754df30f Go back to winner-takes-all lib-tree scoring algorithm.
(Because we sort alphabetically there's no way to see
what the second-highest scored item was.)
2023-04-30 13:01:09 +01:00
Jeff Young d01c023d5a Retire the lib-tree scoring algorithm.
It appears to cause more confusion than help.

Fixes https://gitlab.com/kicad/code/kicad/issues/13905
2023-04-14 23:35:27 +01:00
Seth Hillbrand 5c1b15f8e3 Make LIB_TREE_NODE sort irreflexive
std::sort requires explicit ordering of all elements.  It does not allow
for equality in its output
2023-02-16 13:00:18 -08:00
kliment b97f9ea329 Add support for symbol unit display names in eeschema and symbol editor 2022-09-14 22:11:37 +00:00
Jon Evans e294fe2074 ADDED: Dynamic field columns in symbol chooser
CHANGED: Symbol chooser search now considers custom symbol fields

Visible columns can be controlled in database libraries.
In standard KiCad libraries, we show columns for all custom fields for now.

Customizable column visibility will be added in the future.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11946
2022-09-05 16:38:14 -04:00
Jon Evans 300d92438c Allow hiding symbol library tables from symbol chooser
Hidden but loaded libraries are useful when using database libraries
2022-08-26 20:18:40 -04:00
Jeff Young 120c5b9ac1 Reimplement pinning now that we're no longer sorting on score. 2022-07-09 12:26:44 -06:00
Seth Hillbrand 4790257616 Don't break alphabetical sorting on search
When using the "Filter" search for footprints/symbols, the least
surprising outcome is that the window filters the existing
(alphabetically sorted) list but does not change the display order based
on scoring.

This also needs to adjust the fix for
https://gitlab.com/kicad/code/kicad/-/issues/259 as that assumed the
selected element would be the first below the group (not the case if we
are sorting alphabetically)

Fixes https://gitlab.com/kicad/code/kicad/issues/11746
2022-06-10 11:48:47 -07:00
Jeff Young 244042ce51 Keep footprint selection in Symbol Chooser history list.
Fixes https://gitlab.com/kicad/code/kicad/issues/1841
2022-06-06 22:24:02 +01:00
Jeff Young dd2e12bdf1 Formatting. 2022-06-04 22:22:55 +01:00
Jeff Young c6f83b6dec ADDED Duplicate Footprint, Rename Symbol and Rename Footprint. 2022-04-22 22:06:51 +01:00
Jeff Young 724182abe4 Fix lib tree searches to handle searching on library names.
Fixes https://gitlab.com/kicad/code/kicad/issues/9981
2021-12-14 15:18:48 +00:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Jeff Young 5cac8afe1d Remove long-dead revision support for LIB_IDs. 2021-06-30 13:12:57 +01:00
Jeff Young b1b4caee6a Escape "naughty" characters in symbol names.
It's tempting to say that we don't need to exclude filename chars
from symbols, but we might regret that decision down the road.  Better
to just escape them.

Fixes https://gitlab.com/kicad/code/kicad/issues/8694
2021-06-30 13:12:57 +01:00
Jeff Young 359c29639f Fix access into empty container.
Fixes https://gitlab.com/kicad/code/kicad/issues/6840
2020-12-24 19:43:33 +00:00
emC5RgViIK 47297402d3 #include <algorithm> so std::sort is found. 2020-05-15 10:49:43 +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
Jeff Young 6b6e9eddee Return control of Symbol and Footprint chooser col widths to user.
The auto-calculation wasn't working out and even with it some users
wanted control.

Fixes: lp:1796774
* https://bugs.launchpad.net/kicad/+bug/1796774
2019-08-26 18:27:49 +01:00
Jeff Young 92330b9c93 Sort modules and pads in Footprint Report file.
Fixes: lp:1793764
* https://bugs.launchpad.net/kicad/+bug/1793764
2019-08-26 18:27:49 +01:00
Seth Hillbrand 5151cd0bfe C++14: Remove unused make_unique.h
Also removes header references now that we are in C++14, this is
built-in to the std
2019-08-07 09:27:31 -07:00
Wayne Stambaugh 8d26b07f67 Fix potential string iterator issue.
Added checks to StrCmpNum() function in common/sting.cpp to prevent
iterating past the end of the sting.  Also removed length of string
parameter since it did not seem to be used anywhere.

Fixes lp:1818157

https://bugs.launchpad.net/kicad/+bug/1818157
2019-03-02 08:20:53 -05:00
Seth Hillbrand 813578eba6 Fix a few coverity errors 2019-02-15 20:15:04 -08:00
Jeff Young be1d6113d6 More performance enhancements.
Be more intelligent about sorting lib tree items.  (Footprint
entries, for instance, come out of an already-sorted list.)

Don't recreate menus twice when laoding Footprint Editor.

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

For POSIX kernels do all the work on the file-system side so we
don't have to keep converting back and forth between encodings.
2018-08-06 13:49:27 +01:00
Jeff Young 08bcec9ac0 Make sure symbols have a valid lib nickname...
... even if the library pointer isn't set.

Also fixes the "every symbol as a Unit A" issue.

Fixes: lp:1785438
* https://bugs.launchpad.net/kicad/+bug/1785438
2018-08-06 13:48:17 +01:00
Jeff Young 3a39ea21a2 Library pointer can be null even when LibId is set. 2018-08-01 15:27:54 +01:00
Jeff Young 4e3c84e733 Score leaf nodes in LIB_TREEs, not just symbols & footprints.
Fixes: lp:1783251
* https://bugs.launchpad.net/kicad/+bug/1783251
2018-08-01 09:35:46 +01:00
Jeff Young f8a5e2c1c8 Performance enhancements in fp loading, string cmp, etc.
Knocks about 1/3 off the first footprint load, and more than 1/2
off subsequent loads.
2018-08-01 09:35:46 +01:00
Jeff Young 97f7bd4cb9 Push component tree down into common.
Precondition to reusing component tree for footprints.
2018-08-01 09:35:45 +01:00
Renamed from eeschema/cmp_tree_model.cpp (Browse further)