Commit Graph

1409 Commits

Author SHA1 Message Date
Jeff Young 4b22b1e831 Debugging aid. 2023-08-31 00:25:20 +01:00
Jeff Young aeb8374ae5 Fix presumed typo in collision reporting.
(The format string contains two %d items, but is only passed a
single int.)
2023-08-31 00:25:20 +01:00
Jeff Young ac7ceb03ee Fix warning message typo, empty wxString::Format, and formatting. 2023-08-31 00:25:20 +01:00
Jeff Young 9e309d1d83 Coding standards and wxS() safety. 2023-08-30 11:18:54 +01:00
Jeff Young f24cf2250e Make sure we have a BOARD when trying to read nets.
Also fixes a nullptr bug when trying to write nets when we don't
have a NODE.
2023-08-29 17:30:00 +01:00
Wayne Stambaugh 1026596964 Allow symbols to be derived from other derived symbols.
[CHANGED] Symbols can now be derived from other derived symbols removing
          the requirement to derive from root symbols.
2023-08-24 07:59:32 -04:00
Jon Evans e118d2fca0 DbLib: Map multiple footprints to footprint filter list
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13587
2023-08-23 19:16:49 -04:00
Seth Hillbrand a6073ae566 Revert pns_log_file.cpp change to compile 2023-08-23 09:12:43 -07:00
Jeff Young 6166a96b8e Update PSN logger to new NET_HANDLE architecture. 2023-08-23 14:10:03 +01:00
Seth Hillbrand b9936b6d8a Fix fat-finged correction in c5f97421 2023-08-22 14:41:32 -07:00
Seth Hillbrand c5f9742153 Fix PNS QA compile 2023-08-22 14:10:14 -07:00
Jeff Young 76cd637895 Make the net identifier opaque to PNS router.
This also improves performance as we don't have to look up the
netcodes in a map.
2023-08-22 15:17:02 +00:00
Jeff Young 55a7b9e6bf More consistent naming.
(Also better differentiates the PCBEXPR_ classes from PCB_
objects.)
2023-08-21 15:26:33 +01:00
Jeff Young 3cade7fc47 Don't use string compare for A.NetClass == B.NetClass.
(or A.NetName == B.NetName, or != of either)
2023-08-21 15:26:33 +01:00
Jon Evans 0c529411d7 Update SHAPE_POLY_SET API to not hide virtual functions 2023-08-18 21:40:40 -04:00
Thomas Pointhuber c2a91caacf altium: verify that file contains "Compound File Binary Format" magic bytes, as we do not support the ASCII format 2023-08-18 14:47:08 +02:00
Jeff Young f2a8c25084 Update Eagle gold files for spoke angle fixes. 2023-08-16 23:21:18 +01:00
Alex Shvartzkop 918ada9b16 Fix CI build. 2023-08-15 06:55:32 +03:00
Roberto Fernandez Bautista dbfb7880b5 Add IO_MGR::FindPluginTypeFromBoardPath (+QA tests) 2023-08-15 05:26:12 +03:00
Roberto Fernandez Bautista 8d5ebf5e30 QA: Add dummy board files (should fail header checks) 2023-08-15 05:26:12 +03:00
Roberto Fernandez Bautista fb3e8ef8f1 QA: Add example P-CAD file
Supplied by evanshultz in gitlab issue 3993
2023-08-15 05:26:12 +03:00
Roberto Fernandez Bautista 0b0c50471a QA: Add example KiCad legacy PCB files
legacy_demos based on commit e4fdce4a47
2023-08-15 05:26:12 +03:00
Roberto Fernandez Bautista 1c95762534 QA: Add example EAGLE PCB file - Adafruit-AHT20-PCB
Source: https://github.com/adafruit/Adafruit-AHT20-PCB
2023-08-15 05:26:12 +03:00
Roberto Fernandez Bautista 87959a4625 QA: Add simple CADSTAR PCB file 2023-08-15 05:26:12 +03:00
Alex Shvartzkop a0d96cea9f Rename Save -> SaveBoard, Load -> LoadBoard in PLUGIN. 2023-08-15 05:26:12 +03:00
Marek Roszko 64a7bad56e Use fn_str with std file streams
This uses the MSVC-only wchar_t overload
2023-08-13 14:59:10 -04:00
Roberto Fernandez Bautista fd7781510e PNS Log Viewer: Add Open / Save as GUI functions 2023-08-09 22:21:14 +00:00
Roberto Fernandez Bautista 6ba250a4e6 PNS Log Viewer: Refactor loading/saving functions 2023-08-09 22:21:14 +00:00
Roberto Fernandez Bautista 54bcd1d5ca PNS Log Viewer: Fix crash on exit
m_board needs to be deleted before m_logFile
2023-08-08 23:33:46 +02:00
Jon Evans 93b7862615 PNS Log viewer: open project read-only 2023-08-07 18:31:05 -04:00
Marek Roszko 97fbbceae7 Fix pns_debug_tool build due to font metrics change 2023-08-06 16:51:29 -04:00
Jon Evans 103eb556f7 PNS: Make sure log viewer uses the actual design settings 2023-08-06 16:05:37 -04:00
Jon Evans 5cbe3c5d42 PNS: Fix a few issues with debug logging
Hide non-copper layers for clarity

Fix saving of router settings
2023-08-06 15:30:58 -04:00
Jeff Young 0413270012 ADDED: Move Corner To... and Move Midpoint To...
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5012
2023-08-05 16:43:55 +01:00
Jeff Young 1cbef0157d Avoid edge cases on very wide thermal spokes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15280
2023-08-04 15:38:06 +01:00
Jeff Young 9456fab435 Fix QA gold DRC counts.
Also improves the error message when some spokes are ignored because
they're connected to an isolated island.
2023-08-04 00:35:19 +01:00
Roberto Fernandez Bautista 44ff2f4858 Enable legacy .brd zone fill qa test + fix golden files
Use 0.020mm pen thickness for SVG golden file (generated with build 2013-07-07 BZR 4022)
2023-08-03 15:36:19 +02:00
Roberto Fernandez Bautista b8a7e378d8 QA: Fix utils.images_are_equal + add basic tests for qa utilities
Note: We allow differences of up to 2 pixel thickness due to erosion operation
2023-08-03 15:36:19 +02:00
Roberto Fernandez Bautista f00a68576e Add qa test for legacy (< v5) zone fills
Disable tests for .brd (legacy file format) fill for now.
2023-07-30 20:56:27 +02:00
Roberto Fernandez Bautista d5fc2b757d qa_cli: increase to 1200dpi + use 1 pixel erosion in comparisons to golden sample 2023-07-27 00:21:48 +02:00
Seth Hillbrand 96a34e5b57 Consolidate Maximum clearance calculation
We were calculating the same thing in three locations and we missed
adding the clearance from the footprints in, resulting in bad fills and
missed drc errors (see QA addition)
2023-07-26 12:55:48 -07:00
jean-pierre charras bd503647c6 Add fix in QA, missing in commit a16ab0aa 2023-07-25 11:05:02 +02:00
jean-pierre charras 9c5aa82d2c QA test: disable a DRC test that generate a wxWidgets exception,
and is useless in this QA test
2023-07-23 16:02:50 +02:00
jean-pierre charras a343cd0a24 Try to fix a QA issue (disable useless DRC tests for 2 boards) 2023-07-23 13:08:59 +02:00
Seth Hillbrand 2485e9a38a Update connectivity python test
Previous test depended on which track was first.  Re-saving the board
changed the track order, so there was no pad connected.  It was still in
the connectivity database, just not at the first track
2023-07-20 15:54:40 -07:00
Seth Hillbrand b827073b3f Update one more board to deal with changed default net clearance 2023-07-19 17:30:48 -07:00
Seth Hillbrand 45ed38a63b Update qa tests to use new zone fill algo 2023-07-19 16:13:49 -07:00
Marek Roszko c009328c07 Undo accidental commit from some time ago (woops) 2023-07-16 21:54:09 -04:00
Jeff Young ff044cd0cf Mostly a terminology update...
... but also makes DIALOG_SIM_COMMAND and SIMULATOR_REPORTER a bit
more simulator-agnostic.
2023-07-14 17:46:06 +01:00
John Beard 046d978ba7 ADDED: Pcbnew chamfer and extend tools
Using the new ITEM_MODIFICATION_ROUTINE system, drop in two new
tools: chamfer and line extend. These are two geometric operations
that are relatively common when editing footprints in particular.

Chamfer delegates the geometric calculations to a dedicated unit
in kimath/geometry.
2023-07-12 19:21:37 +01:00
Seth Hillbrand 998e749918 Move some DRC regression tests
The RegressionZoneFillTests handle issues that are resolved by the zone
filler, so Clipper2 problematic fill belongs there.  Otherwise, the
remaining tests should not refill the zones before running DRC because
we expect the DRC to catch errors without needing a refill
2023-07-07 11:52:25 -07:00
Seth Hillbrand 954b265839 Check for zone-zone overlap
Instead of just checking for the zone outline, we adjust to check the
full fill area of the zones for intersection and overlaps
2023-07-07 11:52:25 -07:00
Jeff Young bde9c2cbc5 ADDED FFT analyses.
CHANGED abandon the unpredictable behaviour of the Simulation Command
dialog.  You now separately add simulation tabs (which have invariant
command types once created), and the dialog edits the current tab.

Also a bunch of bug fixes to make multiple simulation plots actually
work.
2023-07-07 12:33:50 +01:00
Jeff Young d5d2800b03 Sort out terminology issues between vectors and plots. 2023-07-07 12:33:50 +01:00
Jeff Young 67c9d3932b Another attempt to fix qa error. 2023-07-03 16:26:20 +01:00
Jeff Young 84a3cdada6 Attempted fix for qa-failure on GTK. 2023-07-03 15:46:05 +01:00
Jeff Young 9ff33e5ec6 Remove BOARD_COMMIT( TOOL_MANAGER ).
It initializes both m_isFootprintEditor and m_isBoardEditor to false,
causing all sorts of trouble.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15072
2023-07-01 11:52:46 +01:00
Jeff Young dd83217062 Add DRC testing for copper graphic to zone fill collisions. 2023-06-30 14:04:20 +01:00
qu1ck ec94439df4 Footprints swig API: access shown text in fields 2023-06-29 20:36:27 +00:00
Jon Evans d4b7144448 Properties: expose symbol attributes
Flip polarity of exclude-from-BOM and -board for symbols
to match that of footprints and match the GUI display.
2023-06-24 22:03:06 -04:00
Ian McInerney 00885ab5b2 Fix mock implementation of NeighboringSegmentFilter
This was missed in 3c24ddd8cc.
2023-06-20 22:40:38 +01:00
Mike Williams a24c55affe PCB Fields: fix up python, API
Remove SetFields from both symbol and footprint, it doesn't handle
mandatory fields and is unlikely to ever be safe.
2023-06-20 18:34:52 +00:00
Mike Williams 85c633eb00 QA: PCB Fields bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams 85f889bc19 Fields: Description now mandatory
Propagate from symbols to footprints, footprints keep a library
description, too. (GetLibDescription())
2023-06-20 18:34:52 +00:00
Mike Williams 993bb84240 PCB_FIELD: bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams a859b25d2c PCB: convert footprints to use PCB_FIELDs for fields from schematics 2023-06-20 18:34:52 +00:00
Jeff Young ee567180d1 Give ngspice time to finish simulation in test suite. 2023-06-18 18:09:07 +01:00
Wayne Stambaugh 5a7f95e8da Allow for library symbols to derived from derived symbols.
This change allows for infinite inheritance depth so internally there is
no limit to deriving library symbols from other derived symbols.  Please
note that the Flatten() method now recurses until a symbol with no parent
is found.  The user interface is not hooked up at this time.
2023-06-13 15:52:42 -04:00
Seth Hillbrand 42933c1c12 Save difference file if error detected in QA image test 2023-06-12 16:14:36 -07:00
Seth Hillbrand cef4b72b89 Remove image-diff from QA
Re-enable tests for Ubuntu.

This implements a custom image diff function that checks for image
changes in plotted output.
2023-06-12 16:11:10 -07:00
Jeff Young 4ea41174c3 Variable names and minor performance fixes. 2023-06-05 21:26:37 +01:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
Seth Hillbrand 4bc0822733 Connectivity: Correct alias-based bus resolution
Aliases in bus resolution were being resolved without a path, making
them effectively global nets.  This applies the corrected path to the
bus members and adds a QA to catch this error
2023-06-02 14:25:51 -07:00
Tomasz Włostowski b22b0e5d03 qa: ignore duplicates in PNS regression test reference data 2023-05-31 17:07:13 +02:00
Tomasz Włostowski b1ae093fe6 qa: disable center view on zoom in the PNS debug tool 2023-05-31 17:06:41 +02:00
Tomasz Włostowski 6e0a52dd47 qa: fix crash on null PNS::ITEM::Parent() UUID access 2023-05-31 17:06:33 +02:00
Tomasz Wlostowski 5100345c6e router: prevent pushout/bogus collision of via with is own hole (or copper) when dragging
The root cause was not removing the original (pre-dragging) via from the world, comparing the ITEM::Parent() pointers of the items was only hiding the main issue.
This also fixes the PNSViaCollisions test in the qa/ suite.
2023-05-31 17:06:24 +02:00
jean-pierre charras 86abfd2cef Update a golden file in Eagle QA tests 2023-05-31 11:52:50 +02:00
Marek Roszko c31b5eb7d8 Fix errant typecast in VECTOR2<T>::Resize
This fails QA on Windows but not Linux
2023-05-29 19:34:40 -04:00
Marek Roszko 8b3f5de620 Add a simple testcase for VECTOR2I::Resize 2023-05-29 18:32:56 -04:00
Roberto Fernandez Bautista bb90aa24b7 Add basic QA test to CADSTAR PCB footprint import 2023-05-29 23:29:28 +02:00
Jon Evans fbe185b99b PNS debug tool: HiDPI and settings fixes 2023-05-25 21:53:38 -04:00
Marek Roszko ecbde8fc5f Disable the image diff test on ubuntu due to the restricted PPA builder 2023-05-16 21:44:26 -04:00
Marek Roszko 06b3edec53 Use pre-python 3.9 type hint in cli qa 2023-05-15 20:05:44 -04:00
Seth Hillbrand 6a0f64b5a4 Update golden QA images with fixed stroke font output
QA images were generated with v7 output location.  This needs to update
to use the v6 locations
2023-05-12 12:40:41 -07:00
Seth Hillbrand 6e4de18e15 Ensure _changed_ netlist is propagated
The propagation is currently (maybe not needed) limited to the global
name that is the source of the change.  We also need to propagate the
global name that is changed in case the global is set in a tree leaf and
not the root

Fixes https://gitlab.com/kicad/code/kicad/issues/14657
2023-05-09 12:13:06 -07:00
Jeff Young 8bd21edd8a Fix capitalization of text vars for Eagle importer.
Also fixes the test gold files to expect the correct variable
references.
2023-05-06 23:49:10 +01:00
Marek Roszko 82d4bfac75 Make attach paths relative and upload the output contents
Attach should be relative to CI_PROJECT_DIR
2023-05-05 23:17:12 -04:00
Marek Roszko caf09dc85e Disable compare in the cadstar netlist 2023-05-05 20:16:19 -04:00
Marek Roszko ca59360d9d Move pcbnewswig tests to pytest 2023-05-05 20:16:19 -04:00
Mark Roszko 112aa66be5 Changes to get cli testing in CI and other test fixes 2023-05-05 20:16:19 -04: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
Marek Roszko 2a222706df Start adding cli qa 2023-05-02 23:23:13 -04:00
Seth Hillbrand f7f52d77e4 Rework Copper Sliver check
Adds QA checks to copper sliver tests.  Adds the following checks:
- Dot product between two arms (quickly avoids checks for >90°)
- Checks the sliver is convex (area test)
- Eliminates minor slivers with angles that are approximately 0 and ones
  with the opposite side width beneath a configurable level
- Updates Clipper2 to fix a couple of jagged edges on inflate
- Adds simplify during zone fill inflation to limit jaggies

Fixes https://gitlab.com/kicad/code/kicad/issues/14549
2023-04-25 10:32:46 -07:00
Mark Roszko 50b916cb73 Fix paths in the python tests
Can't actually test on Windows without making that a setup adventure
2023-04-25 12:29:47 +00:00
Marek Roszko e45b6c441a Fix pcbnewswig test run 2023-04-25 07:30:51 -04:00
Marek Roszko 8d4db2edf5 Move tests around 2023-04-24 22:09:36 -04:00
Marek Roszko 47fa5a29cd the ibis folder is really a tool 2023-04-24 19:25:58 -04:00
Jeff Young 69500bfcaa LTSpice schematic import based on the work of Chetan Shinde. 2023-04-24 13:52:52 +01:00
Marek Roszko ea077bc34d Banish ignore.h to core 2023-04-18 22:44:04 -04:00
Seth Hillbrand 32d17547e5 Fixup settings loading
Settings loading needs to account for potential chaining, so each
instance should be created before being Load()ed.  Additionally, add the
settings loading to QA
2023-04-18 16:00:31 -07:00
Nimish Telang 51e55dd750 Convert sprintf to snprintf in most files 2023-04-17 15:39:34 +00:00
Ian McInerney 2b22ff9f39 Add missing include
The implicit includes have changed in wx 3.3, so this is no longer being
included in the file, so include it explicetly to et
wxMessageOutputStderr.
2023-04-12 18:57:12 +01:00
Ian McInerney 5d0b5e16ff Remove python-based board_item duplicate method
This method shadows the C++ method, and doesn't properly handle updating
the duplicated object's KIID to be unique.

Also add tests to ensure the KIIDs are unique after duplication.

Fixes https://gitlab.com/kicad/code/kicad/issues/14460
2023-04-12 16:05:56 +01:00
Jeff Young 2f198bdcb2 Further simplify PNS::ITEM::collideSimple().
Also brings text_pns_basic's mocks into line with their "real"
counterparts.
2023-04-11 15:51:00 +01:00
Jeff Young 6f0d963683 Add PNS::ITEM::BoardItem() call.
About 1/3 of callers to Parent() don't care if they get the immediate
parent or not, about 1/3 want only the immediate parent, and about 1/3
want the hole parent's Parent().

I had earlier changed PNS::ITEM::HOLE to override Parent() and return
the hole parent's Parent(), but since the callers are pretty evenly
split I've reverted that and added BoardItem() for callers who want the
eventual BOARD_ITEM (whether a direct parent or a grandparent).

(Also removes a dead routine so I didn't have to figure out which of
the two it wanted....)
2023-04-11 15:51:00 +01:00
Tomasz Wlostowski 1532a83330 router: hole as first-class-object, initial version of rewritten collision check routine
Rebased and modified by Jeff Young <jeff@rokeby.ie> 6 April 2023
2023-04-11 15:51:00 +01:00
Tomasz Wlostowski d961cdce3f router: further changes to the ownership model
- LINEs now own their vias optionally (depending whether a LINE with its VIA belongs to a node)
- get rid of unique_ptr on the internal NODE::Add API (and also made it private)
- make sure stack pointers are not added to the node
- use rvalue reference for NODE::Add/NODE::Replace

Manually rebased by Jeff Young <jeff@rokeby.ie> 5 April 2023
2023-04-11 15:51:00 +01:00
Tomasz Wlostowski bfbda978b8 router: hole as first class objects, wip
Rebased by Jeff Young <jeff@rokeby.ie> 5 April 2023

(Also includes a bug-fix for highlighting collisions with edge-cut
items.)
2023-04-11 15:51:00 +01:00
Seth Hillbrand 012737593b Handle nested netclass assignments
Netclass directives should not be overriden, instead hold our error
checking for actually missing nets

Fixes https://gitlab.com/kicad/code/kicad/issues/14494
2023-04-06 17:38:13 -07:00
Ian McInerney ea62b145ff Introduce core interface library
This library is meant to move non-EDA items (language extensions,
library extensions, etc.) into the lowest-level of our dependency chain.
This library should never depend on anyother non-thirdparty code in the
kicad codebase.
2023-04-06 15:01:18 +01:00
Seth Hillbrand 16b4ec3c7e Allow bus elements to connect
Previously, bus elements that were not instantiated as individual nets
could not connect to each other.  This caused issues for complex
schematics where busses needed to connect to other busses with elements
that resolved to the same net names.  Functionally, this means mixing
bus elements, which we will replace with first-class elements in version
8 but currently can only be accomplished either by using bus aliases and
  this patch or by individually instantiating each bus element as a
local label

Fixes https://gitlab.com/kicad/code/kicad/issues/14300
2023-04-04 15:23:29 -07:00
Wayne Stambaugh c3e6825d62 Add hashing to and unit tests for some low level objects. 2023-04-04 15:28:34 -04:00
Ian McInerney 27e2e820cb Split spice tests into separate test 2023-04-03 14:42:10 +01:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Wayne Stambaugh 28776f5745 Text attributes object improvements.
* Add compare method to COLOR4D object.
* Add unit test to validate COLOR4D comparison method.
* Add missing color test in text attribute comparison method.
* Add unit test for text attribute object.
* Remove unnecessary headers from text attribute header.
* Move text attribute code into separate source file.
2023-03-29 12:53:45 -04:00
jean-pierre charras 0e82b79a8f QA test: disable Silk clearance test in solder mask bridge QA test.
the Silk clearance test has nothing to do with a solder mask bridge QA test
2023-03-27 12:04:03 +02:00
Jeff Young 30b3645e60 Add regression test for 14412. 2023-03-25 16:13:45 +00:00
Jeff Young 35ca3e7264 Add regression test for 13988. 2023-03-25 12:45:36 +00:00
Jeff Young e65a58b823 Add regression test for 14334. 2023-03-25 12:45:36 +00:00
Seth Hillbrand 0984599624 Pins are case-sensitive
Cleanup should remove mis-matched cases

Fixes https://gitlab.com/kicad/code/kicad/issues/14415
2023-03-24 11:21:35 -07:00
Wayne Stambaugh 244c37298f Fix Doxygen commenting issues. 2023-03-24 11:57:52 -04:00
Wayne Stambaugh a0d02fbab1 Make multivector.h header order independent.
Attempt to clean up all redundant headers that multivector.h touches.
2023-03-23 13:26:32 -04:00
Seth Hillbrand 8150deec32 Add QA test for Clipper2 fill 2023-03-22 15:24:46 -07:00
Seth Hillbrand 914b5a4d21 Simplify test for substantial nubs
Substantial elements following a divot should be at least as far in each
cardinal direction from the origin point in order to be considered
substantial.  This catches cases where the "substantial" element is
actually a straight segment away from the divot

Fixes https://gitlab.com/kicad/code/kicad/issues/14130
2023-03-22 13:01:50 -07:00
Jeff Young 5bda3b99f9 Handle single-token flag parameters.
Also fixes a bug where all VDMOS instance parameters weren't marked as
instance parameters.

Also fixes a bug where VDMOS thermal models weren't supported (they
have two extra pins: Tj and Tcase).
2023-03-22 13:52:17 +00:00
Ian McInerney aa11f78bbc Link ngspice with the QA tests that need it
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12491
2023-03-20 16:54:32 +00:00
Ian McInerney 016c958021 Always build spice simulator support
The simulator has advanced considerably, and it is seeing lots of active
development, so make it a required part of KiCad. Additionally, the
build without the simulator has actually been broken for a while, so no
one clearly is building without ngspice right now.
2023-03-20 16:54:32 +00:00
Roberto Fernandez Bautista f97beb15b8 QA: std::optional testing + re-enable cadstar parts parser qa test 2023-03-19 15:28:13 +01:00
Roberto Fernandez Bautista 4bbd9731a1 Disable cadstar parts parser qa test for now 2023-03-16 23:03:54 +01:00
Roberto Fernandez Bautista a05333541c Try to fix cadstar build #3: add operator<< for std::optional 2023-03-16 22:44:29 +01:00
Roberto Fernandez Bautista 59d88e1871 CADSTAR Parts: Add parsing of hierarchy tree 2023-03-16 21:07:07 +01:00
Roberto Fernandez Bautista b70fe88145 CADSTAR Parts: Fix parsing of hidden pins (possible for several pins per net!) 2023-03-16 21:07:07 +01:00
Roberto Fernandez Bautista 6ab2112135 ADDED: CADSTAR Parts Libraries (.lib) 2023-03-16 21:07:07 +01:00
Roberto Fernandez Bautista f45ab30fa6 Add parsing for symbols and pins (Parser now complete) 2023-03-16 21:07:05 +01:00
Roberto Fernandez Bautista 379e3b2fbb Add CADSTAR Parts Library (.lib) parser and qa tests 2023-03-16 21:07:04 +01:00
Ian McInerney 3d7a463cb8 Remove last few occurances of Boost::system 2023-03-11 14:21:07 +00:00
Jeff Young 6eb73133f0 Fix qa gold value. 2023-03-11 14:17:03 +00:00
Ian McInerney 8f2a453d07 Remove explicit Boost::system dependency from our cmake
Boost::system is only used transitively by the other Boost libraries, so
their CMake will include it when it is needed.
2023-03-11 13:29:58 +00:00
Ian McInerney e20b33cb66 Fix boost dependencies
* Add Boost::locale explicetly to the CMake since nanoodbc requires it
* Don't let nanoodbc add all Boost libraries to the link line, since it
  is used in common, and it was pulling the unit test framework into
  common then.
2023-03-11 13:29:45 +00:00
jean-pierre charras 4737e3b8a7 QA tests: link unit_test_framework library only with QA tests.
It fixes a link issue on W10/msys2 when building some .exe files
not related to QA tests, but have the unit_test_framework library linked
without this change..
2023-03-11 10:28:06 +01:00
Ian McInerney a6ebd60c3b CMake: Modernize Boost import to use imported targets 2023-03-10 16:38:35 +00:00
Ian McInerney d3ae535885 cmake: Fix ordering issue in include directive 2023-03-10 16:38:35 +00:00
Ian McInerney c9eefa7ad7 Replace boost::filesystem with std::filesystem
Our minimum C++ version is C++17, which has std::filesystem, so ditch
the boost dependency and use the standard library instead. (this only
affects temp file creation in the QA suite anyway).
2023-03-10 16:38:35 +00:00
Jeff Young 2d6ab62da4 ADDED: schematic/library diff for symbols. 2023-03-09 18:04:52 +00:00
jean-pierre charras e4ec74e1ac Fix link issue for qa_utils on MINGW/msys2
For some obscure reason, using Boost_UNIT_TEST_FRAMEWORK_LIBRARY as library
name to link does not work. So use the actual filename.
2023-03-08 17:47:50 +01:00
Mike Williams 671f555bc8 CMake: add flag to turn off spice QA tests (tests default to on) 2023-03-07 12:05:01 -05:00
Seth Hillbrand 7653a2bf99 Smarten connection width checker looking for splits
Fractured polygons are always fractured along the x-axis, so when
checking to see if a segment is a fracture point, we check if the y
coordinate is equal.  This avoids situations where there are multiple
fracture points between two inflection points

Additionally, we add a second check to ensure we don't hit spurious
blobs (all kinks should be symmetric and therefore be substantial in
each direction)

Fixes https://gitlab.com/kicad/code/kicad/issues/14130
2023-03-06 16:14:34 -08:00
Jeff Young d96598c87c Add 12505 to the regression test suite.
Fixes https://gitlab.com/kicad/code/kicad/issues/12505
2023-03-06 10:26:59 +00:00
Wayne Stambaugh 4e99812145 Coverity fixes and code cleaning. 2023-03-04 13:02:05 -05:00
Seth Hillbrand bce402a01c Revert font spacing/tabs to the v6 model
While convoluted, this model matches as best we have found so far, the
alignment with scintilla.  The spacing is character size for N-1 of the
characters in the 4-space tab stops.  The final character is sized for
the actual space character in the stroke font (0.761905)

Fixes https://gitlab.com/kicad/code/kicad/issues/13791
2023-02-24 17:15:57 -08:00
JamesJCode 9dca70a773 Eeschema netlist output: Propagate NC across hierarchical schematics
Fixes #12580

Additionally does not export no_connect netlist annotation on pins
which are both connected to another pin and a NC item, unless all
connected pins are stacked at the symbol level.

Adds testing of pin types to netlist QA unit tests.
2023-02-25 00:02:46 +00:00
Mike Williams 959a19a461 Power Symbols: automatically fix mismatched legacy symbols, add tests
Has netlist generation test for legacy power symbols, and test for
fixing legacy mismatched power symbol text fields and invisible pin names.
2023-02-22 18:01:47 +00:00
Mike Williams 5995e0e516 Power Symbols: make value editable, use as netname
QA: update tests for editable power symbol values
2023-02-22 18:01:47 +00:00
Mike Williams ca5004b1d2 Power Symbols: rename IsPowerConnection to IsGlobalPower
It's kind of confusing because we have power type pins, and pins that
make global power nets as part of power symbols.
2023-02-22 18:01:47 +00:00
Jeff Young 68fe146861 Remove most of SIM_VALUE in favour of good old wxString.
This allows us to save the user's intent, including units, formatting,
and crucially variable references.
2023-02-22 10:45:27 +00:00
Ian McInerney be19e967dc Remove WX_COMPATIBILITY flag
Some classes had been originally designed to be usable separate from wx,
but over time our uses of the classes have become entertwined with wx
features (e.g. colors), and various changes have also leaked wx into the
classes unguarded. So just remove the option to hide wx in those classes
to simplify the code.
2023-02-22 01:44:06 +00:00
Ian McInerney bcb93e9aa7 Modernize setting of compiler definitions in CMake
add_compile_definitions was added in 3.12, and our minimum is now
greater than that.
2023-02-22 01:44:06 +00:00
Fabien Corona 2a3b70b7eb sim - Remember the option to save powers
Fixes #13978
2023-02-20 19:30:45 +01:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
jean-pierre charras 07f79208b9 Minor fixes: Coverity and compil minor warnings. 2023-02-18 13:04:43 +01:00
jean-pierre charras 05b68413f7 Fix a QA test for bitmaps, to work with latest changes in bitmap code. 2023-02-15 14:37:01 +01:00
Jeff Young 5c45b53f88 Rollback testing changes that were accidentally checked in. 2023-02-11 21:11:07 +00:00
Jeff Young bc108023b3 ADDED operating point overlay for SCH_EDIT_FRAME.
Fixes https://gitlab.com/kicad/code/kicad/issues/11253
2023-02-11 21:11:07 +00:00
Jeff Young 2a5bb71fbd ADDED operating point text variables for labels and symbols.
ADDED formatting for cursors and operationg points

Also fixes a bunch of bugs to make the new cursors work with .ac sims.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/6965
2023-02-11 21:11:07 +00:00
Jeff Young 09822c7f18 ADDED direct access to signals & cursors.
ADDED differential cursors.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/6221
2023-02-11 21:11:07 +00:00
Jon Evans e066454c61 Zones: use metric defaults and limits instead of mixed units
Update testcases to reflect new defaults
2023-02-11 07:39:29 -05:00
Jeff Young 8b03c093f9 Move potentiometer pin model to r0, wiper, r1, and remove flipping code.
Fixes https://gitlab.com/kicad/code/kicad/issues/13741
2023-02-02 16:22:13 +00:00
Jeff Young 9ca539b416 Remove TL072.031 from regression test. 2023-01-31 14:57:52 +00:00
Jeff Young c939b1ef76 Followed-by-3-digits doesn't guarantee a thousands separator.
Fixes https://gitlab.com/kicad/code/kicad/issues/13708
2023-01-30 21:22:48 +00:00
Roberto Fernandez Bautista 963e82ee7f CADSTAR PCB: Correctly handle anticlockwise arcs
Also add some qa tests for EDA_SHAPE::SetAngleAndEnd

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13626
2023-01-30 19:56:22 +00:00
Roberto Fernandez Bautista 0ecad1ef2e Add EDA_ANGLE::NormalizeNegative() and qa tests 2023-01-30 19:56:22 +00:00
Jon Evans 5beb79bbdc Disable spice directives test for now 2023-01-29 12:15:04 -05:00
Jon Evans 675b6b5d5c Fix logic error in ec4d377d
Also fixup goldens for importers for new default island mode
2023-01-27 10:16:56 -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
JamesJCode 24fd659bce Eeschema: QA schematic loader now traverses hierarchical sheets
(Assumes all nested schematics are in the same directory as the root schematic)
2023-01-24 14:11:01 +00:00
Seth Hillbrand 9861ed1a5f Don't special case power symbol re-annotation
When the designer asks to reset annotations, we reset all annotations
including power symbols.  This may create additional churn in the files
but only when requested and is useful to fix schematic errors

Fixes https://gitlab.com/kicad/code/kicad/issues/13138
2023-01-23 13:19:01 -08:00
jean-pierre charras f6d9a2574b Fix a QA simulation test on W1/msys2:
- Gives a bigger relative tolerance when comparing 2 values to pass some tests
- Fix error in test_sim_regressions.cpp for 3 TestNetlist() calls
2023-01-22 16:52:11 +01:00
Jeff Young 232e4d34f1 Use default error limits. They're already relative to the value. 2023-01-22 14:35:27 +00:00
Jeff Young 241dc0d96b Add SPICE regression test. 2023-01-21 19:32:25 +00:00
Jeff Young 259e382041 Add simulation regression test for legacy fixups. 2023-01-21 19:32:25 +00:00
Jeff Young e218c7109b Test case for immediate SBCKT models. 2023-01-21 19:32:25 +00:00
Jeff Young 6053b86a24 Add new spice regression test for windows path separators. 2023-01-21 19:32:25 +00:00
Marek Roszko b2421c7d9f Fix tiny bug in double 2 string formatting
- I forgot to handle the trailing dots when I added the fmt variant
- UIDouble2Str (the original) lacked the comma check
- Add unit test lol
2023-01-21 13:54:52 -05:00
Seth Hillbrand 6fa2eedb4b Avoid the obsolete GetNextPin() call
This iterated over all pins to find the pin after a given item.  Because
out pattern is consistently to iterate in the outer loop, this means
that we were an O(n^2) loop for the pins just to find their names.  This
affected very large parts (e.g. FPGAs) when switching sheets to display
2023-01-20 14:12:15 -08:00
Marek Roszko 358a05a2c8 msvc warning fix 2023-01-16 22:44:19 -05:00
jean-pierre charras 167e430fd9 Fix a compil issue in mocks.cpp. 2023-01-16 20:04:03 +01:00
Roberto Fernandez Bautista 355e817302 Move DefaultTransform definition to transform.cpp, so it can be shared 2023-01-15 19:17:51 +01:00
Roberto Fernandez Bautista d063eb431b Move FixupJunctions to SCHEMATIC 2023-01-15 19:17:50 +01:00
Tomasz Wlostowski 7da98a447a qa: enable tool framework for the P&S debug tool 2023-01-12 23:37:07 +01:00
Tomasz Wlostowski dd1a780d1f qa: follow up router API changes in the PNS log player/regression test tool 2023-01-12 23:37:07 +01:00
Seth Hillbrand 1c90eeaa5a Fix missing parameter in CADSTAR test 2023-01-10 16:48:07 -08:00
Roberto Fernandez Bautista ee6e86d1db Add conversion from CADSTAR SHAPE to SHAPE_POLY_SET 2023-01-10 22:28:01 +01:00
jean-pierre charras 31202a2eb3 Fix a compil issue in QA tests 2023-01-09 19:44:04 +01:00
Jeff Young e9a21130a8 Add a few more MARKUP_PARSER test cases. 2023-01-08 23:33:36 +00:00
Roberto Fernandez Bautista e7e151c46c MARKUP_PARSER grammar should match everything, even incomplete markup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13438
2023-01-09 00:17:11 +01:00
Marek Roszko 570fa246ae Fix typo in matrix3 multiply, add unit tests 2023-01-05 21:06:52 -05:00
Seth Hillbrand fc86998bf6 Ensure duplicate pin names get unique nets
Same pin name != same net name unless the pins are explicitly connected

Also add pin number to all unconnected pads ensuring they have unique
nets

Fixes https://gitlab.com/kicad/code/kicad/issues/13236
2023-01-04 11:32:15 -08: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
Tomasz Wlostowski 7d40bbdf38 router: mark the head trace (as opposed to the 'fixed tail') with fully saturated color
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11386
2022-12-29 17:54:59 +01:00
Jeff Young 6940333f40 Update test cases for unknown-variable = error. 2022-12-27 20:14:13 +00:00
jean-pierre charras 438c4b58a3 Try to fix a QA issue probably due to the order some Ctors are called.
This is not the first time an issue is created by the order of ctors.
2022-12-27 19:56:04 +01:00
Wayne Stambaugh 78e2f0fd4d Sheet instance handling improvements. 2022-12-26 08:30:03 -05:00
Jon Evans b85fab9ab6 Support DXF ellipses and elliptical arcs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12563
2022-12-24 22:46:07 -05:00
Jeff Young 7abfa46531 Inferred sim value improvements, and a unit test for them. 2022-12-21 17:03:49 +00:00
Jeff Young a3a2e2e5b1 Update demos and legacy qa files SpiceMapping -> Spice_Node_Sequence.
Also removes migration in the code as it will no longer be needed.
2022-12-19 12:04:53 +00:00
Jeff Young 50ccc4e6da Fix issue converting legacy SPICE models.
1) if a legacy model references a library then we need to see if said
   libraray exists and read model from it if so
2) legacy node ordering is by index, not pin name
3) we can't auto-generate a pin map when we don't know the pin names,
   so don't try
2022-12-14 13:36:28 +00:00
Seth Hillbrand ba11de6e66 Update QA test schematics with valid and invalid variants 2022-12-09 02:14:05 +00:00
Barabas Raffai 63da407345 Add tests for no connect flag 2022-12-09 02:14:05 +00:00
Jeff Young cfbf14ebfd Attempt to fix build issue with NGSPICE off. 2022-12-08 23:57:42 +00:00
Jeff Young ce8fa2ad00 Move previous fix to subclass (which overrides the base class). 2022-12-07 17:13:19 +00:00
Jeff Young 5aa204e194 Another attempted sim testcases fix. 2022-12-07 15:07:25 +00:00
Jeff Young b9287968d6 Update symbol default prefixes after updating instance data.
Also moves the sim model fixups after the instance data updating as
it uses the prefixes.
2022-12-07 01:34:56 +00:00
Jeff Young 69448afb47 Don't run simulation twice when the sim command is overridden.
Fixes https://gitlab.com/kicad/code/kicad/issues/12731
2022-12-07 01:34:56 +00:00
Jeff Young 38906397d2 Move V6->V7 sim model migration from sheets to screens.
Also moves passive RLC inference out from migration to just-in-time
creation for the simulator or netlisting.

Also fixes a version guard mismatch because the spice migration was
done inside UpdateSymbolInstances (which has its own version guard).

Also changed UpdateSymbolInstances to UpdateSymbolInstanceData so
someone else in the future doesn't think it's a general-purpose symbol
instance updater.
2022-12-06 16:01:18 +00:00
Jeff Young 8260f0ee13 Add support for unitless values to PCB_EXPR_EVALUATOR.
Fixes https://gitlab.com/kicad/code/kicad/issues/13016
2022-11-29 14:24:20 +00:00
Mikolaj Wielgus 9055043409 Sim QA: Test for duplicates and wrongly deduplicated parameters
(adapt tests to the names of the newly deduplicated parameters)
2022-11-29 15:04:38 +01:00
Mikolaj Wielgus b025b103de Sim Model Editor: Make the VBIC model the first BJT model to select 2022-11-29 10:13:20 +01:00
Mikolaj Wielgus 484620eeb5 Sim QA: Add test for VDMOS 2022-11-29 09:48:01 +01:00
Mikolaj Wielgus 5fb191e4d6 Sim QA: Test all BJT parameters in each model 2022-11-28 09:49:48 +01:00
Mikolaj Wielgus 26644952a4 Sim QA: Test all diode parameters 2022-11-28 08:01:50 +01:00
Mikolaj Wielgus d836fbaaaa Sim: Add VBIC model support
Update generate_sim_model_ngspice_data.bash a little, but it's still
outdated.
2022-11-28 04:45:36 +01:00
Mikolaj Wielgus f2fb734e06 Sim QA: Add test for Numparam expressions inside .subckt 2022-11-27 06:32:17 +01:00
Mikolaj Wielgus 08d37d2795 Sim QA: Add Spice .subckt parsing tests 2022-11-26 10:24:11 +01:00
Mikolaj Wielgus 9766351ee6 Sim: Update QA to tests to match the new model upgrade scheme 2022-11-25 05:38:21 +01:00
Jeff Young 0b0c35c4dc Adjust test result. 2022-11-23 21:37:50 +00:00
Wayne Stambaugh cd92088b7a Fix disabled schematic page numbering unit tests. 2022-11-23 08:05:35 -05:00
Wayne Stambaugh d37015bada Temporarily disable unit tests so builds pass. 2022-11-22 19:08:08 -05:00
Mikolaj Wielgus 833146cf50 Sim QA: Fix QA errors
Let's not allow units in fields for now. (is 1m one meter or one milli?)
2022-11-22 21:18:01 +01:00
Jeff Young 729e64f33a Add call modification missed from previous commit. 2022-11-22 17:25:09 +00:00
Mikolaj Wielgus e9fe59a28c Sim: Rename the missed Sim_* fields to Sim.* 2022-11-21 03:33:11 +01:00
Mikolaj Wielgus 6969362813 Sim Model Editor: Don't provide library-only models as builtins 2022-11-20 22:07:39 +01:00
Fabien Corona 8498630876 Ibis: correctly load QA files up to v2.1 2022-11-20 19:10:46 +00:00
Mikolaj Wielgus 059ca8fc48 Sim: Rename Sim_* fields to Sim.* 2022-11-20 03:37:54 +01:00
Jeff Young e09e521162 Remove GUI calls from netlisting. 2022-11-18 15:29:16 +00:00
Tomasz Wlostowski cab5f65685 qa/pns: added test case for via drag walkaround 2022-11-18 15:14:34 +01:00
Tomasz Wlostowski bf4671aa16 qa: PNS debug tool should draw COMPOUND shapes too... 2022-11-18 15:14:34 +01:00
Mikolaj Wielgus e7c43ca20a Sim: Remove inference from Reference and Value 2022-11-18 08:39:15 +01:00
Jeff Young a61ac363c2 Excise the remaining occurrences of "Alias" for derived symbols.
Fixes https://gitlab.com/kicad/code/kicad/issues/12895
2022-11-16 18:37:40 +00:00
Tomasz Wlostowski 33594e92fa router: qa test case for backspace (unfix) regression 2022-11-15 23:05:53 +01:00
Tomasz Wlostowski 26a38797c7 router: log and replay the 'unfix' events too 2022-11-15 23:05:53 +01:00
Marek Roszko 3dd2ae762d Refactor step export to use our normal board processing routines 2022-11-12 21:27:10 -05:00
Jeff Young 9d525e82f5 Fix qa tests so they don't assert on cleanup. 2022-11-11 20:31:39 +00:00
Jon Evans c07477b94c Move to explicit symbol properties mapping
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12845
2022-11-08 22:19:08 -05:00
jean-pierre charras 97a002e06c fix previous commit for QA stuff (missing changes) 2022-11-08 12:33:24 +01:00
Jon Evans 68de92313e Properties: move to custom editor for distances; refactoring
Also fix display of angle values since EDA_ANGLE was introduced

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12290
2022-11-06 11:40:45 -05:00
Bevan Weiss 4f634d7df7 Updated accelerating zoom controller to use default (non-accelerated)
zoom if changing direction.

Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
2022-11-04 16:28:32 +00:00
Seth Hillbrand 07ef5d3343 Clarify QA message 2022-11-01 13:08:09 -07:00
Tomasz Wlostowski ab350cbfaa qa: some trivial test cases for the P&S regressions 2022-10-31 11:49:31 +01:00
Tomasz Wlostowski 50142ca73f qa: P&S regression tool ported to Boost::test 2022-10-31 11:49:31 +01:00