Commit Graph

102 Commits

Author SHA1 Message Date
Wayne Stambaugh a11c40197f Expunge default symbol instance from schematic file format.
Now that importing hierarchical sheets "properly" imports instance data,
the default symbol instance setting doesn't have any meaning.
2022-10-04 15:42:41 -04:00
Seth Hillbrand e055302a3c Allow printing backgrounds prior to foreground
Eeschema shows background fills on a different z-level than the rest of
the symbols/elements.  Print the backgrounds prior to the foregrounds in
order to preserve this view for print output

Fixes https://gitlab.com/kicad/code/kicad/issues/12559
2022-10-02 13:23:54 -07: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
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
Marek Roszko 2646be730d Don't place bookmarks for power symbols (like GND) 2022-09-25 08:50:48 -04:00
Marek Roszko a381a0acb2 Generalize bookmarks to support additional groups and names 2022-09-24 22:35:20 -04:00
Marek Roszko 6f8205235f ADDED: Add outline support to schematic PDF and PCB plot 2022-09-24 21:45:48 -04:00
jean-pierre charras 78087597cd Avoid including plotters/plotter.h in many files.
It avoid a large rebuild when modifying the plot code.
2022-09-21 08:52:34 +02: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 5f85c3b8b9 Fix everything loading DNP 2022-09-17 00:21:05 -04:00
Marek Roszko 61e11d6896 Strip out Mils2Iu 2022-09-16 21:09:27 -04:00
Seth Hillbrand 524b129c64 ADDED: Support for explicit DNP field
Dims elements shown as DNP.  Adds property `dnp` to explicitly denote
parts that should not be populated. These parts are not included in X/Y
files
2022-09-16 22:26:16 +00:00
kliment b97f9ea329 Add support for symbol unit display names in eeschema and symbol editor 2022-09-14 22:11:37 +00:00
Jeff Young ef05069ebc ADDED 2 new vars: EXCLUDE_FROM_BOM and EXCLUDE_FROM_BOARD. 2022-09-13 13:47:24 +01:00
Jeff Young 9bed145475 Allow the current sheet a chance to resolve text variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/8692
2022-09-08 14:10:18 +01:00
Jeff Young 59dc6c8e45 Add wire and bus popups for PDF export.
Fixes https://gitlab.com/kicad/code/kicad/issues/12157
2022-09-06 13:59:52 +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
jean-pierre charras 0e95f06c7b SCH_SYMBOL::UpdatePins() re-add pin filtering by conversion:
It was removed by accident in commit c72091d7e.
without the filtering pins, in symbols with conversion, pins are added
twice in Pin list and create errors in ERC
2022-09-05 09:01:24 +02:00
Jeff Young ca5d95a62b Don't filter pins for conversion or unit.
Symbol datastructure is used for all instances, and some instances may
have different conversion and/or units than others.
2022-09-03 21:47:52 +01:00
Jeff Young b1e5cb5a56 ADDED ${SYMBOL_DESCRIPTION} and ${SYMBOL_KEYWORDS}.
Fixes https://gitlab.com/kicad/code/kicad/issues/9783
2022-09-03 19:29:59 +01:00
jean-pierre charras c72091d7e0 fix a compil warning. 2022-09-03 19:55:54 +02:00
Wayne Stambaugh 4c096fee15 Eeschema: fix crash when attempting to edit missing library symbol.
Disable the edit symbol buttons in the symbol properties dialog when
there is no library symbol to edit.

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

(cherry picked from commit 5afeb45a84)
2022-09-02 16:25:34 -04: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
Jon Evans 5c43c46365 Add new symbol fields to autocomplete list 2022-08-26 23:53:23 -04:00
Jon Evans 460e8015f0 Allow referencing LIB_ID components in symbol fields 2022-08-26 20:30:48 -04:00
Wayne Stambaugh 7c6d9f67f9 Eeschema: fix broken instance data when adding new symbol.
Pass the current SCHEMATIC object pointer in SCH_SYMBOL ctor so that
newly created symbols will update the current instance data on creation
when the current sheet instance is being displayed.

This is a better fix for the master branch and cherry-picking from 6.0
was a mess.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12190
2022-08-26 13:35:49 -04:00
Jon Evans ae6a2a6443 ADDED: Database libraries MVP
Allows placing parts from an external database that reference symbols from another loaded library.

Includes:
- nanodbc wrapper
- database schematic library plugin
- basic tests

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7436
2022-08-26 10:51:13 -04: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
Mikolaj Wielgus 6fad25f8ed Allow mapping sim model pins to arbitrary string symbol pin numbers
This change removes the incorrect assumption that symbol pin numbers are
integers and are the same as indexes in the vector storing the symbol
pins.

"~" is now used to denote a floating sim model pin.
2022-08-22 08:13:26 +02:00
Jeff Young 4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Wayne Stambaugh 10123d164f Fix schematic symbol initial default instance data bug.
The commit bumps the schematic file format version in order to fix the
initial symbol default instance data to the first instance of each symbol.
It also sets the initial instance data to undefined in the SCH_SYMBOL
ctor so on the first schematic save, the default instance will be set
to the first instance of the symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12190
2022-08-21 08:03:28 -04:00
Jon Evans 8694c37376 Remove requirement that non-power symbols share a name and value
There is no technical reason for this restriction for non-power symbols, so let's remove it.
This will allow more flexibility and compatibility with other tools.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9389
2022-08-20 17:43:43 -04:00
Jeff Young aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Wayne Stambaugh 797827b833 Fix missing legacy value and footprint field instance data.
The legacy and s-expression (prior to version 20200828) file formats only
supported symbol unit and reference fields so the newly added value and
footprint fields must be updated from the original symbol fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12226
2022-08-17 11:32:04 -04:00
Mikolaj Wielgus 978f01553b Sim Model Editor: Serialize models in fields
Implemented serialization and deserialization of models in symbol fields
through the SIM_VALUE class. We don't carry the Spice legacy of
case-insensitive suffixes, instead we conform to the SI standard (i.e. M
is Mega, not milli, P is peta, p is pico).

Parameter grid value validation is implemented by simply not allowing
any characters that will make the value invalid (instead of highlighting
the field in a red color). This will likely be changed at some point in
the future.
2022-07-30 02:25:34 +00: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
Jeff Young 5295342f42 Fix another case of the instance data getting messed up.
(Or, more accurately in this case, of the instance data not getting
applied to the current view.)

Fixes https://gitlab.com/kicad/code/kicad/issues/11390
2022-07-27 12:29:01 +01:00
Mike Williams c3d952644c Annotation: fix wrong multi-unit annotation messages
SCH_SYMBOL::Unit() is updated when the symbol is on the screen, we need
to get the instance unit so it's right even if it's not being displayed /
has never been displayed.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/12050
2022-07-25 18:44:55 +00: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 cb77e68076 Don't assume a SCH_EDIT_FRAME in EE_SELECTION_TOOL.
It's also used in the symbol editor.

But in any case, pins of other units have no business being in an
SCH_SYMBOL anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/12076
2022-07-23 14:28:07 +01:00
Jeff Young d24e6c3408 Auto-annotate (and then don't re-annotate) power symbols.
Fixes https://gitlab.com/kicad/code/kicad/issues/11942
2022-07-11 21:46:01 -06:00
Seth Hillbrand ff54b8c718 Overplot schematic symbol fields and pins
In the absence of z-ordering, we need to ensure that pin text and symbol
fields are always visible in plots as they are in the schematic window.
We do this by overplotting the fields/pins when symbols overlap each
other.

This can be removed if/when we implement https://gitlab.com/kicad/code/kicad/-/issues/2211

Fixes https://gitlab.com/kicad/code/kicad/issues/11969
2022-07-05 16:39:53 -07:00
Jeff Young e4798199c6 Handle alt pins in plot code.
Fixes https://gitlab.com/kicad/code/kicad/issues/11728
2022-06-10 22:38:01 +01:00
Seth Hillbrand 1a70465927 Use instance data to store values
Previous use of instance was as an "override" of the default value.
This has changed to be used as the primary storage location for all
values.  This means that we cannot clear the instance data when setting
a new value for all instances, instead we have to change the instance
data and the default value is superfluous

Fixes https://gitlab.com/kicad/code/kicad/issues/11439
2022-04-25 12:47:48 -07:00
Jeff Young 160240166c Cleanup. 2022-04-14 17:09:27 +01:00
Jeff Young 034b57d9c0 When reannotating keep existing prefix in most cases.
(Execption is reannotating entire schematic, in which case we reset
all of them.)

Fixes https://gitlab.com/kicad/code/kicad/issues/11379
2022-04-13 23:38:45 +01:00
Jeff Young 8358685920 Dual-purpose IsMovableFromAnchorPoint to keep from moving symbols off-grid.
Fixes https://gitlab.com/kicad/code/kicad/issues/11360
2022-04-11 12:02:20 +01:00