48 Commits

Author SHA1 Message Date
Jeff Young
5996cffabc EE -> SCH (no functional changes) 2025-03-13 13:15:47 +00:00
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00: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
Jeff Young
2a1b93a254 Fix bugs in library existence checking, and add for symbol libs. 2025-02-19 23:43:52 +00:00
Jeff Young
6f38709a1c Prevent assert when saving design block. 2025-02-10 11:36:10 +00:00
John Beard
636c6c4efb Eeschema/pcbnew: fix pasted image saving
The m_imageData buffer in the BITMAP_BASE is an
internal implementation - the public API to persist the
data to a stream appears to be SaveImageData - so use that,
which hides the implementation (and generates the image data
"live" when needed).

Remove the public access to the m_imageData buffer as it isn't
needed for public use, and also is misleading.

Also break out the formatting of the data into KICAD_FORMAT,
as it's currently replicated in eeschema/pcb/pagelayout
formatting code.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19772
2025-01-31 23:01:07 +08: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
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
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
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
Ian McInerney
150f0ee5f9 Cleanup if statement not needed after formatter changes
The differences between these branches were removed in
6686ade45b566fb5c154eb77a9ea83f0fecbdbc1
2024-12-31 00:18:10 +00:00
Jeff Young
eee28aa06a Clean up fields autoplacement control architecture.
Also adds a mode for AUTOADDED fields.

Also fixes a couple of bugs where a manual-level autoplaced
symbol would get reset back to auto-level when autoplaced.
2024-12-23 14:30:17 +00:00
Wayne Stambaugh
c4e2c0d3ec Save schematic symbol field and unit by ordinal sheet instance.
Use the ordinal symbol reference and unit when saving schematics to
prevent file changes instead of the first instance.  The first instance
would change when sheets were moved and the hierarchy order changed.
The ordinal instance is defined as the first sheet instance when the
hierarchy sorted by page number.
2024-12-19 09:19:35 -05: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
Jon Evans
8436b80bdd Do not save fields_autoplaced for text with no fields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19159

(cherry picked from commit 96378dd5bc878119ffc0a2411a9d70255bb4a838)
2024-12-08 10:11:49 -05:00
Jeff Young
6686ade45b Remove (somewhat atrophied) manual pretty printing.
Also fixes a bug where the pretty printer didn't insert
linebreaks for a forest (it assumed a single tree root).

Also further regularises bool and quote formatting.
2024-11-28 11:08:16 +00:00
Jeff Young
fa52d68268 Fix pretty-printing of UUIDs and bools. 2024-11-25 19:10:13 +00:00
John Beard
d9890e38ff Symbol editor: avoid bug in writability check
If the file exists and is not writeable, but the directory
_is_ writable, this check falsely returned true, even
though it will then try to write to a non-writeable file.
2024-10-13 20:47:45 +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
John Beard
460e575457 Use REFERENCE_IMAGE for SCH_BITMAP
Also wire in the transform origin handling to the point editor
and the properties panel in eeschema.
2024-09-30 10:20:20 +01:00
Seth Hillbrand
7214ef1f14 Remove basic masking class map_string_utf8
This is just std::map<std::string, UTF8>, using the class just masks
what it is and adds unclear functions.
2024-08-19 11:51:13 -07:00
Seth Hillbrand
aa01eebac4 Fix paste for schematic editor
When pasting text in the schematic editor, the sheet does not have a
valid schematic parent but the screen does. This is required to properly
assign fonts to the text
2024-07-16 08:23:08 -07:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

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

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00
Seth Hillbrand
11c6164934 Silence font replace warnings for libs
When loading schematics/pcbs, notification of font replacements might be
warranted but in libraries, this warning is not helpful and intrusive
2024-06-24 09:55:10 -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
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
c59ed0bbb7 Flip symbol editor's Y axis to match other editors. 2024-04-27 13:47:56 +01:00
James J
be8744176c Add SCH_RULE_AREA shapes to eeschema
Includes:
 - Fix GAL to draw closed polygons in eeschema
 - Add functionality to eeschema to draw arbitary polygons
 - Update polygon item previews to have customisable edge colour
 - Add new SCH_RULE_AREA class, derived from a poly SCH_SHAPE
 - Add SCH_RULE_AREA to paint and plot methods
 - Add new rule area color preference to themes
2024-04-25 14:24:46 +00:00
Wayne Stambaugh
a86a258f66 Improve symbol instance data file save ordering.
Use the root schematic UUID to order projects and sort symbol instance
data by KIID_PATH.  This will ensure file changes to instance data are
more consistent by using a fixed ordering.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17737
2024-04-20 08:57:00 -04:00
Jeff Young
95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Jeff Young
3efe504dcc Collapse LIB_TEXT into SCH_TEXT. 2024-04-16 16:31:16 +01:00
Jeff Young
d77eae3e7e Collapse LIB_FIELD into SCH_FIELD. 2024-04-13 15:42:13 +01:00
Seth Hillbrand
6c17e275fb Revert "Re-enforce ordering"
This reverts commit b22fcf70cd77b4cb1bb44a63a9e1d1afe90fe65b.
2024-04-12 14:14:06 -07:00
Seth Hillbrand
b22fcf70cd Re-enforce ordering
Instances, pins and graphics have started to wander around the files.
Sorts instances before writing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17737
2024-04-12 11:58:30 -07:00
Seth Hillbrand
f08cacb30f Revert "Re-enforce ordering"
Unexpected element loss after save.  Reverting to fix

This reverts commit f2f489034258a85df3de36ce0f482ddd18933a1f.
2024-04-12 10:34:11 -07:00
Seth Hillbrand
f2f4890342 Re-enforce ordering
Instances, pins and graphics have started to wander around the files.
Sorts instances before writing.  Uses compare with std::set (not
std::multiset) to enfore lib item ordering

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17737
2024-04-12 10:08:46 -07:00
Seth Hillbrand
e14e956c1d Fully order schematic saves 2024-04-11 16:54:30 -07:00
Jeff Young
5abc7145da Fold LIB_ITEM into SCH_ITEM. 2024-04-08 10:24:50 +01:00
Jeff Young
3a430357bc Cut/copy/paste for SCH tables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17335
2024-03-28 14:34:11 +00:00
Jeff Young
4eefbc7815 ADDED: textbox and tablecell margins.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10672

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806
2024-02-24 20:05:51 +00:00
Jeff Young
91df43c97a ADDED: schematic tables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806
2024-02-24 20:05:50 +00:00
Jeff Young
ae735d3eb4 Renaming: replace convert with body-style.
No functional changes.
2024-01-26 16:21:03 +00:00
Wayne Stambaugh
8975f26c26 Coding policy fixes. 2024-01-26 08:59:14 -05:00
Wayne Stambaugh
04d15026c5 Rename SCH_SYMBOL::GetInstanceReferences() to GetInstances(). 2023-12-28 18:25:56 -05:00
Ian McInerney
743e9d669a Push library management into IO_BASE 2023-12-27 01:21:53 +00:00
Ian McInerney
cad91312aa Introduce main base class for all IO loaders 2023-12-26 23:27:11 +00:00
Ian McInerney
85f62c1fde Rename all schematic IO plugins 2023-12-24 01:22:21 +00:00