Commit Graph

298 Commits

Author SHA1 Message Date
Seth Hillbrand 1ca0737c34 Replace stale pin references with UNDO copy
When we replace a symbol with one that has fewer pins, the old pins
are released, which leaves points to them in the connection graph
dangling.  This updates the pointer to use the cloned copy in the undo
stack until the connection graph is rebuilt with the new data

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17851

(cherry picked from commit 315ad0e071)
2024-04-24 12:55:30 -07:00
Seth Hillbrand 26629928c3 Incremental updates should not clear globals
Netclass assignments are stored in the project level but
CONNECTION_GRAPH updates would clear the assignments.  This keeps
existing netname->netclass assignments but updates any netnames that
were changed by the incremental updates.  Absolute updates are not
affected and fully recreate the net name to netclass map

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17720

(cherry picked from commit e538b98286)
2024-04-14 14:14:38 -07:00
Seth Hillbrand 55c864ec45 Fix incremental connectivity
The connectivity routine would consider symbols, overwriting unused
subgraphs for pins that were not in the change list.  This is resolved
by updating the full connectivity to only use pins in the graph since
symbols are not connected independently.

In the process of adding QA tests for this change, additional issues
with the schematic QA were discovered.  Specifically, we were not
properly setting the root sheet UUID.  This was partially masked by a
const_cast setting of the RefDes in sch_symbol when called the RefDes
getter.  This exposed the fact that our QA ERC numbers did not match the
schematic editor stand alone ERC numbers.  So the test value for one
check needed to be updated

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17528

(cherry picked from commit a9f35ba42e)
2024-04-14 14:14:38 -07:00
Jon Evans 30df673ffa Check for bus no-connects in ERC
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13285


(cherry picked from commit ce846f5c22)
2024-04-07 12:50:45 +00:00
Jon Evans ef0204a44b Remove debug output 2024-02-11 09:04:10 -05:00
Jon Evans 4eba781013 Try harder to remove stale pins from connectivity
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16846
2024-02-10 23:26:37 -05:00
Seth Hillbrand 7664c345e2 Revert "Schematic performance enhancements"
This reverts commit df654ac12f.
2024-02-01 09:00:13 +01:00
Yon Uriarte df654ac12f Schematic performance enhancements 2024-02-01 02:28:09 +00:00
Marek Roszko 059b043935 Try and walk from a real component pin rather than power symbol that will fail our later check 2024-01-21 21:12:14 -05:00
Marek Roszko fb8dc75108 Fix broken conditional check while walking global power connected items
Per the if statement and logic, we want to walk into looking up connections if we are a pin on a chip.
IsGlobalPower is a test for it's in a power symbol, so we want it false not true.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16699
2024-01-21 19:54:09 -05:00
Seth Hillbrand ba6979a274 Fix pin check to allow for globals
Don't short-circuit adding global labels to the pins vector or we won't
search all subnets
2024-01-16 16:35:47 -08:00
Seth Hillbrand 8fea4812f3 Don't count power flags as sinks/sources
Just because we have a power flag on a net does not mean that there are
more than 1 pin

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13469
2024-01-16 15:24:32 -08:00
Wayne Stambaugh 4f3fb5c23f Second attempt at fixing ERC dialog reference update issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16519
2024-01-09 13:14:13 -05:00
Wayne Stambaugh 92c58f2564 Fix sheet path dependent ERC dialog selection issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16519
2024-01-08 11:16:55 -05:00
Wayne Stambaugh f07d797ab3 Don't show ERCs for every sheet path when using shared schematics.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16434
2024-01-04 13:53:16 -05:00
Jon Evans ea0673e7a0 Do not merge buses of distinct types
Previously, this code would merge a vector bus
with a group bus containing the vector as a member.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16439
2023-12-30 10:54:24 -05:00
Jon Evans dad842d3f0 Allow no-connects on standalone hierarchical pins/ports
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16397
2023-12-22 19:08:14 -05:00
Wayne Stambaugh 922aee1532 Coding policy fixes. 2023-12-20 07:17:23 -05:00
Jeff Young 03953e80fc Enforce SCH_SHEET_PATH processing in (yet) more places.
Also fixes a bug where ERC testing for text variables in sheet pins
would start with the wrong sheet.

Also fixes a bug where ERC testing of similar labels would use the
wrong sheet.

Also fixes a bug where ERC testing of bus-to-net conflicts would use
the wrong sheet.

Also fixes a bug where ERC didn't process variable references when
checking hierarchical labels against sheet pins.

Also fixes a bug where ERC multiple-drivers and netclass-conflicts
tests didn't set a sheetpath.
2023-11-12 14:15:04 +00:00
Seth Hillbrand de0736863b Allow multiple strong drivers with same name
Multiple labels with the same name are allowed (and expected) so ensure
that we use a structure that allows duplicate names
2023-10-31 11:52:29 -07:00
Jeff Young ca9fdbbedb Use a slower method of keeping dangling state correct for current sheet.
(The faster method ran into unit test failures.  There must be
something in here that's order-specific.)
2023-10-26 15:22:15 +01:00
Jeff Young 84b0848a1e Make sure that current sheet's units and dangling states are correct.
We used to store the symbol units of the current sheet and then
restore them, but we didn't handle the dangling states.

The new code uses a different strategy and just makes sure that if
any of the sheets are going to modify the current screen, the current
sheet gets to go last so that its modifications will "stick".

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15392
2023-10-26 13:07:16 +01:00
Seth Hillbrand 4741a5ed4c Fix memory leak in connection graph
When generating virtual connections to represent bus aliases, we need to
store the pointers for future deletion otherwise we will leak the memory

(cherry picked from commit 9260f58803)
2023-10-23 13:47:07 -07:00
Seth Hillbrand 8cbad7a3c0 Compare bus local names
When running ERC, we want to check if bus members exist in the bus and
this should be done using m_local_name (i.e. the name it take from the
parent bus) not the resolved name as this will change depending on
connections

(cherry picked from commit 1380feef72)
2023-10-23 12:54:58 -07:00
Wayne Stambaugh 5d6ef69726 Coding policy and Doxygen comment fixes. 2023-10-12 09:36:28 -04:00
Seth Hillbrand d6c3f4d190 Protect against subgraph loops
Optimize the subgraph processing to avoid repeated loops when multiple
items belong to the same subgraph.

(cherry picked from commit 75de21314c)
2023-10-05 09:20:26 -07:00
Seth Hillbrand 16324facaf Use kicad_algo when possible 2023-09-20 10:32:37 -07:00
Seth Hillbrand 7d12e1c4f5 Fix crash in incremental update and bus conn
We store our connectivity dirty flag with the SCH_ITEM but we generate
SCH_CONNECTION based on the SCH_ITEM and the SCH_SHEET_PATH.  For this
reason, we need to avoid clearing the connectivity dirty flag until
we've finished processing all instances of the SCH_ITEM in the graph

This also means that we need to allow getting the SCH_CONNECTION pointer
even when the connectivity is still dirty (getting SCH_CONNECTION
happens based on SCH_ITEM and SCH_SHEET_PATH, not just SCH_ITEM)
2023-09-19 15:55:19 -07:00
Seth Hillbrand b52c43b933 Fix some stale pointers in incremental updates
Shared pointers contained stale references to the temporary graph.  When
merging, we need to ensure all references are updated to the final graph
2023-09-18 18:02:41 -07:00
Seth Hillbrand 9fc45eb08c Properly handle incremental bus connections
- Incremental extraction needs the newly created items.  The modified
  items are already set in the connection graph but the newly created
  items don't exist yet, so we need to add those explicitly
- Bus parents need to ensure that the bus children exist because we
  iterate on the updates from the top of the graph down
2023-09-16 12:45:04 -07:00
Seth Hillbrand cb1231382f Fix connectivity regression
We have a break somewhere in the connectivity that doesn't fully process
connections but the current code seems to catch these by forcing a
top-down & bottom-up calculation

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14818
2023-09-14 14:39:51 -07:00
Marek Roszko 7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -04:00
Marek Roszko 4d77fd48ef Shove thread_pool to core 2023-09-06 17:50:12 -04:00
Seth Hillbrand c2fd2f42eb Update TestDanglingEnds to O(n) speed
The elements don't care which they connect to, so don't search for
points on the page, just collect them all and then test them all

Adjusts f3dd5b73
2023-08-31 15:31:48 +00:00
Jeff Young c30bdf9ba8 Implement second-level cache for escaped netnames.
While it's a bit of an encapsulation leak (see comment in
CONNECTION_SUBGRAPH::driverName()), it more than doubles undo/redo
performance in documents with *lots* of nets.
2023-08-07 21:44:04 +01:00
Jeff Young e48a96ecaf Don't call driverName() unless we have a cache miss.
(That is, in fact, the whole purpose of this cache.)
2023-08-07 21:44:03 +01:00
Seth Hillbrand 248404a0d1 Better fix for #15217
Rather than rely on a quirk, we avoid the modified structure

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15217
2023-08-04 13:58:35 -07:00
Seth Hillbrand 018d60eb40 Fix-up for previous commit
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15217
2023-07-28 09:47:18 -07:00
Seth Hillbrand 7bd3992350 Change stale_bus_members to work around MSVC issue
Somehow, MSVC vector gets corrupted in certain cases.  While the
mechanism is unclear, using an unordered_set avoids this problem

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15217
2023-07-28 09:35:39 -07:00
Jon Evans d4b7144448 Properties: expose symbol attributes
Flip polarity of exclude-from-BOM and -board for symbols
to match that of footprints and match the GUI display.
2023-06-24 22:03:06 -04:00
Ian McInerney b73cc7db4a Fix a few accidental copies in loop iterators 2023-06-15 22:57:05 +01:00
Seth Hillbrand 4bc0822733 Connectivity: Correct alias-based bus resolution
Aliases in bus resolution were being resolved without a path, making
them effectively global nets.  This applies the corrected path to the
bus members and adds a QA to catch this error
2023-06-02 14:25:51 -07:00
Wayne Stambaugh 24b04795fd Add net navigator panel to schematic editor.
[ADDED]: A panel to the schematic editor  that allows quick access to all
         of the items connected to the currently highlighted net.

This is an initial swag at implementing a full net navigator feature.  For
now it only shows the currently highlighted net nodes.  The incremental
net list advanced setting must be enabled in order to use this feature due
to performance reasons.  There are still some issues with saving the panel
position which will be addressed in the future.

Initial code for serializing wxAuiPaneInfo settings to and from JSON have
be implemented.
2023-05-20 13:48:03 -04:00
jean-pierre charras 94bd1c6025 Fix a few Coverity warnings. 2023-05-12 18:53:55 +02:00
Seth Hillbrand 6e4de18e15 Ensure _changed_ netlist is propagated
The propagation is currently (maybe not needed) limited to the global
name that is the source of the change.  We also need to propagate the
global name that is changed in case the global is set in a tree leaf and
not the root

Fixes https://gitlab.com/kicad/code/kicad/issues/14657
2023-05-09 12:13:06 -07:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
Seth Hillbrand 2cac992801 Fix a28d590b9b
Needs to be static, so keep the reference from the associated symbol and
not the SCH_SYMBOL instance.  Both will likely have the same prefix,
which is all we care about here
2023-05-04 12:06:19 -07:00
Seth Hillbrand a28d590b9b Force not-on-board symbols to NONE priority
Symbols that are not on the board should not affect the arbitrary names
assigned to unlabeled nets.
2023-05-04 11:51:21 -07:00
Seth Hillbrand 8b73b0549f Remove matching parents/neighbors in subgraphs
This ensures that when bus elements or labels matching bus elements are
removed that the stale neighbor/parent references are similarly removed

Matching 7.0 commit 4cdf75dc72
2023-05-03 13:37:11 -07:00
Seth Hillbrand 6e8a5acc66 Bug Fixes for new incremental connectivity
- Ensure that critical paths (ERC/netlister) are fully-rechecked
- Handle symbol/pin distinction in change markers
- Fully connect hierarchical pins in one pass descending
2023-04-21 13:35:18 -07:00