142 Commits

Author SHA1 Message Date
Jeff Young
ec155c00f3 Comboboxes for units and body styles.
Also for pin-types in pad properties.

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19905
2025-07-23 14:35:37 +01:00
Jeff Young
18e107529a Don't force callers of GetAppSettings to implement exception processing. 2025-06-14 20:25:59 +01:00
oskarwires
abba11031a Fix pin length change and push 2025-06-09 13:57:08 -04:00
Jeff Young
327cca9de5 Coverity fixes. 2025-05-25 20:01:18 +01:00
Wayne Stambaugh
d16d2f5a5b Fix a cadre of symbol pin alternate issues.
Prevent the file formatter from writing and the file parser from loading
symbol pin alternates that have an empty name or when the alternate name
is the same as the default pin name.  Apparently at some point they were
able to be created and saved.

Do not allow SCH_PIN::SetAlt() to set an alternate name when the name
does not exist in the library symbol pin alternate list.  This required
fixing the associated QA test.

When updating or changing schematic symbols from library, reset the pin
alternate to the default when the alternate no longer exists in the
symbol.

Do not populate pin alternates context menu with duplicate default pin.

Clear orphaned pin alternates to the default when saving symbols from
symbol editor.
2025-05-17 14:20:07 -04:00
Jeff Young
19d1b6ec52 Don't let legacy overbar processing mess up empty-string test. 2025-03-19 18:14:30 +00:00
Jeff Young
7e046e6c8b Remove '~' == empty_string.
It has long outlived its usefulness (which was
to preserve token sequence in pre-sexpr files).

This will no doubt turn up latent issues....
2025-03-19 17:16:55 +00:00
Seth Hillbrand
2b557c5497 Revert "Allow a no-connect to connect to a single pin (but not multiple pins)."
This reverts commit ee4a6127c6bed91f0d153983b8dc88da1e3375f1.
2025-03-07 08:10:04 -08:00
Jeff Young
ee4a6127c6 Allow a no-connect to connect to a single pin (but not multiple pins).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20222
2025-03-06 10:27:11 +00:00
Seth Hillbrand
49a4699d5a ADDED: Local power symbol option
Local power symbols work like regular power symbols except that they are
scoped only the the sheet in which they are instantiated

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2075
2025-03-04 17:07:46 -08:00
Seth Hillbrand
aff0ad971f Update search dialog
Allow regular expression in search and replace
Allow searching netnames including nets contained in buses

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17102
2025-03-03 16:57:49 -08:00
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Jeff Young
f2da0c791f Retire non-cairo printing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19323
2025-02-24 11:08:29 +00:00
Wayne Stambaugh
f45915ba93 Eeschema folder housekeeping. 2025-02-06 09:47:00 -05:00
Wayne Stambaugh
4e80c6fdc1 Revert "Do not use schematic object UUID comparisons when UUIDs are mutable."
This reverts commit 1dfe3ebc54e5dd71be5c84b0045617e15c8e549a.
2025-01-24 15:30:25 -05:00
Wayne Stambaugh
1dfe3ebc54 Do not use schematic object UUID comparisons when UUIDs are mutable.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19716
2025-01-24 14:01:02 -05:00
John Beard
6f2a3582ae SCH_PIN: defer to lib pin for menu image
Otherwise we try to look up the icon for INHERIT,
which is an assertion.

This can be hit when long-clicking  no-connect on a pin.
2025-01-25 00:35:00 +08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Jeff Young
7da8b42206 Push more functionality to SYMBOL.
(This will allow us to run the fields autoplacer on SYMBOLs,
including LIB_SYMBOLs.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2024-12-22 20:21:24 +00:00
Wayne Stambaugh
aaf94ecbad Fix potential crash bug in SCH_PIN::compare(). 2024-12-21 08:12:34 -05:00
Wayne Stambaugh
a37d2372cf Fix a wxRecursionGuard crash when library symbol is missing.
The various wxCHECKs in the SCH_PIN object where being raised inside
the SCH_SYMBOL object which would also raise it's own wxCHECK that
would cause a recursion guard failure and segfault.  The offending
wxCHECKs were replaced with null pointer checks.  Missing library
symbol links will be shown with the missing library symbol.

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

Manually cherry picked from cf71e5707e66d0775e1590a151898b2d905c4aab
2024-12-20 11:51:42 -05:00
Jeff Young
753d385473 Reduce dependency on dynamic_cast.
Also switches to checking __clang__ instead of __WXMAC__.
2024-12-08 21:46:54 +00:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
John Beard
ede31b6252 Pin layout: unify bounding box calcs
The logic for this was duplicated, in two very different forms,
between the SCH_PIN bounding box function and the
SCH_PAINTER draw function.

And the SCH_PIN one was slightly wrong, as it didn't take into
account the PIN_TEXT_MARGIN, or the electrical types.

Provide a way for clients of the PIN_LAYOUT_CACHE to access
the name and number boxes.
2024-10-26 15:04:51 +08:00
John Beard
f29d1fafe4 Include dangling indicator in SCH_PIN bbox
Delegate computation of the size and location of the pin dangling
indicator to the PIN_LAYOUT_CACHE.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18894
2024-10-26 15:04:51 +08:00
John Beard
fe48e51315 SCH_PIN: break out layout calculations
The bounding box calculations of SCH_PINs are pretty complicated.
There is already caching of the name and number texts, but the
SCH_PAINTER (for example) has to repeat this work and sometimes
slightly diverges. For example, dangling indicators and alt
icons are painted, but not included in the bbox.

This commit introduces a more encapsulated 'layout cache' object which will
take care of caching the current extents, but also providing layout
geometry to SCH_PAINTER (and other interested code, like hit testers
on a given field) witohut requiring recomputation or reimplementation.

The extents calculations use exclusively the public API, so it's nice
and easy to split it out.

In this commit, nothing is functionally changed - the name and number
are still cached, and everything else is computed in the exact same way.
This is the groundwork for fixing this issue:

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/18894
2024-10-26 15:04:51 +08:00
John Beard
884530e699 SCH_RENDER_SETTINGS: Remove duplicate electrical type setting
This class had m_ShowPinsElectricalType and m_ShowPinElectricalTypes.
Nearly everything used the former, only one callsite used the latter,
which would never have been changed.
2024-10-22 22:45:32 +08:00
John Beard
91dca89116 Eeschema: Add indicator icons for pins with alt modes
This makes it easier to see which pins have alt modes
available. There is an option to turn them off.

The icon positions are chosen so they they shouldn't
interfere as far as possible:

* If the text is inside, the icon goes more inside
  the body
* If the text is above/below the pin, it goes away from
  the body

This means it won't collide with a symbol wall in
most cases, but some symbols with alt pins on opposing
sides may need to be widened if the icons are show.

Includes a rather fiddly refactor of the SCH_PIN painter
function, which needs quite a lot of massaging to allow
it to figure out where an icon would go. Quite a bit
of logic is broken out into smaller encapsulations with
less visible state to each chunk.

Icon modes for base-name-selected and alt-selected are
included, but only the former works due to information
being thrown away during the SCH_PAINTER tempPin
process.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11069
2024-10-08 23:30:50 +08:00
John Beard
76c328db84 SCH_PIN: Fix missing alt assign in copy ctor 2024-09-30 16:22:43 +01:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Wayne Stambaugh
74070afbc6 Fix a bunch of GCC build warnings compiling the schematic editor.
Apparently GCC does not like competing definitions of the == operator.
The recent refactoring away of all LIB_ITEM objects created a conflict
with the SCH_ITEM == operator definition.  This change required some
rather ugly comparison changes.  There were no unit test failures but
that doesn't mean something didn't get broken.
2024-06-11 08:07:32 -04: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
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
8aab764c33 Handle m_alternates in operator= and copy c'tor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17966
2024-05-07 15:07:33 +01:00
Jeff Young
352463dfeb Fix pin drawing after removal of upside-down coords. 2024-04-28 15:24:19 +01:00
Jeff Young
c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
Jeff Young
615f84e567 SCH_PINs define their own sorting order.
Don't use SCH_ITEM's compare function.

This is required so that SCH_PINs sort in the same
order as their LIB_PIN equivalents in the library.
2024-04-26 23:10:19 +01:00
Jeff Young
02c1eef3be Simplify parsing of alt pin definitions. 2024-04-26 20:11:33 +01:00
Jeff Young
e8be782687 Mostly clean-up, but also bug fixes with bounding boxes. 2024-04-22 11:16:14 +01:00
Jeff Young
7d8215401a Fix message panel for pins, take 2. 2024-04-21 15:14:10 +01:00
Jeff Young
b4239b3ee4 Fix message panel for pins. 2024-04-21 14:51:07 +01:00
Jeff Young
320f531110 Improve inheritance processing; simplify hidden flag. 2024-04-21 12:19:22 +01:00
Jeff Young
c0f480eea8 Lint reduction. 2024-04-21 12:19:22 +01:00
Jeff Young
9f691d063c Fix default pen width for pin text. 2024-04-20 18:25:17 +01:00
Jeff Young
95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Seth Hillbrand
0e0ada8e4e Allow NIC pins to be stacked
Previously, we only allowed pins of the same time as well as passive
pins to be stacked.  This change allows NIC pins as well since they are
not internally connected, there is no reason that they cannot be tied to
another pin electrically
2024-04-17 10:00:00 -07:00
Marek Roszko
96cdfc7fa7 Update equality overloads for C++20
C++20 added new reverse and rewritten candidates. This can confuse the compiler because it'll test both A==B and B==A for overloads.
Because we were defining parent class equality overloads, A==B and B==A was considered ambigious due to both being compatible in casting.

So we needed to add explicit child class equality operator overloads
2024-04-12 23:05:58 -04:00
Jeff Young
5abc7145da Fold LIB_ITEM into SCH_ITEM. 2024-04-08 10:24:50 +01:00
Jeff Young
1028a76e4a Harmonize print/plot APIs. 2024-04-06 09:34:56 +01:00
Jeff Young
92910d5d0f Factor common parts of SCH_ & LIB_SYMBOL into SYMBOL. 2024-04-04 13:18:55 +01:00