Commit Graph

11480 Commits

Author SHA1 Message Date
Seth Hillbrand 439c25fca9 Altium schematic parser: Add fraction pin placement
In the schematic libaries, pin positions that are off 10mil spacing need
fractional elements stored in a different location
2024-06-10 15:02:18 -07:00
Alex Shvartzkop 35d60598d5 Fix build error on MSVC. 2024-06-11 00:06:32 +03:00
Seth Hillbrand 1325701956 Altium SCH Lib updates
- Use pin-compatible line widths for symbols
- Handle circular arcs as circles, not elliptical arcs
2024-06-10 12:40:01 -07:00
Jeff Young de2fbbd11a Fix stack address escaping routine. 2024-06-10 20:23:36 +01:00
Jeff Young 4e133ae83b Cleanup. 2024-06-10 20:23:36 +01:00
Jeff Young a02cb75656 Cleanup. 2024-06-10 20:23:36 +01:00
JamesJCode 0826c10a20 Don't re-add deleted netclass assignments in incremental connectivity
Ensures that if moving or deleting a netclass directive label, the
netclass on the previously-assigned net doesn't have the stale
netclass re-applied.
2024-06-10 20:19:07 +01:00
Wayne Stambaugh 5e048bc64c Fix several Eagle schematic import issues.
Fix broken arc angle polarity due to library symbol changes.

Fix broken wire and text Y axis coordinate polarity due to library symbol
changes.

Fix broken field visibility and position on library symbols with multiple
units that have fields with different visibility and positions.  Because
KiCad does not support this, when parsing the Eagle schematic file, the
last library symbol unit parsed ends up being the field visibility and
position for all units in the symbol.
2024-06-10 11:28:20 -04:00
Wayne Stambaugh 889931505b Eagle schematic importer improvements.
Change Eagle file importer to use a two pass import.  The first pass
parses the entire Eagle file into an associated E* object.  The second
pass converts the parsed E* objects into the appropriate KiCad objects.

Improve handling of Eagle versioned libraries.

Add helpers to IO_BASE to ease handling of PROGRESS_REPORTER and REPORTER
objects.

ADDED: Support for importing Eagle schematic modules.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1813
2024-06-10 11:28:20 -04:00
Mike Williams e0e837189d sch_symbol: use fail message fall back to dummy symbol when passed null 2024-06-10 11:24:58 -04:00
Jeff Young 2e38fa84bf Don't allow writing "//" to spice netlist.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18161
2024-06-10 15:36:20 +01:00
Mike Williams 0b187e7122 SCH/LIB SYMBOL: never allow null LIB_SYMBOLs in SCH_SYMBOL
Also always always flatten incoming lib symbols.
2024-06-10 08:36:42 -04:00
Jeff Young ed0869aa0c Share more library tree code. 2024-06-08 19:06:10 +01:00
Jeff Young cb7d51dbe4 Formatting. 2024-06-07 12:10:41 +01:00
Jeff Young d8c2929163 SCH_SHEET_PATH::IsContainedWithin() didn't do what I thought it did.... 2024-06-07 12:09:58 +01:00
Jeff Young c0ee987e8b Fix typo. 2024-06-07 10:52:11 +01:00
Wayne Stambaugh 360d185e3b Clear parent symbol references when flattening derived library symbols.
Broken parent symbols could lead to invalid return values and flattened
library symbols cannot be derived from a parent symbol.
2024-06-06 18:53:27 -04:00
Seth Hillbrand 6dcb9bb664 Do not allow trailing/leading whitespace in mandatory fields
Reference, Value, Footprint and Datasheet all reference elements that
should not use trailing/leading whitespace or similar hidden charaters.
Other fields may utilize leading/trailing whitespace for obscure
purposes but won't break functionality as they are display only
2024-06-06 11:48:20 -07:00
Jeff Young edc7603d2a Make it clear that GetSheets() is heavy.
Also removes the side-effect that SCH_SHEET_LIST's
c'tor would sort the list (and write virtual page
numbers) anytime the starting sheet was the root.

Also, definitely don't build a SHEET_LIST (sorted or
otherwise) if you're not even going to use it.

Also don't build SCH_SHEET_LISTs on idle events.  Better
to just always have the Next Sheet button enabled (we
already beep if you click it and there's no next sheet).

Also, use a SCREEN_LIST when you can.  It's much cheaper
to create.
2024-06-06 18:00:59 +01:00
Jeff Young cbfc692e24 Performance for large hierarchies: symbol fields table
Don't bother to sort sheet list when we're going to
sort the symbols anyway.
2024-06-06 11:53:01 +01:00
Jeff Young 758974f5aa Performance for large hierarchies: sorting
Cache page numbers during sort.
Don't construct SCH_SHEET_PATH when reference will do.
Don't construct SCH_SHEET_PATH when KIID_PATH will do.
2024-06-06 11:53:01 +01:00
Jeff Young a6e8cfe35f Performance for large hierarchies: avoid sorting
Don't sort SCH_SHEET_LISTs if we're just scanning the doc.
2024-06-06 11:53:01 +01:00
Jeff Young 44c588f122 Performance for large hierarchies: lazy eval
Don't create SCH_SHEET_LISTs until we have to, and then
only create them once.
2024-06-06 11:53:01 +01:00
Jeff Young e543ff0578 Performance for large hierarchies: lookups
Don't bother to sort sheet lists when we're just looking
up a UUID, sheet count, other symbol units, etc.
2024-06-06 11:52:57 +01:00
Jeff Young 68fbe98b1d Performance for large hierarchies: ERC
Share constructs between ERC tests.

Large SCH_SHEET_LISTs, in particular, can be very
expensive to construct.
2024-06-06 11:41:37 +01:00
Wayne Stambaugh 82b310f666 Do not update schematic editor net navigator when it's not shown.
Since the addition of all nets to the net navigator, performance on very
complex designs is unacceptable.  Not updating the net navigator is a
cheap and dirty short term fix.  Users with complex designs will not be
able to use the net navigator.  A better fix to resolve the performance
issues needs to be implemented.
2024-06-05 11:46:19 -04:00
Jeff Young 8e855156c8 Import child sheets relative to project, not parent.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17785
2024-06-04 17:47:55 +01:00
Mike Williams 7679f40b2b SCH_REFERENCE: drop separate pointer to LIB_SYMBOL
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18115
2024-06-04 10:03:00 -04:00
Jeff Young 42caceb799 Tidy incorrect column width (and fix some formatting). 2024-06-04 13:00:02 +01:00
Jeff Young e5bad195b6 Fix a bunch of failures to resolve text variables. 2024-06-04 12:46:34 +01:00
Jeff Young 26fc2bd071 Reduce compiler warnings. 2024-06-04 11:18:45 +01:00
Jeff Young a74e834b33 Formatting. 2024-06-04 11:16:11 +01:00
Seth Hillbrand 9f2c9636f0 Update conn minor check to use Advanced Config 2024-06-03 11:56:37 -07:00
Seth Hillbrand 74998790e8 Turn off incremental connectivity for small schematics
The benefit of incremental connectivity is only for larger
schematics.  For smaller schematics, the downside of larger bug surface
outweighs the current benefits
2024-06-03 11:33:29 -07:00
Mike Williams 32289ffce7 schematic: fix broken undo of sheets, new and changed
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11855
2024-06-03 13:45:52 -04:00
Seth Hillbrand 549ea93be2 Fix typo 2024-06-03 10:41:37 -07:00
Jeff Young ec0fdfffff ADDED: markers for excluded-from-sim items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15382
2024-06-03 17:12:15 +01:00
Jeff Young 5e1a16e821 Regularize DNP printing & plotting with painting. 2024-06-03 12:53:37 +01:00
Jeff Young aca73b699c Fix uninitialized variables. 2024-06-03 11:44:10 +01:00
Jeff Young 6aab0d66c2 Fix uninitialized variables. 2024-06-03 11:44:10 +01:00
Jeff Young 900c7e0257 Centralize exclude-from-sim processing. 2024-06-03 11:44:10 +01:00
Jeff Young 40854cec0e Remove cover types. 2024-06-03 11:44:10 +01:00
Jeff Young aee7680a6c ADDED: support for DNP & friends at the sheet level.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14387
2024-06-02 22:41:22 +01:00
Jeff Young 1f69680d91 Expose global Field Name Templates to symbol editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2382
2024-06-02 19:31:27 +01:00
Jeff Young 14f3a22f3d ADDED: support editing unit in Reference Field Properties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17362
2024-06-02 13:42:34 +01:00
Jeff Young 4a01f322ff Special-case hit-testing of filled schematic rule areas.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17879
2024-06-01 22:48:02 +01:00
Jeff Young 11193d2cda Make sure ERC pin-to-pin checks are always in same order.
Comparing U1.pin1 : U2.pin1 will return the same
results as U2.pin1 : U1.pin1, but will result in a
different serialization of any exclusions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17004
2024-06-01 11:37:34 +01:00
Jeff Young 878a795be1 Formatting. 2024-06-01 11:37:34 +01:00
Seth Hillbrand 79a354bf0e Unify SCH_PIN ambiguity in equality operator
Remove != operator that is not used for C++20 and reworked
SCH_PIN==SCH_ITEM operator that was not reciprocal
2024-05-31 13:42:36 -07:00
Seth Hillbrand a9ae86eefd Cleanup geometry functions
Added Distance(VECTOR2) function that returns a double.  Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints

Also extended the size for arc calculations that get distances to center
points to avoid overflow
2024-05-31 12:26:37 -07:00
jean-pierre charras 1322e0bc73 symbol editor: allows rotation of fields in derived symbols.
Fields in derived symbols are editable, so the context menu must allow rotations.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18003
2024-05-31 17:32:31 +02:00
Jeff Young ac59a65d8d Resolve variables in LIB_SYMBOLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18099
2024-05-29 22:52:55 +01:00
Jeff Young d82522304c Improve clarity. 2024-05-29 19:53:20 +01:00
Jeff Young ec89d2c22e Formatting. 2024-05-29 17:56:15 +01:00
Mike Williams cc350cf279 symbol fields table: remember includeExcludedFromBOm correctly 2024-05-29 08:41:25 -04:00
Jeff Young bab97f91cc Tidy up string find API usages. 2024-05-28 15:30:29 +01:00
Seth Hillbrand 43a622cadf Ensure we are checking all ERC errors
Also, handle the possiblity that we return NULL when calling
DeserializeFromString in the case where we don't handle all cases or the
file is corrupted
2024-05-28 06:55:34 -07:00
Alex Shvartzkop 07470efc0b Autosize bitmap buttons in wxFB. 2024-05-27 00:12:55 +03:00
Jeff Young df3eaf0e03 Trim before sorting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17046
2024-05-26 19:28:24 +01:00
Jeff Young 8204577fba Throw duplicate pin error as it prevents other checks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14761
2024-05-26 16:18:54 +01:00
Seth Hillbrand b2e0c2606f Avoid referencing parents after deletion
We look at the parent when deleting EDA_ITEMs but when clearing the test
sheet, we delete the sheet before the pin, causing a use-after-free.
Avoid this by setting parents to null in this case

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17961
2024-05-26 07:35:46 -07:00
Jeff Young 34dbee0693 Show text item anchor locations in schematic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17668
2024-05-25 21:40:37 +01:00
jean-pierre charras 3065ae1f01 PANEL_EESCHEMA_COLOR_SETTINGS: fix incorrect symbol drawing.
Graphics items were not modified when the LIB_SYMBOL Y axis orientation was
modified, making the symbol body not visible in panel canvas.
2024-05-25 18:01:51 +02:00
Jeff Young bda0a73c63 Set swatch background colors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17564
2024-05-24 21:26:20 +01:00
Mike Williams 3f4c82b39b annotate: cleanup Annote event name to match button 2024-05-23 09:47:30 -04:00
Mike Williams 8d8fa155f7 annotate: remove dead code
Never gets called as we will always have a message.
2024-05-23 09:47:30 -04:00
Mike Williams 39f355e71d annotation: also report cleared annotations 2024-05-23 09:47:30 -04:00
Wayne Stambaugh 795a9eea60 Coding policy fixes.
This is primarily to change all instances of wxLogDebug with wxLogTrace
so developers do not have to sift through debugging output that is always
dumped.  The only exception is for code blocks built in debug builds and
called on demand for dumping object states.
2024-05-23 07:59:45 -04:00
Jeff Young edae328ca6 Push multi-sweep traces down into MathPlot.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17215
2024-05-23 12:24:56 +01:00
John Beard 0bcd5e5795 Eeschema: Also make 'note' backgrounds translucent on selection
For the same reason as device backgrounds - it obscures everything
else while moving a filled shape.
2024-05-23 16:51:06 +08:00
John Beard 5a69b163a3 Fix translucency when selecting a filled shape in the symbol editor
Overriding the color in draw() throws away the alpha that was set
due to aItem->IsSelected() in getRenderColor().

Instead, get the layer BG fill color in getRenderColor() before
the translucency is applied.
2024-05-23 16:51:06 +08:00
John Beard fd4c15517f Eeschema: Fix selection of items inside filled shapes
The selection heuristic broke down when one item was a filled
shape. Because all hit tests would succeed with distance 0 for
these shapes, they would always be considered the closest item
to the exclusion of all else, which made it very hard to
click on a graphic inside a filled shape.

Now, recognise when an item would be "dominating" and
decline to promote it to the "closet" spot. It will still
be selectable if there are no other items nearby, or if
there are multiple shapes.
2024-05-23 12:53:09 +08:00
Jeff Young 856d03dbe2 Create signals from .save directives (as well as .probe directives).
(Also fixes a bug where we only looked for a single
token after .probe.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18057
2024-05-22 22:37:57 +01:00
JamesJCode 76cb7cf54a Clear all dirty connectivity flags on symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17984

When moving / deleting a power symbol, in some instances the
symbol is marked dirty, and sometimes the pin (depending on
whether the symbol is the primary edited item, or whether
the pin is identified through an edited item subgraph). If
the pin and the symbol are marked dirty, the pin dirty flag
was not being cleared.

Additionally, not all extracted items were being deleted
from subgraphs correctly.

Both resulted in dirty state and duplicated items in the
subgraphs during incremental connectivity, which resulted
in essentially corrupted subgraph states.
2024-05-22 21:51:02 +01:00
Roberto Fernandez Bautista ee3533baeb kicad-cli sym export svg: Ensure bounding box is correctly calculated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18062


(cherry picked from commit 3e5ceaa319)

Co-authored-by: Roberto Fernandez Bautista <roberto.fer.bau@gmail.com>
2024-05-21 20:00:35 +00:00
Jeff Young cb76ad3206 Add unit & body style property access.
(It had gotten lost in SCH_ITEM/LIB_ITEM collapse, but
then again the old version didn't work right
anyway.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18049
2024-05-20 23:37:59 +01:00
Mike Williams 52f9060b3b Symbol Fields Table: make sure power symbols don't get added by commits
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17544
2024-05-20 14:11:38 -04:00
Mike Williams a81891053e Schematic: add Power tab to searcher 2024-05-20 13:59:42 -04:00
Mike Williams 21022b4fa4 Symbol Fields Table: better handle variable fields with attributes
Attributes need to be checked first since we do some internally hackery
to make the checkboxes work.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18005
2024-05-20 08:52:00 -04:00
John Beard 6992afeb38 Consider a bus entry hitting a wire corner or tee to be dot-worthy
This doesn't change the connectivity, it just makes putting the
dot more closely match what the connectivity already does.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18046
2024-05-20 12:40:29 +08:00
John Beard 6313b58ad6 Break out junction analysis so it can be tested in isolation
There are some corner cases with bus entries that could do with
care and it's a bit tricky to keep all the cases in mind at once!
2024-05-20 12:40:29 +08:00
John Beard d3e03c51bf Bus unfold: snap the entry to the bus, even if the cursor isn't right on the bus
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18011
2024-05-20 12:40:06 +08:00
Alex Shvartzkop 6dd5c7d733 Make IBIS errors visible / more obvious.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18041

(cherry picked from commit 6dfd417767)
2024-05-19 01:44:56 +03:00
Jeff Young c5162f5483 Fix PEGTL flagParam grammar.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16393
2024-05-17 11:15:44 +01:00
John Beard 7e02f1254e Remember the bus unfold label orientation between invocations 2024-05-17 09:55:40 +08:00
Jon Evans 2836025402 Clear field listener when quitting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016
2024-05-16 20:49:27 -04:00
Seth Hillbrand 9fbda137cb Free item memory when closing schematic window
This fires the dtor for each item on the screen, allowing us to properly
close and remove them from the connection graph

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17961
2024-05-16 09:59:10 -07:00
Seth Hillbrand f61ee3ff4b Remove unused code generation path
After 11 years, I doubt we're making this file format
2024-05-16 09:19:06 -07:00
Jeff Young f7bef5e09b Generalize EnhanceAttr() function.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17735
2024-05-16 16:28:13 +01:00
jean-pierre charras 87d3d38552 Eeschema, Pin helpers: fix wrong label orientation if the symbol is rotated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18012
2024-05-16 17:15:06 +02:00
Jeff Young ea013f3ca3 Fill device colour on foreground layer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18002
2024-05-16 15:24:11 +01:00
jean-pierre charras f17b13655b DIALOG_SYMBOL_FIELDS_TABLE::syncBomPresetSelection(): fix not working comparison
for non English languages.

The main issue was the function compared a English string to a translated string.
However, even with this fix, the code, although working, is not very good:
It compare 2 members (BOM_PRESET .sortField string) that are not very significant
and can be or not translated.
2024-05-15 16:25:05 +02:00
Wayne Stambaugh c3360d8c43 Fix Eagle schematic arc orientation and field visibility issues.
This does not fix all field visibility and position issues.  This is due
to LIB_SYMBOL objects not supporting per unit field properties.  The
current Eagle importer sets multiple unit symbol field properties to the
last unit parsed in the Eagle schematic file.  The upcoming two pass
importer will resolve this issue.
2024-05-14 10:13:08 -04:00
Jeff Young 8aaca0509c More PEGTL tomfoolery. 2024-05-13 21:41:58 +01:00
Petri Hodju 4920c6b00b remove item from schematic's connection graph on destruction
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17961
2024-05-13 20:41:31 +00:00
Jeff Young 086e609c3d Reimplement bracedExpr and token lists for CPL models only.
This prevents the incompatibility between token lists
and single-token param-value pairs.
2024-05-13 21:28:24 +01:00
Jeff Young 2921d47fb3 Tighter control over braced-expression list separators. 2024-05-13 21:19:23 +01:00
Jeff Young 8bb807f170 Remove support for multiple token values for CPL models.
It breaks param lists which contain single-token params
(ie: those without the "=<value>" part).
2024-05-13 21:10:02 +01:00
Jeff Young 255a7d6f06 ADDED: ability to remove ignored tests from ERC/DRC list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17681
2024-05-13 17:09:54 +01:00
Jeff Young b934914c59 Allow .ends to be preceeded by whitespace.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16560
2024-05-13 13:36:35 +01:00