Commit Graph

384 Commits

Author SHA1 Message Date
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
Jon Evans 0814219513 Clean up some handling of project files in standalone
Add control of project creation to Eeschema; change defaults
to enable project creation in both programs.  Properly set
project on newly-created schematics so "Save As" doesn't
get triggered repeatedly.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9000
2021-08-21 12:09:21 -04:00
Jeff Young 41619ebbe2 Decouple PROGRESS_REPORTER interface from implementations. 2021-08-14 21:05:49 +01:00
Jeff Young c51b1dad72 Generalize infobar MESSAGE_TYPE handling and use for DRC errors.
Fixes https://gitlab.com/kicad/code/kicad/issues/8782
2021-08-01 21:51:39 +01:00
Jeff Young 01d3a88faa Allow unnamed embedded step files in altium boards.
Fixes https://gitlab.com/kicad/code/kicad/issues/7898
2021-07-10 16:37:45 +01:00
Jeff Young 6810912f09 Refuse to load schematics from the future.
Also fixes a bug where an empty window would get left when loading
a file from the KiCad manager window errored out.

Also fixes a bug where we were getting the wrong exception because
we were rethrowing the type-casted one (rather than just calling
throw).

Fixes https://gitlab.com/kicad/code/kicad/issues/8604
2021-06-30 18:32:07 +01:00
Jeff Young 4c5df22eb0 Don't show busy cursor when dialogs (including progress) are in use.
Also removes a stale comment.
Also moves the progress reporters earlier to lessen need for busy cursor.
Also cleans up some error strings and makes other more easily translatable.
2021-06-26 22:53:24 +01:00
Jeff Young 5c21f93803 Consistency in progress and error messages. 2021-06-26 13:23:43 +01:00
Jeff Young 5fa5a73c6d File open/import progress dialogs.
Fixes https://gitlab.com/kicad/code/kicad/issues/6864

Fixes https://gitlab.com/kicad/code/kicad/issues/2166
2021-06-23 23:55:54 +01:00
Jeff Young 96e4b19444 Append Schematic Content -> Insert Schematic Content
Fixes https://gitlab.com/kicad/code/kicad/issues/7905
2021-06-18 21:23:49 +01:00
Jeff Young 1722bc03b0 Consistent terminology and punctuation. 2021-06-17 00:05:17 +01:00
Jeff Young decfe89091 Refresh after import; don't wait for user to move mouse. 2021-06-16 21:44:18 +01:00
Wayne Stambaugh ff099453c8 Rename class_library.[h|cpp] to symbol_library.[h|cpp]. 2021-06-15 09:24:55 -04:00
Wayne Stambaugh ee3eac325d Expunge the use of the word part from Eeschema code. 2021-06-15 08:32:11 -04:00
Jeff Young 08d56f897c Update Hierarchy Navigator after performing file actions.
Fixes https://gitlab.com/kicad/code/kicad/issues/8498
2021-06-13 17:15:43 +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
Marek Roszko 8f2819cfa4 Kill the last of wx/wx.h in headers 2021-06-07 17:59:20 -04:00