Commit Graph

264 Commits

Author SHA1 Message Date
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
Seth Hillbrand a154571438 Add ability to update subgraphs based on changeset
Previously, almost all connectivity updates were full updates, meaning
that the entire connectivity graph would be rebuilt each time a change
was made to the schematic.  This update modifies the update to only
correct the subgraphs that are directly affected by the change.

It uses the existing connection graph to find all affected subgraphs as
well as connections to the changes based on the visible schematic.
These elements are removed from the existing connectivity graph and
marked dirty.  They then have a new connectivity graph built only around
their changes.  The resulting graph is merged into the original.

Currently, this ability is behind an advanced config flag
`IncrementalConnectivity` while testing.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/1794
2023-04-19 16:14:35 -07:00
Seth Hillbrand 012737593b Handle nested netclass assignments
Netclass directives should not be overriden, instead hold our error
checking for actually missing nets

Fixes https://gitlab.com/kicad/code/kicad/issues/14494
2023-04-06 17:38:13 -07:00
Seth Hillbrand 16b4ec3c7e Allow bus elements to connect
Previously, bus elements that were not instantiated as individual nets
could not connect to each other.  This caused issues for complex
schematics where busses needed to connect to other busses with elements
that resolved to the same net names.  Functionally, this means mixing
bus elements, which we will replace with first-class elements in version
8 but currently can only be accomplished either by using bus aliases and
  this patch or by individually instantiating each bus element as a
local label

Fixes https://gitlab.com/kicad/code/kicad/issues/14300
2023-04-04 15:23:29 -07:00
Jeff Young 7e5cd01079 Improve scoping control of connetion members.
(The real bug here is that CONNECTION_GRAPH::assignNetCodesToBus() was
growing the bus aliases members list because it used a non-const
reference to it as a local storage list.  The const scoping of it will
prevent this type of error in future.)

Fixes https://gitlab.com/kicad/code/kicad/issues/14269
2023-04-04 12:03:06 +01:00
Mike Williams e738750dff Schematic: sheet pins need to use their parent to resolve text variables
Otherwise the current sheet will be searched, which is one layer too far
down the hierarchy.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13998
2023-03-08 11:52:43 -05:00
Mike Williams bf59f1246b Schematic: correctly resolve label nets using sheet variables 2023-03-08 11:52:43 -05:00
Mike Williams c8fdac7abe Schematic: correctly resolve global power nets using sheet variables
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/7445
2023-03-08 11:52:43 -05:00
Mike Williams 45e67950fd Schematic: fix global labels overriding wrong power symbols
Need to check pin netname now that we support changing the value of the
power symbol.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14076
2023-02-27 09:25:05 -05:00
Mike Williams 5995e0e516 Power Symbols: make value editable, use as netname
QA: update tests for editable power symbol values
2023-02-22 18:01:47 +00:00
Mike Williams ca5004b1d2 Power Symbols: rename IsPowerConnection to IsGlobalPower
It's kind of confusing because we have power type pins, and pins that
make global power nets as part of power symbols.
2023-02-22 18:01:47 +00:00
Mike Williams dd461d6ad6 Power Symbols: drop requirement for invisible pins 2023-02-22 18:01:47 +00:00
Seth Hillbrand 420eceecbb Simplify name caching
We don't need two functions to get driver names.  The map should be
mutable to allow updates when needed.  C++17 gives some extra syntactic
sugar for map manipulation
2023-01-24 10:30:52 -08:00
JamesJCode fef3274e8e Eeschema: ERC checks handle connections between a common sub-circuit
Fixes #10926

Contains the following changes:

    - Adds a new ERC_SCH_PIN_CONTEXT class which is used to provide deterministic
      comparison between items causing ERC violations (e.g. pins) when associated
      with a SCH_SHEET_PATH context.

    - Adds association of SCH_SHEET_PATHs for ERC_ITEMs and the sub-schematic items
      which caused an ERC violation. This allows correct display of markers on the
      sheets of interest only, and allows correct naming resolution and cross-probing
      from the ERC dialog.

    - Adds a new ERC_TREE_MODEL class, derived from RC_TREE_MODEL, which correctly
      resolves component references across heirarchical sheets using the associated
      SCH_SHEET_PATHs. This allows sheet-specific component references to be displayed
      correctly in the ERC results tree.

    - Updates SCH_MARKER to only draw sheet-specific markers on the sheet causing
      an ERC violation.

    - Increments the schematic file version.

    - When loading a schematic with legacy ERC exclusions, discards those of type
      ERCE_PIN_TO_PIN_WARNING, ERCE_PIN_TO_PIN_ERROR, ERCE_HIERACHICAL_LABEL, and
      ERCE_DIFFERENT_UNIT_NET as there is no safe way to automatically infer the
      information which is now stored with these exclusions (sheet paths for error
      location and related items). Requiring users to (once) re-add exclusions is
      preferable to silently incorrectly matching new ERC issues to legacy exclusions.
2023-01-24 14:11:01 +00:00
Seth Hillbrand ed0d57ddf6 Handle the forced propagation to subgraphs 2023-01-20 15:20:03 -08:00
Seth Hillbrand e6dbca051c Force realtime connectivity on
The pressure relief valve was not useful for common work patterns as it
forced the recalculation on many common actions such as bus expansion.
This caused it to actually feel slower than with the pressure relief
valve off.

For most schematics, realtime is now fast enough to not need the valve
and for those that are extremely complex, removing the valve helps this
run more predictably
2023-01-20 15:17:57 -08:00
Marek Roszko d2c0f5fc2a More wxSing 2023-01-16 23:14:38 -05:00
Seth Hillbrand bd6d0b6cb6 Ensure that all subgraphs are processed
Don't skip subgraphs just because they do not have off-sheet connections
on their hierarchical ports
2023-01-12 17:01:09 -08:00
Jon Evans c530bdb5a1 Rename GetSelectMenuText to GetItemDescription
This descriptive text is used for many more things than
just the select menu these days.
2023-01-11 22:27:44 -05:00
Jon Evans 5657ca5a04 No-connects might not be connected to a pin
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13256
2022-12-23 20:50:49 -05:00
Seth Hillbrand c86688d280 Ensure we have a subgraph 2022-12-14 16:41:52 -08:00
Seth Hillbrand bc8366cd95 Don't report a pin if the pin is null
The pins can exist on a different sheet from the no-connect.  In this
case, we do not set the ERC for the current sheet to the remote pins,
instead only link the NC
2022-12-12 19:29:15 -08:00
Seth Hillbrand eaf56bc05a Fix NC and label connection logic
label has 0 pins -> unconnected label warning
label has 1 pin -> OK only if also has a NC marker, otherwise unconnected pin warning
label has >1 pins -> OK only if has no NC marker, otherwise "NC is connected" warning

Thanks @craftyjon for helping work out the details
2022-12-09 02:14:05 +00:00
Seth Hillbrand 9a5df73060 ERC: don't flag hierarchically connected NCs
NCs require no more than one pin on the full net.  They may also have
multiple labels connecting them.
2022-12-07 13:48:25 -08:00
Seth Hillbrand f9a36b9c91 Update thread_pool to 3.3
Fixes an issue with `wait_for_tasks()` and adds a lower-overhead
`push_loop` helper.  We replace our usage of `parallelize_loop` with
`push_loop` as we didn't use the multi-future vector return and don't
need the extra overhead.
2022-12-02 12:01:34 -08:00
Seth Hillbrand 6625afabb7 Restore subgraph removal behavior
Commit 938645b29d had lines commented out
for debugging purposes.  This commit restores the original lines

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

Fixes https://gitlab.com/kicad/code/kicad/issues/12814
2022-11-22 05:43:53 -08:00
Seth Hillbrand 938645b29d Add terrible hack to get subgraph netname
In certain cases, the subgraph does not receive the proper netname,
preventing us from checking for correct pin counts.  This is a backwards
iteration of the net name <-> subgraph map to extract the proper name
and sibling subgraphs

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

Fixes https://gitlab.com/kicad/code/kicad/issues/12814
2022-11-21 15:19:45 -08:00
Jon Evans 0e454054f1 Also include resolved name when checking for bus membership 2022-11-02 17:37:34 -04:00
Jon Evans 5689c4b625 Include overridden drivers when checking bus membership
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10945
2022-10-30 19:17:04 -04:00
Jon Evans 3f68b7c5c1 Don't consider sheet pins as connections in ERC
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9828
2022-10-29 09:06:31 -04:00
Jon Evans 3a9ed47bf0 Prioritize power symbols over hidden power pins on regular symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8400
2022-10-27 22:54:36 -04:00
Jon Evans 141c1f020e ERC: Include power connections in multiple driver test
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12138
2022-10-27 22:36:40 -04:00
Jon Evans 014d536954 Ignore lastDriver in connectivity
Using the last driver in driver sorting breaks the stability/reproducibility
of the netlisting algorithm.  The last driver still needs to be tracked for
efficient redraw dirty detection.

Partially reverts 81e1bc9
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10757
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11393
2022-10-21 22:29:25 -04:00
Jeff Young eea8c7a8fd Handle netclasses assigned to bus labels.
Fixes https://gitlab.com/kicad/code/kicad/issues/12546
2022-10-02 15:01:16 +01:00
Seth Hillbrand 9adae0e8ba Avoid double-processing SCH_ITEMs
Elements such as zero-length lines might get into the connection map,
causing the system to process them twice.  This can cause allocation
errors when both are performed at the same time

Fixes https://gitlab.com/kicad/code/kicad/issues/12278
2022-10-01 12:28:39 -07:00