Commit Graph

453 Commits

Author SHA1 Message Date
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
Wayne Stambaugh 4cf22e428c Fix broken pasted sheet page numbering.
This change no longer sorts pasted sheets by page number.  This was done
because pasted sheets may not be numbered.  When sheets are not numbered
they are sorted by UUID path which results in some unexpected results.
Since the pasted sheet code uses recursion, pages will be numbered in the
order they are added.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16580
2024-01-22 16:55:43 -05:00
Wayne Stambaugh 2cfb7a5310 Incremental schematic connectivity fixes. 2024-01-21 16:53:05 +00:00
Wayne Stambaugh d3f40dde3f Fix assertion when pasting schematic sheets.
Pasted sheets do not have assigned SCH_SCREEN objects until after they
are loaded.

Do not recalculate connectivity unless the SCH_COMMIT object actually has
connectable schematic object changes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16579
2024-01-15 12:15:30 -05:00
Wayne Stambaugh a310c0a05a Do not expand the entire schematic hierarchy navigator tree by default.
The new behavior is to only expand to the first child of the root sheet
level.  On very complex hierarchies, this makes the navigator far more
useful.

Do not update schematic hierarchy navigator on every edit.  Now only
sheet changes will trigger a rebuild of the tree.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16371
2024-01-06 07:56:16 -05:00
Ian McInerney f2702b223c Introduce base IO_MGR class and unify RELEASER objects
The IO_RELEASER is a thin-wrapper around a std::unique_ptr, but done
this way to allow easier addition of a custom deleter in the future if
something needs to call back into the IO_MGR.
2023-12-29 00:37:38 +00:00
Wayne Stambaugh 04d15026c5 Rename SCH_SYMBOL::GetInstanceReferences() to GetInstances(). 2023-12-28 18:25:56 -05:00
Wayne Stambaugh 482aff3f0b Prune orphaned schematic sheet instances.
Pasting from the clipboard when copying from another project can leave
sheet instance information that is not valid for the current project.
This change prunes all sheet instance information that is not relevant
to the current project.  It also prunes invalid paths created by pasting
sheets from different paths in the same project.
2023-12-28 12:19:19 -05:00
Marek Roszko 9a890cdba9 Kick the wildcards and file exts into a static class, export it from kicommon 2023-12-27 21:10:01 -05:00
Wayne Stambaugh 20ee45edbe Fix schematic editor crash when exporting symbols to missing library.
UI string was reused from the symbol library manager.  No new translatable
strings were used.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16446
2023-12-26 12:49:34 -05:00
Ian McInerney 85f62c1fde Rename all schematic IO plugins 2023-12-24 01:22:21 +00:00
Ian McInerney d8b47d18d3 Initial rename of file plugin infrastructure components to IO 2023-12-24 01:22:21 +00:00
Ian McInerney 3c0566d318 Don't allow copying markers
Fixes KICAD-5FQ
2023-12-11 22:22:19 +00:00
Wayne Stambaugh 484491aaea Fix crash on save after pasting symbols in schematic editor.
This was caused by pasting zero length instance paths which are not valid.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16300
2023-12-11 08:29:10 -05:00
jean-pierre charras 3bd7d92522 Fix crash: Under some circumstances the command "Export symbols to (new) library"
produces a crash when the library links are updated, and a power symbol is not found
in any loaded library.
Add also an option to export all symbols or all not pwer symbols
Fixes #16229
https://gitlab.com/kicad/code/kicad/-/issues/
2023-12-04 18:12:51 +01:00
Wayne Stambaugh 764df1d107 Fix crash when saving pasted root sheet symbols.
The paste code creates invalid KIID_PATH objects with a zero length.  All
paths must include the root KIID at a minimum.  Code was added to prune
the invalid paths and some defensive code was adding to the formatter to
prevent the crash in case there are other paths where someone generates
a zero length path.

Pruning orphaned instance data does not work when loading schematics prior
to version 7 because the paths did not include the root sheet UUID.  Once
the file is saved to V7 or later, the next load will prune any orphaned or
invalid instance data for the current project.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16245
2023-12-03 08:03:31 -05:00
Wayne Stambaugh 6dc25f4775 Fix broken symbol reference designators on paste special.
It appears that in our zeal to prevent file changes when saving shared
schematics, we (I) clobbered saving relative symbol instance data paths
to the clipboard.  This has be restored along with setting the correct
symbol unit for relative clipboard paths.

Fixed a serious issue with KIID_PATH::MakeRelativeTo() where the original
path was not restored when the incremental KIID object test fails.  This
also included a minor optimization using the actual KIID object for
comparison instead of converting it to a string and then comparing the
string.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15981
2023-12-01 14:18:47 -05:00
Wayne Stambaugh 23175c163f Fix unconnected schematic net highlighting issue.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16218
2023-11-30 11:29:01 -05:00
Wayne Stambaugh 70dad45996 Fix broken schematic net highlighting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16131
2023-11-23 17:29:02 -05:00
Wayne Stambaugh f6c99816b2 Change the bus selection behavior of the schematic net highlight tool.
[CHANGED] Bus highlight tool now supports toggling between highlighting
          only the bus objects and highlighting the bus and all of the
          bus member objects.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15388
2023-11-17 07:16:12 -05:00
Jeff Young f83d60a48f Clean up autosave files when reverting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15998
2023-11-05 12:20:31 +00:00
Marek Roszko 8c6899b0d3 Tear out the eeschema conditional compile of PROJECT 2023-09-27 23:05:30 -04:00
Mike Williams cb115189f6 Symbol Fields Table: menu shortcut should start in edit tab
The BOM shortcut goes to Export, this makes them symmetrical.
2023-09-27 09:14:25 -04:00
Mike Williams 398a336d91 BOM Generator: redirect BOM buttons to new exporter
Also add legacy generator menu item.
2023-09-20 11:12:03 -04:00
Jeff Young 0310973e3f Push TEXT_SPIN_STYLE from SCH_TEXT out to SCH_LABEL_BASE.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15444
2023-09-07 17:42:51 +01:00
Jeff Young 7a2a2e2df0 Remove error-prone SetReporter() API. 2023-09-06 11:37:50 +01:00
Mike Williams b1a388ca69 Grids: Support X and Y for all grids, add optional names 2023-08-30 11:22:19 -04:00
Jeff Young a470cab7b2 Include description for page settings command. 2023-08-27 19:03:17 +01:00
Mike Williams dc103b88d1 Symbol Fields Table: make non-modal
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2141
2023-08-14 14:19:26 -04:00
jean-pierre charras db382f8782 Eeschema: Export symbols to New Library: Fix Cancel button not working
This bug can crash Eeschema.
Fixes #15278
https://gitlab.com/kicad/code/kicad/-/issues/15278
2023-07-27 15:14:49 +02:00
jean-pierre charras a16ab0aae1 Replace SHAPE_T::RECT by SHAPE_T::RECTANGLE: RECT creates a collision name
issue with a Windows header on msys2.
Change very similar to the commit 9a47b344 about class PAD_SHAPE.
No actual code change
2023-07-25 09:11:55 +02:00
Josue Huaroto eeb74dbae9 Sort SCH_ITEM by name on paste 2023-07-24 16:37:25 +00:00
Jeff Young 5bca002567 Swap non-temp and non-edit flags for SCH_ITEMs.
This is required to keep selected and brightened state across undo.

It's also probably required for things like IS_SHOWN_AS_BITMAP and
possibly ENTERED.  FWIW, most BOARD_ITEMs do a straight swap, including
the temp and edit flags.  But that seems like a risky change....

Also removes SyncView() call from Undo/Redo as that does a MODEL_RELOAD
which clears the selection.
2023-07-08 18:37:47 +01:00
Jeff Young 773e1a1ab6 Actions with a COMMIT must be run synchronously.
Note that "immediate" doesn't mean quite the same thing: while it will
enter the tool immediately, it won't necessarily finish the tool during
the call if the tool has an event loop.  So for something like Rotate
"immediate" and "synchronous" have the same behaviour, but for something
like Move they do not.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15085
2023-06-30 18:57:37 +01:00
Ian McInerney 2fb6f19a84 Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2023-06-27 00:57:59 +01:00
Ian McInerney 118b815824 Get proper LINE_MODE type from tool event.
Properly fix https://gitlab.com/kicad/code/kicad/-/issues/15053
2023-06-25 13:43:32 +01:00
Ian McInerney b00361d136 Revert "Don't use TOOL_EVENT parameters for line modes."
This reverts commit 84a63f7daa.
2023-06-25 13:37:58 +01:00
Jeff Young 84a63f7daa Don't use TOOL_EVENT parameters for line modes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15053
2023-06-25 11:10:07 +01:00
Jeff Young a901247cbd Rebuilding connectivity must be done after changes are committed.
It also needs to be done after undo and redo.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15028
2023-06-23 22:10:17 +01:00
Jeff Young aa6d9ad69a Clear IS_NEW flags on commit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15037
2023-06-23 15:30:09 +01:00
Jon Evans 3a0f8214fa ADDED: Properties panel for schematic editor
Initial infrastructure work; follow-ons will add more
properties for schematic items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6351
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14105
2023-06-22 22:32:24 -04:00
Ian McInerney 480223f67c More RunAction specialization 2023-06-20 21:52:50 +01:00
Jon Evans fc69939190 ADDED: GUI feedback when grid setting is changed by hotkey
Can be extended to other cyclical hotkey settings

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14756
2023-06-17 23:18:50 -04:00
Wayne Stambaugh 4ccbbde54a Net navigator bug fixes and improvements.
Note: This changes the net highlight tool behavior.  When clicking on an
      already highlighted net, the net highlighting is no longer toggled
      off.  This prevents the net navigator panel from being cleared.
2023-06-14 09:57:55 -04:00
Jeff Young 286716a1ff Retire AddItemToCommitAndScreen()
It duplicates a bunch of stuff in SCH_COMMIT and isn't really
compatible with it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14933
2023-06-12 19:34:23 +01:00
Jeff Young 8f1b9119bf Upgrade some symbol editor stuff to SCHEMATIC_COMMIT.
Also renames SCHEMATIC_COMMIT to SCH_COMMIT since it's not schematic-specifc.
2023-06-09 22:41:47 +01:00