Commit Graph

328 Commits

Author SHA1 Message Date
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
Jeff Young 03953e80fc Enforce SCH_SHEET_PATH processing in (yet) more places.
Also fixes a bug where ERC testing for text variables in sheet pins
would start with the wrong sheet.

Also fixes a bug where ERC testing of similar labels would use the
wrong sheet.

Also fixes a bug where ERC testing of bus-to-net conflicts would use
the wrong sheet.

Also fixes a bug where ERC didn't process variable references when
checking hierarchical labels against sheet pins.

Also fixes a bug where ERC multiple-drivers and netclass-conflicts
tests didn't set a sheetpath.
2023-11-12 14:15:04 +00:00
Jeff Young 3819b2d5e7 Enforce SCH_SHEET_PATH processing in more places.
Making assumptions about the current SCH_SHEET_PATH has caused no end
of pain.
2023-11-11 17:46:06 +00:00
Jeff Young 7e46e85c7d Update copyrights. 2023-11-11 15:29:34 +00:00
Jeff Young bdead1d0b1 Use correct sheetpath when we have it.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15870
2023-11-11 15:07:54 +00:00
Jeff Young f50de028fb Make plotting of PDF property popups optional. 2023-10-21 21:52:51 +01:00
Seth Hillbrand d99641be40 ADDED: Git integration support
Adds support for project-based git integration, branch support, commit,
revert and updates

Fixes https://gitlab.com/kicad/code/kicad/issues/10441
2023-10-20 12:51:47 +00:00
Seth Hillbrand 9636321c09 Simplify logic when setting field vector
Previous logic could get stuck in infinite loop if removing element from
the middle of the vector

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15498
2023-08-28 15:26:19 -07: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 c8e8b71198 TestDanglingEnds needs to test sheet pins as well.
Also fixes a bug where zooming doesn't get a redraw until mouse moves.

Also fixes a couple of bugs where dangling markers on SCH_SHEET_PINs
and SCH_HIERLABELs weren't getting drawn.

Also simplifies drawing algorithm by removing aesthetic offset (which
wasn't implemented when pin is drawn as part of selection VIEW_GROUP).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15129
2023-07-08 12:55:45 +01:00
Alex Shvartzkop 36901bda62 Eeschema: don't plot hiererchical sheet fill when color is transparent. 2023-07-03 02:15:05 +03:00
Jeff Young ed6487da1e Disallow sheet pins from changing sides when edited by point editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15057
2023-06-25 19:55:13 +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
Jon Evans 3686c5b371 Use the right path for recursing in text var resolution
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14720
2023-05-10 21:46:05 -04:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
Seth Hillbrand 0984599624 Pins are case-sensitive
Cleanup should remove mis-matched cases

Fixes https://gitlab.com/kicad/code/kicad/issues/14415
2023-03-24 11:21:35 -07:00
Ian McInerney 56b7d570f9 Remove uses of climits header/defines
2 of the 3 includes never used it, and the other could be switched to
  the C++ numeric_limits class.
2023-03-10 17:08:56 +00:00
Mike Williams ade29c8577 Schematic Sheet Variables: more SCH_SHEET_PATH plumbing
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14239
2023-03-10 09:16:53 -05:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Marek Roszko 4665823089 Turn on and fix MSVC compliance mode issues
We want /permissive- to enable debug performance improvements in MSVC 17.5+.
This flag is also default under C++20 so we'll have to deal with these compile issues anyway at some point in the future.

In particular, MSVC becomes pedantic about ternary types.
See https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170#ambiguous-conditional-operator-arguments

MSFT cites https://cplusplus.github.io/CWG/issues/1805.html
2023-02-12 16:30:37 -05:00
Graham Keeth 9b9ebebb2d Add missing autocomplete for FILENAME, PROJECTNAME 2023-02-03 00:10:55 +00:00
vinsfortunato 39e85015c2 Preserve pins positions when resizing sheet 2023-01-26 20:56:37 +01:00
vinsfortunato cf1d17b566 Fix unexpected resizing behaviour when using top left edit corner 2023-01-26 20:54:51 +01:00
Jeff Young 26c821962f Simplify and regularize text variable substitution architecture.
EDA_ITEMs are responsible for giving their parent a crack at it if
they failed to resolve it.  This recurses all the way up to the schematic/
board, and then to the project.

Cross-reference handling is also move to the EDA_ITEMs.  It must be done
before bubbling up so that we don't end up in loops.  (The aDepth parameter
will break the loop, but without having done anything useful.)

Fixes https://gitlab.com/kicad/code/kicad/issues/13541
2023-01-17 17:05:41 +00:00
Jon Evans c530bdb5a1 Rename GetSelectMenuText to GetItemDescription
This descriptive text is used for many more things than
just the select menu these days.
2023-01-11 22:27:44 -05:00
Wayne Stambaugh 78e2f0fd4d Sheet instance handling improvements. 2022-12-26 08:30:03 -05:00
Jeff Young 09302296f4 Use SCH_SHEET_PATH interface to get page numbers.
Fixes https://gitlab.com/kicad/code/kicad/issues/13021
2022-12-16 22:49:42 +00:00
Jeff Young f75d18c7c8 Slight improvement to schematic editor title bar.
Also improves some other clients of PathHumanReadable(), such as the
set page number dialog.
2022-12-12 12:54:34 +00:00
Wayne Stambaugh 945361ca65 Fix schematic editor crash when saving shared schematics.
Shared schematics can have a root sheet instance when opened with the
schematic editor in stand alone mode.  This would cause a crash when
opening the shared schematic in a project where it was shared because
the root instance was trying to be saved in the normal sheet instance
data which is not valid.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13102
2022-12-09 10:02:16 -05:00
Simon Richter 6d1ab81261 Mark unused parameter 2022-11-25 14:10:30 +01:00
Wayne Stambaugh 4a27d856f7 Move schematic sheet instance information into file sheet definition.
This will make it possible to maintain sheet instance information when
copying and pasting from any sheet other that the root sheet of a
project.

Setting and getting sheet page numbers must now be performed using a
sheet path.  This was done to ensure that the instance paths were not
getting changed unexpectedly from different code paths.
2022-11-22 16:45:38 -05:00
Wayne Stambaugh 2b387ae9c3 Move schematic symbol instance data back into symbol definition.
This change reverts the storage of all symbol instance data in the root
schematic.  This was done because it's not possible to reuse instance
data when importing from sub-sheets.

There has been a fundamental change in how sheet paths are store in the
instance data.  The root schematic UUID is always used when saving the
instance data.  To prevent file churn, the virtual root sheet UUID is set
to the root schematic UUID when loading the project.  This provides a way
to determine the project that stored the instance data.  All uses of paths
without root sheet have been expunged from the code.

The sheet instance data is still saved only in the root sheet for the
time being.  New sheet instances will be automatically assigned an page
number based on the incremental virtual sheet page number.  Sheet page
numbers will not be imported.

Added project name to instance data to improve the readability of the
schematic file format.  It also creates an opportunity to remove orphaned
instance data by project name rather than cryptic UUIDs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12472
2022-10-02 15:06:42 -04:00
Seth Hillbrand 93239516d9 Remove ID from property fields
ID was not maintained or used other than to ensure unique fields.
Instead of saving, we assign the known IDs to specific field names and
sequentially create new IDs on load

Fixes https://gitlab.com/kicad/code/kicad/issues/12390
2022-09-30 17:19:53 -07:00
Wayne Stambaugh 979b4a4eb7 Revert "Move schematic symbol instance data back into symbol definition."
This reverts commit 7984e114db.
2022-09-29 15:33:23 -04:00
Wayne Stambaugh 7984e114db Move schematic symbol instance data back into symbol definition.
This change reverts the storage of all symbol instance data in the root
schematic.  This was done because it's not possible to reuse instance
data when importing from sub-sheets.

There has been a fundamental change in how sheet paths are store in the
instance data.  The root schematic UUID is always used when saving the
instance data.  To prevent file churn, the virtual root sheet UUID is set
to the root schematic UUID when loading the project.  This provides a way
to determine the project that stored the instance data.  All uses of paths
without root sheet have been expunged from the code.

The sheet instance data is still saved only in the root sheet for the
time being.  New sheet instances will be automatically assigned an page
number based on the incremental virtual sheet page number.  Sheet page
numbers will not be imported.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12472
2022-09-29 17:47:57 +00:00
Jeff Young 64a6fc0fd4 Push UNITS_PROVIDER down into a low-level mixin.
This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
2022-09-19 17:10:59 +01:00
Marek Roszko 61e11d6896 Strip out Mils2Iu 2022-09-16 21:09:27 -04:00
Jeff Young 59f546ced0 Allow recursion up the sheet hierarchy for text variable resolution.
Fixes https://gitlab.com/kicad/code/kicad/issues/11953
2022-09-10 00:04:20 +01:00
Jeff Young 8afc1db7a6 Property popups for symbols, labels, sheets, and footprints in PDF.
Fixes https://gitlab.com/kicad/code/kicad/issues/5521
2022-09-06 13:59:52 +01:00
Jeff Young f17a865593 Move EDA_ITEM hitTest to BOX2I. 2022-08-31 17:18:45 +01:00
Jeff Young 2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Jeff Young 122a6d7f46 Move hypertext linking to user-page-numbers.
Also moves most navigation code to SCH_NAVIGATION_TOOL.
Also changes page number href to anchor syntax ('#foo').
Also adds hypertext processing to SCH_TEXTBOXes.
Also adds combobox with schematic pages to text properties dialog.
2022-08-27 19:17:43 +01:00
Roberto Fernandez Bautista a78cefc7d4 ADDED: Plotting of sheet objects with go to page hyperlinks (pdf for now) 2022-08-27 19:17:42 +01:00
Marek Roszko e0f28fc4e1 Replace wxFindReplaceData with our own container
By dropping the flags, we can be strict with options.
Also it makes future usage of search functionality a little more "UI" framework independent
2022-08-23 22:16:51 -04:00
Jeff Young 4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Jeff Young aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Jeff Young 6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01:00
Marek Roszko a8505d9c76 SEARCH_RESULT -> INSPECT_RESULT
To fix the name squatting it's doing for future functionality
2022-07-29 20:01:10 -04:00
jean-pierre charras 993c446fdf Fix some warnings detected by PVS-STUDIO (most are not used vars) 2022-07-25 18:23:52 +02:00