Commit Graph

9796 Commits

Author SHA1 Message Date
Seth Hillbrand 240d7921ba 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

(cherry picked from commit de0736863b)
2023-10-31 11:53:56 -07:00
Seth Hillbrand 3ce4a5bf7f Fix missing random sim command 2023-10-24 13:57:44 -07:00
Alex Shvartzkop f62c3431ff Semi-fix schematic text properties dialog on wx 3.2.3.
Based on d9b5257b9e
2023-10-24 23:30:31 +03:00
Seth Hillbrand 1380feef72 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
2023-10-23 12:54:31 -07:00
Alex Shvartzkop 14f12ccf51 Add ngspice lib paths for when running from build dir.
(cherry picked from commit 71fb1afe4c)
2023-10-23 21:29:11 +03:00
Jeff Young f89803eb64 Don't turn an empty string into a '0'.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15871

(cherry picked from commit 0b06a1376b)
2023-10-14 15:33:00 +01:00
Alex Shvartzkop 0547c7ba91 Fix loading legacy (until 2009) schematic files.
(cherry picked from commit b87496b834)
2023-10-14 15:45:20 +03:00
Alex Shvartzkop 8f4b809599 Fix the insufficient privileges message in symbol remap dialog.
(cherry picked from commit 7b94ecdc01)
2023-10-14 15:44:52 +03:00
Marek Roszko 84df2c86ae Fix ambiguous cast 2023-10-13 19:26:16 -04:00
Seth Hillbrand 9260f58803 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
2023-10-06 09:14:07 -07:00
Seth Hillbrand 1a5c515e45 Improve pin-pin iteration in ERC checks
Rather than generating expensive classes to store in a set to check for
duplicate checks, we avoid double-checking elements in the vector.  For
large schematics this results in a substantial speed increase
2023-10-06 09:14:07 -07:00
Seth Hillbrand 75de21314c Protect against subgraph loops
Optimize the subgraph processing to avoid repeated loops when multiple
items belong to the same subgraph.
2023-10-05 08:39:56 -07:00
Jeff Young 1f870bf76c Handle justification when hit-testing fields.
This steals the algo used in SCH_PAINTER to get the right coords
for the text.

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

(cherry picked from commit 6fbbf981f0)
2023-10-04 18:51:33 +01:00
Jeff Young d5cc334e20 Clear render caches before plotting.
Also fixes a bug where text variables in LIB_TEXT weren't getting
expanded when plotting.

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

(cherry picked from commit 003acbd686)
2023-10-04 18:49:56 +01:00
jean-pierre charras 838eadd47f Eeschema: fix a crash when loading a schematic if a symbol in a sheet has
a lib_name containing {slash} instead of /
(related to commits #2f51d22b and b2bf28f5)
From master branch.
Fixes #15791
https://gitlab.com/kicad/code/kicad/-/issues/15791
2023-10-01 10:08:33 +02:00
jean-pierre charras afb43531e8 Eeschema: fix a crash when loading a schematic if a symbol in a sheet has
a lib_id containing {slash} instead of /
(related to commit #2f51d22b)
Fixes #15791
https://gitlab.com/kicad/code/kicad/-/issues/15791
2023-09-30 18:25:18 +02:00
Jeff Young 7e747085d3 Handle read-only libraries when saving symbol from canvas.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15519

(cherry picked from commit 1fd3f4e375)
2023-09-30 13:36:13 +01:00
Jeff Young 2b106a2b34 Handle flipped horiz/vert justifications in FIELDS_GRID_TABLE.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15677

(cherry picked from commit 6f62565093)
2023-09-30 13:27:28 +01:00
Jeff Young f6494d2980 Implement printing and plotting for directive-specific label shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15650

(cherry picked from commit 394ab8ccb1)
2023-09-30 13:26:59 +01:00
Jeff Young c858643100 Collect comment lines into following spice unit.
This can't distinguish a header block comment in front of a file
with multiple spice units, and so will include that into the first
unit only.

Also fixes the pin assignments reference textbox to use a
fixed-width font as many .subckt's contain ASCII graphics for
pin definitions (not that it helps any with the test case from
the given bug).

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

(cherry picked from commit ede542f911)
2023-09-30 13:25:44 +01:00
Jeff Young 17b0bdc9fe Check value-follows-name case in symbol Save As.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15647

(cherry picked from commit 849a4656c8)
2023-09-30 13:24:32 +01:00
Jeff Young 0eca698a39 Update symbol editor's title bar when renaming the canvas symbol.
(cherry picked from commit 7d1dbb77c3)
2023-09-30 13:19:40 +01:00
Jeff Young 16f259da81 Only update value on rename if it previously matched the symbol name.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15621

(cherry picked from commit ee724f6a2b)
2023-09-30 13:18:53 +01:00
Jeff Young c3ee477a1b Apply DC voltage source exception to current sources.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15626

(cherry picked from commit 4a59f0de43)
2023-09-30 13:18:17 +01:00
Seth Hillbrand 093db600ff Fix cherry-pick issue with file locking 2023-09-29 11:15:59 -07:00
Seth Hillbrand fff95fa4e6 Disable non-KiCad import for project-mode
Adds warning if project schematic contains data

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

(cherry picked from commit b837aa823c)
2023-09-29 11:05:49 -07:00
Seth Hillbrand 686048dcce Be smarter about releasing lockfiles
If KiCad crashes or exits without deleting the lockfile, don't show the
warning message unless we are not the one who locked it or there are
other KiCad instances running locally.

This should catch 99% of the cases where the message is shown
incorrectly.  There may be some corner cases where the lock file is
created on a network drive using two different machines with the same
name and same user but these cases should be (famous last words)
sufficiently rare as to not be observed in practice

(cherry picked from commit 7fe83993cf)
2023-09-29 11:02:42 -07:00
Seth Hillbrand 330c0f86de Set pinmap after updating pins
When duplicating and existing symbol, we must set the pins before
setting the lib symbol as the lib symbol will generate a pin map that
will be broken by the shift to new pins

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

(cherry picked from commit 12ebb2bbfa)
2023-09-29 17:59:24 +00:00
Seth Hillbrand 83317f1b80 Don't destroy the pin cache in symbols
SCH_PIN pointers are used through KiCad and removing them without a
global refresh risks crashes.  A safer approach is to simply reuse the
SCH_PIN structures, updating the data to the revised library

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

(cherry picked from commit bdb7b99fc8)
2023-09-29 17:59:24 +00:00
Wayne Stambaugh a416eb2cf6 Fix schematic editor crash when updating symbols.
Some how symbol names that still have escaped '/' character get mixed with
symbol names that have '/' characters now that it is no longer an invalid
LIB_ID character.  This was causing derived symbols to loose the link to
the parent symbol.  This fix replaces any instances of "{slash}" with "/"
to convert symbol names to the proper escaping.

Thanks to JP for the inspiration for the fix.

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

Manually cherry picked from commit 2f51d22b3a.
2023-09-29 12:53:33 -04:00
Seth Hillbrand 6b43bb8fe3 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)

(cherry picked from commit 7d12e1c4f5)
2023-09-19 16:07:40 -07:00
Seth Hillbrand 0faad370f9 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

(cherry picked from commit b52c43b933)
2023-09-18 21:27:22 -07:00
Seth Hillbrand 23fab89131 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

(cherry picked from commit 9fc45eb08c)
2023-09-18 21:26:58 -07:00
jean-pierre charras 48189172ea Eeschema: fix crash if using ${FOOTPRINT_NAME} or ${FOOTPRINT_LIBRARY} as values
in fields, if no footprint defined for the symbol.
From master branch
Fixes #15676
https://gitlab.com/kicad/code/kicad/-/issues/15676
2023-09-18 09:33:25 +02:00
Seth Hillbrand ee343e1263 Fix crash when duplicating symbol
Adding symbol to the screen can change the library reference.  But when
we are pasting, we want the library reference for annotation, so we need
to keep a map of old->new libsymbols and fixup the pasted symbols before
using

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15419
2023-09-15 15:43:50 -07:00
Seth Hillbrand 57ef739404 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-13 12:31:46 -07:00
Seth Hillbrand 584eb9f531 Remove extra nag/grid assertion
When editing the properties, if you accidentally make an extra line, you
should be able to remove the data and have it ignored.
2023-09-13 12:31:46 -07:00
Alex Shvartzkop 951fd2d693 Altium schematic: support Line dash styles and colors.
Master commit: a2b7bf97b9
2023-09-11 18:33:34 +03:00
Alex Shvartzkop be991cfcd6 Clear view before resetting schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15159

(cherry picked from commit cab0db76f8)
2023-09-11 18:28:05 +03:00
Alex Shvartzkop 3cd6935acb Work around wxGTK printing offset in eeschema.
Affects landscape Letter, Legal, A4 paper.

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

(cherry picked from commit 5da4dfd4a7)
2023-09-11 14:37:39 +03:00
Alex Shvartzkop 6daef080e3 Altium schematic: fix ISSOLID flag for text frames.
Fixed in master by 24d3df5416
2023-09-11 14:23:54 +03:00
Alex Shvartzkop 6ee909b958 Altium schematic: support custom sheet sizes.
(cherry picked from commit 16062bbe33)
2023-09-11 10:06:38 +03:00
Seth Hillbrand 96a3621b8e 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

(cherry picked from commit c2fd2f42eb)
2023-09-07 01:37:42 +02:00
Jeff Young 14d4c38979 Honour override-individual-item-colors setting for filled shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15572

(cherry picked from commit d593257fbd)
2023-09-06 16:31:22 +01:00
Alex Shvartzkop 30c2028852 Revert "Set reporter in DIALOG_SIM_MODEL::TransferDataToWindow."
This reverts commit 5b0d752e0c.
2023-09-06 08:03:00 +03:00
Marek Roszko 95e6be0e81
Prevent crash trying to load missing spice lib
(cherry picked from commit 4fe7c7a902)
2023-09-06 01:13:54 +00:00
Marek Roszko 32c2135047 Flip the RegisterSettings order to avoid legacy import crashes 2023-09-04 23:22:39 -04:00
Marek Roszko 702e08b083 Don't call .Load() and cause settings to reload from disk
RegisterSettings can load the new settings json as added by not turning off the load now parameter
2023-09-04 22:41:12 -04:00
Jeff Young 5c456370d9 Add items to repeat_items after paste (or duplicate).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15556

(cherry picked from commit f6e238dc3f)
2023-09-03 22:10:38 +01:00
Jeff Young 93fdd35b31 Support SHORT_NET_NAME(pin_number) and friends on symbols.
While it's of debatable use in the schematic, some users want to
author them there so that they're then copied onto the board.

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

(cherry picked from commit d74e9ba040)
2023-09-03 22:07:11 +01:00