348 Commits

Author SHA1 Message Date
Jeff Young
524575a595 Allow embedded files to come from components
as well as parent containers, part II.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20210
2025-04-25 12:26:31 +01:00
Jeff Young
8113824f7c Don't conflate generated fields (${DNP}) and fields with variable references.
They're not quite the same thing as the later
can have un-applied values which require expanding.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20417
2025-04-18 13:41:18 -07:00
Jeff Young
69bf9894e9 Fields don't currently have any metadata to search. 2025-04-16 11:41:56 +01:00
Jeff Young
0a8d5ea78b Fields don't currently have any metadata to search. 2025-04-16 11:33:16 +01:00
Jeff Young
98ec2d7ba2 ADDED: metadata searching.
Symbol and footprint search panels can now optionally
search library links, descriptions and keywords.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10602
2025-04-09 17:46:07 +01:00
Jeff Young
582aef0220 Don't assume a hypertext link is a cross-sheet reference.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20511
2025-03-30 21:55:28 +01:00
Mike Williams
7cf699bc9d eeschema: move SwapData to SwapItemData/swapData paradigm
Used by BOARD_ITEM to support groups, which we are adding to the
schematic. Also adds an unused group pointer for now.
2025-03-27 13:16:09 -04: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
Jeff Young
0fae6a0db0 Initialize field ordinals for LIB_SYMBOLs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20263
2025-03-07 15:52:31 +00:00
Jon Evans
10cb0592ee Fix SCH_SHEET field layer settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20128
2025-03-01 11:19:47 -05:00
Jeff Young
8f40feedbb m_ordinal has no meaning for mandatory fields.
... but it should still be initialised.
2025-02-24 23:42:56 +00:00
Seth Hillbrand
ea520da1c8 Protect search from mis-attributed LIB/SCH instance
The parent of fields might be a LIB_SYMBOL, not SCH_SYMBOL.  We need to
watch for and avoid these in the search/replace for schematics

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20079
2025-02-24 10:13:38 -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
Seth Hillbrand
157c7422b0 Allow sim models to reference embedded files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20024
2025-02-22 14:53:59 -08:00
Jeff Young
5edae8250d Finish eradication of visibility flag on text items.
Import/read previously-hidden symbol/footprint
text items as hidden fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19875
2025-02-19 23:43:52 +00:00
Wayne Stambaugh
f45915ba93 Eeschema folder housekeeping. 2025-02-06 09:47:00 -05:00
Jeff Young
fccb661487 More MANDATORY_FIELDS work.
Also fixes a crasher when Cancelling a FIELDS_GRID
dialog with one of the grid editors currently open.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19762
2025-01-27 17:02:17 +00:00
Jeff Young
e19bce2f93 Reduce reliance on MANDATORY_FIELDS and their implied order. 2025-01-22 17:51:57 +00:00
jean-pierre charras
9a57f7d573 Fix a minor compil warning 2025-01-22 17:18:26 +01:00
John Beard
95a1d17603 Eeschema: init variable in SCH_FIELD 2025-01-22 21:03:42 +08:00
Jeff Young
a0dd0485e9 Pull a little harder on the MANDATORY_FIELDs string.
We still conflate the fieldID, the position in the
array of fields, and whether or not that means the
field is mandatory.  But this attempts to clean up
*some* of that, without introducing too much risk.
2025-01-21 16:48:13 +00:00
Jeff Young
d21eeb4249 Nullptr safety when called from test framework. 2025-01-21 14:21:10 +00:00
Jeff Young
d50b69f1ae Reconcile divergence of MANDATORY_FIELDS between symbols and footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19697
2025-01-21 13:28:28 +00:00
Jeff Young
1d8ed071b8 Respect recursion depth limit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19633
2025-01-15 00:08:08 +00:00
Jeff Young
189e0688be Don't allow a "private" marking on a mandatory field. 2025-01-05 20:48:49 +00: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
1d4945dad5 Implement private flag for SCH_FIELD.
I don't think this was the original intent, but the
GUI for setting the flag leaked out via the
properties inspector so it kind of needs to work.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18760
2024-12-09 20:33:40 +00:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
Wayne Stambaugh
a6923b3de3 Cache full schematic sheet list sorted by sheet page number.
The sheet list is returned as a copy of the cached list rather than a
reference to prevent external code from changing the list.  While not as
performant, it eliminates the risk of the sheet list being altered in
ways that could break the schematic.  The sheet list should only be
updated by calling SCHEMATIC::RefreshHierarchy() when any appropriate
sheet changes are made.

Note to developers: there is something inherently different about how the
QA tests are loading and handling schematics versus the schematic editor.
Using the cached sheet list for the SCHEMATIC object will cause some QA
test to fail.  This is why SCHEMATIC::Hierarchy() has not replaced
SCHEMATIC::BuildSheetListSortedByPageNumbers() everywhere.
2024-10-09 09:58:50 -04:00
JamesJCode
d64a112971 Implement Component Classes
- Adds Component Class field to SCH_DIRECTIVE_LABEL
- Adds SCH_SYMBOLs to SCH_RULE_AREA item lists
- SCH_SYMBOLs resolve Component Class directives
- Netlist exporter / importer handles Component Class names
- Adds DRC expressions and functions
- Adds QA check for component class netlist export
2024-10-01 22:36:18 +01:00
John Beard
634b54cf8e SCH_FIELD: handle rotation of centre-justified fields
The case of centre-justified fields was just not handled
in SCH_FIELD::Rotate.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18421
2024-07-21 21:27:59 +08:00
John Beard
bb100994a7 Eeschema: swap label rotations (and include fields)
This means that labels keep the position relative
to what they are connected to after the swap.

An attempt is made to map the fields of a label
into the position of a matching field (i.e. same name)
on the swapped-to label.

Move the SCH_FIELD rotation justification
handling to the SCH_FIELD class, so it's not just
SCH_LABEL that handles it.

https://gitlab.com/kicad/code/kicad/-/issues/18303
2024-07-10 21:37:27 +08:00
Seth Hillbrand
b4760b9b2c Add ADVANCED_CFG variable for recursion depth of variables
At 10, a strict recursion shows a noticable lag in schematics with
larger numbers of fields.  2 may be a sweet spot unless we find a
schematic where this does not work
2024-07-02 11:37:21 -07:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Jeff Young
c549a214c9 Performance: don't alloc std::vector in critical areas.
For some history, see also aa2ad3b44c3e533cf00a5077db17fb0ee7e302eb
2024-06-21 19:07:46 +01: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
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
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
20cde51b43 Fix numerous bugs in schematic item rotation.
(This will probably introduce some new ones too, but
it was so broken it's hard to know where to start.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17921
2024-05-12 20:43:08 +01:00
Jeff Young
20bb82a011 Remove vestigial coord flip code. 2024-05-08 11:27:57 +01:00
Seth Hillbrand
72eee002aa Add effective display for fields 2024-05-07 17:59:13 -07:00
Jeff Young
c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
jean-pierre charras
28f48cbec1 Eeschema: fix issues related to ERC tests after changes by commit d77eae3e
It also fixes a bug in SCH_FIELD::compare()
2024-04-26 07:23:07 +02:00
Seth Hillbrand
6540c3ec9f Resolve worksheet variables in SCH_FIELD
Sheet fields should also resolve the worksheet of that sheet and not the
parent sheet

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17723
2024-04-20 13:39:35 -07:00
Jeff Young
c842de24b9 HitTesting is the wrong place to do visibility checks. 2024-04-17 10:53:49 +01:00
jean-pierre charras
b7f035964f Fields in symbols: Ensure visibility is correctly set when reading a file
Also ensure default fields visibility is correctly set when creating a symbol
Change default field visibility to true in SCH_FIELD Ctor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17767
2024-04-15 18:19:19 +02:00
jean-pierre charras
ac36feda41 EEschema: fix incorrect (missing) init of main layer of SCH_SHEET fields
These fields were not drawn when drawing a hierarchical sheet.
2024-04-15 09:56:19 +02:00
Jeff Young
14762e3d54 Handle layers for label fields. 2024-04-13 19:53:58 +01:00