Commit Graph

297 Commits

Author SHA1 Message Date
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
Jeff Young d5a6452934 Get rid of special default line style for Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/11882
2022-06-27 19:12:45 -06:00
Marek Roszko 88c7322a0d EDA_TEXT Get/SetTextSize should use VECTOR2I 2022-05-14 08:16:15 -04:00
jean-pierre charras 20d1d0705e Fix a few issues related to field names and their translation. - Do not use translated field names outside strings displayed in dialogs. - fix code that does not work well with default locale. - fix some (not all) I18n issues in DIALOG_UPDATE_SYMBOL_FIELDS. 2022-05-13 11:45:37 +02:00
Roberto Fernandez Bautista 0015574a60 ${SHEETNAME} represents the sheet name + introduce ${SHEETPATH}
CHANGED: The text variable ${SHEETNAME} now always represents the name of the
sheet when used anywhere in the schematic editor, including the title block

ADDED: A new text variable ${SHEETPATH} which is replaced with the path to the
current sheet - e.g. "/Sheet 1/Sheet 2".

To ensure backward compatibility, the default drawing sheet now uses
${SHEETPATH}. Custom drawing sheets will need to be manually edited.
2022-04-09 15:45:58 +01:00
Wayne Stambaugh 7da7864f5e Fix some Coverity issues. 2022-03-25 15:51:05 -04:00
Seth Hillbrand 984eb0fb40 Handle locally-coded file names for sheets
Windows can accidentally create forward slash-coded files.  This simply
converts them to the proper unix-coded value when set

Fixes https://gitlab.com/kicad/code/kicad/issues/10964

(cherry picked from commit 429544c188)
2022-03-01 17:23:30 -08:00
Seth Hillbrand eb06ecab10 Avoid resolving text vars without screen
We need to keep the screen blank while initially loading a sheet before
the hierarchy is developed.  Avoid resolving text variables during this
process

Fixes https://gitlab.com/kicad/code/kicad/issues/11000

(cherry picked from commit 63b06af6b1)
2022-02-28 12:28:02 -08:00
Jeff Young f11b8011cd Separate plotting into background and foreground.
Fixes https://gitlab.com/kicad/code/kicad/issues/10390
2022-02-10 20:33:06 +00:00
Jeff Young 60bcfd1bf1 Bug fixes in arc & textbox printing.
Also removal of the no-longer-used clipping code from GR*.
2022-01-31 20:00:47 +00:00
Seth Hillbrand be5bb8c4bd Enforce strictly weak ordering in sheets
This ensures that irreflexivity is given in sort ordering.  This may
have been triggering issues in MacOS when adding sheets

Fixes https://gitlab.com/kicad/code/kicad/issues/10557

(cherry picked from commit a1615cce7e)
2022-01-24 10:41:21 -08:00
Jeff Young e61144d45a Finish with EDA_ANGLE. 2022-01-16 21:15:40 +00:00
Jeff Young e048e51f5d Improve SNR of EDA_ANGLE stuff. 2022-01-14 16:08:18 +00:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Marek Roszko 347e03363a Convert wxPoint/wxSize starting from EDA_RECT usages 2022-01-01 11:30:33 -05:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Jeff Young 889970a449 SCH_NETCLASS_FLAGs and SCH_FIELDs for labels.
ADDED: a new label type for netclass flags.
ADDED: the ability to define fields on labels.
2021-12-24 16:13:27 +00:00
Jeff Young 832eb0d019 Fix off-by-one error in grid snapping.
Fixes https://gitlab.com/kicad/code/kicad/issues/9013
2021-12-09 16:35:11 +00:00
Wayne Stambaugh b7af66e3f9 Eeschema: fix broken page numbers when renaming a sheet file name.
Always use full sheet paths when storing sheet instances.  Partial sheet
paths cannot be full resolved resulting in lost page numbers when renaming
sheet file name.

Fixes #9782
2021-12-09 12:56:03 +00:00
Wayne Stambaugh a03e6e4926 Revert "Eeschema: fix broken page numbers when renaming a sheet file name."
This reverts commit a468a79948.
2021-12-06 07:47:18 -05:00
Wayne Stambaugh 5ae844ba93 Revert "Fix SCH_SHEET object assignment operator bug."
This reverts commit 37d53a7147.
2021-12-06 07:47:02 -05:00
Wayne Stambaugh 37d53a7147 Fix SCH_SHEET object assignment operator bug. 2021-12-01 07:19:30 -05:00
Wayne Stambaugh a468a79948 Eeschema: fix broken page numbers when renaming a sheet file name.
Remove duplicate instance data saved in both root SCH_SCREEN and SCH_SHEET
objects that was causing them to be out of sync.  All sheet instance data
is stored in the SCH_SHEET object itself and rebuilt on the fly so it is
always current.

Remove Get/SetPageNumber from SCH_SHEET_PATH object so it doesn't obfuscate
where the actual sheet page number information exists.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9782
2021-11-30 08:11:24 -05:00
Mikolaj Wielgus 9bb370e6b4 SCH_SHEET_PIN: Rename GetEdge, SetEdge to GetSide, SetSide 2021-11-28 20:07:06 +01:00
Mikolaj Wielgus 2e1862de1c Run AutoAutoplaceFields() in SCH_SHEET constructor
A constructor should create a fully initialized object.
2021-11-28 18:46:28 +01:00
Roberto Fernandez Bautista 3660597082 Use canonical names when saving sheet name and filename fields 2021-11-27 20:38:51 +00:00
Jeff Young fe6cb7dbb4 Mirror sheet fields when mirroring sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/9479
2021-10-28 21:45:22 +01:00
Jeff Young b52529521e Replace individual LIB_* shapes with LIB_SHAPE (based on EDA_SHAPE).
Also moves to more capable FILL_T model that can be shared.
2021-10-15 12:45:43 +01:00
Jeff Young 935a307674 Formatting and iterator safety. 2021-10-06 11:13:16 +01:00
Jeff Young 5f3c67bd2b Fill in some missing GetMsgPanelItems and make some others consistent.
Also expunges a std::vector<MSG_PANEL_ITEM> cover type.
2021-09-27 00:23:40 +01:00
Seth Hillbrand 871bdbc952 Search sheets in hierarchy-order
Also fixes an issue where multiple sub-sheets were skipped in certain
cases

Fixes https://gitlab.com/kicad/code/kicad/issues/8972
2021-08-27 13:03:18 -07:00
Jeff Young 69fac89e86 Fix some issues with incorrectly scaled defaults given in mils. 2021-08-25 20:04:06 +01:00