Commit Graph

400 Commits

Author SHA1 Message Date
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 b9287968d6 Update symbol default prefixes after updating instance data.
Also moves the sim model fixups after the instance data updating as
it uses the prefixes.
2022-12-07 01:34:56 +00:00
Wayne Stambaugh da0624286c Fix spelling error in schematic import exception handler. 2022-12-06 18:04:38 -05: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 5001555f0e Fix crash in Altium schematic importer.
The crash was caused by an unhandled exception. The uncaught exception
caused a cacophony of null configuration setting pointers so guards were
added to prevent crashes should other exceptions occur that do not get
handled correctly.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13046
2022-12-05 20:20:01 -05:00
Jeff Young 96819f6c01 Better cache invalidation for text objects with references.
Fixes https://gitlab.com/kicad/code/kicad/issues/13059
2022-12-04 11:51:44 +00:00
Wayne Stambaugh 4a27d856f7 Move schematic sheet instance information into file sheet definition.
This will make it possible to maintain sheet instance information when
copying and pasting from any sheet other that the root sheet of a
project.

Setting and getting sheet page numbers must now be performed using a
sheet path.  This was done to ensure that the instance paths were not
getting changed unexpectedly from different code paths.
2022-11-22 16:45:38 -05:00
Simon Schaak bd74489b00 Clean up autosave file handling edge cases 2022-11-22 15:21:26 +00:00
Sylwester Kocjan a234d5a2c8 common,eeschema,pcbnew: path cleanup 2022-11-02 13:29:52 +00:00
Wayne Stambaugh 349de90bb0 Fix Altium schematic importer bug(s).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11412
2022-10-31 10:03:35 -04:00
Wayne Stambaugh 85805bdad7 Fix broken legacy file format symbol instance data import. 2022-10-19 12:23:28 -04:00
Wayne Stambaugh 2a13c0af2e Revert commented out code. 2022-10-18 16:07:14 -04:00
Wayne Stambaugh f782323960 Fix yet another symbol instance issue when loading legacy schematics. 2022-10-15 14:16:03 -04:00
Jeff Young ad5df7f4cc More busy cursor tightening.
Fixes https://gitlab.com/kicad/code/kicad/issues/11648
2022-10-11 23:40:58 +01:00
Jeff Young 8206283a20 Code clarity. 2022-10-11 11:22:26 +01:00
Jeff Young 3221877fe8 Push autosave-require down in to EDA_BASE_FRAME.
Fixes https://gitlab.com/kicad/code/kicad/issues/11790
2022-10-10 14:03:52 +01:00
Jeff Young be6f08deca Code clarity. (No functional changes.) 2022-10-10 14:03:52 +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 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
Alex dc07ab9df1 Replace PROF_COUNTER with PROF_TIMER in some conditional places. 2022-09-27 14:07:47 +00:00
Jeff Young 838bd7292c Default intersheet ref field visibility to off, and show warning
when user tries to edit via Symbol Properties or Field Propeties.
2022-09-26 21:00:46 +01:00
lulu731 0180bcf90a ADDED: Implement Drag and Drop
dropping files to Kicad manager :
  *.kicad_pro, *.pro -> open project;
  gerber and job files -> open in Gerbview editor;
  Eagle and Cadstar files -> open project.
dropping file to schematic editor -> append schematic;
dropping library file to Symbol editor -> add library;
dropping board file to PCB editor -> append board;
dropping library or footprint file to Footprint editor -> add library or import footprint;
dropping ZIP file or gerber files to Gerbview editor -> open files;
dropping sheet file to Drawing Sheet editor -> open sheet.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11638
2022-09-14 22:28:09 +00:00
Jeff Young 5d468ca759 Use MESSAGE_TYPE::OUTDATED_SAVE for read-only infobar messages as well.
Fixes https://gitlab.com/kicad/code/kicad/issues/12252
2022-09-10 21:27:10 +01:00
Jeff Young c30a557810 ADDED netclass assignment from PCB canvas.
Fixes https://gitlab.com/kicad/code/kicad/issues/5975
2022-09-03 19:29:59 +01:00
Wayne Stambaugh 10123d164f Fix schematic symbol initial default instance data bug.
The commit bumps the schematic file format version in order to fix the
initial symbol default instance data to the first instance of each symbol.
It also sets the initial instance data to undefined in the SCH_SYMBOL
ctor so on the first schematic save, the default instance will be set
to the first instance of the symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12190
2022-08-21 08:03:28 -04:00
Wayne Stambaugh 797827b833 Fix missing legacy value and footprint field instance data.
The legacy and s-expression (prior to version 20200828) file formats only
supported symbol unit and reference fields so the newly added value and
footprint fields must be updated from the original symbol fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12226
2022-08-17 11:32:04 -04:00
Jeff Young 6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01:00
Seth Hillbrand 939313088e Units are stored in the instance data
At the moment, units are stored in the instance data, so when loading
the file, all symbols will have bbox for the first unit.  After calling
`UpdateUnit()`, we need to recache the rtree bounding boxes to get
correct hit tests

Fixes https://gitlab.com/kicad/code/kicad/issues/11681
2022-06-30 14:59:17 -07:00
Seth Hillbrand a852286eb5 Cleanup compile warnings 2022-06-21 17:04:56 -07:00
Marek Roszko ff94d289c7 Move the eeschema standalone to the new save dialog 2022-06-11 22:06:42 -04:00
Mike Williams 857990a883 Hierarchy: turn into a left side pane
Drop auto-closing option as well.
2022-06-02 21:56:17 +00:00
Jeff Young 90bfe2d94b Remove Save Copy As from fp editor, and rename to Save a Copy elsewhere.
It's still used by Eeschema and PCBNew when not in stand-alone mode.

Fixes https://gitlab.com/kicad/code/kicad/issues/9185
2022-04-24 19:46:57 +01:00
Jeff Young 535ecb9b7b Don't leave dangling pointers to old document when importing.
This goes for both selection pointers and undo/redo pointers.

Fixes https://gitlab.com/kicad/code/kicad/issues/10145
2022-03-22 18:08:05 +00:00
Seth Hillbrand 6934bc124c Move temp save files to temporary directory
Avoid excess writes to the project directory to dodge issues with remote
file systems not fully writing data.

wxRename works across disk boundaries (in theory) and falls back to
wxCopy/wxRemove when it fails

Fixes https://gitlab.com/kicad/code/kicad/issues/10747
2022-03-07 20:13:28 -08:00
jean-pierre charras 4c81bac9e3 Eeschema: ensure ERC exclusions list is up to date before saving it in *.kicad_pro
Fixes #10339
https://gitlab.com/kicad/code/kicad/issues/10339
2022-02-25 18:21:46 +01:00
Seth Hillbrand b0fddef9b4 Don't rename existing schematic file
We should never leave a situation where the schematic file may no longer
exist (if the first rename succeeds and the second fails).  So, make a
backup copy of the original schematic file and then attempt to rename
the autosave over the first file.  In this case, if either attempt
fails, we do not lose the original file

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

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

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

(cherry picked from commit b1658fdf9a)
2022-01-04 20:28:21 -08:00
Seth Hillbrand f7fb756f78 All imported schematics need connectivity update
Fixes https://gitlab.com/kicad/code/kicad/issues/9907
2021-12-08 16:27:24 -08:00
Jon Evans aa5f496727 Properly migrate bus-bus entries on load of legacy schematic
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9678
2021-11-25 12:12:01 -05:00
Mikolaj Wielgus 38bd4b07e4 Close the simulator before changing schematic
Fixes https://gitlab.com/kicad/code/kicad/issues/9501
2021-11-07 23:35:06 +00:00
Ian McInerney 280743d9e9 Fix missing reference in for loop 2021-10-18 00:29:10 +01:00
Wayne Stambaugh c4d0a06701 Eeschema: fix broken auto save feature.
Make auto save recover all auto saved sheet files not just the root sheet.

This does not fix existing auto save issues because recovery would require
an iterative reload for each automatically saved sheet file and would only
happen once.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9288
2021-10-13 14:51:00 -04:00
Jeff Young 5f5ee7335d Formatting. 2021-10-01 21:49:14 +01:00
Wayne Stambaugh d90094de39 Fix progress dialog main frame focus issue on Linux.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8718
2021-09-16 15:53:18 -04:00
Seth Hillbrand ca6e43d1e1 Fix segfault when discarding changes on open
When opening new schematic, the undo/redo list is invalidated.
CleanupSchematic uses it before presenting the new schematic to the
user, so we need to make sure that old data are not preserved here past
their pointer lifetimes
2021-09-14 16:41:25 -07:00
Jeff Young b84d1456d5 KIFACE_I -> KIFACE_BASE. 2021-09-14 23:45:14 +01:00
Jeff Young 2cdd3c9ebf Work-around incorrect spacing (and order) of buttons on Mac. 2021-08-31 22:39:25 +01:00
Jeff Young b5a3385ea9 Overhaul file locking system.
See bug report for details.

Fixes https://gitlab.com/kicad/code/kicad/issues/8919
2021-08-31 15:04:31 +01:00
Jon Evans 0463fc4c2b Fix several bugs and refactor schematic saving
Having the logic split between three different paths was
a bit much, this should hopefully be a bit easier to
maintain.  All save logic now goes through SaveProject;
individual file writing is now a private function.

Also change Save As to Save Copy As in project manager
mode, as we don't want to change projects from inside
the editor in project manager mode.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9015
2021-08-23 23:01:08 -04:00