Commit Graph

194 Commits

Author SHA1 Message Date
Jeff Young f67a477f65 Pull some fixes from master. 2023-04-14 19:55:31 +01:00
Seth Hillbrand 839301f81e Revert "Consolidated ERC fixes"
This reverts commit 2127712115.

Version uses functions only available in the master branch.  Will revert
for 7.0.2 to allow targeted update
2023-03-06 21:22:55 -08:00
James J 2127712115 Consolidated ERC fixes
- Consistent calculation of IsStacked() for pins across ERC checks
 - Correct placement of ERC marker for unresolved field variables
 - Add sheet-specific paths to two ERC check results

(cherry picked from commit 39e56485fc)
2023-03-06 16:38:11 -08:00
JamesJCode fef3274e8e Eeschema: ERC checks handle connections between a common sub-circuit
Fixes #10926

Contains the following changes:

    - Adds a new ERC_SCH_PIN_CONTEXT class which is used to provide deterministic
      comparison between items causing ERC violations (e.g. pins) when associated
      with a SCH_SHEET_PATH context.

    - Adds association of SCH_SHEET_PATHs for ERC_ITEMs and the sub-schematic items
      which caused an ERC violation. This allows correct display of markers on the
      sheets of interest only, and allows correct naming resolution and cross-probing
      from the ERC dialog.

    - Adds a new ERC_TREE_MODEL class, derived from RC_TREE_MODEL, which correctly
      resolves component references across heirarchical sheets using the associated
      SCH_SHEET_PATHs. This allows sheet-specific component references to be displayed
      correctly in the ERC results tree.

    - Updates SCH_MARKER to only draw sheet-specific markers on the sheet causing
      an ERC violation.

    - Increments the schematic file version.

    - When loading a schematic with legacy ERC exclusions, discards those of type
      ERCE_PIN_TO_PIN_WARNING, ERCE_PIN_TO_PIN_ERROR, ERCE_HIERACHICAL_LABEL, and
      ERCE_DIFFERENT_UNIT_NET as there is no safe way to automatically infer the
      information which is now stored with these exclusions (sheet paths for error
      location and related items). Requiring users to (once) re-add exclusions is
      preferable to silently incorrectly matching new ERC issues to legacy exclusions.
2023-01-24 14:11:01 +00:00
Marek Roszko d2c0f5fc2a More wxSing 2023-01-16 23:14:38 -05:00
Jeff Young d839f11d49 Rip out parsing of SPICE libraries for netlisting.
We only need to parse the libraries for the Sim Model Editor dialog
(so that we can determine the models to put in the popup).  Doing it
for netlisting just opens us up to incorrectly parsing the SPICE, and
returns no value.

This also means that a SIM_LIB_MGR manages a single library, and
never multiple libraries.

This also allows the tidying-up of some error reporting structures to
better inform the user what went wrong.

Fixes https://gitlab.com/kicad/code/kicad/issues/13431
2023-01-12 14:51:03 +00:00
Jeff Young 9b9795a87d Reduce reliance on exception processing -- it's waay too bugy at present.
This moves some stuff to REPORTER APIs.  Moving more stuff would be good,
but it probably too high-risk at present.  We'll wait for 8.0 for that....

Fixes https://gitlab.com/kicad/code/kicad/issues/13359
2023-01-03 17:20:23 +00:00
Jeff Young 7f35323416 Re-enable sim model ERC testing. 2023-01-03 00:59:14 +00:00
Seth Hillbrand 09cc6decaf ADDED: ERC for missing units
Reports a warning (by default) for missing units
Reports an error for missing units with power input pins
Reports a warning for missing units with input pins
Reports a warning for missing units with bidi pins

Fixes https://gitlab.com/kicad/code/kicad/issues/1922
2022-11-29 23:49:55 +00:00
jean-pierre charras 7c9f3981ef Revert "Reorder includes is some simulator files to fix issues on msys2 (no code change)"
This reverts commit 78e45fa1b9.
Looks like it creates a compil issue on MSVC
2022-11-12 20:47:36 +01:00
Mikolaj Wielgus e8762da4f4 Revert "Support for variable references in SPICE models."
This reverts commit 95ebfeeed1.
This reverts commit 672ce650a9.
2022-11-07 19:37:40 +01:00
Jeff Young 672ce650a9 Basic ERC for simulation models. 2022-11-07 13:33:00 +00:00
Jeff Young 8fc08b9185 Erc for simulation models. 2022-11-07 12:28:11 +00:00
Marek Roszko 61e11d6896 Strip out Mils2Iu 2022-09-16 21:09:27 -04:00
Marek Roszko e6ed275c25 Repoint IU_PER_MILS 2022-09-16 21:09:26 -04:00
Jeff Young 1e64db779c Fix some issues in ERC error messages.
1) use consistent punctuation
2) make sure all are translated

Fixes https://gitlab.com/kicad/code/kicad/issues/12432
2022-09-15 23:43:46 +01:00
Jeff Young 536561f7b3 Move bus aliases to std::set.
This is mostly to output the aliases sorted (for ease of VCS integration),
but also because a btree will be faster than hashing on a small dataset.

Fixes https://gitlab.com/kicad/code/kicad/issues/11890
2022-09-11 19:48:08 +01:00
Seth Hillbrand 06786c34d7 Blacklist hashes for 2d integer elements
The hash table for integer hashes is extremely limited and places most
elements in the same buckets.  This leads to a linear search time for
structures built on this.

This blocks hashes, directing the coder to utilize std::set or std::map
structures instead of hash tables for implementing integer-based
lookups.
2022-08-26 08:43:37 -07:00
Jeff Young 88c9177ff6 Move bus members from wxArray to std::vector and fix some bugs in dialog. 2022-08-21 20:54:41 +01:00
Jeff Young ced55583a6 Back out unordered_map change for SCH_ITEM.
We're sensitive to the ordering in this one.

Also fixes a problem with the unit tests when KICAD_SPICE=OFF.
2022-08-03 14:29:34 +01:00
Jeff Young 96f01d33c8 Performance improvements.
1) Move a bunch of std::map's to std::unordered_map to get constant-time
look-ups
2) Lengthen progress-reporting intervals to spend more time doing work
and less time talking about it
3) Reverse order of SHAPE_LINE_CHAINs in thermal intersection checks to
make (much) better use of bbox caches
4) Don't re-generate bboxes we already have
5) Fix some autos that weren't by reference (and were therefore copying
large datasets)
6) Rename delta progressDelta so it's easier to search for in future
7) Get rid of a few more autos (because I don't like them)
8) Pass large items to lambdas by reference

Fixes https://gitlab.com/kicad/code/kicad/issues/12130
2022-08-03 11:59:42 +01:00
Seth Hillbrand fe3a112396 ADDED: Allow stacked pins of the same type
Removes the need for the "KiCad" workaround where stacked pins need
to be "Passive" type.  Pins that have the same parent symbol, name,
position and type are considered to be the same output and do not
trigger ERC errors

Fixes https://gitlab.com/kicad/code/kicad/issues/5367
2022-07-30 13:16:30 -07: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
Seth Hillbrand 702623ef87 Don't flag pin missing driver when there is an NC
The NC flag indicates user intention to override the lack of connection
to input pins

(cherry picked from commit e02229a234)
2022-04-07 09:35:23 -07:00
Seth Hillbrand 4b0b4c0ddc Show non-driven error on single-pin nets
Better to have both the single-pin error message and the non-driven
error message when an input pin is not connected than miss error
messages when the pin is connected to a blank net

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

(cherry picked from commit e740db61f5)
2022-04-06 16:54:04 -07:00
Jeff Young e77a71bf7a Fix typo found in code review. 2022-03-21 10:32:36 +00:00
Jeff Young 41c0009c51 Off-grid ERC warnings.
Fixes https://gitlab.com/kicad/code/kicad/issues/10379
2022-03-17 20:23:56 +00:00
Jeff Young 76535d8572 Make LIB_ITEM::COMPARE_FLAGS really a flags field, and add ERC.
Before they were 1/2 treated as flags and 1/2 treated as a mode enum.

The ERC flag relaxes constraints on data that is settable in the
schematic editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/11018
2022-03-03 13:27:18 +00:00
Jeff Young b55bda8d6f Font support for drawing sheet editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/10306
2022-02-28 18:05:26 +00:00
Jeff Young c6a8100d46 Schematic and symbol text boxes.
Also fixes some plot bugs with arcs.

Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.

Fixes https://gitlab.com/kicad/code/kicad/issues/5017
2022-01-28 21:38:15 +00:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Jeff Young 83e5208213 Fix a couple of holes in the IsTestEnabled() checks.
Fixes https://gitlab.com/kicad/code/kicad/issues/7270
2021-11-04 16:24:06 +00:00
Jon Evans 4da0c897bc Fix flagging power pin in ERC check
IsPowerConnection() is too restrictive a check

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8881
2021-08-21 11:19:09 -04:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Jeff Young 6d4c454e8c Fix some more missing escaping for symbol ids.
Fixes https://gitlab.com/kicad/code/kicad/issues/8694
2021-07-28 18:37:09 +01:00
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
Jeff Young 389287e942 A bit more Part -> Symbol. 2021-06-17 22:24:41 +01:00
Jeff Young c0ad498c4a Report all lib symbol issues.
Fixes https://gitlab.com/kicad/code/kicad/issues/7725
2021-06-17 22:24:41 +01:00
Jeff Young 0484ca5564 Separate LIB_PIN and SCH_PIN GetShownName/Number processing.
SCH_PIN wasn't handling the legacy empty string token (~), but
more importantly this will allow text variable resolution specific
to the schematic.

Fixes https://gitlab.com/kicad/code/kicad/issues/8625
2021-06-17 10:52:46 +01:00
Wayne Stambaugh ee3eac325d Expunge the use of the word part from Eeschema code. 2021-06-15 08:32:11 -04:00
Wayne Stambaugh fb46cd8bc5 Expunge the use of the word component from Eeschema code.
The only exception to this is the SPICE simulator's use of component
when referring to physical component (R, L, C, etc.) values.
2021-06-14 14:00:21 -04:00
Wayne Stambaugh 71c183d7bb Rename LIB_PART to LIB_SYMBOL. 2021-06-14 07:11:17 -04:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00
Wayne Stambaugh 2b86b34124 Eeschema: split out SCH_SHEET_PIN declarations into separate header. 2021-04-06 17:15:49 -04:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Jeff Young 2e129d9b47 Naming conventions and other cleanup. 2021-03-19 23:06:19 +00:00
Wayne Stambaugh 7a00e01b3e Eeschema: fix false positive library symbol changed ERC errors.
This fix required sorting all of the LIB_PART draw items to ensure
accurate comparison between the symbols stored in the schematic and the
original library symbols.  This has a noticeable impact on symbol library
load performance.  It may also cause significant changes the next time
the library is saved due to changes in the draw item sorting.  Hashing
may be a better solution here but this addressed the immediate problem.

A skeleton method SCH_SCREEN::SwapSymbolLinks() was added because there
is most likely an issue with orphaned symbols in the schematic library
symbol cache during undo/redo operations.  More testing is required to
verify this.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7263
2021-03-04 17:59:24 -05:00
Jeff Young a3b9e8ddb4 Round 2 of Worksheet -> Drawing Sheet. 2021-02-23 11:57:44 +00:00
Jeff Young cad5198ab7 Worksheet -> (industry standard) Drawing Sheet. 2021-02-22 17:35:46 +00:00
Jeff Young 8464add58c Use GetSchSymbolLibraryName() when looking up symbol in schematic.
Fixes https://gitlab.com/kicad/code/kicad/issues/7301
2021-02-02 22:55:18 +00:00