Commit Graph

5742 Commits

Author SHA1 Message Date
Jeff Young b15913bd53 Support env variables in spice library paths.
Also removes a bunch of std::string stuff from the file handling in the
simulator.  All our file handling, env variable expansion, project path,
etc. stuff is wxString based, and jumping through std::string in between
just makes it more complex and increases the potential bug surface.

Also fixes a bug where you'd get two error messages when a spice model
library wasn't found.

Also fixes a bug where you'd get a spice model library not found error
when the text field was empty.

Also fixes a bug where we'd try to absolutize a path starting with an
unresolved text or environment variable.  If the path starts with a
variable it's probably absolute, and tacking on the project path in the
error message just obfuscates things.

Fixes https://gitlab.com/kicad/code/kicad/issues/13082
2022-12-07 15:07:25 +00:00
Marek Roszko c0b5fe58c3 Implement output targeting of symlib/fplib upgrade per request 2022-12-06 21:20:27 -05:00
Jon Evans ad8e5891d2 Properties: update evaluator locale when creating editors 2022-12-06 17:56:33 -05:00
Seth Hillbrand 77b763f8ba Change binding with units 2022-12-05 15:34:23 -08:00
Jeff Young c771d866f5 Cleanup 3D caches before d'tors run.
Fixes https://gitlab.com/kicad/code/kicad/issues/10973
2022-12-05 22:39:09 +00:00
Seth Hillbrand 6f43915b25 Don't keep a stale iu reference around
The IU memory areas are const but we need to be able to update this when
the frame changes, so use pointers instead
2022-12-05 13:33:45 -08:00
Alex 6d513e7ecf Expose changing arc edit mode in arc button context menu and Preferences
Ctrl+Space can still be used to cycle through modes.

Fixes https://gitlab.com/kicad/code/kicad/issues/5412
2022-12-05 21:28:16 +03:00
Jeff Young b7d41e0e56 Update simulator with NUMERIC_EVAL, decimal separator processing, etc.
Also includes fixes for instance data and resolving of textvar
references.

Also includes virtual d'tors for IBIS parser to get rid of all the
compile warnings on CLang.

Fixes https://gitlab.com/kicad/code/kicad/issues/12357
2022-12-05 12:40:29 +00:00
Seth Hillbrand 54dd494ff2 Remove frame dependency from UNIT_BINDER
Place the frame information into the event data instead of keeping a
pointer (potentially invalid) into the frame
2022-12-04 16:50:27 -08:00
Jon Evans a8cb0ee116 Properties: Use insertion order as display order 2022-12-04 17:20:34 -05:00
Jeff Young f805fd267f Divorce UNIT_BINDER from wxFrame.
This allows us to supply Pcbnew or Eeschema as the unitsProvider when
called from the main frame.

Fixes https://gitlab.com/kicad/code/kicad/issues/13066
2022-12-04 11:51:44 +00:00
Jeff Young 96819f6c01 Better cache invalidation for text objects with references.
Fixes https://gitlab.com/kicad/code/kicad/issues/13059
2022-12-04 11:51:44 +00:00
jean-pierre charras 342780bfb5 gl_utils.h: fix compatibility with gcc/msys2 and wxWidgets version < 3.1.6 2022-12-04 08:35:28 +01:00
Seth Hillbrand 92266635cc Add an advanced config value for the minimum sliver
The hard coded value was too small for certain calculations.  Better to
have a configurable value that is initially set to our error level to
allow for deviations that don't meet the visibility test for spikes.
These have become more apparent with Clipper2
2022-12-03 16:03:43 -08:00
Alex 7d2f83ea29 opengl: Don't attempt to use adaptive swap interval on old AMD drivers. 2022-12-04 01:11:50 +03:00
Jon Evans 70f9d8cab9 Properties: Add text orientation 2022-12-02 21:33:21 -05:00
Jon Evans 2091aaba2f Properties: Move angles to UNIT_BINDER
Also add support for unicode degree sign in evaluator
2022-12-02 21:25:42 -05:00
Jon Evans 5e352d2a66 Properties: improve handling of unit binders 2022-12-02 19:37:44 -05:00
Alex 199e25f3f3 opengl: Add more checks and debugging info to SetSwapInterval. 2022-12-03 00:06:34 +03:00
Jon Evans ef3f2a8f1e Properties: ignore shape props for textbox 2022-12-01 21:54:12 -05:00
Jon Evans 307063b9f2 Properties: work around wxVariant / wxAny compatibility issues 2022-12-01 17:45:50 -05:00
Alex 55a3946af8 Properties: Use a constant variable for PG_UNIT_EDITOR editor name. 2022-11-30 20:10:22 +03:00
Jeff Young 19eab62516 More safety around ratsnest state.
Fixes https://gitlab.com/kicad/code/kicad/issues/13011
2022-11-30 13:00:21 +00:00
Jon Evans 458935bb5a Properties: Set flag to prevent clobbering layer color swatch
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13020
2022-11-29 18:37:29 -05:00
Jeff Young 31eb91e9e5 Infobar for slow zone auto-refill. 2022-11-29 21:09:16 +00:00
Seth Hillbrand 4039b7da6b Remember to clear pointers when clearing backing data
The snap is a point to the anchors that we compute.  This needs to be
removed when we clear the vector

Fixes https://gitlab.com/kicad/code/kicad/issues/13037
2022-11-29 09:46:06 -08:00
Seth Hillbrand 5fc5a2132b Fix Properties panel to reference the correct frame
The properties editors are global but the frame that they reference is
not static, so we need to be able to update the frame reference when
restarting pcb editor from the main window.  This updates the frame,
being careful to remove the signalling when closing pcbnew but keeping
the instance of the editor in place.

Fixes https://gitlab.com/kicad/code/kicad/issues/12297
2022-11-29 09:24:41 -08:00
Seth Hillbrand 4f6b853756 Don't use modifiers when moving with keyboard
The modifier keys on the keyboard control the motion spacing (Ctrl) and
shouldn't be confused with the modifier key used to disable grid
snapping when moving with the mouse (also Ctrl)

Fixes https://gitlab.com/kicad/code/kicad/issues/13027
2022-11-28 11:05:12 -08:00
Seth Hillbrand 259e41be2d Don't add non-groupable items to the group
Things like markers and netinfo should never get added to the group,
even if we are inside the group while adding the items

Fixes https://gitlab.com/kicad/code/kicad/issues/13026
2022-11-28 09:11:20 -08:00
Jon Evans b2b3f5752f Properties: Add grouping and sorting by creation order 2022-11-27 22:40:23 -05:00
Jeff Young ec9c6a8053 Separate creation of polygons for open and closed shapes.
This allows us to create a bounding hull from an open shape-line-chain,
which is useful for defining milled slots.
2022-11-27 18:29:41 +00:00
Jeff Young 387f1214f0 Add some heuristics to guess a better font overbar offset.
Fixes https://gitlab.com/kicad/code/kicad/issues/13010
2022-11-26 17:26:20 +00:00
Jon Evans 96fe93618e Properties: Stop sorting by name
It's more useful to have properties shown in add order,
since we can group them
2022-11-25 16:29:56 -05:00
Jon Evans 611c19016f Properties: add support for string escaping
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12975
2022-11-25 13:15:46 -05:00
Jon Evans 5061f0556f Properties: implement ellipsization for name column 2022-11-25 12:37:47 -05:00
Jon Evans 396db7794d Properties: add friendly names to shapes 2022-11-25 12:37:47 -05:00
Jon Evans 220ef6fb44 Properties: Add some missing footprint properties; cleanup
Add concept of "internal" properties that will be accessible from
Python/DRC but not shown in the Properties Manager
2022-11-25 12:37:47 -05:00
Jon Evans 4285b38b74 Properties: Handle units changes correctly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12885
2022-11-24 17:15:07 -05:00
Mikolaj Wielgus d89745ca21 Implement iterator_traits in ENUM_ITERATOR 2022-11-20 22:07:39 +01:00
Jeff Young 3747cae7dc Reinstate marker searching. 2022-11-20 13:12:44 +00:00
Alex 01a835a4cb Use wglGetSwapIntervalEXT in SetSwapInterval. 2022-11-19 04:33:19 +05:00
Jeff Young 11dddefd05 Implement GetEffectiveShape for groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/12940
2022-11-18 21:13:23 +00:00
Jeff Young c409646aad Update message panel after rebuilding connectivity.
Fixes https://gitlab.com/kicad/code/kicad/issues/10122
2022-11-18 15:29:16 +00:00
Alex 53b9baa5ba Some refactoring around Gerber files extension checking.
Fixes a case where most Protel inner layer files couldn't be drag and dropped.
2022-11-18 09:55:34 +05:00
Alex dcb131c20d Improve canvas responsiveness by better swap interval management. 2022-11-18 00:32:25 +05:00
Alex d98e08d90b Set swap interval to 1 if adaptive is unavailable. 2022-11-18 00:32:25 +05:00
Alex 399aa7e418 Implement SetSwapInterval on Windows. 2022-11-18 00:32:25 +05: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
Jon Evans 85c7cca846 Fix missing include 2022-11-15 23:30:01 -05:00
Jeff Young 13f5c78e89 More tightening of group parent lifecycles.
Fixes https://gitlab.com/kicad/code/kicad/issues/12908
2022-11-16 00:42:38 +00:00
Jeff Young 03ba14c6d3 Tighten lifecycle management of parent group pointers.
Also adds some debugging to try to catch dangling pointers.

Also adds a cache for group bounding boxes (which will be expensive
to calculate for large groups).

Fixes https://gitlab.com/kicad/code/kicad/issues/12875
2022-11-11 17:27:28 +00:00
Marek Roszko 43f039ef5f Add netlist export cli 2022-11-09 22:37:55 -05:00
Jon Evans d9d3ccd6eb DbLib: Allow inheriting field properties from source symbol
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12856
2022-11-09 21:24:31 -05:00
Jon Evans dbd498f451 Re-add keyword mapping 2022-11-09 20:50:01 -05: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 9501f4303d Rename CreateWindow to CreateKiWindow to avoid a collision name with a windows header
No code change, but it fix an issue specific to msys2 that bother me when
trying to fix issues with wx 3.0.x version
2022-11-08 12:31:07 +01:00
Jeff Young ae741b93e6 Resore push/pop-less PickerTool.
(Functionality was accidentallly lost when we removed the opt command
strings.)
2022-11-07 19:11:12 +00:00
Jon Evans f708dad5cd Don't use frame events for PROPERTY_EDITOR_UNIT_BINDER 2022-11-06 18:26:17 -05:00
Jon Evans dd94b2d3a7 Rename PROPERTIES to STRING_UTF8_MAP for clarity
This class has nothing to do with the properties system
2022-11-06 11:51:52 -05: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
Jeff Young b385a4b60a Implement DarkMode for the Appearances Palette.
Fixes https://gitlab.com/kicad/code/kicad/issues/11734
2022-11-06 00:34:45 +00:00
Jeff Young 25f06eed8c Move zone borders back to their "host" layer.
Zone borders shouldn't be affected by zone-opacity control; we always
draw them in full layer opacity.

Fixes https://gitlab.com/kicad/code/kicad/issues/12438
2022-11-05 16:50:54 +00:00
Jon Evans 995a153f27 Update nlohmann::json to 3.11.2
Also update json_schema_validator to match new deprecations
2022-11-05 10:53:57 -04:00
Jeff Young cf581137d8 Handle multiple unitProviders in a WX_GRID.
This allows us to provide a more consistent and less buggy presentation
of the netclasses grid in both eeschema and pcbnew.

Fixes https://gitlab.com/kicad/code/kicad/issues/12826
2022-11-05 10:23:12 +00: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
jean-pierre charras f80c150f13 Add missing cases for PCB_SHAPE_LOCATE_BEZIER_T in switches. 2022-11-01 16:07:05 +01:00
Jon Evans a5d685ff5c Handle coordinate transforms in properties system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12320
2022-10-31 23:01:52 -04:00
Seth Hillbrand c7c4439027 Allow bezier->line/poly conversion
Fixes https://gitlab.com/kicad/code/kicad/issues/12778
2022-10-31 12:48:53 -07:00
Tomasz Wlostowski f25d449d5f JSON_SETTINGS: added direct serialization to a string (FormatAsString) and parsing
from explicitly provided file (bypassing the migration and settings framework). Used for
router regression tests.
2022-10-31 11:17:31 +01:00
Marek Roszko 30211da69f Move the cli definitions to kicad 2022-10-29 11:55:38 -04:00
Jeff Young f6c441c434 Viewport switcher keys are platform-specific.
Also fixes a regression where ctrl-tab doesn't get recognized.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/10127
2022-10-27 14:28:11 +01:00
Jeff Young f480cbf93f Treat internal copper layers as side-specific.
Fixes https://gitlab.com/kicad/code/kicad/issues/12726
2022-10-25 12:08:57 +01:00
Jeff Young 4778122aa0 Flip anything on a side-specific layer, rather than physical layer.
Fixes https://gitlab.com/kicad/code/kicad/issues/12726
2022-10-24 16:54:33 +01:00
Jeff Young 064e7f0f2c Dark mode hacks for SPLIT_BUTTON on OSX. 2022-10-23 17:56:44 +01:00
Jeff Young cef7cd8f7c Move default font to RENDER_SETTINGS.
Fixes https://gitlab.com/kicad/code/kicad/issues/12723
2022-10-22 21:32:42 +01:00
Jeff Young 96fed676a3 Formatting. 2022-10-22 14:11:01 +01:00
jean-pierre charras 63002cec57 Do not add a title/comment in mandatory field strings when writting netlists.
This is mainly for "Sheetfile" property because current it is the only one
that has a title when plotting/drawing it.
2022-10-22 12:50:26 +02:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Seth Hillbrand 27add591ec Add Clipper2
Currently this lives behind the advanced config flag `UseClipper2`.
Enabling this flag will route all Clipper-based calls through the
Clipper2 library instead of the older Clipper.  The changes should be
mostly transparent.

Of note, Clipper2 does not utilize the `STRICTLY_SIMPLE` flag because
clipper1 did not actually guarantee a strictly simple polygon.
Currently we ignore this flag but we may decide to run strictly-simple
operations through a second NULL union to simplify the results as much
as possible.

Additionally, the inflation options are slightly different.  We cannot
choose the fallback miter.  The fallback miter is always square.  This
only affects the CHAMFER_ACUTE_CORNERS option in inflate, which does not
appear to be used.

Lastly, we currently utilize the 64-bit integer coordinates for
calculations.  This appears to still be faster than 32-bit calculations
in Clipper1 on a modern x86 system.  This may not be the case for older
systems, particularly 32-bit systems.
2022-10-19 16:25:45 -07:00
Jeff Young 437d2c4589 Overhaul of remove-unconnected's zone filling and drawing strategies.
1) The highest priority zone that a via/pad collides with "owns" its
connectivity state.  Once set, lower priority zones cannot change it --
and in fact, if they would have connected to it are forced not to.

2) The connectivity state goes with the zone fill state, and therefore
must be saved in the file.

3) Display of remove-unconnected's pads is no longer done in GetViewLOD()
(which isn't called for selected items), and is instead done in PCB_PAINTER.
This allows us to draw the full pad in outline mode when a via/pad is
selected which would otherwise only show the hole.

4) Note that in some cases this will still generate DRC errors -- in
particular when a via nearly collides with a higher priority zone it
won't get "owned" by that zone and may therefore have insufficient
clearance if said zone concludes it's unconnected and a subsequent
(lower priority) zone connects to it (causing it to now become flashed).

Fixes https://gitlab.com/kicad/code/kicad/issues/11299
2022-10-18 13:05:42 +01:00
Jeff Young d1450e1802 Commenting. 2022-10-13 13:05:51 +01:00
Jeff Young 3231bc5be3 Formatting and cleanup. 2022-10-12 16:36:54 +01:00
Jeff Young 33ed02af70 Another include for non-Mac platforms. 2022-10-12 01:15:31 +01:00
Seth Hillbrand 41503a3a7a Include missing header 2022-10-11 16:47:29 -07:00
Jeff Young 971cbfa2ed Fix include for non-Mac platforms. 2022-10-12 00:37:19 +01:00
Jeff Young e02c05d38f Add unit and eval support to WX_GRIDs.
Fixes https://gitlab.com/kicad/code/kicad/issues/1871

Fixes https://gitlab.com/kicad/code/kicad/issues/4285
2022-10-11 23:40:58 +01:00
Jeff Young 3221877fe8 Push autosave-require down in to EDA_BASE_FRAME.
Fixes https://gitlab.com/kicad/code/kicad/issues/11790
2022-10-10 14:03:52 +01:00
Jeff Young be6f08deca Code clarity. (No functional changes.) 2022-10-10 14:03:52 +01:00
Marek Roszko 3b63ce8a48 Don't use the 3d resolver config anymore 2022-10-08 14:27:10 -04:00
Alex 0fea6f5ac3 Fix selection and entering in nested groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/12586
2022-10-06 21:02:36 +03:00
Jeff Young 19d270fe74 Text size sanity checking for TEXT_ITEMS_GRID.
Oh dear, there was a bunch going on here.  Firstly the move from int
to long long int for ValueFromString() means that we were no longer
catching overflows (as we were C-style casting it back to int in many
places).  But even when the overflow is caught, it would run in to
wxWidgets' empty string bug while trying to log it.

Fixes https://gitlab.com/kicad/code/kicad/issues/12577
2022-10-06 13:19:08 +01:00
Jeff Young b52106aa37 Formatting and commenting. 2022-10-06 13:19:08 +01:00
Marek Roszko 40a279ae32 Hotglue the unit tests to work for now
The mocks never expected InitPgm to work and I accidentally fixed it for the kicad-cli
2022-10-05 17:12:32 -04:00
Marek Roszko 2bac898298 Make -f set standalone mode in kiway 2022-10-04 23:03:03 -04:00
Mark Roszko fb8a4c10f7 Shove kicad2step into pcbnew itself with a new cli 2022-10-04 01:53:37 +00:00
Jeff Young e335c1c612 Fix for LIB_TREE hotkeys over canvas and possible fix for over LIB_TREE itself.
Fixes https://gitlab.com/kicad/code/kicad/issues/11034
2022-10-02 22:22:21 +01:00
Jeff Young b3ddd09c44 Unit-binderize board thickness. 2022-10-02 20:03:00 +01:00
Jon Evans 7059ef9b89 Store netclass visibility separately from nets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10290
2022-10-01 19:54:13 -04:00
Seth Hillbrand 19378675f1 Ensure that token size is large enough
Input tokens can be arbitrary, so output needs to keep pace

Fixes https://gitlab.com/kicad/code/kicad/issues/12555
2022-10-01 11:30:30 -07:00
Jeff Young c0a666507c Work around more instances of the wxWidgets color string locale bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/12552
2022-09-30 20:56:25 +01:00