Commit Graph

5347 Commits

Author SHA1 Message Date
Wayne Stambaugh 0ef97ac486 Eeschema: add missing alternate body style to new schematic file format.
Fixes https://gitlab.com/kicad/code/kicad/issues/4321
2020-05-05 09:15:13 -04:00
Wayne Stambaugh c18a7b42ee Eeschema: fix crash when updating board from schematic.
Removed some rogue calls to SCH_SCREEN::UpdateSymbolLinks() which should
only be called the last time the schematic is loaded from the legacy file
format.  After that, all symbol library links should be changed using
SCH_COMPONENT::SetLibSymbol() which will prevent the pin maps from ending
up with broken symbol library pin links.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4318
2020-05-04 19:34:24 -04:00
Wayne Stambaugh a8407fba4c Fix schematic field index bug in s-expression file format plugin. 2020-05-04 12:40:03 +00:00
Wayne Stambaugh 169f63a6c0 Eeschema: make schematic sharing truly safe across all designs.
There has been a long standing (since the beginning of the project?)
issue with sharing schematics between projects.  It has been somewhat
supported for complex hierarchies (a sheet shared multiple times in a
single design) but it has not been well supported for simple hierarchies
(the symbol references cannot be changed in the shared schematic).  This
issue has been resolved by moving all of the symbol instance sheet paths
from the symbol definitions in the all of the project files and save all
symbol path instances in the root sheet.  This ensures that orphaned
symbol instance paths do not accumulate in shared schematic files and
that designs that reuse schematic in simple hierarchies can how have
different references.  It also allows the root schematic from one project
to be uses as a sub-sheet in another project.

When legacy schematics are loaded, all sheet and symbol UUIDs are
converted from time stamps to true UUIDs.  This is done to ensure there
are no sheet path instance clashes between projects.  That being said,
there are no checks for this.  It is assumed that the probability of
UUID clashes is so low that it doesn't make sense to test for them.
2020-05-04 12:40:03 +00:00
Wayne Stambaugh 7183e9f97e Make the new schematic and symbol library file formats the default.
This is a very large and potentially disruptive change so this will be an
unusually long and detailed commit message.

The new file formats are now the default in both the schematic and symbol
library editors.  Existing symbol libraries will be saved in their current
format until new features are added to library symbols.  Once this happens,
both the legacy schematic and symbol file formats will be no longer be
savable and existing libraries will have to be converted.  Saving to the
legacy file formats is still available for round robin testing and should
not be used for normal editing.

When loading the legacy schematic file, it is imperative that the schematic
library symbols are rescued and/or remapped to valid library identifiers.
Otherwise, there will be no way to link to the original library symbol and
the user will be required manually set the library identifier.  The cached
symbol will be saved in the schematic file so the last library symbol in
the cache will still be used but there will be no way to update it from the
original library.

The next save after loading a legacy schematic file will be converted to
the s-expression file format.  Schematics with hierarchical sheets will
automatically have all sheet file name extensions changed to .kicad_sym
and saved to the new format as well.

Appending schematics requires that the schematic to append has already been
converted to the new file format.  This is required to ensure that library
symbols are guaranteed to be valid for the appended schematic.

The schematic symbol library symbol link resolution has been moved out of
the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the
symbol.  This was done to ensure that there is a single place where the
library symbol links get resolved rather than the dozen or so different
code paths that previously existed.  It also removes the necessity of the
SCH_COMPONENT object of requiring any knowledge of the symbol library table
and/or the cache library.

When opening an s-expression schematic, the legacy cache library is not
loaded so any library symbols not rescued cannot be loaded.  Broken library
symbol links will have to be manually resolved by adding the cache library
to the symbol library table and changing the links in the schematic symbol.

Now that the library symbols are embedded in the schematic file, the
SCH_SCREEN object maintains the list of library symbols for the schematic
automatically.  No external manipulation of this library cache should ever
occur.

ADDED: S-expression schematic and symbol library file formats.
2020-05-04 12:40:03 +00:00
jean-pierre charras 12d1d3a844 Pcbnew: fix not wanted changes in .kicad_pcb files when the board has no changes.
Some items (tracks and footprint graphic items) when reading were added in reverse order
of the initial file, creating useless differences and breaking source comparisons.
2020-05-04 14:01:35 +02:00
Jeff Young c155d80213 User configurability of pin electrical symbol size.
Also fixes a bug where a bunch of eeschema settings weren't getting
loaded because it looked like they were larger than the max value
(which wasn't being scaled from mils to internal units).

Fixes https://gitlab.com/kicad/code/kicad/issues/2089
2020-05-04 00:56:32 +01:00
Jeff Young da1a89fc7e Allow users to control the order of sheets through sheet fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/2394
2020-05-03 23:27:30 +01:00
Jeff Young 5bed201a23 Don't collect connected labels on a paste.
Fixes https://gitlab.com/kicad/code/kicad/issues/4311
2020-05-03 21:47:53 +01:00
Jeff Young 0370eff7ba Add sheet number processing to sheet fields.
Also fixes a bug where we were depending on the old deque stuff's
deterministic traversal, which isn't provided by the new RTree stuff.

Fixes https://gitlab.com/kicad/code/kicad/issues/2433
2020-05-03 20:56:32 +01:00
jean-pierre charras 05afbcc22e library viewers: fix a focus issue that prevent using arrow keys in lib or fp lists.
Once the gal canvas hsad the focus, it was not possible to use arrow keys in library
or symbols or fp lists even after clicking on an item.

This focus issue is now fixed.

Fixes #4292
https://gitlab.com/kicad/code/kicad/issues/4292
2020-05-03 20:11:33 +02:00
jean-pierre charras 7554a2df30 Eeschema, library viewer: fix some render options, especially default line thickness 2020-05-03 15:38:28 +02:00
Wayne Stambaugh c9d549ffba Eeschema: minor update symbol fields dialog layout improvements. 2020-05-03 08:40:31 -04:00
Wayne Stambaugh 1c82fc9465 Eeschema: minor sheet properties dialog layout improvements. 2020-05-03 08:24:08 -04:00
Jeff Young 199bb2ffb0 Add hittesting for worksheets in Pcbnew and Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/4282
2020-05-03 00:07:38 +01:00
Wayne Stambaugh 055ab92797 Fix symbol library table dialog padding. 2020-05-02 18:42:45 -04:00
Jeff Young 9d6b987ecc Fixes to map pin-to-pin erorrs to new Warning/Error strucutre. 2020-05-01 18:49:42 +01:00
Jeff Young 874f13e29e Fix some issues with rotated oval pads. 2020-05-01 18:49:42 +01:00
Jeff Young a56191b658 Add distances to a bunch of DRC violation reports. 2020-05-01 18:49:42 +01:00
Jon Evans 4b4952b09a Add short-circuits for regex testing 2020-04-30 19:53:25 +00:00
Jon Evans cf15a1c493 Cache SCH_SHEET_PATH recursion test results 2020-04-30 19:53:25 +00:00
Jon Evans f4f43f51c8 Cache connection names 2020-04-30 19:53:25 +00:00
Jon Evans 1204b9cbef Use cached pins in SCH_COMPONENT::GetEndPoints() 2020-04-30 19:53:25 +00:00
Jon Evans 2eaefb4874 Improve performance of schematic load and connectivity
Store component paths and references efficiently
Remove redundant calls to RecalculateConnections
2020-04-30 19:53:25 +00:00
jean-pierre charras b26e9520b3 DIALOG_EDIT_SHEET_PIN: allows only the text size to be edited (and sizeX = sizeY).
In Eeschema, texts are expected to have the same size X and size Y.
So we cannot set 2 different values for X and Y pin size:
- only size X is saved in file
- 2 different values for X and Y create bad look for pin + associated graphic symbol
Allowing separte values need a file format change *and* a code change.
2020-04-30 10:33:53 +02:00
jean-pierre charras 687c2f3e82 eeschema: fix a readability issue for small texts.
Texts were drawn with a minimal line thickness = GetDefaultPenWidth().
The default pen width can be to large for small texts.
So the actual text thickness is now always clamped.
2020-04-30 09:38:23 +02:00
jean-pierre charras d10c8cd75b Sheet pins: fix incorrect size and plot thickness of the graphic symbol.
Unlike the global labels, the hierarchical label is not inside the graphic symbol.
So the graphic symbol size depends only of the text size, not of the text offset.
2020-04-29 17:46:36 +02:00
jean-pierre charras 62d78cdf49 erc_item.cpp: fix issue that created broken error list in panel setup severities
Fix a minor Coverity warning.
2020-04-29 15:30:31 +02:00
Jeff Young 1daa2224d0 Tidy up the layout of the Colors Editor. 2020-04-27 11:59:57 +01:00
Ian McInerney d006acecf4 More window sizing fixes
* Push all sizing operations into EDA_BASE_FRAME
* Save the unmaximized window size when maximizing
  so that we can then save it in the config if the
  window is maximized. Otherwise the config ends up
  with the maximized size saved, and weird behavior
  occurs when unmaximizing on the next opening.
2020-04-27 00:14:12 +01:00
Wayne Stambaugh 1a8082c6d6 Eeschema: fix partial schematic load bug in the legacy plugin.
Move the hierarchical sheet loading outside of the try exception block
so that any sheets that were loaded when a schematic file load fails
are loaded rather than skipped.  This allows more of the schematic to
be loaded when any parser errors occur.
2020-04-26 15:47:25 -04:00
Wayne Stambaugh fa57c8a570 Eeschema: fix sheet bug in schematic editor drawing tool.
SCH_SHEET objects can only have another SCH_SHEET object as a parent
or nullptr for the root sheet so overload EDA_ITEM::SetParent() to
prevent the parent from being set to another type of object and add
some checks to the root sheet code just in case someone gets clever
and attempts to bypass the overloaded SetParent() call.
2020-04-26 14:27:51 -04:00
jean-pierre charras 349ec2031b Eeschema plot worksheet: use the color defined in Eeschema settings.
Fixes #4265
https://gitlab.com/kicad/code/kicad/issues/4265
2020-04-26 09:06:02 +02:00
jean-pierre charras 4f369801f2 Fix a few compil and Coverity warnings. 2020-04-25 08:49:16 +02:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young 49c46dc796 Fix typo. 2020-04-24 23:22:11 +01:00
Jeff Young 2fb2eac4d5 Performance enhancements. 2020-04-24 22:17:45 +01:00
Jeff Young 32db9eb0f1 Add some distances to a few DRC errors. 2020-04-24 22:17:45 +01:00
Jeff Young e14e3faed6 Use resolved text for connections. 2020-04-24 22:17:45 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jeff Young cb89e18281 Get rid of the visible axes in Eeschema. 2020-04-24 14:46:22 +01:00
Jeff Young 7308099852 Add an icon and put Schematic Setup in the toolbar. 2020-04-24 14:46:22 +01:00
Jon Evans 69db66e1ea Fix saving of pcbnew colors when edited from layers widget 2020-04-23 22:33:02 -04:00
Jon Evans 2d95270a31 Add color theme settings to pcbnew 2020-04-23 21:55:29 -04:00
Ian McInerney facf40d3ce libedit: Add drag to move behavior
ADDED: Drag to move behavior in the symbol editor

Fixes https://gitlab.com/kicad/code/kicad/issues/1904
2020-04-23 23:58:33 +01:00
Jon Evans f7ebf2af5e Add separate color setting for bus junctions
Fix plotting and printing to use bus color when
connectivity detects that the junction is on a bus.

Fixes #4098
2020-04-22 21:55:48 -04:00
Jeff Young 615ad9abfc Check sheet file extension when editing, and add if missing when reading.
Fixes https://gitlab.com/kicad/code/kicad/issues/4107
2020-04-22 21:27:33 +01:00
Jeff Young fe383efb93 That gcc is a squirrelley beast... 2020-04-22 12:35:32 +01:00
Jeff Young 1fdaac3440 Safer way to do std::string conversions. 2020-04-22 12:31:06 +01:00
Jeff Young 857aca78cd More std::string vs. wxString compile issues. 2020-04-22 12:28:25 +01:00