Commit Graph

436 Commits

Author SHA1 Message Date
Ian McInerney f2702b223c Introduce base IO_MGR class and unify RELEASER objects
The IO_RELEASER is a thin-wrapper around a std::unique_ptr, but done
this way to allow easier addition of a custom deleter in the future if
something needs to call back into the IO_MGR.
2023-12-29 00:37:38 +00:00
Marek Roszko 9a890cdba9 Kick the wildcards and file exts into a static class, export it from kicommon 2023-12-27 21:10:01 -05:00
Ian McInerney d7fe668d79 Push PCB_IOs to use the base progress reporter instead of per-function 2023-12-27 17:06:23 +00:00
Ian McInerney f8688a922d Unify IO library descriptors 2023-12-27 16:34:59 +00:00
Ian McInerney e6632bb983 Rename PCB IO classes/files 2023-12-24 01:22:21 +00:00
Ian McInerney d8b47d18d3 Initial rename of file plugin infrastructure components to IO 2023-12-24 01:22:21 +00:00
Seth Hillbrand 5e9b56b431 Don't set the dirty flag when saving 2023-11-27 11:57:31 -08:00
Seth Hillbrand 75c6b0ab28 Added IPC2581 support
IPC2581 is a modern production file exchange system.  It provides
single-file data output for an entire board including BOM and netlist
information.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1954
2023-11-26 15:30:58 -08:00
Jeff Young f83d60a48f Clean up autosave files when reverting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15998
2023-11-05 12:20:31 +00:00
Alex Shvartzkop 847ab093c8 ADDED: Project chooser dialog for EasyEDA Pro import. 2023-10-30 09:35:27 +03:00
Jeff Young d5d07e64c9 Use IsShownOnScreen(), not IsShown(), if you really want to know if its visible. 2023-10-14 23:51:37 +01:00
Jeff Young e242f54816 Fix crash trying to create a new board. 2023-10-02 22:12:07 +01:00
Marek Roszko f1c5581802 Don't continue with a null board in board import
Some plugin is failing and returning a null-board when the usual convention was exceptions

Fixes KICAD-3ZJ
2023-10-01 09:38:44 -04:00
Marek Roszko 6b12a12b3e On second thought rename PROJECT_PCBNEW to PROJECT_PCB 2023-09-27 23:15:54 -04:00
Marek Roszko 7e8b18035f Eliminate the conditional pcbnew/cvpcb definition of PROJECT 2023-09-27 20:53:46 -04:00
Alex Shvartzkop 21ee65aa9c ADDED: Importers for EasyEDA (JLCEDA) Standard / Professional. 2023-09-07 11:02:40 +03:00
Alex Shvartzkop e128896ba6 Schematic plugins refactoring, fixes for PCB plugins.
- Move PLUGIN_FILE_DESC to common.
- SCH_PLUGIN: rename Load -> LoadSchematicFile, Save -> SaveSchematicFile.
- Use PLUGIN_FILE_DESC and CanRead* in schematic plugins.
- Return none/unknown types from Find/GuessPluginType functions.
- Iterate over file types for file wildcards.
- Clean-up header checking in IO plugins.
- Use PCB plugin list in IO_MGR::GuessPluginTypeFromLibPath.
2023-08-31 05:08:03 +03:00
Seth Hillbrand db8e15ce88 Require wxWidgets 3.2
Removes old defines and work arounds for earlier wx versions and adds a
CMake requirement to use at least 3.2 (or the minimum matching wxPython
version)
2023-08-23 22:02:56 +00:00
Thomas Pointhuber f7f8bf5418 fix coding policy violations 2023-08-18 14:51:33 +02:00
Thomas Pointhuber 94c732409b Fix nullptr SEGFAULT for the case PLUGIN::CanReadBoard() returns false, as no supported PLUGIN was found for the given file. 2023-08-18 14:08:06 +02:00
Alex Shvartzkop d02e4f3254 Fix PLUGIN_FILE_DESC copy warning, remove a leftover comment. 2023-08-17 14:43:59 +03:00
Alex Shvartzkop 953cf0d680 Fix KiCad-only board file dialog filter. 2023-08-17 09:36:47 +03:00
Roberto Fernandez Bautista dbfb7880b5 Add IO_MGR::FindPluginTypeFromBoardPath (+QA tests) 2023-08-15 05:26:12 +03:00
Alex Shvartzkop 76e0d5981d Import system refactor for PCB plugins. 2023-08-15 05:26:12 +03:00
Alex Shvartzkop a0d96cea9f Rename Save -> SaveBoard, Load -> LoadBoard in PLUGIN. 2023-08-15 05:26:12 +03:00
Roberto Fernandez Bautista 30a63b7b32 Fix loading of legacy zone fills in .brd files + Don't refill after board import 2023-08-03 15:36:19 +02:00
Seth Hillbrand 7fe83993cf Be smarter about releasing lockfiles
If KiCad crashes or exits without deleting the lockfile, don't show the
warning message unless we are not the one who locked it or there are
other KiCad instances running locally.

This should catch 99% of the cases where the message is shown
incorrectly.  There may be some corner cases where the lock file is
created on a network drive using two different machines with the same
name and same user but these cases should be (famous last words)
sufficiently rare as to not be observed in practice
2023-07-21 15:40:19 -07:00
Roberto Fernandez Bautista cf0b719a4a Fix some unreachable code msvc warnings 2023-07-16 15:41:05 +02:00
Ian McInerney 2fb6f19a84 Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2023-06-27 00:57:59 +01:00
Jeff Young 3bdc66d3ed Save project to disk whenever we save the board to disk.
This prevents data loss in the event of a subsequent crash.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14991
2023-06-26 16:59:47 +01:00
Jon Evans 55c00f1845 ADDED: Initial support for importing Solidworks PCB files 2023-06-19 11:57:33 -04:00
Jeff Young aafbbb4c63 Clean up includes. 2023-06-05 11:01:10 +01:00
Seth Hillbrand c7758999af Handle LOCKFILE logistics for ro
We need to check if a lockfile is valid to determine if we should
override the lock. Valid() is true if the lockfile couldn't be created
b/c of permissions or if the lockfile could be created and acquired.
2023-05-31 17:04:32 -07: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
Nimish Telang 51e55dd750 Convert sprintf to snprintf in most files 2023-04-17 15:39:34 +00:00
Jeff Young 521aa5b5ae Update DRC exclusions model to match terminology.
DRC exclusions were originally written following the C++
pragma model (ie: allow this violation here).  However, the
"exclusion" terminology we used in the GUI suggests a model
model where the exclusions go away when the violation no
longer exists.

Fixes https://gitlab.com/kicad/code/kicad/issues/14351
2023-04-15 12:18:41 +01:00
Jeff Young c4ef08bead Exercise more caution with user filenames.
In particular, don't assume "1" is an extension in "Schematic_1.1".

Fixes https://gitlab.com/kicad/code/kicad/issues/14263
2023-03-12 15:52:45 +00:00
Jon Evans 610e787ada Move to requiring explicit action to save project settings 2023-03-04 14:25:07 -05:00
Chris Morgan ce06171561 Convert additional sprintf to snprintf 2023-01-30 16:22:03 +00:00
Marek Roszko 0ff32d20cd wxS more things 2023-01-22 09:41:42 -05:00
Seth Hillbrand 7e5a2450b8 Move multiple wxMessageBox to DisplayErrorMessage
Also provide protection for headless running in multiple callsites

Fixes https://gitlab.com/kicad/code/kicad/issues/13575
2023-01-18 16:54:01 -08:00
Wayne Stambaugh f81642bbb3 Fix broken graphics import file filters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13570
2023-01-17 11:19:53 -05:00
Seth Hillbrand 25f34a14a1 Check file starting signature when opening
Opening .brd files might be legacy or eagle (probably others as well).
We check for the starting "PCBNEW" in KiCad files to differentiate

Fixes https://gitlab.com/kicad/code/kicad/issues/10201
2023-01-05 18:10:22 -08:00
Jeff Young 4c63b4e061 Class name <-> file name sync. 2022-12-29 18:05:57 +00:00
Ian McInerney 639626fda4 Include the proper header instead of the entire lockfile function 2022-12-17 23:37:24 +00:00
Ian McInerney 82a11c71af Clean up extra control creator logic in pcbnew save file dialog 2022-12-17 23:37:24 +00:00
Jeff Young 19eab62516 More safety around ratsnest state.
Fixes https://gitlab.com/kicad/code/kicad/issues/13011
2022-11-30 13:00:21 +00:00
Jeff Young 97fd99ec99 Re-resolve netclasses after assigning netclass to pattern.
Fixes https://gitlab.com/kicad/code/kicad/issues/12965
2022-11-22 14:54:08 +00:00
Jeff Young c409646aad Update message panel after rebuilding connectivity.
Fixes https://gitlab.com/kicad/code/kicad/issues/10122
2022-11-18 15:29:16 +00:00