Commit Graph

184 Commits

Author SHA1 Message Date
Michael Kavanagh c40483d18a Cleanup: Move KiCad files into plugins folder 2020-10-12 16:36:08 +00:00
Marek Roszko f47d81af85 Create and use a LIB_PIN constructor to remove hot path during symbol table loading 2020-09-22 22:33:06 +00:00
Seth Hillbrand 02a5d47de9 Avoid passing references in EESchema
This returns the connection list by value.  This allows easier Python
use

Also renames m_End() to GetEnd()
2020-09-08 06:29:27 -07:00
Jeff Young dcd02539e3 Remove linked-pin processing from LIB_PIN's setters.
It belongs in the tool layer (specifically LIB_PIN_TOOL).
2020-08-03 22:21:35 +01:00
Wayne Stambaugh 52078a4b1b Allow setting mandatory derived symbol field properties.
CHANGED: All mandatory fields in derived symbols can be edited.  This
not only includes the field value but also all text properties.

Kill the dual datasheet variable storage which caused many datasheet
bugs over the years.  The datasheet is now always stored in the data
sheet field.
2020-06-02 14:21:11 +00:00
Wayne Stambaugh dd1a7627f8 Move setting derived symbol field properties from parent symbol.
In order allow the new file format to support derived symbols with
field properties that are different than the parent symbol, the code
that copied the parent field properties to the derive symbol field
properties had to moved out of LIB_PART::SetParent() into the legacy
symbol library plugin and the symbol library editor add new symbol
code to preserve the current behavior and not overwrite derived
symbol field properties.

This lays the ground work for allowing field properties of derived
symbols to be different than their parent symbol.
2020-06-02 14:21:11 +00:00
Wayne Stambaugh c2d94358fc Symbol editor: minor fixes to disable saving the legacy file format.
Fixes https://gitlab.com/kicad/code/kicad/issues/4093
2020-05-29 12:43:00 +00:00
Jon Evans 2499a1d640 Remove KIWAY dependence from SCH_PLUGINs 2020-05-20 23:00:23 -04:00
Jon Evans 7c7b7f41da Move SCH_SCREEN project access to SCHEMATIC
SCH_SCREEN no longer needs to be a KIWAY_HOLDER
2020-05-20 22:27:48 -04:00
Jon Evans 14773d073d Fix initialization of schematic in legacy plugin 2020-05-19 09:08:49 -04:00
Jon Evans f4d7c323f5 Coverity fixes 2020-05-18 22:58:28 -04:00
Jon Evans d7bd4c9b04 Move Eeschema globals to new SCHEMATIC object
Set up a new lineage for SCH_ITEMS to get back to the SCHEMATIC
they live on: Items will all be parented to the SCH_SCREEN that
they are added to, and each SCH_SCREEN will point back to the
SCHEMATIC that it is part of.  Note that this hierarchy is not
the same as the actual schematic hierarchy, which continues to
be managed through SCH_SHEETs and SCH_SHEET_PATHS.
2020-05-18 13:04:56 -04:00
Jeff Young 1f9723cf62 Reconcile new Sheet Fields and new S-expr file format.
Fixes https://gitlab.com/kicad/code/kicad/issues/4327
2020-05-06 15:48:58 +01: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
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
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
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 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
jean-pierre charras 952e7a5fb4 Eeschema: move some default values to default_values.h.
These default values are used in many files, and some files were using
magic numbers.
2020-04-14 20:15:18 +02:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
Jeff Young 322ab60cc5 Fix some Coverity issues. 2020-04-06 12:31:59 +01:00
Jeff Young 591428b0d9 Remove some problematic global variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4121
2020-04-05 16:17:04 +01:00
Jeff Young 9a67dc56f9 Clean up assumption that field_id < MANDATORY means its mandatory.
It looks good, but non-mandatory fields have an ID of -1, so it
doesn't actually work.  Some places got around this by converting
the ID to unsigned, but this just hides the real issue from
unsuspecting coders.

Fixes https://gitlab.com/kicad/code/kicad/issues/4140
2020-04-01 15:59:52 +01:00
Jeff Young 41b5872f12 Add ERC & DRC checks for unresolved variables. 2020-03-30 14:15:59 +01:00
Jeff Young 4990d1e7b2 Variable substitution framework.
This implements editing of variables and moving SCH_FIELDs,
TEXTE_MODULEs, TEXTE_PCB and worksheet items over to the new
framework.
2020-03-30 14:15:59 +01:00
Jeff Young 085d80e3f3 Remove duplicated settings from preferences.
These have now moved to project-specific settings.
2020-03-13 17:28:53 +00:00
Jeff Young fe3e0307d8 Move sheet name and filename to SCH_FIELD architecture.
Only internal storage architecture has changed (so far).
2020-03-06 16:23:44 +00:00
Jon Evans 8660b4c144 ADDED: New color theme editor and multi-theme support 2020-03-06 00:01:03 -05:00
Jeff Young 21469efa63 Make sure EESCHEMA definition gets passed into common.cpp.
Also includes a fix to seed timestamps that got incorrectly
written out as '00000000' because of the above.

Fixes https://gitlab.com/kicad/code/kicad/issues/3977
2020-03-04 02:04:18 +00:00
Seth Hillbrand 2cff50d7a8 Fix return value for new plugin
Even when we throw, we still need to provide a default return value that
will never be reached for MSVC

Fixes #3982 | https://gitlab.com/kicad/code/kicad/issues/3982
2020-03-03 14:02:37 -08:00
Seth Hillbrand 081ec393da eeschema: Load using root sheet if null
The root sheet is not set for pasting, in which case, we should utilize
the global root if needed.

Fixes #3956 | https://gitlab.com/kicad/code/kicad/issues/3956
2020-02-28 11:09:41 -08:00
Jeff Young 0614bbc663 Silence a couple of compiler warnings. 2020-02-25 18:26:42 +00:00
Jeff Young c68b554c8e Promote PathsAndReferences from wxArrayString to first-class-citizen.
Keeping the data in an un-serialized format greatly simplifies usage,
and should make it more robust.
2020-02-24 23:19:17 +00:00
Jeff Young 83057a48e1 Write Eeschema "AR" references in legacy timestamp format.
Also fixes a bug with path separators not getting added to the
m_PathsAndReferences array.

Fixes https://gitlab.com/kicad/code/kicad/issues/3925
2020-02-21 23:20:57 +00:00
Jeff Young ea025a35e5 Change KUUID to KIID. 2020-02-21 22:20:42 +00:00
Jon Evans e8e3b4f11e Rename UUID to KUUID to fix MSVC build
Also add another newly-required boost flag
2020-02-20 22:07:17 -05:00
Jeff Young e69c82f45f Back out changes which updated the eeschema file format.
We'll wait until we have the new eeschema format to turn on UUID
generation for Eeschema.  Right now only Pcnbew generates full UUIDs.
2020-02-20 23:40:30 +00:00
Jeff Young e033e394e7 Add visibility flags for sheet names and sheet filenames. 2020-02-20 21:29:52 +00:00
Jeff Young 129042f8a6 Convert timestamps to UUIDs. 2020-02-20 21:29:52 +00:00
jean-pierre charras 2ca16c0b29 eeschema: fixes some issues related to translated and not translated field names.
When searching for fields, the code was sometimes comparing translated and not translated names.
This is an issue for mandatory fields, in non English languages.

Translated field names should be used only in messages.
2020-02-16 17:52:53 +01:00
Jeff Young 2017389f2d Pinning for library trees in FPEditor and SymbolEditor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 00:10:40 +00:00
Seth Hillbrand 55eb687184 Eeschema: Force output ordering
The RTree does not have a deterministic iterator, so extracting items
may be in arbitrary order, causing issues as the schematic appears to
change when comparing to previous revisions.

This uses the SCH_ITEM comparison operator to for ordering by type, then
by custom sorting within type.

For the netlist, we choose the first available unit in the sheet for
each component.

Fixes #3811 | https://gitlab.com/kicad/code/kicad/issues/3811
2020-01-28 13:31:52 -08:00
Mark Roszko 70908043a3 Convert enums inside eeschema and the symbol editor to be scoped
Scope: NETLIST_ITEM, CONNECTION_TYPE, ELECTRICAL_PINTYPE,
       NET_CONNECTION, NETLIST_ITEM, GRAPHIC_PINSHAPE

Note, the pin type enum had PT_ added to the front to prevent
shadowing of the INPUT symbol on msys2 (see discussion at
c17c9960d8)
2020-01-18 20:51:28 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Seth Hillbrand 6e5e453d0d Replace EESchema DLIST
This moves EESchema DLIST structures to rtree.  These changes are more
fundamental than the pcbnew changes from 9163ac543 888c01d11 d1877d7c1
and 961b22d60 as eeschema operations were more dependent on passing
drawing list references around with SCH_ITEM* objects.
2020-01-10 06:37:08 -08:00
jean-pierre charras c17c9960d8 Eeschema: fix a colliding name between sch_text.h and a Windows/msys2 header.
"INPUT" declaration in sch_text.h generate *a lot of* compil warnings.
So it is replaced by PS_INPUT.
For consistency, others member of enum class PINSHEETLABEL_SHAPE are also renamed.
2020-01-09 08:52:30 +01:00
Mark Roszko ca34ade00c Make global labels have the same spin style as net/hierarchical labels
For legacy reasons, it stored left and right "spin" as flipped integers in the file format.
But the code handled the flip in multiple locations rather than just doing it on file io.
This change unifies the internal code and does the mapping in the file I/O.
2020-01-08 19:07:55 +00:00
Wayne Stambaugh aeb3281e27 Convert Schematic Internal Units to 100nm 2019-12-30 18:28:00 +00:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Mark Roszko d3edeaec50 Fix "Properties" not appearing in right click menu for graphic line. 2019-12-26 15:15:34 +00:00