Commit Graph

6037 Commits

Author SHA1 Message Date
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
Jon Evans d599648ec7 ADDED: Enable color themes for schematic printing 2020-05-16 13:19:43 -04:00
Jeff Young d3f017d825 DRC rules parser and engine.
Fixes https://gitlab.com/kicad/code/kicad/issues/2182

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/1965
2020-05-16 15:53:05 +01:00
Jon Evans 92ce7caf9a Remove extra write to common view control settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4458
2020-05-15 21:37:17 -04:00
jean-pierre charras 3f8d11144e Avoid crash when reading a json config file having an unexpected parameter value.
Now print the json path in debug mode instead of crashing.
In release mode, skip the parameter (the default value is still used)

Fixes #4451
https://gitlab.com/kicad/code/kicad/issues/4451
2020-05-15 15:02:40 +02:00
emC5RgViIK 47297402d3 #include <algorithm> so std::sort is found. 2020-05-15 10:49:43 +00:00
Jeff Young 37adf7d3d5 Add text field for color definitions.
You can enter HTML notation, CSS 3-value notation (rgb), or CSS
4-value notation (rgba).  It will always print rgba.

Fixes https://gitlab.com/kicad/code/kicad/issues/4016
2020-05-15 00:18:15 +01:00
Jeff Young 3a9746c657 Add ~ processing in env vars.
Fixes https://gitlab.com/kicad/code/kicad/issues/1829
2020-05-13 23:45:32 +01:00
Jeff Young c9bf2eaa1d Fix PDF syntax error. 2020-05-13 18:04:08 +01:00
Jeff Young bcea2019d4 Unify support for line width magic cookies.
They were added for the Gerber plotter but once there there's the
expectation by others that they'll work.
2020-05-13 17:56:47 +01:00
Jeff Young a632e5fbdb Fix same parsing issue in PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/issues/4416
2020-05-12 20:38:58 +01:00
Jeff Young 301ac3461c Fix some more pen width issues from global removal.
Fixes https://gitlab.com/kicad/code/kicad/issues/4408
2020-05-12 15:20:17 +01:00
Jeff Young 06dea92bcb Fix issues with Kicad Manager frame and new kicad_sch files.
Fixes https://gitlab.com/kicad/code/kicad/issues/4410
2020-05-12 15:20:17 +01:00
Jeff Young 74ee143d45 Add via annulus minimum. 2020-05-11 22:56:09 +01:00
Jeff Young 1fb51d29ab Reverse interpretation of triple-tilde.
Fixes https://gitlab.com/kicad/code/kicad/issues/4396
2020-05-11 22:56:09 +01:00
Jon Evans 108cf23892 Restore separate libedit settings for common settings params
Be careful when calling config() in eeschema/libedit/pcbnew/modedit
It's usually not the thing you want.

A better fix for #4389
2020-05-10 18:02:58 -04:00
Simon Richter 632494cba7 Add missing includes
A few more instances of missing <algorithm> for std::max
2020-05-10 00:24:11 +02:00
Simon Richter 2341b69840 Make sure that Ninja knows the version header (fixes #4209)
This is required, because Ninja otherwise doesn't properly rebuild after
updating the version string header file.

Because BYPRODUCTS requires CMake 3.2, bump the minimum version and remove
now unused compatibility code for older CMake versions.
2020-05-09 15:25:33 +00:00
Jeff Young 3c3984a6fc Generalize default footprint fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/2289
2020-05-08 23:30:33 +01:00
Jeff Young 8efa8af8cc Add persistence of DRC error severities. 2020-05-07 17:51:27 +01:00
Jeff Young 0f8c7ffd11 Add pad keepout and footprint keepout areas.
Fixes https://gitlab.com/kicad/code/kicad/issues/2365
2020-05-07 17:51:27 +01:00
Ian McInerney 18cd0cdb58 Don't copy the items being iterated 2020-05-06 22:37:13 +01:00
Jeff Young 001a50bf14 Moved PANEL_COLOR_SETTINGS from buttons to swatches.
This allows us to correctly display non-100%-opacity colors (ie:
over the correct background color).
2020-05-06 19:02:21 +01:00
Ian McInerney c43122a45f Get the undecorated window size on GTK when saving the window config
The window decorations introduce an offset to our window size, since
they are not used when restoring the window size at startup they are
added by the window manager again.

Fixes https://gitlab.com/kicad/code/kicad/issues/4278
2020-05-06 14:53:15 +01:00
Jon Evans 9916f24fab Split out footprint editor color settings
Migrate COLOR_SETTINGS 0->1 to remove fpedit section
Migrate FOOTPRINT_EDITOR_SETTINGS 0->1 to use new theme if created
Remove COLOR_CONTEXT that is no longer needed
2020-05-05 21:46:00 -04:00
Jon Evans 66eb84097a Auto-size theme list 2020-05-05 21:46:00 -04:00
Jon Evans d00df0169f A few tweaks to settings migration infrastructure 2020-05-05 21:46:00 -04:00
Jon Evans c0a345882e Fix schema version for APP_SETTINGS_BASE derivatives 2020-05-05 21:46:00 -04:00
Ian McInerney e4b6487fca Overhaul compiler warnings infrastructure
* Track our warnings separate from normal flags
* Remove all warnings from the SWIG code
* Add more GCC warnings
2020-05-06 01:47:20 +01:00
Jeff Young 67bccaf465 Make indeterminate control states clearer for the user.
Fixes https://gitlab.com/kicad/code/kicad/issues/4313
2020-05-05 20:26:51 +01:00
Jeff Young e0da677d4d Add min clearance to DRC; rename Min Via Drill to Min Through Hole.
Also fixes a crash bug when ignoring a DRC violoation with multiple
markers.

Fixes https://gitlab.com/kicad/code/kicad/issues/2528
2020-05-04 22:08:36 +01:00
Wayne Stambaugh 169f63a6c0 Eeschema: make schematic sharing truly safe across all designs.
There has been a long standing (since the beginning of the project?)
issue with sharing schematics between projects.  It has been somewhat
supported for complex hierarchies (a sheet shared multiple times in a
single design) but it has not been well supported for simple hierarchies
(the symbol references cannot be changed in the shared schematic).  This
issue has been resolved by moving all of the symbol instance sheet paths
from the symbol definitions in the all of the project files and save all
symbol path instances in the root sheet.  This ensures that orphaned
symbol instance paths do not accumulate in shared schematic files and
that designs that reuse schematic in simple hierarchies can how have
different references.  It also allows the root schematic from one project
to be uses as a sub-sheet in another project.

When legacy schematics are loaded, all sheet and symbol UUIDs are
converted from time stamps to true UUIDs.  This is done to ensure there
are no sheet path instance clashes between projects.  That being said,
there are no checks for this.  It is assumed that the probability of
UUID clashes is so low that it doesn't make sense to test for them.
2020-05-04 12:40:03 +00:00
Jeff Young bdf9491682 Re-factor the event whitelist stuff so that it doesn't promise what it can't deliver. 2020-05-03 20:56:32 +01:00
Jeff Young a3486b7cd4 Fix ESC handling with whitelist. 2020-05-03 20:56:32 +01:00
jean-pierre charras da05b43a9f DIALOG_SHIM: fix incorrect escape key handling.
Fixes #4304
https://gitlab.com/kicad/code/kicad/issues/4304
2020-05-03 12:52:27 +02:00
Jeff Young 199bb2ffb0 Add hittesting for worksheets in Pcbnew and Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/4282
2020-05-03 00:07:38 +01:00
Wayne Stambaugh 0d1bb10771 Fix common preferences panel control padding. 2020-05-02 18:32:54 -04:00
Wayne Stambaugh 8d0b2dcfd3 Fix path configuration dialog control padding. 2020-05-02 16:48:39 -04:00
Jeff Young cf7ffda5f6 Performance improvements for Gerber loading.
The entire issue (at least on OSX) was the layers palette.  Go
figure.

Fixes https://gitlab.com/kicad/code/kicad/issues/1892
2020-05-02 21:10:40 +01:00
Jeff Young 73eda91ec7 Allow some events to run behind a modal dialog.
Right now this is just unit switching.

Fixes https://gitlab.com/kicad/code/kicad/issues/2344
2020-05-02 14:37:24 +01:00
Simon Richter 5acee1962e Add missing include
We need <algorithm> for std::max
2020-05-02 11:19:04 +00:00
jean-pierre charras 02e91807ab Avoid marking an empty string translatable (create issues with translation tools).
Fix also a minor compil warning.
2020-05-02 10:35:40 +02:00
Jeff Young 10614a9ebc Implement changes for Sketch Pads to Fab Layers.
Includes adding Fab Layers to default text & graphic settings.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/2274
2020-05-01 18:49:42 +01:00
Jeff Young 4a60b8a776 Improve DRC error reporting and fix some bugs. 2020-05-01 18:49:42 +01:00
Jeff Young 9d6b987ecc Fixes to map pin-to-pin erorrs to new Warning/Error strucutre. 2020-05-01 18:49:42 +01:00
Jeff Young a56191b658 Add distances to a bunch of DRC violation reports. 2020-05-01 18:49:42 +01:00
jean-pierre charras b7e7d6fd5c DIALOG_CONFIGURE_PATHS: Fix crash when deleting the last item in list.
When the list (in 3D search path list) contains only one item, when trying
to remove this last item, the crash happened.
2020-04-30 20:42:40 +02:00
jean-pierre charras 687c2f3e82 eeschema: fix a readability issue for small texts.
Texts were drawn with a minimal line thickness = GetDefaultPenWidth().
The default pen width can be to large for small texts.
So the actual text thickness is now always clamped.
2020-04-30 09:38:23 +02:00
Wayne Stambaugh b1e1e22a5e Fix minor hot key panel layout padding issue. 2020-04-27 12:57:16 -04:00
jean-pierre charras 3e287160d8 gal/opengl: better message for checkGlError() unknown error sub-type
in GL_INVALID_FRAMEBUFFER_OPERATION main error.
The returned error code is now printed in the error message.
2020-04-27 14:46:53 +02:00
Jeff Young 1daa2224d0 Tidy up the layout of the Colors Editor. 2020-04-27 11:59:57 +01:00
jean-pierre charras 5340046747 base_units.cpp: better fix for a overzealous gcc compil warning than 4f369801 fix.
(Replaced a useless break by a default case with a debug warning)
2020-04-27 10:12:01 +02:00
Ian McInerney d006acecf4 More window sizing fixes
* Push all sizing operations into EDA_BASE_FRAME
* Save the unmaximized window size when maximizing
  so that we can then save it in the config if the
  window is maximized. Otherwise the config ends up
  with the maximized size saved, and weird behavior
  occurs when unmaximizing on the next opening.
2020-04-27 00:14:12 +01:00
Marek Roszko 127df701da Remove unnecessary wxPaintEvent from SPLIT_BUTTON 2020-04-26 20:52:28 +00:00
jean-pierre charras 4f369801f2 Fix a few compil and Coverity warnings. 2020-04-25 08:49:16 +02:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young 2fb2eac4d5 Performance enhancements. 2020-04-24 22:17:45 +01:00
Jeff Young 32db9eb0f1 Add some distances to a few DRC errors. 2020-04-24 22:17:45 +01:00
Jeff Young c67d819b17 Adjust GTK hack for wxSearchCtrl.
Fixes https://gitlab.com/kicad/code/kicad/issues/4230
2020-04-24 22:17:45 +01:00
jean-pierre charras 18150e5769 SVG plotter: fix some issues: incorrect bitmap size and missing lines in header
Fixes #4256
https://gitlab.com/kicad/code/kicad/issues/4256
2020-04-24 17:19:08 +02:00
Jeff Young b09463cc86 Improve hack for GTK wxSearchCtrl.
Fixes https://gitlab.com/kicad/code/kicad/issues/4230
2020-04-24 14:55:15 +01:00
Jeff Young 7f742ef934 Fix typo. 2020-04-24 14:46:22 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jon Evans 69db66e1ea Fix saving of pcbnew colors when edited from layers widget 2020-04-23 22:33:02 -04:00
Jon Evans 2d95270a31 Add color theme settings to pcbnew 2020-04-23 21:55:29 -04:00
Ian McInerney 60891f0b6d Add more trace messages in the tool framework 2020-04-23 23:56:53 +01:00
jean-pierre charras fd59660ec8 Save new svg plot options in the board plot parameters section. 2020-04-23 10:02:59 +02:00
jean-pierre charras 7e0a1a16ee SVG plotter: use %f instead of %g to print floats.
Looks like scientific notation is not always accepted by Inkscape.
2020-04-23 07:59:41 +02:00
jean-pierre charras 825d202480 Fix some strings to help translation.
Remove translation mark for strings used in debug, or strings
that cannot be translated (for instance because they are char strings
instead of wide char strings)
2020-04-23 07:40:19 +02:00
Jon Evans f7ebf2af5e Add separate color setting for bus junctions
Fix plotting and printing to use bus color when
connectivity detects that the junction is on a bus.

Fixes #4098
2020-04-22 21:55:48 -04:00
Michael Kavanagh e4cbeeab4c Remove dead code in pcbnew
* Remove dead zone printer
* Remove old canvas in pad properties window
2020-04-22 21:50:15 +00:00
Jeff Young c8140ddb4a Fix a typo that was keeping units refresh from working.
Fixes https://gitlab.com/kicad/code/kicad/issues/4249
2020-04-22 22:41:00 +01:00
Jeff Young 5bc6ad9786 Make UNIT_BINDER sensitive to parent frame user unit changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/4243
2020-04-22 20:45:45 +01:00
Jeff Young fbd68722b2 Fix a couple of problems with text stroke thickness. 2020-04-21 21:17:59 +01:00
Oleg Endo 2f1d23312f add BOARD_CHANGED and UNITS_CHANGED events 2020-04-21 13:23:56 +00:00
Oleg Endo 7bf8a744f1 add support for board listeners 2020-04-21 13:23:56 +00:00
Seth Hillbrand 819f28daf5 Revert part of 9c8941e04
This accidentally changed gerber plotting behavior, resulting in invalid
aperture sizes

Fixes https://gitlab.com/kicad/code/kicad/issues/4232
2020-04-20 15:42:23 -07:00
Johannes Pfister e5042a46ba Add ability to set SVG plot units and precision
ADDED: Ability to set SVG to metric or imperial units
and made it possible to change the size of a step
2020-04-20 22:02:03 +00:00
Jeff Young 10684e9961 Attempt to work around clipping bug on GTK wxSearchCtrl. 2020-04-20 21:49:32 +01:00
Jeff Young db9fd3be21 Minor cleanup. 2020-04-20 21:49:32 +01:00
Seth Hillbrand 1770a1ea21 Prevent invalid decrement in tool manager
Iterating over the tool stack, we potentially remove the current
iterator.  If this removal happens at the beginning of the toolstack, we
cannot decrement the iterator to a position before the stack without
creating an invalid state.
2020-04-20 11:50:45 -07:00
Jeff Young 94e2690fed Fix compile issue on clang. 2020-04-20 17:19:29 +01:00
Jon Evans 3ff3d2cb14 Fix errant $ 2020-04-19 19:13:24 -04:00
Jon Evans b802a3e776 Add command-line option to generate netlist and exit 2020-04-19 19:13:24 -04:00
Jeff Young c977addfa2 Fix conflict between special char escaper and super/subscript.
Fixes https://gitlab.com/kicad/code/kicad/issues/4227
2020-04-19 21:16:22 +01:00
Jeff Young c08a6adb2a Implement GUI and file R/W for 3D model opacity.
Fixes https://gitlab.com/kicad/code/kicad/issues/2087
2020-04-19 18:24:39 +01:00
Jeff Young 71fd560735 Add "Export to other sheets" to paper settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/2177
2020-04-19 18:24:39 +01:00
Ian McInerney e528769637 Move TOOLS_HOLDER into tools/ folder
Also clean up some compiler warnings
2020-04-19 01:51:49 +01:00
Ian McInerney 7bda8178d1 Move library includes to main CMake file
Placing them behind the SYSTEM directive tells CMake to tell
the compiler they are system libraries, so it shouldn't show
warnings created from them.
2020-04-19 01:11:56 +01:00
Jeff Young 2b6089240a Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
Jeff Young d7d1cb6f78 A bunch of fixes to Eeschema Find/Replace. 2020-04-18 14:43:08 +01:00
jean-pierre charras 56c31e65f6 Fix a compil issue: Try a better fix than commit 8f0449c. 2020-04-18 12:36:05 +02:00
jean-pierre charras 8f0449cbab Fix a compil issue. 2020-04-18 09:02:51 +02:00
Ian McInerney 3b67e3d0a4 Rewrite window positioning logic
Now only reposition a window if it is completely on a
disconnected display or if only one corner is on screen
and it is within a region close to the screen border.

CHANGED: Window position on startup should be preserved more
2020-04-18 00:47:38 +01:00
Ian McInerney b8d2802cfe Add missing cases to silence compiler warnings 2020-04-18 00:47:35 +01:00
Jeff Young 919a66a703 Remove side-effect from finishTool().
It belongs out in the calling loop so that if someone else uses
finishTool() later they won't get bit by it.

This also fixes a crash bug where we weren't deactivating all tools
because we couldn't back up at the beginning of the stack (and the
loop increment therefore went past the first element).

Fixes https://gitlab.com/kicad/code/kicad/issues/4206
2020-04-16 21:58:45 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
Tomasz Wlostowski ee70c6dd5b NESTED_SETTINGS: allow to create/load without a parent settings object. Used for test/mocking 2020-04-15 13:00:48 +02:00
jean-pierre charras 04ea20dd44 Eeschema, SCH_PAINTER: fix max text thickness issue, to have small texts readable. 2020-04-14 11:08:42 +02:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
Jeff Young 122b1ddaae Unwrap an unnecessary layer now that we have new config stuff. 2020-04-13 20:58:12 +01:00
jean-pierre charras bdada70ee7 Cosmetic enhancements: add bitmaps to a few context menus.
Fix also a minor compil warning.
2020-04-12 10:29:28 +02:00
Jeff Young 84944524cc Fix crash on OSX when page was changed before hack array was alloc'ed. 2020-04-10 22:49:56 +01:00
Jeff Young b067e441c7 Show/hide sheet colors when flipping override flag. 2020-04-10 00:35:17 +01:00
Jeff Young f4e22a9264 Add ability to override individual item colors.
Fixes https://gitlab.com/kicad/code/kicad/issues/4167
2020-04-09 17:17:27 +01:00
Jeff Young 317e98b344 Simplify user model for editing color themes. 2020-04-08 22:34:56 +01:00
Jeff Young 8eb15fe911 Tidy up some Coverity issues. 2020-04-07 17:29:58 +01:00
Jeff Young 76bbb71402 Correct some formatting issues. 2020-04-07 17:29:58 +01:00
Jeff Young 5b70856a85 Change default sheet background color to transparent.
Fixes https://gitlab.com/kicad/code/kicad/issues/4166
2020-04-06 12:31:59 +01:00
Jeff Young 322ab60cc5 Fix some Coverity issues. 2020-04-06 12:31:59 +01:00
Ian McInerney cb380cda0c Fix some build warnings 2020-04-06 00:31:45 +01:00
Jeff Young b13559c926 Add envVar and text variable resolution to plot directory paths.
Fixes https://gitlab.com/kicad/code/kicad/issues/3808
2020-04-05 23:56:24 +01:00
Jeff Young cc9ac37a0e Add text variable support to envVar processing. 2020-04-05 20:52:26 +01:00
Ian McInerney c0b03a043e Force menubar update when file history is changed
Fixes https://gitlab.com/kicad/code/kicad/issues/4137
2020-04-05 18:05:43 +01:00
Jeff Young 591428b0d9 Remove some problematic global variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4121
2020-04-05 16:17:04 +01:00
Ian McInerney 306ebb0e89 Cleanup dynamic casts in unit binder 2020-04-04 12:24:54 +01:00
Thomas Pointhuber b707c84b62 Use Record handling for parsing
Now, we know how big a record is, and should be able to parse all boards without missing bytes?
2020-04-03 23:22:24 +00:00
Jeff Young 78dfbca9a3 Save pre-eval values for Move Exactly dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/4088
2020-04-03 21:47:47 +01:00
Wayne Stambaugh 082944ad06 Minor build warning fixes. 2020-04-03 13:03:23 -04:00
jean-pierre charras b1b8a32078 fix a few Coverity warnings and compil minor warnings. 2020-04-03 09:54:47 +02:00
Jon Evans 23c1baae8e Defer image surface destruction until next paint
Fixes #4043

(cherry picked from commit dbf786e456f2792476791caf9dadfeb43e9ab383)
2020-04-02 14:36:57 -04:00
jean-pierre charras 161b73e55b Enable storing pin function (pin name) in pads.
This is useful in board routing.
It is plotted in pad attribute TO.P in Gerber files.
2020-04-02 20:14:45 +02:00
Jeff Young a76ddb52a0 Add sheet borders and backgrounds to Edit Text & Graphics.
Also moves sheet border and sheet background colours to preferences
so it's clearer they're just for newly-created items.

Fixes https://gitlab.com/kicad/code/kicad/issues/4144
2020-04-02 14:01:30 +01:00
Jeff Young 811968716c Add OSX layout hack to PAGED_DIALOG for preferences. 2020-04-02 14:01:30 +01:00
Jeff Young 4966ab802e Support single-click colour editing in dialogs. 2020-04-02 14:01:30 +01:00
Jeff Young 13d3f57fce Implement a different solution to refreshing lib trees.
Fixes https://gitlab.com/kicad/code/kicad/issues/4110
2020-03-31 02:09:31 +01:00
Jeff Young eb855d40bb Restore lib tree refreshing, but don't attempt to refresh tree root. 2020-03-30 17:30:26 +01:00
jean-pierre charras 58e03be23c Fix a compil issue. 2020-03-30 17:38:19 +02:00
Jeff Young a1d62e0622 Improve some comments. 2020-03-30 14:15:59 +01:00
Jeff Young 41b5872f12 Add ERC & DRC checks for unresolved variables. 2020-03-30 14:15:59 +01:00
Jeff Young 4990d1e7b2 Variable substitution framework.
This implements editing of variables and moving SCH_FIELDs,
TEXTE_MODULEs, TEXTE_PCB and worksheet items over to the new
framework.
2020-03-30 14:15:59 +01:00
jean-pierre charras 9d2712a824 Fix a few Coverity warnings.
It also fix:

Fixes #4082
https://gitlab.com/kicad/code/kicad/issues/4082
2020-03-29 18:42:24 +02:00
Ian McInerney c29c3d9cc1 Diferentiate action types in the tool trace 2020-03-28 22:01:35 +00:00
Jeff Young 88c4254bb5 Discourage use of wxDataViews. WX_GRID is much less problematic. 2020-03-28 16:09:40 +00:00
jean-pierre charras c41199f048 lib_tree.cpp: Fix a lot of wxWidgets alerts on Windows.
On Windows calling m_adapter->RefreshTree() to refresh the tree does not work fine.
Just calling Refresh() is enough.
2020-03-28 11:00:54 +01:00
jean-pierre charras aebfbda183 DRC dialog: fix a crash when clicking on a item in Footprint Warning panel:
if the warning is a missing footprint, obviously there is no marker associated.
It creates a crash due to a null pointer.

Fixes #4114
https://gitlab.com/kicad/code/kicad/issues/4114
2020-03-28 11:00:54 +01:00
jean-pierre charras 53a98b45f0 DIALOG_ABOUT_BASE: fix a minor wxWidgets alert 2020-03-28 11:00:54 +01:00
jean-pierre charras de7154e8e9 Gerber plotter: Non horiz or vertical oval pads: better plot output:
These pads were plotted as a segment. This is not the right way.
Pads must be flashed or plotted as regions, not painted.
They are now plotted as Gerber regions round rectangle pads.
These regions are similar to flashed pads.
2020-03-27 10:34:41 +01:00
Jeff Young d69ebfae49 Push tool framework base down into TOOL_HOLDER.
This allows us to use it outside of EDA_BASE_FRAMEs (in this case, in
PANEL_PREVIEW_3D.)
2020-03-24 19:00:25 +00:00
Jeff Young 14788eec94 Performance improvement in wx_grid column label height calc.
Don't call GetColLabelValue() repeatedly.  It's expensive as it doesn't
cache the string translations.
2020-03-24 19:00:25 +00:00
Jeff Young c4aed3a8de Add user-configurability of the LibEdit axes color. 2020-03-24 19:00:25 +00:00
jean-pierre charras 4d9d1a5380 Fix a few compil minor warnings and Coverity minor issues 2020-03-22 09:45:51 +01:00
Jeff Young d25a63cd02 Don't allow selection flags to leak in to the libmanager cache.
Fixes https://gitlab.com/kicad/code/kicad/issues/4021
2020-03-21 23:25:08 +00:00
jean-pierre charras 9cb3333d05 Gerber plotter: plot round rectangle pads using a region with arcs.
Previously, the region was a usual polygon with arc approximated by segment.
Using a region with arcs is a better way because it allows CAM tools to
identify this region as a round-rect pad.

A side effect is a better shape and smaller files, however not really noticeable in fact.
2020-03-20 19:45:05 +01:00
Jeff Young e9cd9ee8ff Actionize the rest of the 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/issues/2228
2020-03-19 15:10:32 +00:00
jean-pierre charras 04e4599989 PANEL_SETUP_SEVERITIES: skip non existing error codes in TransferDataFrom/ToWindow
Fixes #4066
https://gitlab.com/kicad/code/kicad/issues/4066
2020-03-18 09:17:43 +01:00
Wayne Stambaugh 7dc64f08b7 Eeschema: implement s-expression schematic file formatter.
Please note that the symbol cache is not embedded in the schematic file
to allow for round robin testing with the existing file format.  Once
the parser round robin testing is complete, the symbol cache will be
embedded in the schematic file.
2020-03-16 09:05:16 -04:00
Jeff Young cee973dc04 Move ERC error reporting over to the new framework.
Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-16 11:06:15 +00:00
Jeff Young 085d80e3f3 Remove duplicated settings from preferences.
These have now moved to project-specific settings.
2020-03-13 17:28:53 +00:00
jean-pierre charras 08f0e8d6e8 Pcbnew, Gerber output: always generates Aperture Attributes.
Previously, for historical reasons, they were added only if
Include Netlist Attributes option was on.

But Aperture Attributes have nothing to do with Netlist Attributes, and good
Gerber files must include them.
2020-03-12 16:57:13 +01:00
Jeff Young c699fb9e39 Move pin-to-pin errors to Setup Schematic. 2020-03-11 21:43:55 +00:00
Jeff Young 437f888c25 Schematic Setup dialog.
Includes:
- moving some of the project settings from the Preferences dialog
- ERC severites
- project-specific field-name templates

Fixes https://gitlab.com/kicad/code/kicad/issues/2145
2020-03-10 18:54:17 +00:00
Jeff Young bbf5ad6160 Improve dialog spacing and remove 'auto' type decls.
Also fixes a couple more coding style issues.
2020-03-10 18:54:17 +00:00
Jeff Young becc66b583 Change some layer names for better grouping when alphabeticized. 2020-03-10 18:54:17 +00:00
Jeff Young d875d5850e Update library trees when their items change.
Fixes https://gitlab.com/kicad/code/kicad/issues/4019
2020-03-08 15:18:19 +00:00
Jeff Young 3e34c1783f Added sheet border width, border color and background color.
Fixes https://gitlab.com/kicad/code/kicad/issues/2216
2020-03-08 15:18:19 +00:00
Jon Evans 8cb8d55843 Remove unnecessary exception handling in settings
Use optionals instead where a value can be absent

Fixes #4024
2020-03-07 16:06:33 -05:00
Jeff Young fb00ca12d6 Performance enhancements for stroke font initialisation. 2020-03-07 18:52:30 +00:00
Jeff Young 535033c5c9 Enable editing of sheet fields. 2020-03-07 18:52:30 +00:00
Ian McInerney a2ad9d67ba Expose more version strings from CMake
Let cmake generate the needed version strings, so we don't
have to spend program time doing it. This simplifies the
settings manager versioning.

Also, convert some file line endings to UNIX from Windows.

A more robust fix for https://gitlab.com/kicad/code/kicad/-/issues/4015.
2020-03-07 18:43:24 +00:00
Jon Evans 01a6d0067b Add missing layer name for sheet fields
Fixes #4018
2020-03-07 09:44:06 -05:00
Jon Evans 1e61668cee Make GetSettingsVersion handle extra version appends better
Fixes #4015
2020-03-07 09:33:35 -05:00
Jeff Young fe3e0307d8 Move sheet name and filename to SCH_FIELD architecture.
Only internal storage architecture has changed (so far).
2020-03-06 16:23:44 +00:00
Jon Evans dd56f6f8e2 Increase width of bitmap button on settings migration dialog 2020-03-06 08:15:14 -05:00
Jon Evans 643c97a2f4 ADDED: Schematic plotting can use a dedicated color theme
ADDED: PDF, PS, and SVG plots can optionally include the page background color

Fixes #1830
2020-03-06 00:01:02 -05:00
Jon Evans 8660b4c144 ADDED: New color theme editor and multi-theme support 2020-03-06 00:01:03 -05:00
Jon Evans ca1ab0af16 Set expand flags and minimum button size on migration dialog
Hopefully fixes #3989
2020-03-04 21:47:28 -05:00
Seth Hillbrand e38ab6c699 Treat 0-length ovals as circles
Some buggy SVG interpreters can't handle 0-length ovals.  In this case,
they are meant to be circles, so we can export as circles in our
plotter.

Fixes https://gitlab.com/kicad/code/kicad/issues/3995
2020-03-04 18:03:20 -06:00
Seth Hillbrand ecbfea68dd ADDED: Allow creation of nets in pcbnew
When editing pcb items, the creation of a new net to connect existing
pads or traces can be a useful shortcut.  This inserts the ability to
optionally create a new net from the Net Selector dropdown menu.
2020-03-04 16:11:47 -06:00
Seth Hillbrand 12088f240d Fix a couple crashes with small canvases
The canvas size is not guaranteed to be strictly > 0, so we need to
enforce a minimum returned size before dividing by it or passing to GAL
initialization
2020-03-04 14:33:42 -06:00
jean-pierre charras b7cd0c54c2 Fix compil issues, especially on Windows:
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
2020-03-04 10:48:18 +01:00
Jeff Young 21469efa63 Make sure EESCHEMA definition gets passed into common.cpp.
Also includes a fix to seed timestamps that got incorrectly
written out as '00000000' because of the above.

Fixes https://gitlab.com/kicad/code/kicad/issues/3977
2020-03-04 02:04:18 +00:00
Jeff Young 85c2e0d23a Add user-defined severities, exclusions and colors to DRC markers.
Exclusions are currently persisted in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-04 00:39:28 +00:00
Marcus Comstedt 349c0e1a14 gal/opengl: Fix shader link state check
The old code caused a bool (size 1) to be overwritten by a GLint (size
4) causing undefined behaviour.

Fixes https://gitlab.com/kicad/code/kicad/issues/3981
2020-03-03 21:47:43 +00:00
Marcus Comstedt 55ac575a88 Cairo GAL: fix incorrect use of pixman formats
Fixes https://gitlab.com/kicad/code/kicad/issues/3970
2020-03-03 18:07:30 +00:00
Wayne Stambaugh e1900161a7 Eeschema: implement new symbol library file s-expression formatter.
CHANGES: Symbol library file format has been converted to s-expressions.

Add support code for picking apart symbols at some future junction that
will allow full inheritance conversion of existing symbol libraries.  For
now, symbols arranged by unit and body style numbers are nested for round
robin testing of symbol libraries once the parser is complete.
2020-03-03 08:06:22 -05:00
Jon Evans 08ef7de493 Use STL replace instead of Boost in JSON_SETTINGS 2020-03-02 19:18:52 -05:00
jean-pierre charras 911c6eb781 Pcbnew, DIALOG_NETLIST: fix incorrect storage of wx_MessageWindow options.
Config values were not stored into the right variables.

Make also an option persistent during the session
in DIALOG_UPDATE_PCB and DIALOG_NETLIST

DIALOG_UPDATE_PCB and DIALOG_NETLIST match options: use same order in dialogs.
2020-03-01 20:49:56 +01:00
Simon Richter 0f105c4c9a Fix preprocessor expression
The "and" and "or" keywords are only defined if <iso646.h> is included.

This fixes the C4067 warnings.
2020-03-01 00:33:45 +00:00
Andrew Downing 2f7ac2b5b4 Don't truncate polar coordinates in position relative dialog/move exact dialog 2020-02-29 02:21:18 +00:00
Jon Evans 72a6963e9e Free some memory that asan was complaining about 2020-02-27 22:58:33 -05:00
Jon Evans 9cc5b4b3f9 Fix management of nested settings for PNS 2020-02-27 22:53:00 -05:00
Jeff Young 3860ab9f0c Fix issue returning pointers to items inside std::vector.
(When the vector is re-allocated your pointers become bogus.)
2020-02-27 22:00:51 +00:00
Tomasz Wlostowski ce683c403a genral: always link libcurl to avoid unresolved symbols in pcbnew 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 6673554866 common: prevent segfault with no edit frame in TOOL_MANAGER 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 33f9843fb7 ACTION_MANAGER: prevent null object call when used without a host frame 2020-02-27 22:02:56 +01:00
Jon Evans b1fd931251 Use grid color for worksheet page borders 2020-02-25 20:36:27 -05:00
Jon Evans 009641d151 Make libcurl a required dependency and always build KICAD_CURL 2020-02-26 01:03:07 +00:00
Ian McInerney 879a8f4efb Rework the file history menus to not need references to the file history
Keeping a pointer to the actual file history inside a special
file history menu led to many cases of use after free crashes,
so instead rework the actual file history to add the menu
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/3741
2020-02-25 16:18:10 +00:00
Ian McInerney cc588471ca Hardcode the minimum window size
For some reason, OSX won't return the minimum window size properly
using GetMinWidth/GetMinHeight, so it would not properly adjust
windows with saved size (0,0).
2020-02-25 01:14:06 +00:00
Jeff Young c7ec110fba Only center focused items when they're not visible.
This includes outside the window and behind an occluding dialog.
This keeps the view from jumping around when focusing on nearby
objects.
2020-02-24 23:19:17 +00:00
Jon Evans d3d74b36bd Allow version selection; make buttons the same size 2020-02-22 11:23:47 -05:00
Jon Evans 80233aece9 Fix URL launching on MacOS 2020-02-22 09:47:51 -05:00
Jon Evans 712ae5a953 Check if scaling factor has changed when top-level window is moved
Fixes #2592
2020-02-22 01:25:08 +00:00
Jon Evans 96da45f12f Rework window size and position fixing code
Fixes #2624
Fixes #3888
2020-02-22 01:25:08 +00:00
Seth Hillbrand 3af868e3d1 Adding Arcs to TRACKS
This expands the TRACKS class to also include ARCS
2020-02-21 23:51:58 +00:00
Jeff Young ea025a35e5 Change KUUID to KIID. 2020-02-21 22:20:42 +00:00
Jon Evans a533748796 Cleanup 2020-02-21 09:30:08 -05:00
Jon Evans ad3e99f933 Fix file history save order 2020-02-21 08:12:53 -05:00
Jon Evans fcdf2bac0b Remove dead code 2020-02-21 08:07:15 -05:00
jean-pierre charras 6d44a93eaf Linking, mingw: Add bcrypt to libraries linked to libcommon.
It is already added with MSVC, and must be added with gcc/mingw

However, the cmake option:
add_definitions( -DBOOST_UUID_FORCE_AUTO_LINK )
does not work on msys2 (at least with my cmake version), so another syntax is used.
2020-02-21 10:37:59 +01:00
Jon Evans ea733639ff Rearrange about dialog; add easy bug report button
Fixes #3871
2020-02-20 22:20:34 -05:00
Jon Evans da1ba54188 Expose curl_easy_escape via KICAD_CURL_EASY 2020-02-20 22:07:17 -05:00
Jon Evans dc75c2b800 Factor out utility to launch a given file or folder 2020-02-20 22:07:17 -05:00
Jon Evans e8e3b4f11e Rename UUID to KUUID to fix MSVC build
Also add another newly-required boost flag
2020-02-20 22:07:17 -05:00
Jeff Young e69c82f45f Back out changes which updated the eeschema file format.
We'll wait until we have the new eeschema format to turn on UUID
generation for Eeschema.  Right now only Pcnbew generates full UUIDs.
2020-02-20 23:40:30 +00:00
Jeff Young 48874a7f19 Fix mis-match between color defaults in old and new systems. 2020-02-20 21:29:52 +00:00
Jeff Young 81dd1d7a68 Timestamp-based paths were ugly. UUID-based ones are worse.
Show a human-readable path in the Edit Footprint dialog.
2020-02-20 21:29:52 +00:00
Jeff Young 129042f8a6 Convert timestamps to UUIDs. 2020-02-20 21:29:52 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
jean-pierre charras 625249322e Pcbnew: regroup drc files to the already existing drc folder. 2020-02-19 10:31:32 +01:00
jean-pierre charras 021eb2f3a8 Fix incorrect usage of a UTF8 char in a C string in code.
Using a UTF8 char inside a C string can work on unix, but not on Windows.
It must be explicitly converted in a unicode value inside a wide string
(like a wxString)
2020-02-16 10:21:36 +01:00
Ian McInerney 43514a18bb Test every environment variable when doing substitution to remove more directories
CHANGED: Use the environment variable that removes the most directories

Fixes https://gitlab.com/kicad/code/kicad/issues/2500
2020-02-14 22:59:18 +00:00
Ian McInerney 36de20a0a7 Allow space to toggle all selected entries in a grid
CHANGED: Space now toggles all selected checkboxes in a grid

Fixes https://gitlab.com/kicad/code/kicad/issues/2252
2020-02-14 19:28:18 +00:00
Ian McInerney 4fef513a3f Fix library table panel path adding and cleanup duplicate dialog
When adding a .pretty library, if the actual .pretty folder were
selected then no folder would be added to the list of libraries.
This led to an assert when normalizing paths, and the library
not being added.
2020-02-14 19:07:27 +00:00
Jeff Young 3ec360f15c Save pinned libraries in project.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 14:22:54 +00:00
jean-pierre charras f17f10d2a6 Eeschema, DIALOG_UPDATE_FIELDS: ensure mandatory fields are put in list.
Add also a comment in common.cpp about using wxLocale instead of setlocale.

DIALOG_UPDATE_FIELDS has issues in non English languages, due to its design.
The fix for mandatory fields is only a partial fix that avoid major issues.
2020-02-14 13:07:13 +01:00
Ian McInerney 25b3cce474 Fix build error and cleanup overzealous refactor changes 2020-02-14 00:56:41 +00:00
Jeff Young 2017389f2d Pinning for library trees in FPEditor and SymbolEditor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 00:10:40 +00:00
Seth Hillbrand 39a45f2a81 Correct cyrillic 'f' in newstroke
The lowercase greek phi had been used which did not match the cyrillic
f.  We use the variant of phi that includes the full strokes instead.

Fixes #3898 | https://gitlab.com/kicad/code/kicad/issues/3898
2020-02-12 14:08:02 -08:00
Seth Hillbrand 03f74c87a1 Update immediate mode location and restart wires
The immediate action option clears (or not) the position of the events.
We use this to determine if the command should start at the given
position or merely activate the tool.  This was being checked in the
menu options, which only activated for tool commands in the context
menu.  Moving to the process event, we catch hotkeys as well.

This also restores the previous logic in eeschema that used a static
variable for storing wires rather than the private class variable.
Starting the draw event now picks up from the existing wires when
activated in immediate mode.

Fixes #3891 | https://gitlab.com/kicad/code/kicad/issues/3891
2020-02-11 09:12:36 -08:00
jean-pierre charras feab56f6e7 LOCALE_IO: replace the call to setlocale by a call to wxLocale to switch to "C" locale.
Previously we call only setlocale( xx, "C" ), but it was not enough on Windows.
Now we call wxLocale("C")
wxLocale calls setlocale, but also make some others initialization in wxWidgets.
It fixes some issues related to comma versus point as fp separator.
Especially wxWidgets warnings are no longer thrown, and a one case of incorrect
conversion is fixed.
2020-02-11 16:19:00 +01:00
Wayne Stambaugh e933045663 Fix build issue exposed by commit b824051a.
The combination of left over test code in lib_id.h/cpp and the changes
to handle the DEBUG compiler flag correctly on all platforms exposed a
swig issue on debug builds.  Removing the offending test from lib_id.h
resolved the issue.
2020-02-07 15:29:03 -05:00
jean-pierre charras 46b72d807b Kicad manager: Avoid crash when calling configure paths or libraries from main menu,
when _eeschema.kiface or _pcbnew.kiface is not found.
Happen mainly when running Kicad from build tree.

Now a suitable error message is displayed.

Fixes #3868
https://gitlab.com/kicad/code/kicad/issues/3868
2020-02-06 11:41:21 +01:00
Ian McInerney b1240b5b1e Gracefully shutdown tools when frames are closed
If the tools are not gracefully exited, then the stack variables are
never destroyed, so variable lifetime issues can occur.

Fixes https://gitlab.com/kicad/code/kicad/issues/1753
2020-02-05 22:23:24 +00:00
Jon Evans fe375b4419 Allow sheet pins to be strong drivers if they don't conflict with anything
Also try harder to match bus members in case one was renamed by a higher
priority label.

Fixes https://gitlab.com/kicad/code/kicad/issues/3797
2020-02-05 14:23:55 +00:00
Jon Evans 8fb72d8290 ADDED: Expose GetBuildVersion and GetBuildDate to Python 2020-02-05 13:28:44 +01:00
Simon Richter 48ce1239a2 Remove unused LIB_TABLE_ROW::Parse 2020-02-05 09:56:41 +00:00
Ian McInerney 6b8d81e95d Add zone area to message panel
ADDED: Area of zone fill is displayed in the message panel

Fixes https://gitlab.com/kicad/code/kicad/issues/2412
2020-02-05 09:44:53 +00:00
Drew Fustini f359892de3 Update copyright year in About dialog to 2020 2020-02-03 22:56:42 +00:00
Jeff Young a1c2abaff5 Get rid of line-weight component of overbar height.
It's not really necessary and it messes up text highlighting.

Fixes https://gitlab.com/kicad/code/kicad/issues/3680
2020-02-03 19:35:48 +00:00
jean-pierre charras 465ffff162 Gerber plots: Add initial G01 command to the header,
to ensure linear interpolation mode.
To avoid issues, an interpolation mode must be set before first D01 command.
2020-02-03 17:55:19 +01:00
Jeff Young a04fdf64da Improve directory handling for Project Save As.
1) don't change directory names that we don't recognize
2) when we do, make sure the child files get copied to the
changed name.

Fixes https://gitlab.com/kicad/code/kicad/issues/3834
2020-02-03 15:08:01 +00:00
Ian McInerney 4f82939384 Fix layout in color dialog on GTK
Don't initially set the minimum widget size, and instead let it be
computed at launch.

Fixes https://gitlab.com/kicad/code/kicad/issues/2617
2020-02-02 15:28:21 +00:00
jean-pierre charras 79e7a27492 Fix a few Coverity warnings. 2020-02-02 08:55:24 +01:00
jean-pierre charras ad3c4b37ab Fix a few coverity warnings 2020-02-01 15:15:51 +01:00
Alexander Shuklin 3d0b3a51f3 Eeschema: Adding back annotation
ADDED: Back annotation algorithm,
eeschema back annotation dialog

CHANGED: added some minor helper methods to SCH_REFERENCE_LIST and SCH_REFERENCE,
split SCH_REFERENCE_LIST::CheckAnnotation on 2 parts to reuse code
2020-01-29 16:33:57 +00:00
jean-pierre charras 460060a694 page layout editor: fix incorrect bitmaps bounding box size.
Bitmap size is using Eeschema units.
So the size was incorrectly calculated for pl_editor.
2020-01-24 11:52:41 +01:00
Ian McInerney 06c979dfaa Convert all CMake paths to absolute instead of relative
It is cleaner and safer to handle the include and source paths
as absolute from the source directory instead of relative to every
path.
2020-01-22 23:27:20 +00:00
Alexander Stock 974f84a5a6 Use proper encoding in UnescapeString() to speed up processing
Use the proper encoding to prevent extraneous conversion encoding conversion inside UnescapeString(). This change reduces the eeschema symbol library loading time (ubuntu and windows build) from 2700ms to 1700ms.

See merge request https://gitlab.com/kicad/code/kicad/merge_requests/70
2020-01-20 10:51:20 +00:00
Mark Roszko 8ac0d84f45 Fix invalid std::array constructor causing MSVC illegal indirection error 2020-01-20 01:30:26 +00:00
Ian McInerney c4277409d7 Add missing header that broke compilation 2020-01-19 11:52:34 +00:00
Seth Hillbrand 7c296fbcb7 GRID_HELPER: Provide alignment axes from snap points
ADDED: alignment lines from item snap points

Alignment lines are shown when moving the cursor horizontally or
vertically from a possible snap point.
2020-01-18 20:43:40 -08:00
jean-pierre charras d714773c22 Fix a minor compil warning. Add a wxASSERT in hierarch.cpp. 2020-01-18 18:23:21 +01:00
Ian McInerney 39b1f0e1ff Replace wxCriticalSection with std::mutex 2020-01-15 23:42:16 +00:00
Ian McInerney 415aaabc29 Fix return type in KIDIALOG
It was returned as a bool for some reason...
2020-01-15 18:29:15 +00:00
Mark Roszko a80b2b7e39 KIDIALOG should ignore "cancel" for the do not show again option.
Fix #3734
2020-01-15 18:23:07 +00:00
Jeff Young 0f4c56cbbd Also catch null dereference in case wxASSERT was skipped. 2020-01-15 17:51:48 +00:00
Jeff Young 1bdcb33f75 Handle error returns from lstat. 2020-01-13 20:16:42 +00:00
Jeff Young 9df2cfb328 More uninitialized variables. 2020-01-13 20:16:40 +00:00
Jeff Young 91d1508c16 Fix some Coverity identified issues. 2020-01-13 20:16:40 +00:00
Jeff Young aeba5c005f Many callers of uni_forward are not expecting an exception.
Remove the throw and used a different mechanism to detect non-unicode.
2020-01-13 15:40:32 +00:00
Ian McInerney e2853862e5 Cleanup redundant type casting 2020-01-13 14:00:45 +00:00
Ian McInerney 8fc434be19 Formatting change for dynamic cast tests 2020-01-13 01:48:57 +00:00
Ian McInerney 36f6b4a9b4 Clean up redundant dynamic casts 2020-01-13 01:39:08 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Ian McInerney b445ce6632 Clean up pointer casting
* Make note of when dynamic cast is actually needed
* Convert some to static cast when we know the type for sure
2020-01-12 19:45:37 +00:00
Ian McInerney 00e58cd974 Fix unintialized values (from coverity scan) 2020-01-12 13:00:42 +00:00
Jeff Young b343391723 Code cleanup for readibility. 2020-01-11 21:30:48 +00:00
Ian McInerney f896043067 Fix comments for switch statement fall throughs
This cleans up all GCC warnings (-Wimplicit-fallthrough=2) about
implicitly falling through switch cases.
2020-01-11 19:16:32 +00:00
Seth Hillbrand 4ebb87d1c1 Fix Eeschema BW printing
Checks forced state when printing to convert images to grayscale.
2020-01-11 09:55:30 -08:00
Seth Hillbrand 195c3d074b Fix bitmap clipping
When printing (using DC context) the bitmap will clear the full screen
unless the clipping region is set to the image itself.

Addresses KSC ticket 126

Fixes #1877 | https://gitlab.com/kicad/code/kicad/issues/1877
2020-01-11 09:47:19 -08:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Seth Hillbrand 2a780dba0e Initialize view variable
Sets known initialization value to the last keyboard command
2020-01-10 16:43:01 -08:00
Seth Hillbrand d1a0102e84 eeschema: Fix print order between worksheet and screen
The worksheet should be drawn behind the screen.
2020-01-10 16:33:53 -08:00
Seth Hillbrand a35db35029 eeschema: Fix bitmap scaling when printing
Bitmaps scale internally to 100nm instead of 1mil.  There is a better
way to do this but I think we'll be adjusting it again when Cairo
printing in finished.
2020-01-10 16:33:53 -08:00
Jeff Young 0fd68dad62 Fix freed pointer access issue (from Coverity scan). 2020-01-11 00:09:08 +00:00
Jeff Young 7bb9551801 Handle boost exceptions. (From Coverity scan.) 2020-01-11 00:04:01 +00:00
Jeff Young c27e278e58 Fix uninitialized variable (from Coverity scan). 2020-01-10 22:32:50 +00:00
Jeff Young 5e5edd03f6 Implement super- and subscript printing and plotting for eeschema. 2020-01-10 22:32:49 +00:00
Jeff Young 65c88ba2c3 Reduce the auto-panning margin and implement acceleration. 2020-01-10 22:32:49 +00:00
Seth Hillbrand 77c60d9655 Remove the last vestiges of dlist
It served us (mostly) well for more than a decade.  It helped KiCad grow
before the std:: came into decent shape or speed.  It was a good little
list.

RIP DLIST 2008-2020
2020-01-10 06:37:08 -08:00
Seth Hillbrand 6e5e453d0d Replace EESchema DLIST
This moves EESchema DLIST structures to rtree.  These changes are more
fundamental than the pcbnew changes from 9163ac543 888c01d11 d1877d7c1
and 961b22d60 as eeschema operations were more dependent on passing
drawing list references around with SCH_ITEM* objects.
2020-01-10 06:37:08 -08:00
Ian McInerney a8d9fcb4e0 Fix event handler type casting
The old methods were very clunky and not recommended (and didn't
properly cast the function types). This changes to useing the
recommended way of declaring events and casting the event handlers.
2020-01-09 18:08:49 +00:00
jean-pierre charras d587bd5bca SVG plotter: fix an issue with mirrored texts.
Mirrored texts have a size < 0.
Of course, the actual value for the plotter is the absolute value.
2020-01-09 18:07:56 +01:00
Mark Roszko ca34ade00c Make global labels have the same spin style as net/hierarchical labels
For legacy reasons, it stored left and right "spin" as flipped integers in the file format.
But the code handled the flip in multiple locations rather than just doing it on file io.
This change unifies the internal code and does the mapping in the file I/O.
2020-01-08 19:07:55 +00:00
Ian McInerney 9e5d52f92d Cleanup 2020-01-08 01:49:51 +00:00
Ian McInerney 9dff31c2ac Remove unused DIALOG_FILE_DIR_PICKER
This class was replaced with native dialogs for choosing
the files and directories
2020-01-07 23:40:00 +00:00
Jonatan Liljedahl f433037dcd Eeschema: simulator: allow dotted traces for current and phase.
ADD: Allow drawing of current and phase traces with dotted style
for easier differentiation from voltage and magnitude. The option
is available in the View menu of the simulator.
2020-01-07 19:45:44 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Simon Richter 270aaec443 Rewrite FBP files generated with unreleased wxFB
These use a few features that are too new, causing errors when trying to
edit with a released version of wxFormBuilder.
2020-01-07 13:32:33 +00:00
jean-pierre charras a46abcd2dc FILENAME_RESOLVER: fix missing conversion from UTF8 to wide chars.
Fixes #3742
https://gitlab.com/kicad/code/kicad/issues/3742
2020-01-07 13:35:37 +01:00
jean-pierre charras 86f9ed1dd9 Allows pad property only by the kicad_advanced feature.
pad property is allowed if "UsePadProperty=1" is found in kicad_advanced.
2020-01-06 18:11:01 +01:00
jean-pierre charras f2518a5120 ADDED: pad fabrication property, as required in latest Gerber file specification.
Property is a pad info used mainly for fabrication or test.
Currently, supported properties are:
BGA property (variant of SMD pad)
Fiducial (global to the board or local to the footprint)
Test Point
Heat sink
Castellated.
And are used in Gerber files (copper layers and drill files)

Increment BOARD_FILE_VERSION  to 20200104
2020-01-06 16:37:35 +01:00
Seth Hillbrand 49e3542662 Remove unused common defines 2020-01-06 05:55:06 -08:00
Seth Hillbrand 850ca98e7b Remove outdated RoundTo0
With internal units in 100nm, there are no rounding errors when
representing mm coordinates in eeschema.
2020-01-06 05:15:14 -08:00
Jon Evans 21d577e638 Implement Gerber job file writing using nlohmann/json 2020-01-04 10:46:50 -05:00
jean-pierre charras 5707e6eac8 Fix QA arc test according to the new arc bounding box calculation.
Previously, the arc center was included in the bounding box,
but this is incorrect.
In many cases it is not in the bbox, and can be very far away.
2020-01-04 10:16:30 +01:00
Ian McInerney 20e7fc8a0e Properly escape spaces when opening PDFs on windows
Fixes https://gitlab.com/kicad/code/kicad/issues/2625
2020-01-03 19:06:49 +00:00
Ian McInerney 2f75dfb09c Fix symbol editor column widths
102b5301 introduced an issue on GTK where the column width was
incorrect when read, then was set incorrectly (a known problem
on GTK tree views). We should only apply that fix on OSX.

Fixes https://gitlab.com/kicad/code/kicad/issues/3720
2020-01-03 17:04:18 +00:00
Ian McInerney 5d46e721e5 pcbnew: Cleanup includes of pcbnew_id.h
* Remove unused IDs from the enum
* Remove the include statements from files that no longer need it
2020-01-03 15:39:05 +00:00
Mark Roszko 49db816c82 Pcbnew: improve add existing footprint library browser and button
CHANGED: Modify Add Existing Footprint Library button to us OS file/directory browsers
2020-01-03 15:09:26 +00:00
jean-pierre charras baa1db031e Fix incorrect arc bounding box calculation.
add comments to SHAPE_ARC ctor.
2020-01-03 14:27:00 +01:00
jean-pierre charras 3543de039b More about code cleaning.
Remove useless includes and dead code
2019-12-31 13:08:50 +01:00
jean-pierre charras 2999bcb721 Try to fix SEG::PointCloserThan(), not working for quasi H or V segments.
Quasi H or V segments are segments having the same x value or y value
(with a + or -1 max diff) for end points coordinates.
The change is a workaround, not really a fix.

Fixes #3711
https://gitlab.com/kicad/code/kicad/issues/3711
2019-12-29 18:24:17 +01:00
Ian McInerney 5c0656d97f Move potrace and libcontext into thirdparty directory
Part of the cleanup in #3637
2019-12-28 18:17:55 +00:00
Ian McInerney 6faa2188ed Silence warnings on MacOS about OpenGL deprecation
Apple has apparently deprecated OpenGL and replaced it with
their Metal API. It still works for now though.
2019-12-28 16:05:03 +00:00
jean-pierre charras d5b8e4928c Gerber P&P files: escape the double quote char inside user strings.
This is a reserved char, used to quote user strings
2019-12-28 13:27:31 +01:00
jean-pierre charras 7241247fbc Pcbnew: add missing storage of dimension units and dimension precision in pcb files.
https://gitlab.com/kicad/code/kicad/issues/3712
2019-12-28 13:27:31 +01:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Mark Roszko d4dee3c5a0 Inner loop iterator should be size_t as well 2019-12-26 13:10:18 +00:00
Mark Roszko a418242ca7 Prevent oob on LSET::FmtHex call when BITSET size is not a multiple of 4 (which it isn't usually) 2019-12-26 13:10:18 +00:00
Jon Evans 2ea565473f LSET: Prevent assertion in MSW when size is not a multiple of 4 2019-12-25 11:34:12 -05:00
jean-pierre charras 60dd1cd5c7 Gerber files: update unicode coding to the 2019 06 Gerber specifications.
In gbr files, not allowed chars are coded using a 16 bit (4 hexa digits) unicode sequence.
Previously, it was \XXXX and now is \uXXXX escape sequence.
2019-12-21 11:15:57 +01:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney b9d8849b28 Unify unsaved changes detection logic in all frames
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
2019-12-19 15:34:01 +00:00
Mark Roszko 686b768a3d Add shutdown blocking on Windows for pcbnew, eeschema and pleditor
ADDED: Block shutdown/logoff on Windows when contents have been modified
2019-12-19 14:11:11 +00:00
Jonatan Liljedahl 1e42d6abeb symbol-editor: Fix MacOS segfault in lib_tree_model_adapter
In LIB_TREE_MODEL_ADAPTER::UpdateSearchString(), don't call
AttachTo() on MacOS.

Fixes https://gitlab.com/kicad/code/kicad/issues/3653 and
https://gitlab.com/kicad/code/kicad/issues/3666
2019-12-19 14:01:35 +00:00
Ian McInerney 3370e89967 Update Linux appdata file and CMake version strings
CHANGED: Update the Linux appdata file to include new tags

* Include version tags (and others) in the appdata file
* Refactor the version string generation to clean it up
2019-12-18 17:24:07 +00:00
jean-pierre charras 24cd80ef3e Gerber plotter: modify G02 and G03 commands.
They are now in a specific block and no longer combined with an other command.
(combining these commands with an other command (D01 or D02) is deprecated)

Fixes #3677 | https://gitlab.com/kicad/code/kicad/issues/3677
2019-12-18 11:35:28 +01:00
Ian McInerney c31c99abd1 Update about dialog link to GitLab
Fixes #3687
2019-12-17 20:17:03 +00:00
Ian McInerney 0259e0ba07 Cleanup struct initialization and formatting 2019-12-17 16:09:32 +00:00
Ian McInerney 18dbe51d66 Remove WINCE check
We don't actually support Win CE
2019-12-17 15:38:38 +00:00
Mark Roszko bf32122134 common: Remove out of bounds and erroenous array access 2019-12-17 14:10:52 +00:00
Jeff Young 1f07505b27 Fix long-standing issue with arrow keys moving in both axes. 2019-12-15 14:29:47 +00:00
Wayne Stambaugh 1abb198fb4 Minor UI improvement.
Use wxMessageDialog instead of wxRichMessageDialog in DisplayErrorMessage
so the platform specific message dialog is used.  wxRichMessageDialog
looks different than the stock message dialog on every platform so only
use it when a checkbox is required.
2019-12-14 12:29:38 -05:00
Mark Roszko ae785194ce Silence/fix double to float conversion warnings 2019-12-12 21:51:21 +00:00
Seth Hillbrand eb3d32f967 SHAPE_LINE_CHAIN: Unify constructors
Keeps the multi element SHAPE_LINE_CHAIN constructors in a single
routine using std::vector and implicit construction.
2019-12-12 13:54:48 +00:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
Seth Hillbrand 7d6665c313 Simplify to merge sequential, parallel segments
The Simplify() routine can take multiple segments that are in a single
line and merge them into a single segment, reducing the line complexity.
2019-12-12 13:54:48 +00:00
Ian McInerney 179f31d377 Add a minimum size to the part column in the lib trees
When the column has 0 width, it becomes hidden and users don't
know where it went or how to get it back.

Fixes https://gitlab.com/kicad/code/kicad/issues/3656
2019-12-10 23:26:07 +00:00
Seth Hillbrand fa133f3f5c Plot SVG embedded
ADDED: embedded image support for SVG files

Fixes #3643 | https://gitlab.com/kicad/code/kicad/issues/3643
2019-12-08 08:57:33 -08:00
Wayne Stambaugh 54f066fed7 Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces
it by allowing LIB_PART objects to inherit from other LIB_PART objects.
The initial implementation only allows for single inheritance and only
supports the mandatory fields in the derived part because that is all
that the current symbol library file format will support.  Once the new
file format is implemented and saving to the old file format is deprecated,
more complex inheritance will be added.  The LIB_ALIAS information saved
in the document files was move into the LIB_PART object.  This change
impacts virtually every part of the schematic and symbol library editor
code so this commit message is woefully incomplete.

REMOVE: Removed the symbol aliases concept from the schematic and symbol
editors and the symbol viewer.

NEW: Replace the symbol alias concept with simple inheritance that allows
a library symbol to be derived from another library symbol.
2019-12-06 11:33:52 -05:00
Seth Hillbrand 4f4bb96f2b Suppress false warning of uninit var 2019-12-06 06:27:47 -08:00
Seth Hillbrand df75167e14 Fix ordering warning and init error for clang
The glyphs and bb pointers were reversed.
2019-12-06 04:33:50 -08:00
jean-pierre charras 52db6acb86 Fix a compil issue on Windows.
A wxString was defined as const, but on Windows it is modified.
2019-12-06 08:40:58 +01:00
Seth Hillbrand ac92afcf13 Clean up compile warnings
Ratsnest did not need a reserve and then iterative emplace.  Instead, we
use resize().  Stroke font gets private vars initialized and kiway
variables that are only used in debug builds are properly scoped for
releases as well
2019-12-05 20:05:21 -08:00
Seth Hillbrand 6983c56cf8 Use const references where possible
This avoids copy cost on local vars where we only read.
2019-12-05 14:40:22 -08:00
Seth Hillbrand c6f5df134c Minor speed cleanup
This adjusts iterators to use const reference when only used for
copy.  It also ensures pre-allocation of vectors when size is known
ahead of time.
2019-12-05 14:20:59 -08:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
Seth Hillbrand 6f8b399c5f Replace unused resize() call
Calling resize(size()) will only zero out elements that exist above the
vector size().  The memory is not freed in this case.  shrink_to_fit()
will accomplish this action (at the discretion of the library)
2019-12-05 13:21:48 -08:00
Seth Hillbrand 4d2e953f42 Cleanup: Replace C-only deprecated headers
This replaces headers deprecated by C++14 with their equivalent
replacement
2019-12-05 11:03:15 -08:00
Seth Hillbrand a2edf9c442 Unified update to C++14 std::make_unique
This update replaces the existing uses of unique pointer creation with
the C++14 std::make_unique call that provides proper memory release in
event of an exception.
2019-12-05 10:43:55 -08:00
Seth Hillbrand 65ef8c1894 StrokeFont: Reserve rather than resize
Minor speedup by not double-initializing the stroke font vector.
2019-12-04 16:36:06 -08:00
Jeff Young 581dc81358 Performance optimizations for the stroke font. 2019-12-03 17:45:26 +00:00
Jeff Young 089ce90de3 Fix some issues with the previous commit. 2019-12-02 23:35:19 +00:00
Jeff Young 9b36489270 Make sure that libraries are always sorted consistently.
Fixes #1847481 | https://gitlab.com/kicad/code/kicad/issues/1847481
2019-12-02 21:52:50 +00:00
Jeff Young 102b530162 Fix library tree updating bug present at least on OSX. 2019-11-29 17:55:01 +00:00
Jonatan Liljedahl 7c7d9c3e3f Eeschema: simulator plot: allow standard mac pan and pinch to zoom 2019-11-25 09:24:31 -05:00
jean-pierre charras a6566b9b53 Fix a crash in some languages when loading a dynamic library.
The crash is inside wxDynamicLibrary::Load() when loading Eeschema,
and hard to find on Windows (gdb shows nothing).
Perhaps due to some issue with a specific string.

The fix is to switch to "C" locale with LC_COLLATE option to load the dll.

Fixes: lp:1853681
https://bugs.launchpad.net/kicad/+bug/1853681
2019-11-24 11:56:02 +01:00
Ian McInerney 99b9354a51 Add clear recent files action to the menus
ADDED: Menu item to allow the recent file lists in each program to be
cleared

Fixes: lp:1821685
* https://bugs.launchpad.net/kicad/+bug/1821685
2019-11-23 23:35:21 +00:00
jean-pierre charras f7159e4692 Make pin function in pads an advanced feature.
Mainly because it creates a new keyword a new keyword in *.kicad_pcb files,
and needs some tests, this is currently a advanced feature.
Enable it by adding "UsePinFunction=1" in "kicad_advanced" config file.

Note also "UsePinFunction=1" only enable saving this info in *.kicad_pcb
and kicad_mod files.
2019-11-23 09:12:44 +01:00