Commit Graph

5593 Commits

Author SHA1 Message Date
Jon Evans acf13a1869 ADDED: Orthogonal dimension object 2020-09-21 23:55:02 -04:00
Jon Evans 6ee866ba6e Set default zone opacity to 60%
Defaulting to less than 100% helps with eyestrain and
aids the "legibility" of boards
2020-09-21 23:53:21 -04:00
Seth Hillbrand 76e44c2f4b pcbnew: Really deal with missing segments this time
The OpenGL missing segments (when small) are due to rounding in larger
coordinates.  The GAL shader uses floats to represent int32 values for
position and distance.  Thus, at larger coordinates, the smaller integer
values cannot be represented accurately.  This tests for the rounding
error and, if it exists, draws a plain circle instead

Fixes https://gitlab.com/kicad/code/kicad/issues/5751
2020-09-21 16:59:31 -07:00
Jeff Young e939afdbe8 Use a better green for DRC badges. 2020-09-21 21:09:58 +01:00
Ian McInerney e9aa9a759a Add missing break statements to prevent fallthrough
Otherwise all RC_ITEM objects are severity info in the log
2020-09-21 12:18:46 +01:00
Ian McInerney 9e6a1225db Catch exception when creating app settings objects
These settings objects could be created in a constructor/destructor
so we should catch the exception since those are noexcept.

Also change the settings trace to match the other kicad traces
as KICAD_SETTINGS
2020-09-21 12:07:51 +01:00
Jeff Young 6020b70596 Display green badge for zero errors or zero warnings.
Fixes https://gitlab.com/kicad/code/kicad/issues/5735
2020-09-21 11:59:27 +01:00
Jeff Young c6fb799fcd Restore severity in saved DRC/ERC reports.
Fixes https://gitlab.com/kicad/code/kicad/issues/5733
2020-09-21 11:59:27 +01:00
Jeff Young 865249c227 Handle two panels both referencing same colour theme.
Fixes https://gitlab.com/kicad/code/kicad/issues/5185
2020-09-21 11:59:27 +01:00
Ian McInerney e0c2531f53 Catch exception inside JSON_SETTINGS constructor
This exception will probably never be thrown in real life,
but the constructors are normally noexcept, so throwing
any exception from the json library causes Coverity to
have a fit.
2020-09-20 23:50:09 +01:00
jean-pierre charras e64806cd20 Menus/Submenus: fix incorrect bitmap for checkable menuitems in submenus.
Windows specific, because other OS do not accept user bitmaps in ckeckable menuitems
the bug was due to the same bitmap was set for each state for these menuitems.

Fixes #5622
https://gitlab.com/kicad/code/kicad/issues/5622
2020-09-20 16:30:23 +02:00
Jeff Young 0b108d61e7 Cairo canvas not on Mac; no need to show antialiasing settings. 2020-09-20 13:55:59 +01:00
Ian McInerney 89dcc46898 Coverity cleanup and remove unused variables 2020-09-20 02:20:41 +01:00
Ian McInerney 65bd1ee9a4 Add a new BITMAP_BUTTON widget and use it in the appearances panel
This button behaves like an AUI button, so it is more suited
to being on panels without a border.
2020-09-20 01:43:27 +01:00
Ian McInerney f82ad61c90 More warning cleanup 2020-09-20 01:43:27 +01:00
Jeff Young 13f1de8e73 Forgot a bunch of files from last commit. 2020-09-19 19:53:58 +01:00
Jeff Young 64fa400b19 Ease translation a bit.
Also improves the SNR and consistency of the menu item text.  For
instance, a position is rarely useful, while relative sizes can be.

Also removes some unnecessary repitition, such as "Graphic Rectangle"
when "Rectangle" communicates the necessary information.
2020-09-19 18:49:06 +01:00
Jeff Young d402d93487 Implement shape routines for DIMENSION_Ts.
This allows them to participate in DRC and PNS.

Fixes https://gitlab.com/kicad/code/kicad/issues/5712
2020-09-19 14:16:00 +01:00
Jeff Young 0763a8962c Implement boolean not processing in expression language.
Also adds some more error catching to be more robust in the face
of malformed customer rules.

Fixes https://gitlab.com/kicad/code/kicad/issues/5694
2020-09-19 12:08:18 +01:00
Jon Evans 375f1b8129 Avoid throwing exception when starting from scratch
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5661
for some reason
2020-09-18 20:41:27 -04:00
Jeff Young 80acf944a0 Don't assert when compiling rules; generate a user-visible error.
Fixes https://gitlab.com/kicad/code/kicad/issues/5694
2020-09-18 22:29:47 +01:00
Jeff Young 1a988e8d85 Fix event processing bug which kept ModEdit's context menu from working. 2020-09-18 11:49:34 +01:00
Ian McInerney a53f3899d4 Initialize variables properly 2020-09-18 11:17:37 +01:00
Jeff Young 81b523f9a4 Make sure the board itself is in the item map.
Also makes closing the DRC dialog a bit more foolproof.

Fixes https://gitlab.com/kicad/code/kicad/issues/5665
2020-09-18 00:53:14 +01:00
Jeff Young 8dd725469f Process properties command locally within drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/5612

Fixes https://gitlab.com/kicad/code/kicad/issues/5615
2020-09-17 22:32:22 +01:00
Jeff Young 4d24c9d610 Increase size of error count badge to show up to 999 errors.
Fixes https://gitlab.com/kicad/code/kicad/issues/5535
2020-09-17 22:32:22 +01:00
Marek Roszko a82edb60fe Rotate the bounding box for hit tests on the fly 2020-09-16 23:29:21 +00:00
Jeff Young ce3819abf8 Remove redundant clearances from DRC dialog. Fold progress bar in. 2020-09-16 16:06:29 +01:00
Jon Evans 75ffce1a0b ADDED: Leader dimension object
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5555
2020-09-15 23:37:38 -04:00
PJM abdd1906c2 Change 'Zoom to Fit' margins and add 'Zoom to Objects'
CHANGED: The margin used in 'Zoom to Fit' is now 2% instead of 10%.

ADDED: Added 'Zoom to Objects' to Eeschema which does not include
the page and border in the bbox calculations.

CHANGED: Removed pre-existing code that tweaked the center to account
for the scrollbars.  It actually made the view off center.  Removing it
results in perfectly centered zooms.

Fixes https://gitlab.com/kicad/code/kicad/issues/5145
2020-09-16 00:53:39 +00:00
Jeff Young e2e229da96 Finish exorcising the old DRC system.
This moves the various BOARD_ITEM calls to the new system, and make
the DRC_ENGINE long-lived so that it can field those queries.
2020-09-15 20:15:46 +01:00
Seth Hillbrand c5eba871e3 Fix formatting error 2020-09-15 10:55:31 -07:00
Seth Hillbrand 514838dbbf Version the lockfile
We are now versioning the configuration files, so we should apply the
same versioning to the lockfiles.

Fixes https://gitlab.com/kicad/code/kicad/issues/5637
2020-09-15 09:31:55 -07:00
Jeff Young 665212341d Cleanup (consistent naming, 100-char line width, message precision). 2020-09-15 12:07:31 +01:00
Jeff Young 514da2f886 Move DRC dialog to new DRC engine. 2020-09-14 22:39:36 +01:00
jean-pierre charras 8e80a4d2ed Common settings: better fix for common environment vars deletion.
The previous fix (d4461f6) removed all vars before re-add them.
Clear all vars created issues with externally defined variables (the internal
initial value was lost)
Now only old, no longer existing, vars are deleted.
Fix also a potential issue related to non ASCII7 in last stored path.
2020-09-14 16:46:56 +02:00
jean-pierre charras d4461f6c53 Common settings: fix: common environment vars: deleted vars were still in list.
When updating common environment variables list, the initial list was never
deleted. Therefore one could not remove an existing var.
The common environment variables list is now deleted before updating.
2020-09-14 14:44:54 +02:00
Jeff Young 748bee1bc7 Hook up netclasses and board minimums to new DRC engine.
Improves implicit rule reporting.
Makes some internal names more consistent.
Moves DRC_REPORT to the test framework.
Removes priority (which isn't supported in the grammar)
2020-09-13 17:08:24 +01:00
Jeff Young 8420fcc33b Cleanup. 2020-09-13 17:08:24 +01:00
Simon Richter 08828667ec Add missing <algorithm> 2020-09-12 22:43:49 +00:00
Jon Evans 76c4c959e6 Implement new dimension properties
- Automatic units mode (follow UI units)
- New text and number formatting options
- Automatic/manual text orientation control
- New text positioning options (inline and manual)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4280
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4497
2020-09-11 21:12:36 -04:00
Jon Evans ae7877c6cb Migrate dimension precision 2020-09-11 21:12:36 -04:00
Jon Evans b11e315d10 Refactor DIMENSION to hide internal details; add some new properties
This is a board file format change to account for the new properties.
Also, we now only store the critical information about the dimension's
geometry in the board, rather than storing every drawn line.

The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
2020-09-11 21:12:36 -04:00
Seth Hillbrand d14c6ba71f Keep snap line alignment before new snaps
Also fixes the alignment line that was supposed to be dashed and not
solid.
2020-09-11 14:22:41 -07:00
Jeff Young e2bc7557cc Clean up arc/circle polygonization.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle.  However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.

2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
 anyway.  (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".

3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers.  Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.

4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.

5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards.  It's now only exposed as a RAII object which  automatically
cleans up when it goes out of scope.

6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/5567
2020-09-11 11:23:49 +01:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Jeff Young 2a2b842707 HTML_REPORTER dialog. 2020-09-10 20:58:38 +01:00
Seth Hillbrand 4026904cc4 Make grid snapping depend on grid visibility
Turning the grid view on enables snapping to the grid.  Turning it off
removes the snap and allows free draw
2020-09-09 10:18:15 -07:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00
Roberto Fernandez Bautista 7ca4f0b375 CADSTAR PCB Archive Importer: Formatting fixes 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 7e65d443e8 CADSTAR PCB Archive Importer: Load TEXTS and fix loading speed
Loading speed fixed by changing the way CADSTAR_ARCHIVE_PARSER::InsertAttributeAtEnd works (we now have a new attribute in each node to keep track of how many attributes there are). Now loads a 30,000 line file in 10seconds instead of 25 minutes!
2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 866c069873 CADSTAR PCB Archive Importer: Load TEMPLATEs, COPPERs and NETs (including Tracks and Vias) 2020-09-08 21:21:20 +00:00
Roberto Fernandez Bautista 3b3af5327f CADSTAR PCB Archive Importer: Move code into common/plugins and pcbnew/plugins folders 2020-09-08 21:21:20 +00:00
Roberto Fernandez Bautista 86bf592bac ADDED: CADSTAR PCB Archive Importer
Initial commit
- Imports directly mappable layer stackup (only physical board fabrication layers for now)
2020-09-08 21:21:20 +00:00
Jeff Young f347118ce3 Add a min pin width advanced config for plotting.
Fixes https://gitlab.com/kicad/code/kicad/issues/5546
2020-09-08 20:19:54 +01:00
Jeff Young a0fbb79fd0 Tighten up the overbar spacing slightly.
Fixes https://gitlab.com/kicad/code/kicad/issues/5544
2020-09-08 11:02:09 +01:00
Tomasz Wlostowski 5f6d171626 pcbnew: fix Python bindings compile error 2020-09-08 01:53:19 +02:00
Tomasz Wlostowski a31c9ae7af VIEW_OVERLAY: implement Line() method 2020-09-08 01:31:42 +02:00
Tomasz Wlostowski 712215fe12 libeval_compiler: fix crash when preflighting method calls with 0 arguments 2020-09-08 01:31:42 +02:00
Tomasz Wlostowski 09d0aff3d6 widgets: PROGRESS_REPORTER - make SetCurrentProgress() virtual, allow to change number of phases post-construction 2020-09-08 01:31:42 +02:00
Tomasz Wlostowski 466cbe2f00 libeval_compiler: fixhandling of method calls with empty argument list (e.g. 'A.method()' ) 2020-09-08 01:31:42 +02:00
Jon Evans 147540b3bb ADDED: Control to only show ratsnest for visible layers 2020-09-07 16:43:43 -04:00
qu1ck e5828d5817 Improve exception handling in KIWAY::Player()
And avoid crashing in kicad_manager_control
2020-09-07 11:12:30 -07:00
Jeff Young 53389442b8 Add Ctrl+A (select all) to scintilla tricks.
Fixes https://gitlab.com/kicad/code/kicad/issues/5538
2020-09-07 12:36:48 +01:00
Jon Evans 758a4c26d5 Switch appearance panel to custom collapsible pane widget
The new widget looks the same on all platforms and fixes a few
bugs with the wxWidgets version
2020-09-06 22:43:39 -04:00
Jeff Young f2e0b4a6f6 Work around wxWidgets to produce a Ctrl-/.
Fixes https://gitlab.com/kicad/code/kicad/issues/5480
2020-09-06 18:46:44 +01:00
Jeff Young 4354fa7bde Another try at a solution for ctrl-/.
Fixes https://gitlab.com/kicad/code/kicad/issues/5480
2020-09-05 22:44:00 +01:00
Jeff Young e782794f96 Flesh out object properties and DRC Rule syntax help. 2020-09-05 17:44:59 +01:00
jean-pierre charras 276d77a1d7 SETTINGS_MANAGER: Fix bug: ensure the destination folder exists.
Better fix than a0df876d
For new users, if this folder does not exist, saving colors does not work,
because if this folder does not exist, it is not created.
2020-09-05 13:04:49 +02:00
Ian McInerney f28b60896c Allow toolbar items to cancel tools when pressed
There was a regression in v6 where the zoom to selection toolbar
item wasn't canceling the tool when pressed and the tool was active
(it was in v5). This implements a more generic framework for canceling
tools on button presses.

Fixes https://gitlab.com/kicad/code/kicad/issues/5103
2020-09-05 01:49:38 +01:00
Michael Kavanagh e05069ce3c Enable sorting on hotkey widget
Fixes https://gitlab.com/kicad/code/kicad/issues/5495
2020-09-04 22:07:17 +00:00
Jeff Young 7e3f35d3fb Netclass dropdowns should be selects, not comboBoxes.
Fixes https://gitlab.com/kicad/code/kicad/issues/5386
2020-09-04 22:22:32 +01:00
Jeff Young 08dee31d9e Try and unify the background colors between panels and platforms.
Also moves to WX_GRID to get rid of some wxGrid bugs, and moves the
provision of attrs to the GRID_TABLE (as those applied to the grid
are ignored when a table is specified).

Fixes https://gitlab.com/kicad/code/kicad/issues/5260
2020-09-04 20:47:50 +01:00
Jeff Young c1889cefcf Try to make block-quote/unquote more keyboard-variation-friendly.
Fixes https://gitlab.com/kicad/code/kicad/issues/git
2020-09-04 20:47:50 +01:00
jean-pierre charras a0df876d58 SETTINGS_MANAGER::SaveColorSettings(): Ensure the destination folder exists.
For new users, this folder noes not exists, and saving colors does not work.
If this folder does not exist, it is not created.
2020-09-04 19:49:19 +02:00
Jeff Young 2736becb8b Fix typo in Toggle Layers action and add descriptions to hotkeys lists.
Fixes https://gitlab.com/kicad/code/kicad/issues/5494
2020-09-04 17:45:07 +01:00
Jeff Young 3573c8b967 ADDED hotkey for comment/uncomment line(s) in Scintilla.
Useful primarily for DRC Rules editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/5480
2020-09-03 20:37:05 +01:00
Jeff Young 555b78e7ca Read/write COLOR4D::UNSPECIFIED in netinfo so you can clear colors.
Fixes https://gitlab.com/kicad/code/kicad/issues/5368
2020-09-03 20:35:38 +01:00
Jeff Young d1006138fd ADDED holeWallPlatingThickness to AdvancedCfg.
Used for zone filling and DRC hole collision testing.  Allows us to
calculate the actual hole size from the finish hole size.

Fixes https://gitlab.com/kicad/code/kicad/issues/5468
2020-09-03 16:00:07 +01:00
Jeff Young 38e9217d54 Consolidate all DRC epsilon/threshold values to a single advancedCfg setting.
Fixes https://gitlab.com/kicad/code/kicad/issues/5464
2020-09-03 15:03:09 +01:00
Jeff Young 450519a4bd Sometimes a DRAW_PANEL_GAL wants its immediate parent and sometimes not.
For instance, we get things like high-contrast-mode from the pad
dialog when rendering a pad preview, but we want the colours from the
parent PCB_BASE_FRAME.
2020-09-03 15:03:09 +01:00
Dominik Wernberger 6c164310ec Delete nodes in vector before clearing it 2020-09-01 23:26:39 +00:00
Ian McInerney 4ca7993382 Give new footprint libraries a dummy name in the file dialog
If they don't have a dummy name, then GTK will display the regex
for the extension in the dialog.

Fixes https://gitlab.com/kicad/code/kicad/issues/5365
2020-09-02 00:10:25 +01:00
Ian McInerney 8bdf25d3e2 Show an error message when switching to a language that isn't installed
Also, ensure that the language names are not translated in the menus
and messages, since they are already translated in the code.

Fixes https://gitlab.com/kicad/code/kicad/issues/5324
2020-09-02 00:10:25 +01:00
Ian McInerney 2ef5e5d1c0 Convert tabs to spaces in panel_setup_severities 2020-09-02 00:10:25 +01:00
Ian McInerney 1b4ec6ccb5 Display symbol libraries that couldn't be loaded as disabled text
Fixes https://gitlab.com/kicad/code/kicad/issues/5092
2020-09-02 00:10:25 +01:00
Ian McInerney dce8837940 Skip the slider event to allow the stepping to work
The stepping is in a static event handler, so it is called
after the dynamic handler and so the dynamic handler must
allow the event to continue processing.

Fixes https://gitlab.com/kicad/code/kicad/issues/5319
2020-09-02 00:10:25 +01:00
Jeff Young a35698f08a Don't fire non-well-formed rules. (But don't assert either.)
Fixes https://gitlab.com/kicad/code/kicad/issues/5443
2020-09-01 18:36:58 +01:00
jean-pierre charras 9fdadcbcf5 EDA_BASE_FRAME::windowClosing( wxCloseEvent& event ): fix incorrect behavior.
windowClosing() calls Destroy() when the wxCloseEvent has no veto.
This is fine for usual EDA_BASE_FRAME frames, but not for frames shown in modal mode.
In modal mode, windowClosing() should not call Destroy(), because the calling frame
expects the instance not deleted after closing.
(the caller has to call Destroy() only once the frame can be actually deleted)
2020-09-01 17:46:17 +02:00
Mark Roszko 9f128f942c Move shutdown blocker to kiplatform 2020-09-01 10:14:51 +00:00
Mark Roszko a9532c2fa1 Add browse button to footprint 3d settings
Add normalization to 3d settings and footprint library table editor
2020-09-01 02:00:38 +00:00
Mario Luzeiro 820e3089a2 3D-Viewer: use the correct opacity meaning in the color settings 2020-09-01 01:08:38 +00:00
Mario Luzeiro 40d5746df6 3D-Viewer: Parameterize body board transparency
Fix/workarround raytracing render issues related with refraction
2020-09-01 01:08:38 +00:00
Mario Luzeiro 0302fe5570 3D-Viewer: Parameterize soldermask transparency 2020-09-01 01:08:37 +00:00
Jeff Young 2979d709f3 Move changed flag ('*') from hotkey to hotkey name.
This way it doesn't look like you've assigned '*' when you clear
a hotkey.
2020-08-31 21:00:57 +01:00
Jeff Young 8d57136ad6 Fix bone-headed previous check-in. 2020-08-31 20:45:22 +01:00
Jeff Young 1f9aa2d198 Remove hotkeys for canvases.
Fixes https://gitlab.com/kicad/code/kicad/issues/4788
2020-08-31 20:34:24 +01:00
Jeff Young 2697fc3864 Remove canvas-switching from OSX.
The Cairo renderer doesn't work on Retina displays.

Fixes https://gitlab.com/kicad/code/kicad/issues/4788
2020-08-31 18:48:25 +01:00
Jeff Young 88635ee5b6 Clean up error messages.
Convert a lot of nags to InfoBar errors/warnings/messages, and some
that never should have been exposed to wxFAIL_MSGs.
2020-08-31 14:19:57 +01:00
Jeff Young 34d069ffd8 Bubble cancel up from app to kicad manager when closing.
Fixes https://gitlab.com/kicad/code/kicad/issues/5402
2020-08-31 11:49:29 +01:00