Commit Graph

143 Commits

Author SHA1 Message Date
Jon Evans 40e0a4295d Re-add netlisting logic inadvertently removed during refactor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4692
2020-06-21 21:43:24 -04:00
Wayne Stambaugh 037898f6fb Eeschema: add support for excluding symbols from board.
ADDED: Support for excluding symbols from board during.  This allows for
creating bill of materials only symbols.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2522
2020-06-10 10:57:28 -04:00
Wayne Stambaugh 77a59fb5d3 Eeschema: add support for excluding symbols from bill of materials.
This provides a method to add symbols that represent footprints on the
board that do not have an associate component such as mounting holes,
fiducials, logos, etc that should be excluded from the bill of materials.
It also prevents those footprints from being removed from the board
accidentally when updating the board from the schematic.

ADDED: Support to exclude schematic symbols from bill of materials
export.
2020-06-03 08:55:13 -04: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
Jon Evans 1c2ef8678c Use proper refdes sorting for component ordering in netlists 2020-05-23 20:31:41 -04:00
Jon Evans ca41dc2e66 Clean up extra TODO 2020-05-23 12:53:05 -04:00
Jon Evans de9520d65e Finish porting netlisters to use CONNECTION_GRAPH 2020-05-23 12:45:24 -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
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
Sylwester Kocjan fdccdd5cb9 Eeschema: adding .op SPICE simulation support
ADDED new tab on simulation settings dialog, which allows to run .op analysis.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2368
2020-04-15 01:51:58 +00: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 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 129042f8a6 Convert timestamps to UUIDs. 2020-02-20 21:29:52 +00:00
Jon Evans ac875e26a8 Fix handling of SCH_PINs on multi-unit parts
Fixes https://gitlab.com/kicad/code/kicad/issues/3770
2020-02-04 11:51:29 +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
Jon Evans 41725e6b07 Sort nets in netlist by name; generate ordered net codes 2020-01-22 14:59:02 +00: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
Seth Hillbrand a7d02a4f75 Recognize subckt blocks in spice
Spice lines defining circuit elements are contained in a .subckt ..
.ends block.  The intervening lines should be exported to the netlist as
well as the control lines.
2020-01-17 18:56:30 -08:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08: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
Wayne Stambaugh 54f066fed7 Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces
it by allowing LIB_PART objects to inherit from other LIB_PART objects.
The initial implementation only allows for single inheritance and only
supports the mandatory fields in the derived part because that is all
that the current symbol library file format will support.  Once the new
file format is implemented and saving to the old file format is deprecated,
more complex inheritance will be added.  The LIB_ALIAS information saved
in the document files was move into the LIB_PART object.  This change
impacts virtually every part of the schematic and symbol library editor
code so this commit message is woefully incomplete.

REMOVE: Removed the symbol aliases concept from the schematic and symbol
editors and the symbol viewer.

NEW: Replace the symbol alias concept with simple inheritance that allows
a library symbol to be derived from another library symbol.
2019-12-06 11:33:52 -05:00
Seth Hillbrand 6983c56cf8 Use const references where possible
This avoids copy cost on local vars where we only read.
2019-12-05 14:40:22 -08:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
jean-pierre charras 71cd8c57bf ADDED: Pcbnew, add "pin function" (pin name in eeschema) to pads.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
2019-11-23 09:12:43 +01:00
Seth Hillbrand 4004c733c8 eeschema: Pad spice ops to differentiate
The .op command is isolated, so differentiating from .option with a
space will only work if we ensure all commandlines have a space at their
end.
2019-10-23 06:31:56 -07:00
Jeff Young a6b7d4f7f6 Support 9 comments in the page setting GUI.
Fixes: lp:1793148
* https://bugs.launchpad.net/kicad/+bug/1793148
2019-08-21 20:34:01 +01:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
Seth Hillbrand 2b55f8a1aa netlist: avoid cast to different iterator
This ensures the list iteration matches the container
2019-08-06 15:28:25 -07:00
jean-pierre charras b3b32fa966 Revert "Fix ngspice netlisting when net names contain '/'"
This reverts commit eadf6d93bc.

because the issue with net names containing '/' is not actually inside the netlist.
This commit eadf creates issues with ngspice 2.8 and older, and do not fix anything in ngspice
2019-07-19 16:13:10 +02:00
jean-pierre charras 710a82bc51 Eeschema: fix an issue in netlists when using "<root sheet>" as root sheet path name.
Netlists do not accept any char in netnames (especially spice).
They must use only "/" as root sheet path name.

Especially _( "<root sheet>" ) breaks netlists because:
- there is a space in name, and special chars (< and >)
- it is a translatable name. so the actual name cannot be managed.
- most of netlist code in Kicad expects a "/" as root path.
2019-06-23 19:37:41 +02:00
jean-pierre charras bc27b0ed5f Sim spice: fix unescaped netnames in spice netlist and simulator dialogs.
Net names in eeschema that include '/' are escaped ('/' replaced by "{slash}")
Escaped netnames are only for internal use, and must be unescaped in spice netlist and dialogs.
2019-06-09 17:48:01 +02:00
Jon Evans 77fe7d8325 Remove netlist QC code; it's outlived its usefulness 2019-04-19 22:53:16 -04:00
Jon Evans eadf6d93bc Fix ngspice netlisting when net names contain '/'
Fixes: lp:1821502
* https://bugs.launchpad.net/kicad/+bug/1821502

(cherry picked from commit 216573bf48)
2019-04-13 15:37:22 -04:00
Jeff Young d8cc2f8280 More cleanup from non-reference return from GetText(). 2019-04-03 19:35:25 +01:00
Jeff Young 3ace73fbdd Fold various SCH pin shadow data structures into SCH_PIN. 2019-04-03 10:18:11 +01:00
Jon Evans 8a9b82c2a2 Switch CONNECTION_GRAPH to wxLogTrace 2019-04-02 22:58:11 -04:00
Jon Evans 82d4029831 Clean up cruft in netlist export 2019-03-31 19:56:22 -04:00
Jon Evans c8c0b89eef Fix issue where some power symbols would show up in netlist 2019-03-31 19:55:00 -04:00
Jon Evans 83c7e7fc65 New connectivity algorithm and bus upgrades
Bus upgrades: core new connectivity code

Bus upgrades: eeschema integration and modifications

Bus upgrades: eeschema dialogs

Bus upgrades: netlist export

Bus upgrades: file format changes
2019-03-31 19:53:41 -04:00
Seth Hillbrand 191679676d eeschema: Export coupling constants to netlist
Patch suggested by Holger Vogt.  Exports text lines following the SPICE
K### <inductor1> <inductor2> format.

Fixes: lp:1815281
* https://bugs.launchpad.net/kicad/+bug/1815281
2019-02-09 18:58:33 -08:00
John Beard 88f9f6f072 Break out ref-des-centric functions to own header
This breaks the following functions out to a general-purposed refdes utils
header:

* MODULE::GetReferencePrefix()
* kicad_string.h RefDesStringCompare()

This acheives:

* Slimming of MODULE interface
* Placement of refdes code in common rather than pcbnew
** Testing of this code in qa_common
* Tighter and smaller includes for code that only needed refdes functions

Note: there are failing tests commited (as expected failures). These
are the cause of lp:1813669 and will be fixed as a follow-up commit.
2019-01-30 15:41:36 -08:00
joel-bertrand-JKB 2d5752f51d Fix duplicate directives in Spice netlist inside .control ... .endc
Fixes: lp:1812082
https://bugs.launchpad.net/kicad/+bug/1812082
2019-01-16 19:54:03 +01:00
Jeff Young ed6c68a1e3 Clean up handling of component fields.
In particular the datasheet field and how its handled with aliases,
but also cleaning up duplicated functionality around aliases and
libids.
2018-11-22 21:31:45 +00:00
Maciej Suminski 9757107b61 Spice netlist exporter: handle multiline directives
Fixes: lp:1797937
* https://bugs.launchpad.net/kicad/+bug/1797937
2018-10-19 17:33:01 +02:00
jean-pierre charras 8f9b0f0235 Eeschema, spice netlist exporter: fix an issue that converted spice string commands to lowercase.
Therefore, it can breaks some commands, especially filenames.

Partial fix of bug 1797937.
2018-10-19 16:18:30 +02:00
Maciej Suminski e6f2c49eae Spice model editor: support for JFET models 2018-09-22 19:05:01 +02:00
Maciej Suminski f2f6dffd16 Refactored logic in Spice model editor dialog
- Removed redundant enums
- Stored Spice model description in an array
- Made code generic by using the model description array
2018-09-22 19:04:54 +02:00
Maciej Suminski 4a57541b76 Spice netlist exporter: make directives case insensitive, extra comments 2018-09-10 10:18:22 +02:00
Joël Bertrand 36f2eb1116 Spice netlist exporter: handle .control .. .endc blocks
Spice may include a list of directives that are wrapped with
.control and .endc. Such directives do not have a dot prefix, so
they need to be handled in a special way.

Fixes: lp:1787902
* https://bugs.launchpad.net/kicad/+bug/1787902
2018-09-10 10:18:17 +02:00
Maciej Suminski d5ee3296b2 Spice simulator: search each line of a text field for a Spice directive
Fixes: lp:1786119
* https://bugs.launchpad.net/kicad/+bug/1786119
2018-08-14 10:25:28 +02:00