When a rescue library already existed, the disabled writing of legacy
symbol library table entries prevented the rescue library from being
updated.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11897
(cherry picked from commit 4e7b5b9784)
The original decision to escape the legacy symbol library names results
in them being escaped every time they are opened which cause the curly
braces '}' from the original escaping to be escaped on subsequent
openings. This resulted in the symbol library names in the rescue
library not matching the library ID in the schematic.
This fix is likely to have other corner case bugs given the potential
for escaped characters in legacy symbol libraries. Given that we now
have escaped rescue libraries in play, removing the escaping will only
result in more issues so we will have to fix the corner cases as we go.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11563
"Highlight on PCB" and "Select" - "Items in Same Hierarchical Sheet"
actions were extended to select items on subsheets too.
"Highlight on PCB" now uses a proper full sheet path, allowing it to
work in subsheets.
Fixes https://gitlab.com/kicad/code/kicad/issues/11493
It looks like this was overlooked by Jeff in 2020 not realizing eda_doc isn't built under eeschema but common in cc9ac37a0e
(cherry picked from commit f85251ef75)
The legacy symbol library plugin code was changed to escape symbol names
which broke the LIB_ID string comparison when checking to see if symbols
needed to be rescued. Escaping the LIB_ID names before comparison resolves
the issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11563
(cherry picked from commit a19490b097)
Previous use of instance was as an "override" of the default value.
This has changed to be used as the primary storage location for all
values. This means that we cannot clear the instance data when setting
a new value for all instances, instead we have to change the instance
data and the default value is superfluous
Fixes https://gitlab.com/kicad/code/kicad/issues/11439
(cherry picked from commit 1a70465927)
Pin names like "+V" were incorrectly parsed as doubles leading to broken
comparisons. These caused heap overflows when sorting pin tables
This corrects the comparison so that numeric sorts are only performed
when there is an actual number in the symbol segment. Also adds unit
tests for common error cases
(cherry picked from commit aac6f576c2)
Better to have both the single-pin error message and the non-driven
error message when an input pin is not connected than miss error
messages when the pin is connected to a blank net
Fixes https://gitlab.com/kicad/code/kicad/issues/10430
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
(cherry picked from commit e336a0e403)
Previously, coordinates were clamped to +- 60 inches. It makes no sense to
clamp them at plotter level: max cooed depends on the editor (schematic/board...)
Rename MAX_PAGE_SIZE_MILS to MAX_PAGE_SIZE_EESCHEMA_MILS and use it only for Eeschema.
Fixes#11196https://gitlab.com/kicad/code/kicad/issues/11196
(cherry picked from commit 21144481d2)
Do not use the symbol field string to populate the value and footprint
grid cells. The field strings may be empty because the symbol has not
been instantiated yet by entering a sheet. This fix makes an incorrect
assumption that the first instance value and footprint data in the symbol
is the same for all instances.
Note: this fix is incomplete because the value and footprint fields are
can now be different between sheet instances. The entire field
table editor design will need to be rethought because the current
grouping doesn't allow different value and footprint instance
changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11194
(cherry picked from commit b87fc45e33)
Now that we are dealing with individual connection elements that do not
update their connected elements as well, we can thread the update, just
being careful to guard any remaining updates (bus_enty/busLine) that
need reciprocal updating
Fixes https://gitlab.com/kicad/code/kicad/issues/10974
If the SCH_ITEM has already been processed, the extra time needed to
iterated over the memberset and get the SCH_CONNECTION when we won't use
it is not neccesary.
Fixes https://gitlab.com/kicad/code/kicad/issues/10974
Normally, you will gain by resursing a nested loop only over the
pairs that are not already handled. In this case, however, you lose
time because you step outside of the cache by adding the reciprocal test
at each step.
Instead, we process one element at a time, keeping it cached and loop
over all other elements to add to the connection. This saves us about
75% of the time for larger loops (e.g. stacked power pins on a large
BGA)
Fixes https://gitlab.com/kicad/code/kicad/issues/10974
Also make sure that value field is updated from name changes when the
symbol is a power symbol (even if it's from the schematic instead of
the library).
Fixes https://gitlab.com/kicad/code/kicad/issues/11093
(cherry picked from commit a9eb7a0e28)
(cherry picked from commit 02252be29d)
We want to shorting the processing time by marking symbols that have
already been processed. But we must avoid marking symbols that will not
be processed due to their other flags
Fixes https://gitlab.com/kicad/code/kicad/issues/11164
Also make sure that value field is updated from name changes when the
symbol is a power symbol (even if it's from the schematic instead of
the library).
Fixes https://gitlab.com/kicad/code/kicad/issues/11093
(cherry picked from commit a9eb7a0e28)
Needed to find bottlenecks in fns, so break out individual sections of
the massive function for easier understanding.
buildItemSubgraphs (one section of the previous function) would build
millions of connections that were never used as stacked pins created X!
connections. Also tested using sets instead of lists and keeping unique
lists to avoid flagging but none of these were as performant as using
flags to remember which items had already been processed.
Fixes https://gitlab.com/kicad/code/kicad/issues/10974
The previous solution cleared all of the fields and force the unit setting
to unit one which would have less than desirable effects when reusing a
schematic in another project. This solution forces all of the instance
settings to the first sheet instance of the current project to prevent file
change churn when changing shared sheets in the current project.
This will not prevent shared schematic file changes when the first sheet
instance data differs between projects.
(cherry picked from commit dd1dbb81f6)
Double-calls are no longer needed when using settings. They can
interfere depending on how the system executes the commands.
Removing keeps the last used plugin as the default, rather than the last
selected
Fixes https://gitlab.com/kicad/code/kicad/issues/11094
Adding a page in the ctor can generate events that change the default
page. Instead, we set the default after all pages have been added,
avoiding the reset
Fixes https://gitlab.com/kicad/code/kicad/issues/10910
The comment regarding bitmaps was true for one more month in 2018, but
hasn't been true for the last 3 years, and clearing the cache is a huge
performance hit.
(cherry picked from commit d58427a519)
Arcs can be altered by the process of changing from on-disk
representation to in-memory representation. Saving back to disk without
modifying the arc should not modify the calculated values.
This stores a copy of the on-disk representation that is only used to
save back to disk in the event that the arc is not modified during
editing.
Fixes https://gitlab.com/kicad/code/kicad/issues/10442
(cherry picked from commit cd7141fd10)
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
Our heuristics for determining when to append to the undo aren't
sufficient for the two segments of a broken wire. One is new and the
other is changed, but the drag should be appended to the current undo.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10865
MapAngles will adjust by small amounts the angles t1 and t2. This
adjustment will determine the CW/CCW drawing. Therefore, the MapAngles
needs to be called explicitly before the Normalize180() call.
Left-to-Right evaluation is not a given for MSVC
Fixes https://gitlab.com/kicad/code/kicad/issues/11050
(cherry picked from commit c9fb95b888)
Before they were 1/2 treated as flags and 1/2 treated as a mode enum.
The ERC flag relaxes constraints on data that is settable in the
schematic editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/11018
(cherry picked from commit 76535d8572)
When double-clicking to open a symbol, it is no longer selected in the
tree. We need to use the `GetTargetLibId()` to pick the correct symbol
(first selected, then current) when using the duplicate command
Fixes https://gitlab.com/kicad/code/kicad/issues/11034
The fix for https://gitlab.com/kicad/code/kicad/issues/10529 kicked the
subsequent IDs for unit selection off the maximum ID value for popup
menus. This increases the maximum popup number (integers are free)
Removes the ability to hide symbol units in file formats. This was
mostly the case for a while but there remained corner cases where we
left a default/hidden option
Fixes https://gitlab.com/kicad/code/kicad/issues/10888
(cherry picked from commit 8c36ba3653)
When reading sheet fields, we need to maintain a consistent order for
the mandatory fields as they are dereferenced by place. We force this
during the `SetFields()` call.