548 Commits

Author SHA1 Message Date
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
dfbbb5afa1 Pretty-print clipboard data. 2024-11-28 11:08:16 +00:00
jean-pierre charras
090500789e Simulator: fix crash when deselecting the Probe Tool in some cases.
If a schematic item was selected, when activating the probe tool from the
simulator, and deactivating from the Select Item sch editor tool, a crash
happened.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18547
2024-11-24 10:30:30 +01:00
jean-pierre charras
90e65ffb34 Fix a few Coverity and compil warnings. 2024-10-19 11:08:07 +02:00
John Beard
c799966774 Handle pasting of image data from the clipboard
Also move some clipboard functions out of TOOL_MANAGER,
as they had no dependency on that class, and are just free
functions around wxTheClipboard.
2024-10-13 20:47:45 +08:00
John Beard
b0043587c2 Add 'Copy as Text' action
This is useful when you want to copy text content out to some
external program (or put it in a text item/box).

I'm not sure it's possible to intuit exactly what a user wants,
as you will often want to copy items as the real items, and sometimes
as text. While KiCad might be able to make a smart guess, external
programs will have no chance!
2024-10-13 20:47:45 +08:00
Wayne Stambaugh
94bf0a33b0 Fix crash when pasting copied schematic sheet.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18885
2024-10-10 08:13:19 -04: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
eae84fd5f3 Sym edit: add alt mode icon toggle
Moves the logic into the SCH_RENDER_SETTINGS, rather than
repeating it in EESCHEMA/SYMBOL_EDITOR_SETTINGS (they still
maintain their state there, but the painter looks at the
SCH_RENDER_SETTINGS).

Also turn them off for preview purposes.
2024-10-09 21:27:58 -06: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
df5fe44839 sch_symbol.h doesn't need sch_lib_table.h
It doesn't even use the forward-declared
SYMBOL_LIB_TABLE.

Including this pulls in the whole richio system,
and sch_symbol.h is a very-included header.

Quite a few things do use SYMBOL_LIB_TABLE, but nowhere
near as many as use SYMBOL.
2024-10-04 18:06:18 +01:00
JamesJCode
64c24fc04b UI consistency improvements 2024-10-02 19:44:48 +01:00
John Beard
69889eff7c SYMBOL_LIBRARY_MANAGER: Enforce non-null via reference
All code paths in CreateLibrary and AddLibrary check that
the LIB_TABLE is non-null first.
2024-09-19 06:35:43 +01:00
Mike Williams
bf7742b8fb schematic: grid/movement tweaks for repeat and duplicate symbols
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18521
2024-09-12 10:03:48 -04:00
Mike Williams
2c99bc6c6d new feature: Schematic Design Blocks
Added to advanced config, default to off.
EnableDesignBlocks=1 in kicad_advanced to test

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2263
2024-09-05 08:35:49 -04:00
Alex Shvartzkop
36019314e9 Make simulation reporter warnings non-fatal.
Adds REPORTER::HasMessageOfSeverity for WX_STRING_REPORTER,
which allows us to show simulation warnings and fail only if there's errors.

Also fixes a crash when SPICE_GENERATOR_KIBIS throws an IO_ERROR.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18143
2024-09-05 05:59:35 +03:00
jean-pierre charras
b3b7cbcab2 Fix a compil issue on msys2.
atoi() want a string, not a wxString.
2024-08-29 09:20:48 +02:00
Jeff Young
cfb93920ed ADDED: increment annotation.
Pushes the ref des numbers for matching prefixes starting
at a particular annotation.
2024-08-28 19:54:23 +01:00
Jeff Young
958df855eb Secondary commit for "fixes" statement.
Fixes KICAD-6S1
2024-07-21 21:27:23 +01:00
Jeff Young
c378e6f690 Remove asserts for valid states.
(A pin won't have a connection until after the connection
graph has been rebuilt.)

KICAD-6S1
2024-07-21 19:00:41 +01: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
Mike Williams
a5e2615251 Revert "SCH/LIB SYMBOL: never allow null LIB_SYMBOLs in SCH_SYMBOL"
This reverts commit 0b187e71227d2129d271f24fb92ae0b99b6f93bd.
2024-06-12 13:30:29 -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
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
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
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
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
29360b1aef Raw spice models don't have pin names. 2024-05-10 20:58:13 +01:00
Jeff Young
a99377c1ec The user can cancel the opening of many editors.
Don't play dice with the devil.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17989
2024-05-08 18:21:42 +01:00
Alex Shvartzkop
5475359d00 More build time optimizations. 2024-05-06 04:39:28 +03:00
Seth Hillbrand
2139789c4c Move ERC items to their own directory 2024-05-03 12:06:24 -07:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Jeff Young
95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Mike Williams
faca7ee05b net navigator: show all nets when none are highlighted 2024-04-11 10:21:17 -04:00
Jeff Young
5abc7145da Fold LIB_ITEM into SCH_ITEM. 2024-04-08 10:24:50 +01:00
Jon Evans
1dbe78c68b Add QA tests and expand serialization for API 2024-04-02 19:51:18 -04: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
dsa-t
db12f2af49 Disallow cross-probing when not on Symbol Fields Table Edit tab.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17531
2024-03-21 19:08:23 +00:00
Wayne Stambaugh
797ab998cc Maintain hierarchy navigator expansion state between edits.
Prevent the hierarchy navigator from being rebuilt unless there are actual
sheet changes that would cause a change to the tree.

Save the tree expansion state before rebuilding the tree and then restore
the expansion state to the previous state sans edits.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16635
2024-03-17 09:02:26 -04:00
Wayne Stambaugh
33566f88a9 Clean up debugging output accidentally left in previous commit. 2024-03-13 10:48:44 -04:00
Wayne Stambaugh
0ff8d21459 Fix broken paste special keep existing symbol annotations.
This was only broken for symbols on the sheet where the symbols were
copied from.  The symbol annotation for all sub-sheets was preserved.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17231
2024-03-13 09:39:41 -04:00
Wayne Stambaugh
c5a02fc266 Do not update schematic connectivity for irrelevant property changes.
Prior to this change, the schematic connectivity was updated any time a
change was made to a connectable object.  Now the connectivity is only
updated when an object change actually affects the connectivity.  Other
properties like line width, fill type, custom fonts, etc. will not cause
the connectivity graph to be rebuilt.

The SCH_COMMIT flag SKIP_CONNECTIVITY has been removed.  All schematic
objects can test if they are connectable and if there have been changes
to any connection properties that require a connectivity rebuild.

Remove duplicate rebuild connectivity calls from editor control tool.
This was causing the tangling end test to get called four times on every
undo and redo action because the dangling end test is already called in
the connectivity graph calculation code.

Update connectivity when changing label names which fixes an unreported
connectivity bug.
2024-03-09 08:50:26 -05:00
Jeff Young
fa0ead98d8 Split out table editing and table cell editing. 2024-02-24 20:05:51 +00:00
Wayne Stambaugh
2f0337974b Update schematic connectivity when redoing changes.
Apparently we forgot to handle schematic connectivity changes when redoing
undone changes.  The same connectivity update logic that was added to the
commit object is now used in SCH_EDIT_FRAME::PutDataInPreviousState().

Please note the granularity of connectivity rebuilds on schematic object
property changes is at the object level which is overly aggressive.  This
means that connectivity rebuilds will happen when connectivity changes
that have nothing to do with and objects connectivity are changed.  Until
objects can handle their own connectivity state, this will have to suffice.
2024-01-27 12:02:53 -05:00
Jeff Young
ae735d3eb4 Renaming: replace convert with body-style.
No functional changes.
2024-01-26 16:21:03 +00:00
Wayne Stambaugh
4d6bbc8caa Fix symbol annotation when pasting nested hierarchical sheets. 2024-01-25 16:39:21 -05:00
Wayne Stambaugh
d96ebf5745 Remove paste sheet instance path debugging output. 2024-01-23 16:04:08 -05:00
Wayne Stambaugh
b3a36bd783 Fix overly aggressive sheet instance pruning. 2024-01-23 07:44:45 -05:00