Commit Graph

5593 Commits

Author SHA1 Message Date
Jon Evans 8945f8865b Add PCB_LAYER_IDs to LayerName() and reformat for readability
LayerName() can now be called to get the default, translatable name
for any board layer.  LSET::Name() is used for the untranslated
names required for parsing board files.
2020-08-30 20:20:45 -04:00
Jon Evans 9f7bca38b3 A better way of handling standalone project files 2020-08-30 16:04:39 -04:00
Jon Evans a52e3fc87a Fix a segfault if screen changes from under the RC_TREE_MODEL 2020-08-30 15:43:16 -04:00
Jeff Young 20211eed49 Unroll a level of prefs for fieldname templates.
It was playing havoc with the saving of project and global templates
without one overwriting the other.

Fixes https://gitlab.com/kicad/code/kicad/issues/5415
2020-08-30 18:58:18 +01:00
Jon Evans 921703c711 Don't restore saved window state if saving is turned off 2020-08-30 12:44:23 -04:00
Jon Evans 046fef2cc1 Only load an empty project if we don't have one already
We may have multiple projects if one of them is a temporary
project used for importing settings

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5423
2020-08-30 12:27:20 -04:00
Fabien Corona 4a0d6297ab pcbnew: Add an alternate edit method for arcs
The alternate edit methods keeps the radius constant

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5369
2020-08-29 22:59:11 +00:00
Jeff Young cc64709407 Reimplement skip-parent-page to work with MacHack.
This prevents the "leaking" pages where the layers panel is shown
in the background of all other panels.

Fixes https://gitlab.com/kicad/code/kicad/issues/5182
2020-08-29 20:53:53 +01:00
Ian McInerney a0d84e94fd Use move to trash to the project manager instead of immediate delete
CHANGED: Delete in the project manager now moves files to the trash can

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2499
2020-08-28 23:00:43 +00:00
Seth Hillbrand 691c33e003 Don't export libid with footprints
We use the LIBID for board files to locate the correct library for the
footprint.  Once exported, the footprint should be associated with the
library that contains it, if any.

Fixes https://gitlab.com/kicad/code/kicad/issues/5400
2020-08-28 12:33:13 -07:00
Jeff Young 29a459768a Don't call EndModal before ShowModal.
It'll get shown, but can then never be closed.

Fixes https://gitlab.com/kicad/code/kicad/issues/5346
2020-08-28 18:41:42 +01:00
Jeff Young e7db43285f ADDED new footprint fabrication attributes.
This commit also adds mapping of the new symbol properties
"exclude from BOM" and "exclude from board" to be correctly
handled in Update Board from Schematic.

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/2233
2020-08-28 11:05:58 +01:00
Seth Hillbrand 1e461c2259 ADDED: Improved center point dragging
The center point on polygons now maintains the axis of the dragged line
and, optionally with Ctrl pressed, maintains the slope of the adjacent
segments as well.

This also fixes a longstanding issue that prevented the ctrl-snapping
from using the original point rather than the last updated point when
constraining.

Fixes https://gitlab.com/kicad/code/kicad/issues/2465
2020-08-27 10:34:12 -07:00
Jon Evans baeb4abd18 Don't handle pin map special case twice
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5385
2020-08-27 11:25:18 -04:00
Jon Evans cd54ba7b01 Fix project unloading in LoadProject
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5380
2020-08-26 20:46:20 -04:00
Jon Evans dc7e1783b3 Make sure a project is loaded at all times
For now, much of KiCad depends on Prj() working, so when we
are asked to unload a project, immediately load the null project
so that nothing breaks.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5374
2020-08-26 18:37:34 -04:00
Jon Evans 9ebdd4bd83 Don't save file state for an empty file 2020-08-26 18:36:42 -04:00
Mark Roszko 1082402b33 Convert UNDO_REDO_T to an enum class 2020-08-26 18:04:32 +00:00
Reece R. Pollack a9c835275a Apply display origin transforms in Pcbnew dialog classes
This commit applies display origin transforms to all Pcbnew
dialog classes that use UNIT_BINDER for their formatting:

  * DIALOG_CREATE_ARRAY
  * DIALOG_FOOTPRINT_BOARD_EDITOR
  * DIALOG_GRAPHIC_ITEM_PROPERTIES
  * DIALOG_GRID_SETTINGS
  * DIALOG_MOVE_EXACT
  * DIALOG_PAD_PROPERTIES
  * DIALOG_POSITION_RELATIVE
  * DIALOG_TEXT_PROPERTIES
  * DIALOG_TRACK_VIA_PROPERTIES
2020-08-26 17:54:22 +00:00
Reece R. Pollack af218a5dc0 Add the PCB_ORIGIN_TRANSFORMS class
This commit adds the PCB_ORIGIN_TRANSFORMS class, which is derived
from the ORIGIN_TRANSFORMS class, and provides a set of templated
functions to convert PCB coordinates between internal representation
and display representation. It extends the ORIGIN_TRANSFORMS class
to understand the three user-selectable display origins and the
coordinate direction display options.
2020-08-26 17:54:21 +00:00
Reece R. Pollack 6e25b7d455 Add ORIGIN_TRANSFORMS to the UNIT_BINDER and EDA_DRAW_FRAME classes
This commit modifies the UNIT_BINDER class to invoke the ORIGIN_TRANSFORMS
methods to support Display Origin Transforms.

The EDA_DRAW_FRAME class is modified to instantiate an ORIGIN_TRANSFORMS
object providing null transforms. A function is provided to allow the
UNIT_BINDER to find the ORIGIN_TRANSFORMS object in an overrideable manner.
2020-08-26 17:54:21 +00:00
Reece R. Pollack 3fec2805ec Add the ORIGIN_TRANSFORMS class
This commit adds the ORIGIN_TRANSFORMS class to support Display Origin
Transforms in all KiCad applications.

Functions are provided to perform four basic types of origin coordinate
transforms:
  * Transform a relative coordinate from internal to display form
  * Transform a relative coordinate from display to internal form
  * Transform an absolute coordinate from internal to display form
  * Transform an absolute coordinate from display to internal form

These functions are supported for data types "int", "long long int",
and "double". The default implementations for all but "int" simply
return their input unchanged; the implementation for "int" invokes
the implementation for "long long int".

The expectation is that the different KiCad applications will create
derived classes from this base class and override the functions as
needed. Protected template functions are provided for the standard
translations to maintain consistency within the derived classes.
2020-08-26 17:54:21 +00:00
Jeff Young 050bbcdb4f Fix error reporting from function pre-flighting. 2020-08-26 12:56:17 +01:00
Jon Evans d40ae3de46 ADDED: ERC check for missing hier labels for sheet ports
A subsheet may have more than one instance of a hier label,
but it's generally a mistake if there is no matching hier label
for a port on the parent sheet.

This is harder to do today now that we don't have manual tool
for placing hier ports, but it's still possible if you place
ports but then rename the label on the subsheet.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3468
2020-08-25 21:52:52 -04:00
Jeff Young 40d7940d52 Don't trim both back and front if there's only one char.
Fixes https://gitlab.com/kicad/code/kicad/issues/5357
2020-08-26 00:02:37 +01:00
Jeff Young 6d12859c14 Give up on trying to get Clipper's miter strategies to work.
Instead, make sure we remove the clearance holes and outline at
the end so that copper isn't allowed to "spill" into areas it
shouldn't be in.

Also fixes a bug where the Advance Cfg defaults weren't getting
loaded when the file didn't exist.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5306
2020-08-25 19:07:37 +01:00
Simon Richter 076230330b Fix missing include 2020-08-25 15:58:18 +00:00
Jeff Young d1371e513d Make sure Gerber print options have a color settings.
We probably don't need it, but some code attempts to dereference
it so safer to have one then to start checking everywhere for
dereferences.

Fixes https://gitlab.com/kicad/code/kicad/issues/5353
2020-08-25 14:08:09 +01:00
Jeff Young 1138c32bf3 Don't pass Cancel event where there was a specific action cancelled.
For instance, if during a move the user hits ESC they only want the
move cancelled, not (for instance) the selection dropped.

Fixes https://gitlab.com/kicad/code/kicad/issues/5356
2020-08-25 12:54:40 +01:00
jean-pierre charras d122321162 mathplot.cpp: fix an issue in plot function optimization. 2020-08-25 10:08:18 +02:00
Jon Evans 24435fcc62 Don't create new project files when opening boards/schematics
Display warning infobar in the board/schematic setup when no project
is loaded, since most of the settings in those dialogs are saved in
the project and not in the board/schematic file.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4868
2020-08-24 22:17:21 -04:00
Jon Evans 5e2946ef90 Use full net names in netclasses
Short net names are not unique; full names with paths must be used.
Added a grid cell renderer that does the escaping, to make it easier
to display net names in grid cells.

Once you unescape a net name, you can't go back to the escaped form
because you can't assume which `/` should be {slash} and which `/`
Because of this, we cannot use Unescape/Escape on the data model in
the netclass setup panel, and instead do the Unescape in the view.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5331
2020-08-24 21:19:07 -04:00
Jeff Young 15c136ead2 Make a bunch of help dialogs modeless.
Fixes https://gitlab.com/kicad/code/kicad/issues/5334
2020-08-24 23:17:33 +01:00
Jeff Young b8bbe72e48 Another attempt to fix the select-reference-point toolstack thing.
This time remove the push/pop from the picker tools as that's
responsible for the issue of trying to re-activate the move action
when its popped.  Instead do the push/pop from the client code
of other actions that need it, and not at all from the move-with-
reference action.

Fixes https://gitlab.com/kicad/code/kicad/issues/5336
2020-08-24 22:47:24 +01:00
Jeff Young a4ff339a1e Clear toolstack after cancel.
Fixes https://gitlab.com/kicad/code/kicad/issues/5336
2020-08-24 19:28:53 +01:00
jean-pierre charras d1e2b57d96 mathplot.cpp: optimize a plot function to have a better look for dashed lines,
and less lines to plot when they can be merged.
2020-08-24 18:40:38 +02:00
Jon Evans 3673c23696 Code style 2020-08-23 22:10:05 -04:00
Mark Roszko 89e74140eb Save file / window states for kicad project locally 2020-08-24 02:01:14 +00:00
Ian McInerney 2f7094b352 Cleanup some unused variables
* Make the app progress indicator only have the indeterminate state
  when the taskbar indicator is used (causes an uused variable warning
  on wx<3.1)
* Remove unused dry run variable in pcb_netlist.h
* Remove unused forceDropAnnotations from the paste special dialog
  since the dialog only controls keeping them.
2020-08-24 01:51:23 +01:00
Thomas Pointhuber a03fb7a9a8 Altium: Refactor and add initial structure for schematic importer
altium: move pcbnew/altium2kicadpcb_plugin -> pcbnew/plugins/altium

See: https://gitlab.com/kicad/code/kicad/-/issues/4412
2020-08-23 19:01:08 +00:00
Jon Evans 6720473db9 Move net visibility/color controls to a wxGrid
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5235
Might improve https://gitlab.com/kicad/code/kicad/-/issues/5210
2020-08-23 13:15:07 -04:00
Jon Evans 342fae7768 Don't allow color overrides for Default netclass
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5330
2020-08-23 12:55:35 -04:00
Jon Evans f5a6492f85 Fix load/save of layer presets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5322
2020-08-23 11:59:40 -04:00
jean-pierre charras c80d029681 json_settings.cpp: add more log traces on errors, when trying to save a json config.
pcb_calculator: fix a minor cosmetic issue: disabled wxStaticTexts are not very readable
on wxWidgets 3.1.4, so do not use disabled wxStaticTexts.
2020-08-23 15:01:52 +02:00
Jeff Young c71bb246e6 Don't allow preview to try and draw empty polygons.
Fixes https://gitlab.com/kicad/code/kicad/issues/5314
2020-08-22 23:46:56 +01:00
Jeff Young 93ef18d775 Fix typo where two footprint warning messages were transposed.
Fixes https://gitlab.com/kicad/code/kicad/issues/5303
2020-08-22 16:20:18 +01:00
jean-pierre charras f28d30a87b Fix minor wxWidgets alert and a few Coverity warnings. 2020-08-22 17:11:02 +02:00
Seth Hillbrand c1a97fc0c3 GAL: Revision to 80af7b3158, allow LIB_POLYLINE
LIB_POLYLINE has a filled/not completely stroked draw mechanism that
allows stroking singular lines that will skip the fill
2020-08-21 16:02:13 -07:00
Seth Hillbrand 80af7b3158 Fix GAL check to account for shared function
Cairo Polyline and Polygon draw functions share a common routine.  While
Polygons must have 3 points to allow triangulation, a polyline (like our
text) need only have 2
2020-08-21 15:18:25 -07:00
Jeff Young 80846dcbc7 Improve shutdown performance. 2020-08-21 19:12:51 +01:00
Seth Hillbrand 7fc222db98 GAL: Check that polygons have at least 3 points
This resolves a crash when passing an empty polygon and alerts debug
users to possible generation cases when bad polygons are created.

Thanks for Frans Zellman
(https://gitlab.com/kicad/code/kicad/-/merge_requests/365) for
identifying the issue.
2020-08-21 09:36:41 -07:00
Seth Hillbrand ffdf4deb59 Fix copy-pasta 2020-08-20 20:18:39 -07:00
Ian McInerney 441243753d Readd freeze/thaw to the library tree update
This freeze/thaw is different than the update locker freeze/thaw,
and is needed to prevent crashes due to accessing invalid (already
freed) data on GTK.

Fixes https://gitlab.com/kicad/code/kicad/issues/5289
2020-08-21 02:39:20 +01:00
Seth Hillbrand 7565a08396 eeschema: Add select all to schematic and library editor
Fixes https://gitlab.com/kicad/code/kicad/issues/2497
2020-08-20 16:07:10 -07:00
Seth Hillbrand 1e315bc3fe pcbnew: Add "Select All" Action to pcbnew and fpedit
Fixes https://gitlab.com/kicad/code/kicad/issues/2497
2020-08-20 16:07:10 -07:00
Marek Roszko de7a1b647c Use a local tmp file for plotting
Fix #5238
2020-08-20 16:23:51 +00:00
Jeff Young d59c5687db Don't wrap-around before first entry. 2020-08-20 00:51:16 +01:00
Jeff Young 27b047ab3f Cache project text vars as properties in the PCB board file.
Fixes https://gitlab.com/kicad/code/kicad/issues/5255

Fixes https://gitlab.com/kicad/code/kicad/issues/5005
2020-08-19 19:32:20 +01:00
Jeff Young 87b078927c Adjust GTK spacing of view preset switcher. 2020-08-19 16:26:29 +01:00
Jeff Young d3d90ddb67 Attempt to de-bounce EndModal() on GTK. 2020-08-19 13:18:53 +01:00
Jeff Young 4b7c883095 Add layer presets switcher.
Fixes https://gitlab.com/kicad/code/kicad/issues/5247
2020-08-19 11:56:28 +01:00
Jeff Young 01bf395cc2 Make via cleaning options clearer.
Fixes https://gitlab.com/kicad/code/kicad/issues/5253
2020-08-19 11:56:28 +01:00
Jon Evans eb9756840d Better defaults for brightness factors
Also store them in the JSON so they can be tweaked
2020-08-18 20:55:39 -04:00
Jeff Young 1711b489b6 Dark-mode proof the undefined colour swatch. 2020-08-18 19:05:30 +01:00
Seth Hillbrand 6b0176d577 eeschema: lock model while updating scores
The tree model adapter appears to have update issues when modifying the
scores while it _might_ get updated.  This moves the lock higher and
removes the extraneous Freeze/Thaw call.

Unfortunately, this only exposes an additional issue in the tool handler
but this will hopefully be easier to debug.

Fixes https://gitlab.com/kicad/code/kicad/issues/5206
2020-08-18 10:50:50 -07:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Marek Roszko a417da4ce0 Split selecteditemmodified to a selecteditemmoved to reduce updatemsgpanel spam 2020-08-18 13:11:47 +00:00
Seth Hillbrand 18e06c659c Set launguage selection to be untranslated
Users should see their language option presented in their own language,
not the current language being used on the system.
2020-08-18 05:32:21 -07:00
Seth Hillbrand 6381f80bfa Remove flags icons and abandoned languages
Flags != language  See http://www.flagsarenotlanguages.com We now use
local, untranslated language names for all languages.

Languages that have not been updated in >5 years and have less than 15%
of available strings translated have been removed from the menu options.
If a translator steps up to update the .po files, we can re-add them
2020-08-18 05:32:21 -07:00
Jeff Young 66ff16dd3d Better board-edge error reporting.
Fixes https://gitlab.com/kicad/code/kicad/issues/4950
2020-08-17 23:55:31 +01:00
Jeff Young 01eb8ad032 Better handling of excluded layers for Color Preferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/5184
2020-08-17 23:55:31 +01:00
Jeff Young 8234e70e77 Remove unused footprint text front & back colours. 2020-08-17 23:55:31 +01:00
Ian McInerney 5955091eb3 Turn CONDITIONAL_MENU's conditions into only show/hide conditions
This leaves the decision to check/enable menu items to the main UI
conditions, and only the menu has control over showing/hiding the menu
items. Also rip out a special case for the preferenes item that isn't
needed on OSX anymore since all the main menus have been moved to
ACTION_MENUs now.
2020-08-17 23:40:02 +01:00
Jeff Young aceed2b0a4 Cleaner look for colour swatches and the undefined colour. 2020-08-17 18:31:20 +01:00
Jeff Young 5ffd2751ef Fix default netclass membership handling.
There's no such thing as an "unassigned" net.  That's what the
"Default" netclass is.
2020-08-16 21:00:46 +01:00
Ian McInerney dbe5537fa9 Don't run the hotkey if the action isn't enabled
CHANGED: Don't run the hotkey if the action's UI elements aren't enabled

This makes it so the action can't be run from either the hotkey or the
UI if its enabling conditions are not met.
2020-08-16 19:10:26 +00:00
Ian McInerney 4491f24d5e Ripout the old SyncToolbars infrastructure reminants
The tool framework no longer needs to request updates of the UI
state for the controls, wxWidgets will do it for us.
2020-08-16 19:10:26 +00:00
Ian McInerney e8b11c911e Migrate Pcbnew/footprint viewer/footprint editor to the new UI update system 2020-08-16 19:10:26 +00:00
Ian McInerney fd4388710d Migrate eeschema, libview and libedit to the UI condition framework
Also, fix some issues in other frames identified along the way.
2020-08-16 19:10:25 +00:00
Ian McInerney 45fb030b9b Rename and shorten the names in ACTION_CONDITIONS 2020-08-16 19:10:25 +00:00
Ian McInerney 3b05d7cddd Move more frames to the new UI condition framework
* Frames moved: cvpcb, cvpcb footprints frame, gerbview, pagelayout editor

This also introduces new EDITOR_CONDITIONS that are used to set the
conditions of very common editor settings.

Also, some IDs were converted to tools in the pagelayout editor.
2020-08-16 19:10:25 +00:00
Ian McInerney 72a1c71e07 Implement a framework to handle wxUpdateUIEvents for tool actions
This allows for the tool framework to keep track of a universal
set of conditions for the UI state (enabled/checked/shown) for
controls of actions. It removes the need for the main menubar
menus to be CONDITIONAL_MENUs and be rebuilt on each open,
and instead makes the updates of the check and enabling of
items handled in the native wxWidgets way.

This commit switchs the 3d viewer and kicad project manager window
over to this system.
2020-08-16 19:10:25 +00:00
Ian McInerney d19ff3e595 Unify the UI IDs for actions between the menus and toolbars
By unifying the IDs so that an action only has one UI ID,
it will receive only one update event that will work for
all controls using the action.
2020-08-16 19:10:24 +00:00
Jon Evans 6cb0343c6a Fix typo causing repeated migration 2020-08-16 14:55:00 -04:00
Jon Evans 92174d414c Ensure pads and zones come up visible by default
These visibility layers didn't exist until now
2020-08-16 10:17:20 -04:00
Ian McInerney 61cdf3436b Ensure PAINTER::Draw routines properly handle EDA_ITEM casting
EDA_ITEM is a child of VIEW_ITEM, so a static_cast is not appropriate,
since in some cases it could be called with a non-EDA_ITEM argument.
This was triggering an ASAN heap-buffer-overflow in GerbView.
2020-08-16 12:37:51 +01:00
Jeff Young 57c3d8e8d8 Make sure preview group gets added to view after a clear. 2020-08-15 21:13:44 +01:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04:00
Jeff Young d7f26cfdf2 Fix test failures. 2020-08-15 19:33:21 +01:00
Jeff Young b42395ec8d Attempt to fix locale issue with decimal separator in rules. 2020-08-15 17:32:13 +01:00
Jeff Young ec5040aff5 Fix missing 'else' and EOF processing, both of which cause crashes. 2020-08-14 22:11:04 +01:00
Jeff Young edda024285 Fix up some Coverity and CLion warnings. 2020-08-14 12:41:20 +01:00
Jeff Young 2b0b7a5153 Clear pin net-name-driving cache when changing annotation.
Also update connectivity after clear annotation, annotate or back
annotate.

Also update status bar for highlighted nets.

Fixes https://gitlab.com/kicad/code/kicad/issues/5170
2020-08-14 12:41:20 +01:00
Tomasz Wlostowski ab17f4b7b5 libeval_compiler: thou shalt not use strlen() on wxStrings. Works under Linux, doesn't work on OSX/MSVC... 2020-08-14 01:55:11 +02:00
Jeff Young 519bc80394 Replace error reporting in DRC rule compiler. 2020-08-13 18:47:41 +01:00
Jeff Young 0b17dbd123 Fix nesting issues in the DRC rule expression code generator.
We were executing function calls multiple times because we were
processing them at a depth the traversal algorithm wasn't expecting.
2020-08-13 18:36:10 +01:00
Tomasz Wlostowski 518a659185 Post-rebase fixes 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski 52fefd15e0 common: include drc_proto keywords in the main DRC parser 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski d937fadd6f Migrate RC_ITEM to use shared_ptr 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski 4abe71d2ef libeval_compiler: implemented unary +/- operators 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski c88c8102e5 libeval_compiler: fixed segfault for "(number)" expressions. 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski a5a06e3c89 libeval_compiler: general clean up of the Lemon grammar + some smart pointers + killed all memory leaks. WIP! 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski 29a01e5515 libeval_compiler: wxString()-ification WIP 2020-08-13 14:50:59 +02:00
Tomasz Wlostowski 6358995ff8 EDA_TEXT: rename GetEffectiveShape() to GetEffectiveTextShape() to avoid name aliasing with BOARD_ITEM inteface 2020-08-13 14:50:59 +02:00
Jeff Young 17d3e36bd6 Fix crash bug when condition expression is empty. 2020-08-12 22:20:07 +01:00
Qbort b41892e4da Rename class GROUP in pcbnew to PCB_GROUP
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5156
2020-08-12 15:36:08 +01:00
Seth Hillbrand ab58b67842 Adding triangulation viewing to AC
This adds a helper routine to visualize the quality of our
triangulation.  It also renames an excessively long variable name for
the arc editor
2020-08-12 06:22:45 -07:00
Ian McInerney fedc6519cd Preserve the externally defined variables in the configure paths dialog
Previously the variables that were defined externally weren't being
readded to the variable map, so they would not appear in the dialog
the next time.
2020-08-12 00:25:58 +01:00
Ian McInerney 47f7c616f8 Fix Python environment variable handling
The variables in the common settings struct are only updated on
save, so Python must use the ones from Pgm to get its values.
This does lead to the observation that Python's changes to the
variables do affect KiCad (they can break resolvers). So apparently
it can mess with us but we can't mess with it easily.

Also, improve the environment variable tracing infrastructure to capture
more changes.
2020-08-12 00:14:19 +01:00
Ian McInerney 63b53c3968 Force regeneration of the lib tree on first load
Just setting the text field is not guaranteed to fire
a text event, so we must forcefully call the regenerate
function to ensure the preselect is handled.

Fixes https://gitlab.com/kicad/code/kicad/issues/4105
2020-08-12 00:14:19 +01:00
Jeff Young 7f65b31cb6 Beautify the PCBNew print dialog.
Mostly fix some uneven spacing, but also indent the color theme
selection under the checkbox which controls it.
2020-08-11 20:42:08 +01:00
Joshua Redstone ee428876ec ADDED: Group/Ungroup function
This implements the group/ungroup functions to mark a set of EDA_ITEMs as a unit, allowing them to be moved and rotated as a unit
2020-08-11 19:37:07 +00:00
Jeff Young 9716c62e32 Performance enhancements for PCBNew scrolling and zooming.
Fixes https://gitlab.com/kicad/code/kicad/issues/5136
2020-08-10 23:43:24 +01:00
Jeff Young de6314e3b5 Convert smart quotes and dashes to ASCII in DRC rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/5135
2020-08-10 23:43:24 +01:00
Jeff Young 0a6a91b5ad Convert smart quotes and dashes in reports to ASCII quotes and dashes.
Fixes https://gitlab.com/kicad/code/kicad/issues/1861
2020-08-10 23:43:24 +01:00
Ian McInerney 5684708b22 Remove shadowing linewidth member from the Cairo GAL
The base GAL has the linewidth property already, and its
accessor will only return the base version. This was causing
problems with the Cairo printing GAL, since that setter wasn't
using the base class version. Also, this removes the print-specific
setter, since the actual setting of line width shouldn't be done
there and is instead done where the drawing happens.

Fixes https://gitlab.com/kicad/code/kicad/issues/5089
2020-08-10 22:16:11 +00:00
Ian McInerney 0a1d8c1aaa Move lemon parser generation into build directory
This moves the generated files out of the source tree and into
the build directory. They are now regenerated each time they are
needed, based on the timestamp of the generated file compared to
the timestamp of the lemon file.

To do this, we also bundle lemon into the thirdparty directory
and build it for ourselves since it is a very tiny program and
not all platforms seem to distribute it in a consistent manner.

Fixes https://gitlab.com/kicad/code/kicad/issues/5013
2020-08-10 13:53:54 +00:00
Seth Hillbrand 5fc6b74c89 ADDED: Remove unused pads
This option removes copper layers from pads and vias where they are not
connected to other board elements.  This allows the inner layers to be
more closely routed if the via landing pad is not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/1835
2020-08-10 03:27:26 +00:00
qu1ck 1bb6d4e22c Fix pads python api compatibility
* Add GetCustomShapeAsPolygon() to swig wrapper
* Make shared_ptr<SHAPE_POLY_SET> usable for GetEffectivePolygon()

Fixes #4999
2020-08-10 03:22:24 +00:00
Ian McInerney 265c6fa3b7 Improve color theme support in the footprint preview widget
This ensures the colors used by the status text pane in the preview
widget are the same as the canvas, so there is a seemless transition
between the two.

Additionally, remove the scrollbars from the symbol preview widget
in the place symbol dialog - they are pointless.
2020-08-10 02:29:15 +01:00
Fabien Corona 133d082cc5 Pcbnew fix arc edition 2020-08-09 23:03:31 +00:00
Jon Evans 2fc9c7233d Add color layer for schematic aux items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4825
2020-08-09 17:39:52 -04:00
Ian McInerney c458b50fd9 Ensure the environment variables are synchronized between KiCad and Python
Before this, the environment variables inside Python wouldn't reflect
the updates to them made after the interpreter was started in Pcbnew.
This will call into Python and set the variables when they are changed,
since Python can't synchronize itself when running in an embedded
interpreter.

Fixes https://gitlab.com/kicad/code/kicad/issues/5071
2020-08-09 19:56:12 +01:00
bjpiccioni d08bf90576 ADDED: Geographic Reannotation 2020-08-09 12:43:05 -04:00
Jon Evans 43ab43ec9e Fix a few issues with Close Project
A new empty project needs to be reopened for now
Footprint info cache write only works with a project for now
2020-08-09 11:13:50 -04:00
Mark Roszko c6e388db14 Implement an app progress indicator in the taskbar
ADDED: Progress indicator in the taskbar

This adds a progress indicator to the Windows and macOS taskbar
icons to display the progress of some operations.

Note, this requires wxWidgets 3.1+
2020-08-09 10:55:00 +00:00
Peter Montgomery 4d460ec073 Delete 3D cache files with GUI settable number of days
KiCad stores 3D cache files but never gets rid of any of them.
This patch adds a new function called 'CleanCacheDir()'.  Any cache
files older than the passed 'number of days' parameter are deleted.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1928
2020-08-09 10:41:45 +00:00
Jeff Young 6b7503be8e ADDED properties passed between eescema and pcbnew.
And referencable from textVars.

Fixes https://gitlab.com/kicad/code/kicad/issues/5079
2020-08-08 22:49:04 +01:00
Jon Evans 79e40cf765 Fix a few issues with Close Projects MR
Store list of previously open projects only in kicad.json
Keep all management of open projects in SETTINGS_MANAGER

Also add kicadSettings() for convenience
2020-08-08 16:00:49 -04:00
Jeff Young 98237e96a4 Fix doubly-inited list.
Fixes https://gitlab.com/kicad/code/kicad/issues/4921
2020-08-08 16:25:30 +01:00
Jon Evans dcc484e114 CHANGED: Library editors are now usable with no project loaded
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3688
2020-08-07 18:02:34 -04:00
Jon Evans 413c2cc2c6 Don't use the schematic grid for page border in pcbnew
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5105
2020-08-07 17:12:21 -04:00
jean-pierre charras f46c1ccb32 Fix another incorrect (and useless) conversion of a wxString to and from std::string.
This useless conversion breaks non ASCII8 strings.
2020-08-07 19:44:34 +02:00
Jeff Young 00e77d1ba4 Implement pad & via aprons for hatched zones.
Fixes https://gitlab.com/kicad/code/kicad/issues/2519
2020-08-07 15:15:43 +01:00
mntmn bf60482b5c OpenGL GAL: support fallback without overlay buffer
On platforms with limited framebuffer attachments, like GC7000L
driven by the open source etnaviv driver, we can still use
GPU acceleration by drawing directly to the main buffer.

EDA_DRAW_PANEL_GAL::onPaint checks if an overlay target is
available in the GAL, and if not, redraws the whole view if the
overlay target should be dirty.

Clearing of the overlay target is a no-op if there is no overlay
buffer.

Signed-off-by: Lukas F. Hartmann <lukas@mntre.com>
2020-08-07 13:27:47 +00:00
jean-pierre charras 8005de27c0 Fix a compil warning and 2 Coverity warnings. 2020-08-07 13:13:25 +02:00
jean-pierre charras 9b6ade6b1c Fix a link issue (symbol not found). 2020-08-07 08:02:45 +02:00
Ben Ellis c3e9007e20 Added a check that canvas exists before trying to dereference it 2020-08-06 20:23:57 -04:00
Jeff Young 0ff5dcee69 Kick the lexer generator one more time... 2020-08-06 23:32:49 +01:00
Jeff Young f244f3b24c Last issue wasn't gcc/CLang after all, but the lexer not getting built. 2020-08-06 23:16:58 +01:00
Jeff Young 76bd344730 Preview for PCBNew colour settings editor. 2020-08-06 19:38:06 +01:00
Jeff Young f27661fa39 Be more flexible with user input; more multibyte safety. 2020-08-06 19:38:06 +01:00
Jeff Young dd0f33bcbb Get rid of extraneous char conversion. 2020-08-05 22:23:53 +01:00
jean-pierre charras ea71d9db81 Fix incorrect (and useless) conversion of a wxString to and from std::string.
This useless conversion breaks non ASCII8 strings.
2020-08-05 18:34:49 +02:00
jean-pierre charras a8028e57ee File history (recent opened files): fix incorrect behavior when a filename
contains non ascii8 code (utf16 value)
2020-08-05 15:48:03 +02:00
Jeff Young ff3d5f0de6 Generate grid event when pasting into cell.
Fixes https://gitlab.com/kicad/code/kicad/issues/4599
2020-08-05 01:22:29 +01:00
Jon Evans b3b567e591 A better approach to clearing color overrides 2020-08-04 19:50:26 -04:00
Jeff Young 0e9714fdba Simplify fp-info-cache escaping mechanism.
Fixes https://gitlab.com/kicad/code/kicad/issues/4969
2020-08-04 23:54:12 +01:00
Jeff Young 3cf5db3ce5 Allow cancelling of zone fills.
Fixes https://gitlab.com/kicad/code/kicad/issues/5035
2020-08-04 19:53:35 +01:00
Jeff Young 6075112ea0 Fix typo in resetting selection after rebuilding colour theme popup. 2020-08-04 14:45:09 +01:00
Jeff Young f67ba62c11 Don't stop when current item is reached: there might be more.
In particular, the two sub-items also count as "current" and need
to be deleted.

Fixes https://gitlab.com/kicad/code/kicad/issues/5057
2020-08-04 13:28:16 +01:00
Jeff Young 9c9fdb2569 More performant (and more correct) deletion of DRC markers.
Fixes https://gitlab.com/kicad/code/kicad/issues/5057
2020-08-04 11:45:07 +01:00
Jeff Young 7e63376266 Fix typo in DRC rule error reporting that causes crash. 2020-08-03 22:21:35 +01:00
jean-pierre charras a146cd9e2e JSON_SETTINGS: add more wxLogTrace() calls. 2020-08-03 08:44:34 +02:00
Jeff Young c56599ab07 Allow ERC/DRC markers to be deleted without deleting exclusions.
Fixes https://gitlab.com/kicad/code/kicad/issues/4953
2020-08-02 22:45:48 +01:00
jean-pierre charras df4226f896 Settings management: try to fix full filename issues when using non ASCII7 chars.
The fix convert all std::string storing a path to wxString (unicode support)
wxString were already used at many place to store paths, but not all.
For internal calculations mixing char strings and wide char strings is a recipe
for bug: any missing conversion between UTF8 and wxString breaks paths.
2020-08-02 21:31:03 +02:00
Jeff Young 07ab97a58b Read and update colour settings when changed in prefs.
Fixes https://gitlab.com/kicad/code/kicad/issues/5046
2020-08-02 18:43:18 +01:00
Jon Evans aae40148dc Switch to ordered_json and enable ignore_comments parser option 2020-08-02 13:11:16 +00:00
Jeff Young a58a75366e Give up on a cross-platform solution to non-ascii filenames.
Sometime it might be worth giving another go at it, but for now I
just put conditional compilation in.

Fixes https://gitlab.com/kicad/code/kicad/issues/5024
2020-08-01 19:47:29 +01:00
jean-pierre charras 1bcc819eed PANEL_COLOR_SETTINGS: avoid crash if the selected theme is no longer existing.
If a previously selected color theme is no longer existing, switch to the default
theme to build the panel.

Fixes #5032
https://gitlab.com/kicad/code/kicad/issues/5032
2020-08-01 20:23:18 +02:00
Jeff Young c8170d9430 Restore selection after rebuilding DRC/ERC tree.
Fixes https://gitlab.com/kicad/code/kicad/issues/5042
2020-08-01 18:19:58 +01:00
Jeff Young 689910ab0a Add missing include. 2020-08-01 15:57:44 +01:00
Jeff Young d586495c0a Preview fp edges & text while dragging in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/5037
2020-08-01 15:40:34 +01:00
jean-pierre charras 91e00e14a9 JSON_SETTINGS: partial fix of non ascii7 filenames on Windows.
It should work with ASCII8 filenames, but the member
m_filename is probably not always correctly initialized in all cases.
2020-08-01 16:08:39 +02:00
Jeff Young e86fc64e7d Check envvars as well before flagging as un-resolved.
Fixes https://gitlab.com/kicad/code/kicad/issues/4644
2020-08-01 00:24:26 +01:00
Jeff Young 625eca8170 Save language changes to file so they're picked up by other apps.
Fixes https://gitlab.com/kicad/code/kicad/issues/1939
2020-07-31 22:29:05 +01:00
Jeff Young 61c817377f Support for wchar_t Windows filenames in JSON settings. 2020-07-31 21:01:13 +01:00
Jeff Young 0e3d9dd2f1 Use ChangeValue() during init so we don't fire events.
Fixes https://gitlab.com/kicad/code/kicad/issues/5030
2020-07-31 18:44:54 +01:00
Jeff Young 6e4d4401ae Make sure to translate UTF8 std::string to wchars for wxString.
Fixes https://gitlab.com/kicad/code/kicad/issues/5024
2020-07-31 14:48:45 +01:00
jean-pierre charras 2d9b0b255b Better fix for OPENGL_GAL::DrawSegment() than initial commit 294dab.
segments having a length <= 1 internal unit are not drawn  in opengl gal.
So these segments are drawn as circle.
2020-07-31 15:41:21 +02:00
Ian McInerney 268dec5c19 Cleanup some build and Coverity warnings 2020-07-31 02:46:05 +01:00
Seth Hillbrand 294dabf640 GAL: Fix issue with small tracks being hidden
When drawing segments that are smaller than the segment width, OpenGL
did not use realistic values, leading to hidden, small tracks.  Instead,
we set the track to only draw a segment when the length is at least 1
radius long (so that we can see the full semi-circle at the track end)

Fixes https://gitlab.com/kicad/code/kicad/issues/5009
2020-07-30 15:11:39 -07:00
Jeff Young 577c1be391 Report all DRC rule errors, not just the first. 2020-07-30 14:27:42 +01:00
Jeff Young ebef7c03db Add simplified HTML reporter window. 2020-07-30 14:27:42 +01:00
Jeff Young 5a1b1c544a Add layer to rule grammar. 2020-07-30 14:27:42 +01:00
Seth Hillbrand b650e4568b Mirror hidden text in SVG plotter
We output a 0 opacity text in the SVG plotter to allow searching.  When
this text is changed to 100 opacity, it can show up on the user screen
and so needs to be mirrored to match the stroke font output

Fixes https://gitlab.com/kicad/code/kicad/issues/5001
2020-07-30 06:17:37 -07:00
Jon Evans a5fbbaa548 Don't hide sheet swatches in theme editor
Even if the override is turned off, the theme colors
will be used for sheets that don't have colors explicitly set.
2020-07-29 21:29:51 -04:00
Seth Hillbrand 0a4ce183a4 ADDED: polygon newlines every point
By default KiCad will now print each polygon point on its own line.
This adds to the vertical distance for large polygons but makes revision
control much cleaner as single point addition to a polygon does not
propagate to a diff over the full polygon.

Users/developers who want to save the files using the 4-points per line
have the ADVANCED_CONFIG setting 'CompactSave' which will provide the
original save method
2020-07-30 01:18:44 +00:00
Jon Evans b0c6a0f9ef Allow sheet colors to remain unspecified if not manually set
This way, when the user changes their color theme, any sheets
that did not have a specific color set will change with the theme.

Also add a button to clear color overrides from a sheet, because
any schematics that have been saved before this change will have
the colors set to something other than UNSPECIFIED.
2020-07-29 21:16:07 -04:00
Tomasz Wlostowski 64766d9754 common: build Lemon grammar for libeval_compiler only when Lemon is installed 2020-07-30 02:13:19 +02:00
Tomasz Wlostowski fe4695719d libeval_compiler: post-rebase fixes 2020-07-29 23:14:34 +02:00
Tomasz Wlostowski 3c80b98d1c libeval_compiler: CONTEXT runs the UCODE now (thread-safe solution), fixed some memory leaks 2020-07-29 23:14:03 +02:00
Tomasz Wlostowski 7dbd8ef802 EDA_TEXT: implement GetEffectiveShape() 2020-07-29 23:14:03 +02:00
Tomasz Wlostowski abe6ccf97e common: re-enable libeval_compiler and DRC proto test (fixed missing file issues) 2020-07-29 23:14:03 +02:00
jean-pierre charras 98b1f55e29 Eeschema: minor fixes: fix incorrect label in DIALOG_LIB_EDIT_PIN, electrical pin list.
Gives also to functions GetText() and GetBitmap() a more significant name.

Fixes #5007
https://gitlab.com/kicad/code/kicad/issues/5007
2020-07-29 17:04:52 +02:00
Jeff Young 9f6098321f Cleanup of extraneous calls for string conversion.
We're already in wx-land, so we don't need the GetData() calls.
2020-07-28 20:44:40 +01:00
PJM a1b79298a4 GerbView #2124 : Alternative drill file extension .txt
'.txt' is a common file extension for drill files.  This Merge
Request adds it to the list of extensions used in the File Open dialog
for Excellon Drill files.

Fixes issue https://gitlab.com/kicad/code/kicad/-/issues/2124
2020-07-28 04:59:50 +00:00
Jeff Young b74e125264 Read/write schematic netclass properties.
Fixes https://gitlab.com/kicad/code/kicad/issues/4990
2020-07-27 23:10:46 +01:00
Jeff Young 2ea5528cd0 Start compiling identifiers.
We'll need this if we support the "L == foobar" syntax, and besides
it should really be up to the parser client whether or not they use
identifiers with no function call or property reference.

It also allows us to generate error messages for unknown identifers.
2020-07-27 19:53:42 +01:00
Jeff Young 8a010bc23e Null safety for expression variables. 2020-07-27 19:53:42 +01:00
jean-pierre charras 0103164571 Simulator: optimize a plot function, to support large amount of points.
Redundant points are not plotted.

Fixes #4737
https://gitlab.com/kicad/code/kicad/issues/4737
2020-07-27 10:47:52 +02:00
Mark Roszko 8324cb30b7 Save the wxDisplay index to set the position of windows correctly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4338
2020-07-27 02:53:56 +00:00
Mark Roszko 7bdb98f961 libedit: Make context menu follow context 2020-07-26 20:16:38 +00:00
jean-pierre charras ed79ef8feb PDF plotter: better handling of non ASCII7 (unicode 16) chars.
Note also the PS plotter handle poorly these non ASCII chars.

Fixes #4957
https://gitlab.com/kicad/code/kicad/issues/4957
2020-07-26 17:59:02 +02:00
Seth Hillbrand 6900f04ee0 Change Zone extra clearance magic number to AC
Rather than keeping a magic number in the code, we set the default in
the advanced config setting and allow users/developers to modify it.
2020-07-26 07:20:24 -07:00
Jeff Young 552dde8976 Fix return value going out of scope.
(From Coverity report.)
2020-07-26 13:41:43 +01:00
Simon Richter 95c2b261e8 Don't mandate ownership semantics in API
This API doesn't transfer ownership, so no smart pointers are required --
this just needlessly tightens requirements on the user of the interface.

(Fixes five instances of MSVC C26410 warning)
2020-07-26 02:45:27 +00:00
Jeff Young bf445c1a95 Performance enhancements.
1) cache pad polygon outlines
   huge improvement in connectivity performance and a decent
   improvement in DRC performance
2) don't pre-allocate CONTEXT stack
   significant improvement in DRC rule performance
2) don't keep re-encoding strings
   decent improvement in DRC rule performance
2020-07-25 13:03:33 +01:00
Jeff Young f97c50bfde Give excluded DRC items their own layer.
(And fix a bug with the new mulit-layer zones and rule-based keepouts
at the same time which prevented me from testing it.)

Fixes https://gitlab.com/kicad/code/kicad/issues/4954
2020-07-24 01:28:25 +01:00
Jeff Young 6529e339a9 Don't store context in the uCode. (It's not thread-safe.)
Although it does give some pretty funny results when filling zones.
2020-07-23 22:21:13 +01:00