Commit Graph

5778 Commits

Author SHA1 Message Date
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
Jeff Young f2812773d4 Better handling of undefined values in Rule expressions.
This is particularly important to keep the user from having to
enter overly verbose statements such as:
A.Type == 'via' && A.Via_Type == 'buried'
when:
A.Via_Type == 'buried'
is perfectly clear.
2020-07-23 16:41:58 +01:00
Jeff Young 84085df82a Fix tokenizer to allow '_' in tokens. 2020-07-23 16:41:58 +01:00
jean-pierre charras c254b331f3 Pcbnew: Activate pad fabrication property in pad properties dialog.
It was previously an option of advanced config since 6 months.
It is now not optional.
2020-07-23 14:33:24 +02:00
Jeff Young 86c9adbcba Add auto-completion for DRC rule function calls. 2020-07-22 21:28:02 +01:00
Jeff Young 637571e0be Assume mm if units not given in DRC rules.
This keeps us from internalizing them as nm which appear to have
no effect (at least visually).
2020-07-22 15:11:23 +01:00
Jeff Young 150c781f27 Fixup formatting and coding style. 2020-07-22 14:33:32 +01:00
Jeff Young a6b6084a60 Add preflighting for DRC rule function calls. 2020-07-22 14:33:32 +01:00
Ian McInerney 21e199f675 Allow all common settings panels to be reset 2020-07-22 00:18:30 +01:00
Ian McInerney 9997c46ee4 Make Coverity use the main KiCad version string
Also create a kicad_build_version.txt file in the build directory
that only contains the version string.
2020-07-22 00:18:29 +01:00
Fabien Corona a1437f4a95 Eeschema : Add A5 sheet size 2020-07-21 00:00:36 +00:00
Jon Evans a107f7ce5b Fix a few issues with legacy project loading
- Prevent crash on project tree for "Empty project" item
- Correctly handle loading of legacy projects in tree view
- Fix an issue where legacy projects would not get saved

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4944
2020-07-20 19:39:59 -04:00
Jeff Young 095937563b Hook libeval compiler up to rule parser
- convert expression string tokens to single-quote-delimited
- fix bug where netclass assignments weren't getting updated after
  board setup dialog
- move property manager rebuild to lazy evaluation
- improve performance with wider use of const&
- retire DRC_SELECTOR stuff
- use wxString for GUI stuff (particularly translated stuff)
- fix EqualTo() to return false instead of asserting when op types
  don't match
- fix buffer overruns with fixed-size string buffers
- make expression function calls case-insensitive
- integrate expression errors into rule parser
- produce more and better error messages
- keep BOARD_ITEM ptrs const as long as possible
- fix a couple of uninitialized variables
2020-07-20 22:11:53 +01:00
jean-pierre charras 6d8fb94d86 Fix a few Coverity warnings. 2020-07-20 16:19:19 +02:00
Mark Roszko 3b727b5d16 Make preference groups not selectable 2020-07-20 13:45:46 +00:00
Seth Hillbrand aa788b452e Adding Fabmaster extensions 2020-07-19 20:46:14 -07:00
Ian McInerney 50b2271f84 Fix missing variable initialization 2020-07-18 23:56:39 +01:00
Seth Hillbrand a253c53fe7 Fix buffer overflow in dumpNode
The formatted string buffer doesn't need to be used, so we bypass it
with string concat
2020-07-18 13:33:23 -07:00
Ian McInerney 7b705af038 Refactor common QA components to create a single common library
This moves the program-specific code (e.g. BIU files) into
the program tests.

Also, create title_block.cpp to break a dependency that pulled
in eda_text.cpp when using the TITLE_BLOCK object.
2020-07-18 16:21:15 +01:00
Jeff Young bcb29b6bf8 Fix security issue (buffer overrun). 2020-07-18 11:44:12 +01:00
Jeff Young 49d242944d Don't treat new netclass as changing a netclass name.
In particular, since it goes from empty string to non-empty, the
oldName comparison will cause it to pick up all unassigned nets.

Fixes https://gitlab.com/kicad/code/kicad/issues/4922
2020-07-18 11:44:12 +01:00
Ian McInerney cc688a3e1d Initialize variables properly
Fixes https://gitlab.com/kicad/code/kicad/issues/4919
2020-07-18 00:36:47 +01:00
Urja Rannikko aa7ab46a06 GAL: Round the incoming mode parameter in fragment shader
This fixes some letters being randomly boxes and some circles
being randomly triangles on the Mali T760.
2020-07-17 20:24:18 +00:00
Urja Rannikko 65ceeebc71 GAL: Remove dead code regarding SHADER_LINE_B in the fragment shader
The only test for it was only called from a function
that's called if the mode is SHADER_LINE_A, not B.
2020-07-17 20:24:18 +00:00
Jeff Young 3fd0a3f842 Update text variables even when they're changed from other binary.
For instance, you might have PCBNew open but change the variable
value through EEschema > Schematic Setup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4918
2020-07-17 21:05:11 +01:00
Jeff Young 33480ecad1 Show all symbol libraries by default.
Also fixes an issue where the plugin wasn't getting reset if the
library type was changed.
2020-07-17 18:33:14 +01:00
Jon Evans 5401f06fce Don't nag when we can't save project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4164
2020-07-16 22:56:02 -04:00
Jeff Young 20ca836ab3 Use consistent naming for project manager. 2020-07-16 01:39:29 +01:00
Ian McInerney af729d578f Unify settings reset buttons into one location 2020-07-16 00:08:16 +01:00
Ian McInerney 4ee8ea1318 Initialize variable in hash computation 2020-07-15 22:58:05 +01:00
jean-pierre charras 9f20c61fa7 Remove creation on the fly of a wxPaintEvent instance (fix previous commit). 2020-07-15 14:56:35 +02:00
Jeff Young 7d07e6719f Make sure eeschema default grid is 50mils.
Fixes https://gitlab.com/kicad/code/kicad/issues/4835
2020-07-15 13:51:12 +01:00
jean-pierre charras 6366aa3ede Remove creation on the fly of a wxPaintEvent instance (final step).
This is not allowed in 3.1.4 wxWidgets.
2020-07-15 12:58:43 +02:00
Jeff Young e9da02e2d5 Only reserve hotkeys for focused textCtrls that are editabled.
Otherwise just send Ctrl-C to the disabled control, and everything
else to the tool framework.

Fixes https://gitlab.com/kicad/code/kicad/issues/4801
2020-07-14 13:30:43 +01:00
Jon Evans 97c360aa9b Fix saving of default netclass
This was broken as a side-effect of 3939b31
Default netclass doesn't get the "nets" member
but still needs to be added to the array of classes

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4860
2020-07-13 19:53:03 -04:00
Jeff Young 940570e9ec Catch exception so that we at least throw up an error message.
Fixes https://gitlab.com/kicad/code/kicad/issues/4677
2020-07-13 22:41:56 +01:00
jean-pierre charras d34f8fd4b5 Prepare removing creation of a wxPaintEvent instance, not allowed in 3.1.4 wxWidgets 2020-07-13 19:53:07 +02:00
Jeff Young 1cd2a51db2 Make undo/redo lists protected. 2020-07-13 15:53:36 +01:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

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

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

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Seth Hillbrand 9f09c3872f Ensure file reads always use the C-locale variant
Str2Double assumes current locale.  We usually switch the locale when
reading files but we should be using the function that explicitly gets
the C-locale conversion.
2020-07-12 20:03:50 -07:00
Jon Evans a94a81b9a8 GAL: Handle text opacity in OpenGL
Vertex alpha was being dropped in the font shader
2020-07-12 11:16:28 -04:00
Jon Evans 5d118b0700 More visibility settings infrastructure
ADDED: Three-state high contrast mode action
ADDED: Save contrast mode in local settings

Also some initial infrastructure for layer presets
2020-07-11 21:59:07 -04:00
Wayne Stambaugh abcbfaa481 Fix ngspice version information issue.
The config.h header for ngspice is not packaged with all platforms so
use pkg-config to fetch the version information when available.  When
pkg-config is not available, check if the ngspice/config.h file is
installed on the system before including it to build the ngspice version
string.  If neither pkg-config or ngspice/config.h is available set the
version string to "unknown".

Fixes https://gitlab.com/kicad/code/kicad/issues/4851
2020-07-11 19:07:10 -04:00
Wayne Stambaugh e254d8cd29 Fix about dialog padding on GTK builds.
As expected, the required padding difference between wxStaticText and
wxHyperlinkCtrl varies depending on the platform.  Restore the original
padding which was correct for windows and add the extra padding required
for GTK builds.  Someone with MacOS should verify if the padding looks
correct and change the padding for MacOS as required.
2020-07-11 22:42:46 +00:00
Jeff Young e325d2e18f Allow Net Inspector to create, rename and delete nets.
ADDED: create/edit/delete nets in PCBnew Net Inspector
ADDED: update from PCB now allows updating of changed nets

Fixes https://gitlab.com/kicad/code/kicad/issues/1996
2020-07-11 21:19:49 +01:00
Simon Richter c407e96b14 std::min/std::max requires <algorithm> 2020-07-11 15:46:57 +02:00
Jon Evans 72b08f2b18 ADDED: Hide ratsnest for specific nets
List of hidden nets stored in project local settings
Hide/Show actions in context menu only for now, will
add them to some more GUI places soon.

Ref https://gitlab.com/kicad/code/kicad/-/issues/1951
2020-07-10 21:06:17 -04:00
Seth Hillbrand 7201e9d7eb pcbnew: adjust component hash for GenCAD export
The previous hash was not unique for changes in integer/boolean values.
Generic hash_combine routines provide decent coverage for limited extra
cycles.
2020-07-09 17:40:30 -07:00
Ian McInerney af24a5d5a7 Properly dismiss the grid combobox editor when it loses focus
The old way of checking for focus loss caused GTK to be unable to
even open the combobox. This way checks for the event sent when the
list closes and uses that to close the grid editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/4617
2020-07-09 20:37:08 +01:00
Jon Evans b1b9cef5fb Full-project automatic backup system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4763
2020-07-09 13:55:19 +00:00
jean-pierre charras 5226d6b4df libcommon build: add NGSPICE_INCLUDE_DIR in include list (similar to Eeschema build).
Useful when ngspice is build by the developer in a specific folder.
Fix also an other minor compil warning.

Fixes #4851
https://gitlab.com/kicad/code/kicad/issues/4851
2020-07-09 08:46:59 +02:00
Jon Evans afd432e687 Infrastructure for net hiding
LoadProjectSettings changed to take place after the board
has been loaded so that board-specific project settings can
be applied (such as net visibility and color overrides)
2020-07-08 21:59:34 -04:00
Jeff Young 741481591e NetClass settings for Eeschema.
ADDED Eeschema-specific netclass settings including wire and bus
thickness, color, and line style.

Netclasses override individual wire & bus colors and line styles.
If that proves an issue we might look at something more sophisticated
with inheritance.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-08 21:23:25 +01:00
Wayne Stambaugh 485518a5e2 Add ngspice build version to KiCad build information.
Fixes https://gitlab.com/kicad/code/kicad/issues/4833
2020-07-08 13:28:26 -04:00
Wayne Stambaugh 55dc0e8b2f Fix about dialog control spacing.
There is a difference between how wxStaticText and wxHyperlinkCtrl
controls are rendered causing alignment issue between the two.  The
cheap and dirty solution was to pad the wxStaticText but this may
yield inconsistent results depending on the platform.

Fixes https://gitlab.com/kicad/code/kicad/issues/4843
2020-07-08 12:56:29 -04:00
jean-pierre charras 8c15ecf8e4 Gerbview: fix issues when setting the grid color and the worksheet color.
The issue for the grid color was due to the fact there are 2 places to
store the color: the color settings and the m_gridColor GERBVIEW_FRAME member.
The worksheet color (color set to RED after a color change in layer render)
is a bit strange: looks like LAYER_GERBVIEW_WORKSHEET and LAYER_WORKSHEET
are both used to draw the worksheet.
2020-07-08 18:49:12 +02:00
Jon Evans 3dd2dc89ad Fix default values for color theme editor
At the time of creating a copy, the defaultColors map
is not initialized, so needs to be initialized from the
copy constructor.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4841
2020-07-08 12:19:10 -04:00
Ian McInerney 37ce9fb847 Tell wx that we really want a transparent background
Try more options for telling wxWidgets that we want the area
to have a transparent background. Also, fix some spacing issues.

Fixes https://gitlab.com/kicad/code/kicad/issues/4842
2020-07-08 16:29:04 +01:00
jean-pierre charras 55daf645b6 UNIT_BINDER::Validate(): fix incorrect display of val min and val max.
When Validate() find an out of limits user value, it displays the limits.
However, the displayed limit value was incorrectly converter to internal units,
and strange values were displayed.
2020-07-08 10:27:31 +02:00
Jon Evans 5d14dc9034 Fix assert that occasionally happened when loading file history
ClearFileHistory must be used to update the underlying data
2020-07-07 23:42:47 -04:00
Jon Evans 961fbadd23 Initial infrastructure for net/netclass colors in board 2020-07-07 22:21:45 -04:00
Ian McInerney c6eb072726 eeschema: Fix cutoff text in pinmap
Ensure the proper bounding box is used when computing the amount
of space taken by angled text in the control.

Fixes https://gitlab.com/kicad/code/kicad/issues/4761
2020-07-07 23:12:17 +01:00
Ian McInerney 0f0e845d74 Add parsing for centimeters into the numeric evaluator
ADDED: Allow cm as a unit in text field expressions

Fixes https://gitlab.com/kicad/code/kicad/issues/4797
2020-07-07 23:12:17 +01:00
Ian McInerney 4cd0ec8808 Fix library tree column widths when tree is refreshed
GTK only calculates new widths once the tree is displayed,
so calling Refresh after updating the tree but before display
will return a column width of 0. Instead, use saved column
widths if an invalid width was returned.

Fixes https://gitlab.com/kicad/code/kicad/issues/4837
2020-07-07 23:12:17 +01:00
Ian McInerney 53bbf69466 Expand choicebox to ensure GTK can display the full strings
Fixes https://gitlab.com/kicad/code/kicad/issues/4715
2020-07-07 23:12:17 +01:00
Jeff Young 77313e4398 OK, so maybe it's a WxWidgets version issue? 2020-07-07 15:28:22 +01:00
Jeff Young 3c791c1016 Fix Linux compile issue. 2020-07-07 15:16:19 +01:00
Jeff Young e66523586b Add Assign Netclass... to context menu.
ADDED Assign Netclass feature to EEschema.

Netclass assignments also now shown in status bar.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-07 14:23:39 +01:00
Jon Evans a3655225cd Save selection filter state in project local settings 2020-07-06 21:53:12 -04:00
Jeff Young 3939b31027 Integration of netclasses into Eeschema.
This is mostly architecture, with the hookup of the Schematic Setup
dialog's Net Classes page.  Things like assigning to a net on the
canvas to follow.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-06 20:00:50 +01:00
Jeff Young b0ca7d5140 Netclass setup for Eeschema.
ADDED netclass panel in Schematic Setup dialog.

Fixes https://gitlab.com/kicad/code/kicad/issues/2132
2020-07-06 20:00:50 +01:00
Jeff Young 2819570d1e Push panel_setup_netclasses down into common. 2020-07-06 20:00:50 +01:00
jean-pierre charras 0d8c6d43a8 fix minor I18N issues. 2020-07-06 13:47:42 +02:00
Jon Evans 1845d3fe35 Disable broken cmake directives added in DRC merge 2020-07-05 18:16:38 -04:00
Tomasz Wlostowski 49c37014f7 Updated copyright headers in expression evaluator code 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 8ffa86a63f get it to compile after rebase 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 9d0f5c7f94 PROGRESS_REPORTER: implement SetCurrentProgress() method 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 65a1ed96e0 libeval_compiler: silence temporary debug stuff 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 3268f98fd7 libeval_compiler: support for method calls (e.g. item.onlayer('layer') ) 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 3005aab444 common: libeval_compiler :virtual method support 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski af5afb5dd7 pcbnew: initial version of PCB-specific expression evaluator 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski aaa91655aa libeval_compiler: integrated in common/ 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 4ffb82b4e3 PROPERTY_MANAGER: added GetAllClasses and GetMatchingClasses methods 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski ba8b058c98 PROPERTY_MANAGER: don't be case-sensitive with property names 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski c1d5394e46 properties: post-rebase fixes 2020-07-05 22:44:38 +02:00
Maciej Suminski f084a86601 Properties replacement method
Adds a possibility to replace properties inherited from base types with
a more specific ones. For example, such properties may have:

- different meaning which should be reflected in property name
  (e.g. TRACK::{G,S}etWidth() sets actual track width, but
  VIA::{G,S}etWidth() modifies the diameter)

- different set of possible values (e.g. BOARD_CONNECTED_ITEM::SetLayer()
  should accept any copper layer, but MODULE::SetLayer() works only with
  F.Cu and B.Cu)
2020-07-05 22:44:38 +02:00
Maciej Suminski a289056a9e Properties meta-data for pcbnew classes 2020-07-05 22:44:38 +02:00
Maciej Suminski cbd5004fd4 Properties (introspection)
Introduces classes:
- INSPECTED: base class for types taking advantage of
  generic properties system.
- PROPERTY*: meta-data storing information about properties
- PROPERTY_MANAGER: singleton class to get properties data
2020-07-05 22:44:38 +02:00
Jon Evans 6eca886292 Fix some UTF8 issues with project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4808
2020-07-05 12:26:14 -04:00
Jon Evans baac062e30 Fix typo that prevented netclass settings from loading
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4804
2020-07-05 11:32:17 -04:00
Qbort f3f17401dc Fix OPENGL_GAL initialization sequence
- New public static function OPENGL_GAL::CheckFeatures() gets called in EDA_DRAW_PANEL_GAL::SwitchBackend() before switching to OPENGL_GAL
- Moved all OpenGL feature checks from OPENGL_GAL constructor to OPENGL_GAL::init()

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4714
2020-07-04 10:54:30 +00:00
Jon Evans a02a4ff179 Clean up worksheet draw items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3882
2020-07-03 23:06:37 -04:00
Jon Evans d143e14694 Fix memory leaks in color theme editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4794
2020-07-03 22:34:41 -04:00
Jon Evans 3d7610d6b9 Hide PNS debug graphics behind an AC key
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4061
2020-07-03 19:33:36 -04:00
Thomas Pointhuber 7ba6a77c94 Improve arc geometry manager to choose the direction which makes more sense
As long as the arc angle stays below <60°, it will automatically choose between
clockwise and counter clockwise. This allows the user to choose the direction
with a simple mouse movement.
2020-07-03 15:05:17 +00:00
Seth Hillbrand a210fd570f Set VSYNC to adaptive (if available)
Swap syncs can limit the redraw rate as the screen waits for previously
issued syncs.  Setting this to -1 allows for adaptive swapping
(resorting to unsynced if it falls behind) if it is supported by the
card but will fall back to unsynced (0) if the adaptive is not
supported.

Fixes https://gitlab.com/kicad/code/kicad/issues/4226
2020-07-03 13:27:48 +00:00
Seth Hillbrand af064eacdd Silence boost:optional compiler warning 2020-07-02 19:23:58 -07:00
Jon Evans 4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00
Jon Evans fe5959b625 Remove the schematic and board backup file system
Per discussion on the developers list, this old system
no longer provides much value and is seen as annoying
by many users.  The new save logic should prevent any
cases of file corruption on save, which was a major
reason for the backup file system existing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2012
2020-07-02 22:08:54 -04:00
Jon Evans b592a4169f Update project template system for new format 2020-07-02 22:08:54 -04:00
Jon Evans 12b4a55ae8 Port Eeschema to new project settings
DRC/ERC error serialization changed to use explicit tokens
Old stored severities and ignored errors are discarded
2020-07-02 22:08:54 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Jon Evans 0e2f9cb1bd Migrate CvPcb project parameters 2020-07-02 22:08:54 -04:00
Jon Evans a4fadfcdf2 Begin moving project file load to new system 2020-07-02 22:08:54 -04:00
Jon Evans a5a19076fd Move PROJECT storage to SETTINGS_MANAGER 2020-07-02 22:08:54 -04:00
Jon Evans a7708fa6dc Add PROJECT_FILE and basic load/unload methods 2020-07-02 22:08:54 -04:00
Seth Hillbrand 7e3a338518 Move warning flags to proper place
Cleans unitialized warnings in wxApps
2020-07-02 12:17:45 -07:00
Jeff Young e26625fc99 Scale polygon drawing guides with zoom.
Fixes https://gitlab.com/kicad/code/kicad/issues/4769
2020-07-01 17:32:15 +01:00
jean-pierre charras 3993181de5 D_PAD::BuildEffectiveShapes(): fix incorrect rect shape size for rect pads
rotated by +-90 deg
Noticeable in PnS router.

Fixes #4771
https://gitlab.com/kicad/code/kicad/issues/4771
2020-07-01 16:06:31 +02:00
Jeff Young 4694b52e1f Lazy rebuild of color themes dropdown.
This allows you to (for instance) create a new theme in PCBNew and
then select it in Footprint Editor.
2020-06-30 18:32:31 +01:00
Jon Evans 44f3cdb31e Fix a few issues with zone islands 2020-06-29 12:16:37 -04:00
Lukas F. Hartmann f5842156a5 GAL: disable glCopyBuffer for etnaviv vendor 2020-06-28 17:01:26 +00:00
Jon Evans 1d5e4f86af ADDED: Copper zone island removal is now configurable
ADDED: Zones and keepouts can now be named (for DRC)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4392
2020-06-28 09:09:38 -04:00
Jon Evans 7532cf4ab0 Add support for data type to UNIT_BINDER 2020-06-28 08:52:37 -04:00
Jon Evans 0b34cea3d5 Add an optional name property to zones 2020-06-28 08:51:57 -04:00
Jon Evans bd19c580f4 Add configuration for cross-probing behavior
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2317
2020-06-27 22:48:48 -04:00
Jeff Young 32c3ea4edd Flags cleanup.
Remove extraneous use of FLAG0 from tracks cleaner (it was checked but
never set).

Fix issue in expand connections where two parts of it couldn't agree
on the same flag (BUSY vs SKIP_STRUCT), and where the second part was
clearing the flag instead of setting it.

Remove obsolete HIGHLIGHT infrastructure (we now use selection).

Remove extraneous use of BUSY flag in several places (it was never
set).
2020-06-27 17:53:04 +01:00
Ian McInerney fb10406e67 Add right-click context menus for toolbar items 2020-06-26 21:29:03 +00:00
Ian McInerney 52856a8ce4 Move scaled toolbar separator into ACTION_TOOLBAR
* Ensure all separators are scaled separators
* Clean up toolbar creation functions
2020-06-26 21:29:03 +00:00
Seth Hillbrand 05a89863c5 GRID_TRICKS: Ensure destinations can take value
Cut/Paste need to set values in the table.  We need to check that the
destination can take the string values before blindly setting.

Fixes https://gitlab.com/kicad/code/kicad/issues/4724
2020-06-26 09:07:28 -07:00
Seth Hillbrand 4ef02fd699 Replace TTL delauney triangulator
Removes the TTL triangulator in favor of the delaunator triangulator.
This removes the only AGPL code in the KiCad codebase and therefore
allows the full project to be licensed under the GPLv3.
2020-06-25 18:45:27 +00:00
jean-pierre charras 534bcc8db0 very minor fix: change the default value user grid size to 10mils
Previously, was 12.5 mils, acceptable for pcbnew but not for eeschema.

Now set to 10 mils.
2020-06-25 10:17:27 +02:00
Wayne Stambaugh 2078e629c5 Eeschema: allow editing of junction properties diameter and color.
Add missing plot and print changes for the new bus entry properties.

ADDED: Junction properties diameter and color can now be edited.

Fixes: https://gitlab.com/kicad/code/kicad/issues/4593
2020-06-24 13:36:17 -04:00
Jeff Young 5ee806c3a3 The dispatch-behind & whitelist stuff got broken again, so I've
retired them in favour of a much dumber hack that special-cases
only ctrl-U for units switch.
2020-06-24 12:22:42 +01:00
Jeff Young 18ab3c4714 Fix missing user grid in COMMON_TOOLS.
Fixes https://gitlab.com/kicad/code/kicad/issues/4702
2020-06-23 11:17:15 +01:00
Jon Evans 713cd4a47a Point editor: show dragged points with a highlight
Take points editor colors from color theme

Also fix an issue where the edited object sometimes didn't
update when a point is dragged.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4600
2020-06-21 14:43:41 -04:00
Ian McInerney 96a5a96037 Fix GTK window position when closed maximized
GTK only sends one maximize event, and it happens after the
window is maximized, so we shouldn't check for not being maximized.
2020-06-19 20:13:03 +01:00
Ian McInerney 5b3d947b7e Fix initialization order fiasco with colors
The legacy color refs are needed by the COLOR4D constructor
when constructing a static variable, so they can't be static
themselves.
2020-06-19 17:05:18 +01:00
Ian McInerney 5649558cff Move DPI_SCALING into the GAL from common
It should be owned by the GAL, since it is used
with the OpenGL canvas infrastructure.
2020-06-19 17:02:46 +01:00
Jeff Young a1332d76fe Remove SHAPE_EDITOR frame types before we forget about them.
They may go back at some point, or they may not....
2020-06-19 14:10:41 +01:00
Ian McInerney fe1e835471 Cleanup some unused files 2020-06-19 12:34:15 +01:00
Jon Evans aa7ce74ad5 Fix overzealous autoformatter 2020-06-18 23:26:10 -04:00
Jon Evans e91b9f6dfb Rip out the unused leftovers of the old color system 2020-06-18 22:32:14 -04:00
Jeff Young cae493fe65 More infrastructure work for shape editor. 2020-06-18 15:38:01 +01:00
Jeff Young ee9d8fcd15 Collapse Pcbnew & ModEdit display and edit settings.
(Prep work for reusing them with a custom shape editor.)
2020-06-18 15:38:01 +01:00
Jeff Young 754f958be2 Attempt to fix duplicate ID issue on MSW. 2020-06-17 18:44:39 +01:00
Jeff Young a7703d1207 Cleanup Graphics to parallel Cleanup Tracks & Vias.
This also allows for easier migration to DRAWSEGMENT::S_RECTs by
auto-converting 4 rectilinear lines to a rectangle.
2020-06-17 18:44:39 +01:00
jean-pierre charras 5db2b6ed8d Action menu: ensure a wxEVT_COMMAND_MENU_SELECTED event is sent to the menu,
when a wxTextCtrl has the focus but is read only, and cannot use a CHAR event.
It fixes an issue in Kicad manager (menus with accelerator not working) when
the wxTextCtrl window showing messages has the focus.
2020-06-17 12:00:34 +02:00
Jon Evans 0dd34d197e Ensure currentGrid is valid on startup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4666
2020-06-16 19:59:00 -04:00
Seth Hillbrand 8c57821e9b pcbnew: Move ratsnest items to separate folder 2020-06-16 11:15:14 -07:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Seth Hillbrand a18aea3a43 Fix signed/unsigned comparison 2020-06-15 12:40:02 -07:00
Ian McInerney 9d78aa604f Force OSX to automatically scale the canvas on legacy settings read
As of ab83c862, the canvas scaling setting is now used on OSX
(before it was ignored). Legacy settings would have this set to 1.0,
which would not automatically scale the canvas and break on Retina
displays. OSX auto detection works well enough in wx 3.0, so we
can use it now.
2020-06-15 00:30:52 +00:00
Jeff Young ad12c42e8b Push grid settings dialogs down into common.
This also gives support for fast grid switching and a user grid
to eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/2200
2020-06-14 19:26:37 +01:00
Seth Hillbrand 810f668d45 Fix compile error
Reading integer config values are implicitly cast and need to be
specified.
2020-06-14 06:53:12 -07:00
Jeff Young 998fe12a5a Make sure COMMON_TOOLS initializes the grid. 2020-06-13 22:44:16 +01:00
Jeff Young c48f4272f3 Collapse a level out of the zoom settings.
The APP_SETTINGS_BASE now holds the list of zoom factors, and
the old legacy (screen-based) code has been removed.
2020-06-13 22:44:16 +01:00
Jeff Young fc44506fe1 Give up on enforcing non-defined-internal-units.
It results in trade-offs in packaging and/or conidtional compilation
which are worse than the disease.
2020-06-13 22:44:16 +01:00
Seth Hillbrand a02d8a5993 Fix a number of signed/unsigned comparisons 2020-06-13 11:55:59 -07:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Ian McInerney 60915fbc76 Default canvas scale setting to automatic on OSX
Fixes https://gitlab.com/kicad/code/kicad/issues/4652
2020-06-12 18:39:08 +01:00
jean-pierre charras 1973153368 Gerber plotter: ensure the gerber region for a round rect pad is always closed.
Due to rounding issues, sometimes (especially for rotated pads) the region
(4 segments+4 arcs) was incorrectly closed (1 unit (nanometer) mismatch between
start point and end point.
Although it does not create bad shape, its breaks the round rect pad identification
in CAM tools.
start point and end point are now the same.
2020-06-12 10:22:19 +02:00
Ian McInerney 4d6abfdf05 Fix DELETE in Scintilla
The previous method would act like backspace at the end
of the string
2020-06-05 14:24:26 +01:00
Jeff Young 22b8133108 Change DELETE behaviour from delete sel to delete forward.
In other words, if there's no selection delete the character in
front of the cursor.

Fixes https://gitlab.com/kicad/code/kicad/issues/4609
2020-06-05 14:09:09 +01:00
Ian McInerney 4357c1d3b3 Coverity and compiler warning fixes
* Initialize variables
* Test dynamic casts

Fixes https://gitlab.com/kicad/code/kicad/issues/4620
2020-06-05 12:50:56 +01:00
Ian McInerney ab83c86210 Remove the platform-specific GetBackendScalingFactor from HIDPI_GL_CANVAS
The scaling factor stored inside the canvas is created by a DPI_SCALING
helper, which will call the platform-specific functions if no user scaling
is specified. This change only affects OSX and Retina displays, so this
now also allows custom scaling to be used on OSX if desired (although it
shouldn't be needed, since wx has detection for it in 3.0.4).
2020-06-05 00:15:54 +00:00
Jeff Young 0ddf53397f Make sure CvPcb gets its Cancel button fixed up.
It's no longer a DIALOG_SHIM so it can't depend on its fixup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
2020-06-04 22:35:01 +01:00
Jeff Young b274b9f972 Fix type-checking which was too tight.
Also fixes a typo leaving the return statement in the wrong place.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
2020-06-04 22:35:01 +01:00
Johannes Pfister 8e8979e317 Fixed a memory leak in CONDITIONAL_MENU
CONDITIONAL_MENU::ENTRY now owns the wxItem object.
2020-06-04 19:08:59 +00:00
Ian McInerney d46f9a5273 Give the 3D viewer an infobar & Infobar upgrades
ADDED: Infobar warning in 3d viewer for board outline issues
2020-06-04 00:13:27 +01:00
Wayne Stambaugh 0032845f9e Fix clipped bitmap buttons with GTK on Linux.
A note to developers, please do not set the minimum and/or size of bitmap
buttons.  It causes bitmaps to get clipped using GTK on Linux.  If the
bitmap button size is not acceptable, then supply an appropriately sized
bitmap rather than attempt to force the wxWidgets sizing mechanism to do
what you want.  This almost always causes platform differences that do
not work well.
2020-06-03 14:01:44 -04:00
Ian McInerney a843c74529 Add new kiplatform library for platform-specific code
* Implement ReparentQuasiModal for OSX natively
* Implement ForceFocus of OSX natively

This change means we no longer rely on the kicad-specific functions in our osx wx fork.
2020-06-03 14:58:54 +00:00
Ian McInerney 57e35c9a60 Fix infobar bitmap size
Fixes https://gitlab.com/kicad/code/kicad/issues/4514
2020-06-02 00:20:08 +01:00
Jeff Young 7aaf72c473 Improve visuals of html error reporting. 2020-06-01 22:00:03 +01:00
jean-pierre charras 59523efc1a Eeschema: fix a crash after reopening the ERC dialog, after changes in schematic.
When the ERC is run and a component has a ERC error linked to it, if it is deleted,
when reopening the ERC dialog, the dialog crashed due to a not found item
(null pointer use)
2020-06-01 19:42:16 +02:00
Jon Evans daad2824c5 Add ability to skip JSON writes if the params aren't modified 2020-05-30 18:07:24 -04:00
Jeff Young 0741bbb1b9 Move autocomplete to the remove filtered items paradigm.
Fixes https://gitlab.com/kicad/code/kicad/issues/4190
2020-05-30 20:09:09 +01:00
Jeff Young 449c90a0ae Some more work on getting wxWidgets to stop stealing textEntry keys.
Fixes https://gitlab.com/kicad/code/kicad/issues/1941
2020-05-30 12:32:33 +01:00
Jeff Young a6eaa3257a Autocomplete for page layout editor text items. 2020-05-30 10:22:50 +01:00
Jon Evans fbef52ec33 Don't process hotkeys on text entries
Thanks @jeffyoung for the suggestion

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4463
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1941
2020-05-29 21:20:44 -04:00
Jeff Young 112316cdfb Fixup kiway by hand when dynamic_cast fails.
Also allows a shortened version of Configure Paths without the 3D
paths when Pcbnew isn't already running.

Fixes https://gitlab.com/kicad/code/kicad/issues/4568
2020-05-29 22:06:48 +01:00
Wayne Stambaugh b624c7090a Deprecate saving legacy schematic and symbol library file formats.
REMOVED: The ability to save schematics in the legacy file format.
2020-05-29 12:43:00 +00:00
Jeff Young e8524163db Another attempt to reconcile GTK and OSX slider spacing. 2020-05-28 23:07:16 +01:00
Jeff Young f4e7e201d8 Use a big hammer when beating wxWidgets over the head. 2020-05-28 22:18:30 +01:00
Jeff Young b06a454559 Try and find settings that look good on both OSX and GTK. 2020-05-28 21:41:17 +01:00
Jeff Young 8f533e1833 A bit of dialog cleanup. 2020-05-28 19:59:18 +01:00
Jeff Young 2c0f3c8088 Recurse into title block fields when resovling text vars.
Fixes https://gitlab.com/kicad/code/kicad/issues/4554
2020-05-28 17:36:22 +01:00
Jeff Young 9f2be3714f Add unresolved variable testing for worksheet items. 2020-05-28 17:36:22 +01:00
Jeff Young fe4fd19c66 Fix crash bug in unicode chars with Scintilla. 2020-05-28 00:23:18 +01:00
Jeff Young 8b084c373e Autocomplete for text variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4190
2020-05-27 23:29:51 +01:00
Jeff Young e4f4de0221 Improve spacing in migrate settings dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/3989
2020-05-27 23:29:51 +01:00
Jon Evans 40dc7a5eef Update legacy migration of common settings for mousewheel pan 2020-05-26 21:43:59 -04:00
Jon Evans 695cdbbde8 Move bug reporting to COMMON_CONTROL; add to Help menu
Also make a shorter version of the version info string
and some other shortening edits to the issue template
to fix occasional 500 errors thrown by Cloudflare due
to excessively long URLs

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3953
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4272
2020-05-26 21:18:32 -04:00
Jon Evans c6a6c071cf PDF Plotter: avoid assert if default pen width is zero 2020-05-26 21:17:39 -04:00
jean-pierre charras 8226e5f0e2 Minor fix: add Fab layers to the assembly layers list. 2020-05-26 19:57:22 +02:00
Wayne Stambaugh f262e08d40 Symbol editor: fix crash when editing new symbol value field.
This also fixes an ASAN accessing deleted memory warning.  See the issue
tracker comments for more information.

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

(cherry picked from commit a16e9ac76a)
2020-05-26 13:20:32 -04:00
Jon Evans 711fc999f2 Coverity fixes 2020-05-25 19:29:41 -04:00
Jeff Young 1db799d841 Implement "disallow" rules and integrate with keepout settings. 2020-05-25 22:51:47 +01:00
Jeff Young c415130de9 Improve parse error messages. 2020-05-25 22:51:47 +01:00
Jeff Young 160981ee71 Better error reporting for DRC rule parsing. 2020-05-25 22:51:47 +01:00
Jeff Young 416d82727f Redo DRC rules to get ready for new system. 2020-05-25 22:51:47 +01:00
jean-pierre charras 077611b8f1 BITMAP_BASE, Eeschema: fix incorrect position of the bitmap when printing.
The previous calculation was not compatible with aDC->SetTransformMatrix()
used in PrintPage in Eeschema.
2020-05-25 07:51:46 +02:00
Jon Evans 237bf35362 Fix accidental revert of touchpad to trackpad 2020-05-24 16:24:43 -04:00
Jon Evans a52435bbb0 ADDED: New mouse settings panel, expanded mouse settings
You can now choose the behavior of dragging with the
middle and right mouse buttons.

You can also choose which modifier keys to use for
panning and zooming with the scroll wheel or trackpad.

You can also customize the zoom speed, which makes
it possible to have a good zoom experience on a wider
range of input devices.

You can also now zoom by dragging with the right or
middle button if desired.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3885
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4348
2020-05-24 14:38:28 -04:00
Jon Evans c7daf8a8f3 ADDED: Cross-probe highlighting of bus members
Note: this is a basic implementation but it could be
improved once we include bus information in the netlist
and pcbnew can natively keep track of buses and nets
instead of just nets.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4158
2020-05-24 13:30:23 -04:00
Ian McInerney a6e9efbe57 Add icon for schematic reverse annotation
Fixes https://gitlab.com/kicad/code/kicad/issues/4527
2020-05-24 12:13:48 +01:00
Ian McInerney c7e512852a Fix escape key event propagation regression from bdf94916
The escape key event shouldn't be propagated after the first
tool dispatcher. Propagatint it causes it to go to parent frames,
which can mean problems arise (such as in cvpcb, where an
escape key press in the fpviewer frame was closing the main
cvpcb window when it is propagated).
2020-05-24 11:58:33 +01:00
Ian McInerney 4ecf99e7c8 Give the footprint viewer a toolbar and remove the options dialog
CHANGED: Cvpcb fpviewer and the pcbnew fpviewer no longer have an options dialog
ADDED: Add a side toolbar to the pcbnew footprint viewer (and the measure tool)

This also cleans up some of the settings structs in the viewers, since
it was somewhat confusing before.

Fixes https://gitlab.com/kicad/code/kicad/issues/2205
2020-05-24 11:58:33 +01:00
Ian McInerney 6692935808 Consolidate common viewer actions across cvpcb and pcbnew frames
* Consolidate the measure tool into one tool (this gives cvpcb
  unit changing and snapping capabilities in its measure tool)
* Transition cvpcb to use actions for the sketch modes
* Replumb how magnetic items settings are stored and used
2020-05-24 11:58:33 +01:00
Stefan 7e6b2211e0 Add Assembly pcbview to pcb_layer_widget 2020-05-22 20:40:53 +00:00
Ian McInerney fca7ade81f Move to the AUI version of the infobar
The sizer-based version had issues with the event processing
inside the GAL panel on Windows systems.

Fixes https://gitlab.com/kicad/code/kicad/issues/4501
2020-05-21 18:22:56 +01:00
Jon Evans 7c7b7f41da Move SCH_SCREEN project access to SCHEMATIC
SCH_SCREEN no longer needs to be a KIWAY_HOLDER
2020-05-20 22:27:48 -04:00
Ian McInerney a49fde5ce0 Fix the UI for the infobar
* Remove the animations on show/hide
* Give the button a small right border
2020-05-20 20:16:34 +01:00
Ian McInerney b5dc213d76 Fix infobar sizer issue for wx 3.1
On wx 3.1, the sizer was iving too much space to the infobar.

Fixes https://gitlab.com/kicad/code/kicad/issues/4501
2020-05-20 19:00:19 +01:00
Ian McInerney 73a1ce3e84 Move eeschema find notification to the infobar and improve the infobar widget
* Move it to a panel along with the canvas to have a better UI
* Allow the infobar to automatically close after a set time

CHANGED: The eeschema find notifications now use the infobar instead of
a popup window
2020-05-20 02:31:47 +01:00
Ian McInerney 2bc57ade28 Cleanup parentage inside the draw panels 2020-05-20 02:23:46 +01:00
Jeff Young 0aaccfbb28 Save hole-to-hole-min to file. 2020-05-19 20:48:47 +01:00
Ian McInerney a2f027e063 Add an infobar widget to display information above the canvas
This widget allows for non-intrusive display of text
above the editing canvas. Currently, this is used
for displaying the read only status of the files.
2020-05-19 00:46:33 +01:00
Jon Evans d7bd4c9b04 Move Eeschema globals to new SCHEMATIC object
Set up a new lineage for SCH_ITEMS to get back to the SCHEMATIC
they live on: Items will all be parented to the SCH_SCREEN that
they are added to, and each SCH_SCREEN will point back to the
SCHEMATIC that it is part of.  Note that this hierarchy is not
the same as the actual schematic hierarchy, which continues to
be managed through SCH_SHEETs and SCH_SHEET_PATHS.
2020-05-18 13:04:56 -04:00
Jeff Young c7da63151c Clamp egregiously large numbers when plotting.
This keeps some plot file viewers (such as Acrobat) from choking.

Fixes https://gitlab.com/kicad/code/kicad/issues/4408
2020-05-18 13:38:17 +01:00
Jeff Young f5bbf24047 Cleanup unused code that was masking earlier stroking bug. 2020-05-18 13:38:17 +01:00
Jeff Young 21ae7907f2 Don't stroke text. Stroking is for move/line statements. 2020-05-18 13:38:17 +01:00
Jeff Young d8a74c13b8 Fix a syntax error in the PDF generator.
The /Trapped key needs to be the name False, which is not the same
as the boolean false.  Thanks PDF, that's clear as mud.
2020-05-18 13:38:17 +01:00
Ian McInerney e662e33104 Store the current filename in the history on close 2020-05-17 00:12:49 +01:00
Ian McInerney 613c020920 Move the file history into the frames 2020-05-17 00:12:49 +01:00
Jon Evans f2e003147e ADDED: Enable color themes for PcbNew printing 2020-05-16 13:19:43 -04:00