72 Commits

Author SHA1 Message Date
Jeff Young
9083c9e6ab Remove dead code. 2025-01-29 20:54:33 +00:00
Seth Hillbrand
452e69de85 Move thread pool into true singleton
Thread pool needs to be stored in a single location for all of KiCad
otherwise each kiface will spin up its own pool of persistent threads
2025-01-09 09:03:08 -08:00
Seth Hillbrand
074e6df3bc Revert "Move thread pool to singleton class"
This reverts commit 361f61a02380881efb59b1cebfdc3e73322b3d3c.
2025-01-03 21:22:44 -08:00
Seth Hillbrand
361f61a023 Move thread pool to singleton class
Having thread pool as its own singleton in the library meant that each
kiface had its own threadpool, leading to many multiples of the threads
being started.  Placing a singleton class in PGM_BASE ensures that all
kifaces use the same thread pool.

The singleton class can be extended to provide single instance
guarantee for any element across kifaces
2025-01-03 13:51:11 -08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
John Beard
e24d43178a Pcbnew: fp load: tidy up FOOTPRINT_SELECT_WIDGET::Load
The call to FOOTPRINT_LIST::GetInstance( aKiway ) returns
a null pointer when it fails, rather than throwing. So this
wouldn't actually catch a KiWay failure and avert a segfault.

And no other caller of ReadFootprintFiles is in a try - so either
this function won't throw, or if it does, all callsites need
updating. For now, go with the majority.
2024-11-11 23:44:27 +08:00
Jeff Young
5a9b681009 Clear timestamp when clearing cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17913
2024-06-16 10:46:36 +01:00
Jeff Young
bf2b3b0b0f Deconflict some LIB_TREE_ITEM APIs so they can remain non-const.
(The non-const is required by FOOTPRINT_INFO, which must load
footrpints to get some of the data.)
2024-04-04 13:18:55 +01:00
Marek Roszko
4d77fd48ef Shove thread_pool to core 2023-09-06 17:50:12 -04:00
Jon Evans
4c4bbdc8f3 Stricter API for LIB_TABLE
Prevent nickname map or row parent getting out of sync

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15315
2023-08-06 00:56:51 -04:00
Mike Williams
85f889bc19 Fields: Description now mandatory
Propagate from symbols to footprints, footprints keep a library
description, too. (GetLibDescription())
2023-06-20 18:34:52 +00: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
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
1a670f4673 Catch IO_ERROR thrown in timestamp gen
Missing nickname can throw when generating a timestamp, this should be
caught and prevent further work in the footprint loading (the entry does
not exist)

Fixes https://gitlab.com/kicad/code/kicad/issues/13029
2022-11-29 14:09:22 -08:00
Jeff Young
f846bc833b Don't error out when enumeration of footprints fails.
We still want to load the ones that did enumerate.

Fixes https://gitlab.com/kicad/code/kicad/issues/12864
2022-11-10 13:48:04 +00:00
Jeff Young
36eb853570 Formatting. 2022-11-10 13:48:04 +00:00
Seth Hillbrand
26a1114e3c Avoid Yields when the results are ready
We always need to check for calculation results before yielding the
system otherwise we will delay outcomes

Fixes https://gitlab.com/kicad/code/kicad/issues/12228
2022-09-14 13:30:04 -07:00
Jeff Young
96f01d33c8 Performance improvements.
1) Move a bunch of std::map's to std::unordered_map to get constant-time
look-ups
2) Lengthen progress-reporting intervals to spend more time doing work
and less time talking about it
3) Reverse order of SHAPE_LINE_CHAINs in thermal intersection checks to
make (much) better use of bbox caches
4) Don't re-generate bboxes we already have
5) Fix some autos that weren't by reference (and were therefore copying
large datasets)
6) Rename delta progressDelta so it's easier to search for in future
7) Get rid of a few more autos (because I don't like them)
8) Pass large items to lambdas by reference

Fixes https://gitlab.com/kicad/code/kicad/issues/12130
2022-08-03 11:59:42 +01:00
Seth Hillbrand
03c279ffd4 ADDED: Threadpool
Thread pools are long-lasting executors that have close to zero overhead
when launching new jobs.  This is advantageous over creating new threads
as we can use this for threading smalling jobs and smaller quanta.  It
also avoids the heuristics needed to determine the optimal number of
threads to spawn
2022-06-24 22:59:24 +00:00
Jeff Young
1f16092e29 Infobar warning if symbol loading was cancelled.
Also makes sure the progress dialog is closed when we're done reading
symbols (it used to stay up for much of the symbol editor initialization).

Also makes sure that any cancel in the preLoad step is honoured in the
sync step.  (The preload is done because it is multi-threaded and therefore
faster than the single-threaded sync.)

Also makes sure that individual threads pay attention to the cancellation,
not just the GUI thread.

Fixes https://gitlab.com/kicad/code/kicad/issues/8372
2022-02-27 17:06:08 +00:00
Jeff Young
7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
Seth Hillbrand
2a0e4a8324 Catch errors from load()
Loading footprints may throw in some cases.  We need to catch these
nicely without breaking out of the full loading process

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

(cherry picked from commit 1874ad2f7e5625b07c2d18cdf42d650ba3cbd857)
2022-01-03 15:31:14 -08:00
Jeff Young
3aae3c6f65 Dark mode for a bunch of HTML dialogs.
WX_HTML_REPORT_BOX
WX_HTML_REPORT_PANEL
HTML_MESSAGEBOX
DIALOG_DISPLAY_HTML_TEXT

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

Fixes https://gitlab.com/kicad/code/kicad/issues/9156
2021-09-14 21:23:57 +01:00
Jeff Young
41619ebbe2 Decouple PROGRESS_REPORTER interface from implementations. 2021-08-14 21:05:49 +01: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
Wayne Stambaugh
cf00319c85 More NULL expunging. 2021-07-20 07:27:18 -04:00
Jeff Young
5c21f93803 Consistency in progress and error messages. 2021-06-26 13:23:43 +01:00
Jeff Young
9f51f7b055 Formatting and include cleanup. 2021-06-25 17:48:15 +01:00
luz paz
f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko
d946d6e68f Cleanup some pgm_base.h includes 2021-06-08 21:56:00 -04:00
Jeff Young
ccaf9e11df Load footprint info when there's no cache available.
Fixes https://gitlab.com/kicad/code/kicad/issues/8371
2021-05-14 22:24:21 +01:00
Jon Evans
c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Wayne Stambaugh
5ecef204cd Coding policy fixes.
Using "this->" violates coding policy section 2.7.
2021-02-09 11:35:43 -05:00
Marek Roszko
525934881f Use a temp file for saving the fp-info-cache for now 2020-12-10 23:07:49 -05:00
Marek Roszko
0967995a80 Replace wxTextFile for writing fp info cache
wxTextFile uses wxFile which uses write syscalls which means its unbuffered.
This makes file IO more expensive against network shares where it will flush far too aggressively.
wxTextFile is fine for reads however.
2020-12-10 21:34:40 -05:00
Jeff Young
a207bd97bb Naming conventions. 2020-11-17 16:05:49 +00:00
Jeff Young
bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young
84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Marek Roszko
e49ac45b84 HTML_MESSAGE_BOX is a dialog 2020-10-25 20:01:12 -04:00
Marek Roszko
1d559108c8 Move LOCALE_IO out of common.h 2020-10-23 21:49:42 -04:00
Marek Roszko
52a12c6ccd Remove kicad_string.h from footprint_info.h 2020-10-15 18:39:43 -04:00
jean-pierre charras
87a220b8e2 more cleanup about removing useless include 2020-10-02 14:51:11 +02: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
0e9714fdba Simplify fp-info-cache escaping mechanism.
Fixes https://gitlab.com/kicad/code/kicad/issues/4969
2020-08-04 23:54:12 +01: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
Seth Hillbrand
b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
Jeff Young
e269b5d1b9 Workaround an issue where a throw terminates (even when there's a catch for it).
You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.
2019-08-31 15:18:27 +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
Jeff Young
684bb62fd8 Escape slashes in labels and netnames.
Also re-allows spaces, as they can already come in through sheet
names.

Fixes: lp:1798621
* https://bugs.launchpad.net/kicad/+bug/1798621
2019-04-07 00:24:10 +01:00
Jeff Young
ed27027ab1 Escape/unescape footprint descriptions and keywords when writing/reading cache file.
Fixes: lp:1803989
* https://bugs.launchpad.net/kicad/+bug/1803989
2018-11-20 21:44:04 +00:00