Commit Graph

215 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
Ian McInerney 85f62c1fde Rename all schematic IO plugins 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
Jeff Young cd05acac34 Use pageSettings & titleBlock export flags when drawing new sheets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9285
2023-11-13 20:30:57 +00:00
Marek Roszko 8c6899b0d3 Tear out the eeschema conditional compile of PROJECT 2023-09-27 23:05:30 -04: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
Kuba Sunderland-Ober e852d04043 Ensure the bitmap exported to the clipboard is valid.
Fixes #14808
https://gitlab.com/kicad/code/kicad/-/issues/14808
2023-06-13 20:47:06 +00:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Jeff Young 6f16678d2d Typo fix courtesy or aris-kimi. 2023-01-01 23:40:18 +00:00
Wayne Stambaugh 78e2f0fd4d Sheet instance handling improvements. 2022-12-26 08:30:03 -05:00
Jeff Young 6535f407a6 Remove version guard from sim migration, and add migration to paste.
Fixes https://gitlab.com/kicad/code/kicad/issues/13080
2022-12-08 23:57:42 +00:00
Jeff Young 38906397d2 Move V6->V7 sim model migration from sheets to screens.
Also moves passive RLC inference out from migration to just-in-time
creation for the simulator or netlisting.

Also fixes a version guard mismatch because the spice migration was
done inside UpdateSymbolInstances (which has its own version guard).

Also changed UpdateSymbolInstances to UpdateSymbolInstanceData so
someone else in the future doesn't think it's a general-purpose symbol
instance updater.
2022-12-06 16:01:18 +00:00
Wayne Stambaugh e517cad12b Fix broken hierarchical sheet file paths when adding nest sheets.
The file path for each sheet must always be relative to it's parent sheet
or absolute if using a relative path is not possible.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10868
2022-11-30 15:44:59 -05:00
Jeff Young cef7cd8f7c Move default font to RENDER_SETTINGS.
Fixes https://gitlab.com/kicad/code/kicad/issues/12723
2022-10-22 21:32:42 +01:00
Wayne Stambaugh a11c40197f Expunge default symbol instance from schematic file format.
Now that importing hierarchical sheets "properly" imports instance data,
the default symbol instance setting doesn't have any meaning.
2022-10-04 15:42:41 -04:00
Wayne Stambaugh 2b387ae9c3 Move schematic symbol instance data back into symbol definition.
This change reverts the storage of all symbol instance data in the root
schematic.  This was done because it's not possible to reuse instance
data when importing from sub-sheets.

There has been a fundamental change in how sheet paths are store in the
instance data.  The root schematic UUID is always used when saving the
instance data.  To prevent file churn, the virtual root sheet UUID is set
to the root schematic UUID when loading the project.  This provides a way
to determine the project that stored the instance data.  All uses of paths
without root sheet have been expunged from the code.

The sheet instance data is still saved only in the root sheet for the
time being.  New sheet instances will be automatically assigned an page
number based on the incremental virtual sheet page number.  Sheet page
numbers will not be imported.

Added project name to instance data to improve the readability of the
schematic file format.  It also creates an opportunity to remove orphaned
instance data by project name rather than cryptic UUIDs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12472
2022-10-02 15:06:42 -04:00
Wayne Stambaugh 979b4a4eb7 Revert "Move schematic symbol instance data back into symbol definition."
This reverts commit 7984e114db.
2022-09-29 15:33:23 -04:00
Wayne Stambaugh a60ed99510 Revert "Add project name to symbol instance data."
This reverts commit 4b276b339a.
2022-09-29 15:33:23 -04:00
Wayne Stambaugh 4b276b339a Add project name to symbol instance data.
This improves the readability of the schematic file format and creates
an opportunity to remove orphaned instance data by project name rather
than cryptic UUIDs.
2022-09-29 17:47:57 +00:00
Wayne Stambaugh 7984e114db Move schematic symbol instance data back into symbol definition.
This change reverts the storage of all symbol instance data in the root
schematic.  This was done because it's not possible to reuse instance
data when importing from sub-sheets.

There has been a fundamental change in how sheet paths are store in the
instance data.  The root schematic UUID is always used when saving the
instance data.  To prevent file churn, the virtual root sheet UUID is set
to the root schematic UUID when loading the project.  This provides a way
to determine the project that stored the instance data.  All uses of paths
without root sheet have been expunged from the code.

The sheet instance data is still saved only in the root sheet for the
time being.  New sheet instances will be automatically assigned an page
number based on the incremental virtual sheet page number.  Sheet page
numbers will not be imported.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12472
2022-09-29 17:47:57 +00:00
Marek Roszko e6ed275c25 Repoint IU_PER_MILS 2022-09-16 21:09:26 -04:00
Wayne Stambaugh e336a0e403 Improve sheet schematic import messages and simplify code.
There was also a logic bug when the selected schematic was in a different
path than the current project and was already part of the current project.
The symbol library table reconciliation code was still run which was wrong.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11075
2022-03-21 17:09:49 -04:00
Wayne Stambaugh c16090cc42 Improve sheet schematic import from different project message.
https://gitlab.com/kicad/code/kicad/-/issues/11075
2022-03-15 18:16:56 -04:00
Marek Roszko cadc0639eb Update BASE_SCREEN to VECTOR2I 2022-01-01 11:30:33 -05:00
Jeff Young b84d1456d5 KIFACE_I -> KIFACE_BASE. 2021-09-14 23:45:14 +01:00
luz paz 0446d35f0d Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-13 10:48:17 +00:00
Jeff Young a1dfc36233 More error message regularization. 2021-06-29 01:08:26 +01:00
Jeff Young 5c21f93803 Consistency in progress and error messages. 2021-06-26 13:23:43 +01:00
Jeff Young 1722bc03b0 Consistent terminology and punctuation. 2021-06-17 00:05:17 +01:00
Jeff Young ed0e0a00c0 Clear selection before importing schematic.
Also moves some error messages to use consistent terminology.

Fixes https://gitlab.com/kicad/code/kicad/issues/8421
2021-06-08 16:08:22 +01:00
Jeff Young e91721cb62 Minor cleanup. 2021-06-07 20:51:45 +01:00
Marek Roszko 4df3cb912d Remove another leaky wx/log.h header 2021-06-03 08:11:15 -04:00
Jeff Young c4cabb38d5 More worksheet -> drawing sheet cleanup.
Fixes https://gitlab.com/kicad/code/kicad/issues/8516
2021-05-31 12:26:44 +01:00
Seth Hillbrand 752ae4d519 Rename modification flag routines
Differentiates better between the EDA_ITEM IsModified(), referring to
items themselves changing and the EDA_SCREEN IsContentModified(),
referring to whether we have made any unsaved changes.
2021-05-28 12:07:04 -07:00
Wayne Stambaugh b1572dd56b Eeschema: fix broken sheet paths when adding existing schematic.
All existing sheet schematic file paths were completely trashed when adding
a new sheet from an existing file outside of the project path.
2021-05-27 14:04:56 -04:00
Roberto Fernandez Bautista ae009e0758 Ensure clipboard data is available after KiCad closes
Always Flush() after SetData()
2021-05-03 19:38:31 +01:00
jean-pierre charras 0427bda768 Remove useless wx/wx.h include, that create sometimes compil warnings on msys.
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
2021-05-01 19:32:15 +02:00
jean-pierre charras 929e535f0c SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(): fix missing init of worksheet color. 2021-04-12 18:15:30 +02:00
Roberto Fernandez Bautista 9aedeae5c3 Don't log error messages when using the clipboard
wxClipboard::GetData()and wxClipboard::SetData() both log a "wxLogSysError" error-level message (see for example:  https://github.com/wxWidgets/wxWidgets/blob/v3.1.4/src/msw/clipbrd.cpp#L703 ). This logged message gets displayed as a messagebox to the user.

The logging can be disabled temporarily by creating a wxLogNull object. See https://docs.wxwidgets.org/3.0/classwx_log_null.html

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6956
2021-02-03 01:55:05 +00:00
Marek Roszko b45eb56ddf Cleanup some msg panel usage using the no longer support colors
The color was being passed to the aPadding param now.....
2020-12-08 00:34:36 -05:00
Jeff Young 6654c03041 Embarking on the next adventure: component -> symbol. 2020-11-15 20:23:15 +00:00
Wayne Stambaugh 4ea3914d4e Coverity fixes.
CIDs: 312996, 305508, 305509, 305510, 312992, 312997, 312994, 312995,
312968, and 306650.
2020-11-10 08:50:16 -05:00
Jeff Young 0d8789935d Refactoring. Push editing code to toolset. 2020-10-31 10:28:21 +00:00
Jeff Young 1d110d5414 Move a couple more dialogs to QuasiModal for syntax help.
Fixes https://gitlab.com/kicad/code/kicad/issues/5897
2020-10-29 22:55:33 +00:00
Ian McInerney 31e626f279 Cleanup creation of all our smart pointers 2020-10-26 23:52:44 +00:00
Michael Kavanagh c40483d18a Cleanup: Move KiCad files into plugins folder 2020-10-12 16:36:08 +00:00
Jeff Young e9d372f4b7 Allow spaces in sheet filenames.
Fixes https://gitlab.com/kicad/code/kicad/issues/5736
2020-10-06 14:21:18 +01:00
jean-pierre charras 7865d8de43 more cleanup about removing useless include 2020-10-02 15:50:46 +02:00
Wayne Stambaugh 03423f13a1 Eeschema: fix broken new sheet path comparison on windows.
Using wxFileName::GetPath( wxPATH_WITH_SEPARATOR ) does not include the
drive specifier (A:, B:, C:, etc.) on windows which fails the comparison
with the project path 100% of the time.  wxFileName::GetPathWithSep()
solves the issue nicely.

Fixes https://gitlab.com/kicad/code/kicad/issues/5077
2020-09-03 11:11:14 -04: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