Commit Graph

220 Commits

Author SHA1 Message Date
Jeff Young f77de66f4e Generalize ERCItem inspections.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10539
2024-02-24 20:05:51 +00:00
Jeff Young e760317af6 ADDED: Implement footprint link checking in ERC.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16842
2024-02-24 20:05:51 +00:00
Jeff Young 7cc663ad77 Schematic parity checking for CLI DRC. 2024-02-02 23:05:37 +00:00
Jeff Young ae735d3eb4 Renaming: replace convert with body-style.
No functional changes.
2024-01-26 16:21:03 +00:00
Wayne Stambaugh 92c58f2564 Fix sheet path dependent ERC dialog selection issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16519
2024-01-08 11:16:55 -05:00
Jeff Young 4bdd5e172c Code cleanup. 2023-12-23 13:30:15 +00:00
Jeff Young f25a06b2a5 More globals eradication.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16031
2023-11-12 23:43:30 +00:00
Jeff Young 03953e80fc Enforce SCH_SHEET_PATH processing in (yet) more places.
Also fixes a bug where ERC testing for text variables in sheet pins
would start with the wrong sheet.

Also fixes a bug where ERC testing of similar labels would use the
wrong sheet.

Also fixes a bug where ERC testing of bus-to-net conflicts would use
the wrong sheet.

Also fixes a bug where ERC didn't process variable references when
checking hierarchical labels against sheet pins.

Also fixes a bug where ERC multiple-drivers and netclass-conflicts
tests didn't set a sheetpath.
2023-11-12 14:15:04 +00:00
Jeff Young 23063fa976 Now that we allow open-text netclass references we need to ERC check them.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12442
2023-11-04 13:59:28 +00:00
Seth Hillbrand 86208a7922 Improve pin-pin iteration in ERC checks
Rather than generating expensive classes to store in a set to check for
duplicate checks, we avoid double-checking elements in the vector.  For
large schematics this results in a substantial speed increase

(cherry picked from commit 1a5c515e45)
2023-10-23 13:45:43 -07:00
Jeff Young 95032bd487 Make ERC off-grid check user-configurable.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14110
2023-10-14 20:47:03 +01:00
Wayne Stambaugh 5d6ef69726 Coding policy and Doxygen comment fixes. 2023-10-12 09:36:28 -04:00
Marek Roszko 8c6899b0d3 Tear out the eeschema conditional compile of PROJECT 2023-09-27 23:05:30 -04:00
Marek Roszko 22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04:00
Jeff Young 7a2a2e2df0 Remove error-prone SetReporter() API. 2023-09-06 11:37:50 +01:00
Jeff Young 9999ac5662 Generate NC-pin errors when connected to other items.
Also removes the NC row in the pin map as it hasn't been used since
6.0 (see #1826).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15558
2023-09-04 17:27:39 +01:00
Marek Roszko 5d001d4858 ADDED: ERC over cli....mostly 2023-08-13 20:31:19 -04:00
Marek Roszko f341fde938 Move RecordERCExclusions and ResolveERCExclusions out of the schematic frame 2023-08-13 19:50:05 -04:00
Marek Roszko 50a4a8639e Move ERC test flow to ERC_TESTER::RunTests 2023-08-13 19:44:10 -04:00
Mike Williams bdecdce1b4 Exclude from Sim: move from field to attribute 2023-08-08 12:36:36 -04:00
Seth Hillbrand f7f67c6d53 Sort the bus alias set by name
If we place pointers in a set, they are sorted by the pointer value in
memory, not the data, so we need a custom comparator

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11890
2023-07-21 09:03:35 -07:00
Jeff Young 782c73300b Move drawing sheet datastructures to EDA_IU_SCALE.
Or mostly, at least.  Plotters still define their own mils-to-iu scale.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14934
2023-06-12 22:34:25 +01:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
Jeff Young d64cb7f81b More uniform handling of power symbols and exclude-from-simulation. 2023-04-14 19:42:13 +01:00
jean-pierre charras aaae50f2aa ERC do not test power symbols for simulation model.
Fix also a minor cosmetic issue with ERCE_SIMULATION_MODEL messages.
Fixes #14463
https://gitlab.com/kicad/code/kicad/issues/14463
2023-04-01 10:16:44 +02:00
Mike Williams 1bc4fc256a Sheets: check for duplicates using shown names
Otherwise sheet names using sheet variables may collide
2023-03-08 11:52:43 -05:00
James J 39e56485fc 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
2023-03-07 00:37:33 +00:00
Seth Hillbrand 48740dd3f8 Clean exposure of CONNECTION_SUBGRAPH
Removes internals from public consumption.
2023-03-03 14:07:17 -08:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05: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