Rather than update library symbols one at a time, queue them up by
schematic symbol to prevent multiple updates to the same symbol in
complex hierarchies. This also removes all of the library symbols
first which will clear out all of the library symbol variants that
were created by modifying library symbols in place and/or changes to
the symbol in the library.
Don't add new variant library symbol if an equivalent variant already
exists in the schematic local cache. This prevents duplicate library
symbols from being added to the local cache when the first variant in
the cache does not match that of the symbol being added.
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.
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
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
This is mostly to output the aliases sorted (for ease of VCS integration),
but also because a btree will be faster than hashing on a small dataset.
Fixes https://gitlab.com/kicad/code/kicad/issues/11890
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
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
Also fixes some plot bugs with arcs.
Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.
Fixes https://gitlab.com/kicad/code/kicad/issues/5017
The tests for file existence and write status perform two file stats
which cause performance issues on slow network shares. Now the file
state is determined at load time and stored in the SCH_SCREEN object
so file access is no longer required.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9343
When swapping SCH_SYMBOL objects during undo, no special processing is
required. The SCH_PIN objects are updated when the LIB_SYMBOL objects
are swapped and the call to SCH_SCREEN::SwapSymbolLinks() didn't do
anything.
This change is a bit more invasive than the description above would
suggest. UUIDs have been added to all schematics. For now, it's only
useful to the root schematic so that the UUID in the project file does
not change every time the project file is save. In the future, it may
be useful to store and check the schematic UUIDs against the one's saved
in the project file.
Fixes https://gitlab.com/kicad/code/kicad/issues/7763
This fix required sorting all of the LIB_PART draw items to ensure
accurate comparison between the symbols stored in the schematic and the
original library symbols. This has a noticeable impact on symbol library
load performance. It may also cause significant changes the next time
the library is saved due to changes in the draw item sorting. Hashing
may be a better solution here but this addressed the immediate problem.
A skeleton method SCH_SCREEN::SwapSymbolLinks() was added because there
is most likely an issue with orphaned symbols in the schematic library
symbol cache during undo/redo operations. More testing is required to
verify this.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7263
This also makes sure that the user gets a warning before saving over
an older s-expr format. While that won't always be wanted, it's now
in the infobar (like in PCBNew), so it's not too onerous.§
Fixes https://gitlab.com/kicad/code/kicad/issues/7347
The variable `m_Initialized` in `BASE_SCREEN` is used by
`SCH_EDIT_FRAME` to mark whether a screen had its zoom level initialized
by the "zoom to fit screen" action. When this variable is `false`, the
function `SCH_EDIT_FRAME::DisplayCurrentSheet()` performs "zoom to fit
screen", modifying the zoom level. This function is indirectly called in
the undo routines, so if `m_Initialized` is not set to `true`, a zoom
change will occur when the user undoes an operation, a behavior that is
undesired.
`m_Initialized` was not initialized to `true` for the null schematic
(the schematic that is loaded if no project is loaded), causing the
aforementioned undesired behavior.
To prevent this, I've changed the `SCH_EDIT_FRAME` constructor to set
`m_Initialized` to `true`, since it zooms to fit screen already. I've
moved `m_Initialized` from `BASE_SCREEN` to `SCH_SCREEN`, as it is used
only in Eeschema, and renamed it to `m_zoomInitialized`, a name I
believe that better describes what this variable does.
I've also introduced the function `SCH_EDIT_FRAME::initScreenZoom()` to
group the "zoom to fit screen" action with setting `m_Initialized` to
`true`, as they often should occur together.
I'd also like to say that I'm not confident whether
`SCH_EDIT_FRAME::DisplayCurrentSheet()` should perform the zoom level
initialization at this point, but I have decided to not change this
behavior for now, as the commit history suggests it's several years old.
Fixes https://gitlab.com/kicad/code/kicad/issues/7343