Commit Graph

4562 Commits

Author SHA1 Message Date
Marek Roszko efa28d3357 Untangle pl_editor includes 2020-10-13 20:33:33 -04:00
Jeff Young ef3b7052e0 Remove layer nag dialogs and just ignore non-shapes on Edge_Cuts.
Fixes https://gitlab.com/kicad/code/kicad/issues/5812
2020-10-13 20:22:31 +01:00
Jeff Young 1703729269 Require explicit decl of maxError and errorLocations.
This should reduce both performance issues and clearance issues.
2020-10-13 13:49:07 +01:00
Jon Evans 74e86a289d Remove all instances from a collector when requested
Perhaps COLLECTOR should use a set, but going for the
less invasive change for now.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5934
2020-10-12 20:06:55 -04:00
Jeff Young 32dffd27ab Add silk clearance to board setup constraints. 2020-10-12 18:31:00 +01:00
jean-pierre charras 380534807b Plotters: better support of filled circles having a thickness set to 0.
Setting a line thickness = 0 for graphic objects (circle, rect, line) is
allowed but creates issues for circles that were plotted a non filled shapes
but having a outline thickness = 0.
2020-10-12 11:30:43 +02:00
Marek Roszko 558f4b4b51 Add new place cursor, fix cursor hotpoints again 2020-10-10 23:45:21 -04:00
Jeff Young 614d452f12 Resolve trackwidth[0]/viasize[0] to be the netclass values.
If we don't have a netclass use the default netclass.

Fixes https://gitlab.com/kicad/code/kicad/issues/5957
2020-10-11 00:54:49 +01:00
Marek Roszko 310786333d Add missing cursors for bus, graphic lines, and hier labels
Fix #5949
2020-10-10 18:25:44 -04:00
Jeff Young 04c4012ee6 Make track/via sizes UI more predictable and compatible with DRC.
Two main changes: netclass values need to go through the DRC engine
so they can interact with other rules.  They're also now dependent
on the layer being routed as well as the start object.

Also make the controls adjust to each other better.  For instance,
copy-track-width needs to turn off when you select a particular
track width, and a particular track width needs to zero out when
you choose copy-track-width.

Fixes https://gitlab.com/kicad/code/kicad/issues/5951
2020-10-10 19:32:30 +01:00
Michael Kavanagh 5e0baa2c4a Cleanup: remove dead code 2020-10-09 02:28:32 +00:00
Marek Roszko bd30a4a406 Add selection lasso and window cursors 2020-10-08 21:25:21 -04:00
Marek Roszko f238d05ead Add COMPONENT cursor 2020-10-08 20:52:58 -04:00
Marek Roszko 6cf4016a64 Add net and global label cursors 2020-10-08 20:52:58 -04:00
Marek Roszko 8fa42a74bd Add zoom cursors 2020-10-08 20:52:58 -04:00
Tomasz Wlostowski 5e4fb46aef MINOPTMAX: added OptThenMin() method as syntax sugar 2020-10-09 00:01:26 +02:00
Jeff Young 2f49db49bf Fix fly-off arc handles and move Arc Properties to start/end/angle.
Fixes https://gitlab.com/kicad/code/kicad/issues/5791
2020-10-08 11:33:32 +01:00
Mark Roszko d9485129c8 Implement more context specific cursors using both stock and custom cursors. 2020-10-08 00:50:28 +00:00
Jeff Young 4565631728 Finish moving eeschema assigned netclasses to sheet-path-relative.
Also adds code for the case where a new label is created on a net
with an existing netclass assignment.

Fixes https://gitlab.com/kicad/code/kicad/issues/5886
2020-10-07 16:31:55 +01:00
Tomasz Wlostowski 30f8cc1346 VIEW_OVERLAY: added Cross() method 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski 719363fa4a Factor out class MINOPTMAX<> into a separate header 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski be0688726c NETCLASS: initial support for net classes with empty clearance/width values 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski bd27d38d9a DRAW_PANEL_GAL: added DebugOverlay() method, creating a temporary overlay for drawing debug graphics 2020-10-07 16:36:37 +02:00
Jeff Young 7c46cb0a05 Make GetCenter() return the boundingbox center by default.
Leaves pads and markers returning the position.

Fixes https://gitlab.com/kicad/code/kicad/issues/1924
2020-10-06 18:00:18 +01:00
Jeff Young ee95d8fe2e Improve SNR in status bar (and use common code). 2020-10-06 12:08:31 +01:00
Jon Evans 728c207105 Deduplicate settings migration handling 2020-10-05 23:21:57 -04:00
Jon Evans 76bfa47a77 Allow creating new projects when doing a Save As in eeschema 2020-10-05 22:36:26 -04:00
Ian McInerney 43c14face0 Switch to showing metric/imperial units in comboboxes and menus
This will always show 1 unit from each system, with the primary unit
being the current frame unit and the secondary unit being the
most recent unit used from the other system. These are saved in
the settings, so they are saved between runs.
2020-10-05 20:26:33 +01:00
Michael Kavanagh 1416280662 Cleanup: Move Eagle files into plugins folder 2020-10-05 14:19:07 +00:00
Jeff Young 37906511f5 Class renaming.
DRAWSEGMENT  -> PCB_SHAPE
EDGE_MODULE  -> FP_SHAPE
TEXTE_PCB    -> PCB_TEXT
TEXTE_MODULE -> FP_TEXT
2020-10-05 11:55:33 +01:00
Mark Roszko a28a0e14ba Fix conversion warnings 2020-10-05 10:41:14 +00:00
Ian McInerney 3a570c27f0 Update unit handling in the preview ruler
* Make the ruler able to switch to mils after creation
* Cleanup an unused flag in Pcbnew dimensions
* Move unit changed notification into EDA_DRAW_FRAME so more
  frames to use it.
* Allow switching units when GerbView ruler tool is active
2020-10-04 17:53:55 +01:00
Ian McInerney 122bd7ca7c Make the statubar aware of mils units
Switch Eeschema to use the built-in printing routines
because its precisions are close to those and it is
cleaner.

Give mils a precision of 2 decimal places to match
the precision shown in inches.
2020-10-04 17:53:55 +01:00
Ian McInerney b1bd1f2a97 Introduce new action to switch to mils as a unit 2020-10-04 17:53:55 +01:00
Jeff Young 7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
Marek Roszko 9e115a548e Add advance config variable to skip bounding box loading on footprints 2020-10-03 22:01:42 +00:00
Jeff Young bb753aaadf Clean up terminology around active & high contrast layers. 2020-10-03 22:55:34 +01:00
Jeff Young 70f329df91 Fix two-point assistant drawing layers to be in correct order.
Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-10-03 22:55:34 +01:00
Mikolaj Wielgus d9fd6e549b Remove "useMils" variable from numeric evaluator 2020-10-03 20:06:56 +00:00
Mikolaj Wielgus 400c15b8eb Add mils to units, remove useMils variables 2020-10-03 20:06:56 +00:00
Ian McInerney b69d396afc Turn the toolbar context menus into unique_ptr for easier management 2020-10-03 19:09:18 +01:00
Jeff Young ba26e056ec Implement groups for modedit.
This uncovered a memory corruption bug in MODULE's move operator,
several bugs in MODULE's move and copy constructors, and a bug in
BOARD's GetItem() call.

It also bumps the file format for saving/restoring groups inside
footprints.
2020-10-03 12:19:50 +01:00
jean-pierre charras b38cef409b Rename CopyFile() to KiCopyFile() to avoid name colliding with a windows header.
Using CopyFile() that can collide with a windows header create hard to
understand errors, including link errors.

Renaming this function avoids these strange errors.
2020-10-03 10:08:21 +02:00
Jon Evans 3e49669304 Clean up some unused things 2020-10-02 21:12:59 -04:00
Jon Evans 45d7f2b6f5 Expose via holes to color theme properly 2020-10-02 21:12:59 -04:00
Jon Evans 3b252c696d Make tool init order dependent on registration order
Previously, init order depended on the ordering of the
tool state map, which is opaque from the point of view of
registration.  This makes it challenging to make one tool's
init depend on another.  With this change, registration
order defines init order.
2020-10-02 18:42:41 -04:00
Jeff Young 4c5db9681c Naming conventions. 2020-10-02 21:25:14 +01:00
Jeff Young cc617b715f Implement hypertext links for intersheet references. 2020-10-02 21:18:34 +01:00
jean-pierre charras 36bc44e6d7 more cleanup about removing useless include 2020-10-02 19:56:10 +02:00
Jeff Young 0052954046 Try to make rulers draw right on Cairo as well as OpenGL.
Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-10-02 13:50:16 +01:00
Franck Jullien 2fc49045d1 ADDED: eeschema: Add intersheets references function
Add a new function to place intersheets references next to
global labels.
2020-10-01 20:39:32 +00:00
Tomasz Wlostowski e884f6d67b tool: fixed missing include 2020-10-01 19:37:14 +02:00
Tomasz Wlostowski 9b470b6c09 EDA_TEXT: Use actual draw rotation angle to generate the effective shape.
Fixes: #5814
2020-10-01 18:55:53 +02:00
Jeff Young 612411a87b Give assistant graphics a max bounding box.
They're only on screen when they're being used, and we don't have
a GAL available to calculate their actual extents from (since their
text scales with zoom).

Fixes https://gitlab.com/kicad/code/kicad/issues/5845
2020-10-01 17:53:44 +01:00
jean-pierre charras 35e129ed47 Minor code cleanup, step3: remove more useless include. 2020-10-01 18:28:12 +02:00
jean-pierre charras f702da95c7 Minor code cleanup, step2: remove more useless include.
fix also a minor compil warning
2020-10-01 15:39:47 +02:00
Jeff Young c7802e7ff8 Adjust ruler text on non-HDPI displays.
Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-10-01 14:35:30 +01:00
jean-pierre charras 42350a4928 Minor code cleanup: remove useless include or useless code.
fix also a minor compil warning
2020-10-01 11:36:15 +02:00
Ian McInerney 5482307ac8 Allow edge cuts to be drawn in the footprint editor 2020-09-30 23:33:30 +01:00
Jeff Young 6abe68fff0 Cleanup. No changes to execution. 2020-09-30 23:07:12 +01:00
Jon Evans 7c003f98d5 ADDED: Appearance panel for footprint editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5643
2020-09-30 17:46:58 -04:00
Jeff Young 626bcea8ce Move ruler drawing to the stroke font.
We don't need to be fast, and this allows us to implement drop
shadows for better readability.

Fixes https://gitlab.com/kicad/code/kicad/issues/5654
2020-09-30 20:38:20 +01:00
jean-pierre charras 3f8c9d49f8 Revert "Code cleanup: remove useless wx/wx.h include inside a few files."
due to compil issue on Linux

This reverts commit cffccc3970.
2020-09-30 20:47:20 +02:00
jean-pierre charras cffccc3970 Code cleanup: remove useless wx/wx.h include inside a few files.
in most of files, including wx.h is not necessary, when only 2 or 3 wx files must be included.
Moreover, on windows, including wx.h sometimes create compil warnings about
shadowed vars defined in some specific windows headers.
2020-09-30 20:03:27 +02:00
Seth Hillbrand bf3cb0b1d0 Standardize pad type enums 2020-09-30 08:38:35 -07:00
Jon Evans 74b0e1fa47 Break apart locked items from the rest of the selection filter
Disable selection of locked items by default

See discussion in https://gitlab.com/kicad/code/kicad/-/issues/5793
2020-09-28 21:38:08 -04:00
PJM 258d1a1971 Pcb: Get proper "Break Track" location when invoked from RMB context menu
When invoking "Break Track" from the RMB context menu, Pcbnew
gets and uses the current position of the mouse to figure out where to
break the track.  The problem is that the mouse has to be moved to select
the "Break Track" menu item, and the mouse position used is wrong.  This
can result in the break in the wrong location or not happening at all.

CHANGED: This commit determines if the "Break Track" was invoked from a
context menu or a hotkey.  If a hotkey, it uses the current mosue position.
If a context menu, it uses the original postion of the mouse when the menu
was opened.
2020-09-28 16:56:02 +00:00
Jon Evans f745036d82 Fix a minor warning 2020-09-27 22:31:34 -04:00
Mario Luzeiro a1e94c2583 3D-Viewer: request a redraw when a footprint is selected in pcbnew 2020-09-28 02:26:25 +00:00
Roberto Fernandez Bautista 72b904a978 ADDED: CADSTAR Archive project importer 2020-09-27 23:50:20 +00:00
Ian McInerney 6dfe7b6eb0 Switch toolbar palettes to use AUI drag event
This isn't as much a hack as trying to detect it ourselves and
hope we don't clobber the internal toolbar workings.
2020-09-27 23:20:17 +01:00
Jeff Young 09ab269770 Support for 'L' in DRC expression language.
Also make layer testing work again against both canonical names and
user names.
2020-09-27 21:33:37 +01:00
Roberto Fernandez Bautista 721cba32d5 ADDED: CADSTAR Schematic Archive Importer
Initial commit to trigger the importer
2020-09-27 18:13:57 +01:00
Tomasz Wlostowski 0c885c9c31 libeval_compiler: == operator now does wildcard string comparison 2020-09-27 16:45:46 +02:00
Tomasz Wlostowski 5023d9a780 libeval_compiler: initial support for multiple (>1) function/method arguments 2020-09-27 16:45:46 +02:00
Tomasz Wlostowski a01e4f19b4 eeschema: allow exporting netlists through UI-less KIFACE API function 2020-09-27 16:45:46 +02:00
jean-pierre charras 6b958ff4e0 Move specialized plotter classes from plotter.h to specific plotter_xx.h
plotter.h contains now only a header common to all plotters.
The code does not actually change, but it allows modifying a specific plotter
without recompiling most of kicad files.
2020-09-27 09:54:39 +02:00
Ian McInerney d5f781c7ca Allow dragging on the toolbar item to open a group 2020-09-27 02:22:22 +01:00
Ian McInerney fc565edb33 Add a palette to the toolbars to display groups of actions
This adds a palette to toolbar items that displays groups
of actions when long-pressed on a button.
2020-09-27 01:00:44 +01:00
Jeff Young 4c21668940 Use high-contrast layer to inform clearance rules for outline.
Fixes https://gitlab.com/kicad/code/kicad/issues/5797
2020-09-27 00:11:51 +01:00
Jeff Young 7f33c229d8 Allow selection of nested items (ie: pads) inside an entered group.
Also moves some group-related functionality from BOARD to PCB_GROUP.
2020-09-26 20:35:52 +01:00
Jeff Young f8875bc5a6 Move std::contains to alg::contains. 2020-09-26 14:42:40 +01:00
Jeff Young 1844e8e0df Fix compilation under ++20. 2020-09-26 13:12:46 +01:00
Jeff Young d7e80f8008 Add std::contains() to simplify a lot of code. 2020-09-26 12:40:32 +01:00
Jeff Young 44af3978af Re-implement undo/redo of group ops in a pointer-safe way. 2020-09-26 10:03:13 +01:00
Jeff Young 6fde9ea8a5 Don't leave stale pointers in groups when exchanging modules.
Also simplifies groups so that other areas of code that have to know
about them at least don't have to know as much. One of the simplifications
is to not worry so much about empty groups until save time; others are in
the access logic to parent groups.

Also simplifies user model slightly by removing Merge and Flatten
(which are just ungroup/group and ungroup/ungroup/.../group).

Also allows multiple groups to have the same name.  This is useful when
using groups for a classification system.

Fixes https://gitlab.com/kicad/code/kicad/issues/5788
2020-09-25 18:43:19 +01:00
PJM d1322e7d1d Refactor GetDocumentExtents()
CHANGED: GetDocumentExtents() in 'eda_draw_frame.h' now has a bool
parameter "aIncludeAllVisible" with a default value "true" which makes
it behave as it did before adding parameter.  If "aIncludeAllVisible"
is false, the returned bbox ignores some items depending on which
program it is running in.

CHANGED: Made "Zoom to Objects" use only PCB edge in Pcbnew.  This
allows text, notes, etc outside the PCB edge to be excluded in the
zoom calculation.

CHANGED: Added "Zoom to Objects" to Pcbnew main menu, and to RMB context
menus for Eeschema and Pcbnew.

Fixes https://gitlab.com/kicad/code/kicad/issues/5787
2020-09-25 00:31:56 -07:00
Jon Evans 0783669633 CHANGED: Design rules files now use .kicad_dru extension
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5763
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5444
2020-09-24 21:26:23 -04:00
Jon Evans 0c5aabc7f7 Add an option to not migrate library tables when migrating settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3924
2020-09-24 20:54:31 -04:00
Seth Hillbrand d535a4b833 When showing/hiding infobar, keep position
The infobar changes the size of the visible screen, so adding/removing
it will shift the screen center, causing the position of onscreen
objects to move up/down.  This changes the sizing to pin the bottom
corner position when showing/hiding the infobar

Fixes https://gitlab.com/kicad/code/kicad/issues/5776
2020-09-24 15:57:49 -07:00
Jeff Young dba42ebed0 ADDED Properties Dialog for groups.
ADDED memberOf() function for DRC rule expressions.

Also fixes a bug in several of the pickers where the event wasn't
being correctly passed.

Fixes https://gitlab.com/kicad/code/kicad/issues/5647
2020-09-24 14:41:02 +01:00
Jon Evans 690575e2b6 Improve edit point legibility with a hover state 2020-09-23 21:27:23 -04:00
Wayne Stambaugh 188232de6f Pcbnew: add user defined layers and allow all layers to have user names.
This changes the file format.  All previous copper layers that had a user
defined name are forced back to the canonical name and the user defined
name is stored as an optional quoted string in the layer definition and
only used for UI and plotting purposes.  All copper object layer names
are now the canonical name for internal file use.

ADDED: Nine new user definable non-copper layers that can be optionally
added to the board layer stack.

CHANGED: All board layers can now be renamed by the user.

CHANGED: User defined layer names can now contain space characters.

Fixes https://gitlab.com/kicad/code/kicad/issues/1969
2020-09-23 15:41:43 -04:00
Jeff Young 7d3eee8cf9 Move DebugZoneFiller to advanced config.
This will hopefully keep it from accidentally getting checked in
again.
2020-09-23 10:52:44 +01:00
Jeff Young 6d18f20093 ADDED constraints reporter for diagnosing constraints.
Also fixes an issue with via type property and makes property
comparisons in rule case-insensitive.

Fixes https://gitlab.com/kicad/code/kicad/issues/5754
2020-09-23 01:14:35 +01:00
Jon Evans b439c169ff Fix two-point assistant shape enum 2020-09-22 18:06:57 -04:00
Mark Roszko 7656663a2f Fix Python integration to build with vcpkg
* Add vcpkg support to find Oython using CMake
* Fix pid_t conflict with python
* Fix COMPILER conflict with python
2020-09-22 12:39:05 +00:00
Ian McInerney c40470ed0b Initialize more variables 2020-09-22 12:29:13 +01:00
Ian McInerney 9530408fdd Remove unused variables 2020-09-22 11:42:16 +01:00
jean-pierre charras 456735f803 VIEW::ViewGetLOD() returns double now instead of int.
ViewGetLOD() returns the minimal value of a zoom to show an item.
However a zoom is a double, and using int as minimal value does not
allows setting a correct value in some cases.
2020-09-21 17:55:24 +02:00
Ian McInerney 9e6a1225db Catch exception when creating app settings objects
These settings objects could be created in a constructor/destructor
so we should catch the exception since those are noexcept.

Also change the settings trace to match the other kicad traces
as KICAD_SETTINGS
2020-09-21 12:07:51 +01:00
Ian McInerney 65bd1ee9a4 Add a new BITMAP_BUTTON widget and use it in the appearances panel
This button behaves like an AUI button, so it is more suited
to being on panels without a border.
2020-09-20 01:43:27 +01:00
Jeff Young 64fa400b19 Ease translation a bit.
Also improves the SNR and consistency of the menu item text.  For
instance, a position is rarely useful, while relative sizes can be.

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5694
2020-09-19 12:08:18 +01:00
Jeff Young f340636f70 When knocking out higher-priority zone use fill, not outline.
Also fixes a bunch of naming issues, primarily with lowercase for
protected variables, but also some for consistency with other parts
of the code.

Also changes the zone fill radio buttons in Board Setup to be more
generic referring to legacy vs. current, and to have tooltips.

Fixes https://gitlab.com/kicad/code/kicad/issues/5583
2020-09-18 16:45:41 +01:00
Ian McInerney a53f3899d4 Initialize variables properly 2020-09-18 11:17:37 +01:00
Jon Evans e9b627bfd8 ADDED: Center marker dimension type 2020-09-16 20:55:11 -04:00
Marek Roszko a82edb60fe Rotate the bounding box for hit tests on the fly 2020-09-16 23:29:21 +00:00
Jon Evans 75ffce1a0b ADDED: Leader dimension object
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5555
2020-09-15 23:37:38 -04:00
Ian McInerney 8bd77c4fe7 Rename the ITEM_SET types to be descriptive of their contents
Now that we have one set type for BOARD_ITEMs and another for SCH_ITEMs
it is better to explictly say if they are board or schematic sets.
2020-09-16 02:04:17 +01:00
PJM abdd1906c2 Change 'Zoom to Fit' margins and add 'Zoom to Objects'
CHANGED: The margin used in 'Zoom to Fit' is now 2% instead of 10%.

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5145
2020-09-16 00:53:39 +00:00
Jeff Young e2e229da96 Finish exorcising the old DRC system.
This moves the various BOARD_ITEM calls to the new system, and make
the DRC_ENGINE long-lived so that it can field those queries.
2020-09-15 20:15:46 +01:00
Jeff Young 514da2f886 Move DRC dialog to new DRC engine. 2020-09-14 22:39:36 +01:00
Jon Evans 3940e20fcb Expose extension offset and zero suppression settings 2020-09-12 11:52:59 -04:00
Jon Evans 0e9997d9ca Add new dimension features to board design defaults 2020-09-11 21:12:36 -04:00
Jon Evans 76c4c959e6 Implement new dimension properties
- Automatic units mode (follow UI units)
- New text and number formatting options
- Automatic/manual text orientation control
- New text positioning options (inline and manual)

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

The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
2020-09-11 21:12:36 -04:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Jeff Young 2a2b842707 HTML_REPORTER dialog. 2020-09-10 20:58:38 +01:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00
Roberto Fernandez Bautista 7ca4f0b375 CADSTAR PCB Archive Importer: Formatting fixes 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 86bf592bac ADDED: CADSTAR PCB Archive Importer
Initial commit
- Imports directly mappable layer stackup (only physical board fabrication layers for now)
2020-09-08 21:21:20 +00:00
Jeff Young f347118ce3 Add a min pin width advanced config for plotting.
Fixes https://gitlab.com/kicad/code/kicad/issues/5546
2020-09-08 20:19:54 +01:00
Tomasz Wlostowski 09d0aff3d6 widgets: PROGRESS_REPORTER - make SetCurrentProgress() virtual, allow to change number of phases post-construction 2020-09-08 01:31:42 +02:00
Tomasz Wlostowski 466cbe2f00 libeval_compiler: fixhandling of method calls with empty argument list (e.g. 'A.method()' ) 2020-09-08 01:31:42 +02:00
Jon Evans 147540b3bb ADDED: Control to only show ratsnest for visible layers 2020-09-07 16:43:43 -04:00
Jon Evans 758a4c26d5 Switch appearance panel to custom collapsible pane widget
The new widget looks the same on all platforms and fixes a few
bugs with the wxWidgets version
2020-09-06 22:43:39 -04:00
Jeff Young e782794f96 Flesh out object properties and DRC Rule syntax help. 2020-09-05 17:44:59 +01:00
Ian McInerney f28b60896c Allow toolbar items to cancel tools when pressed
There was a regression in v6 where the zoom to selection toolbar
item wasn't canceling the tool when pressed and the tool was active
(it was in v5). This implements a more generic framework for canceling
tools on button presses.

Fixes https://gitlab.com/kicad/code/kicad/issues/5103
2020-09-05 01:49:38 +01:00
Jeff Young 08dee31d9e Try and unify the background colors between panels and platforms.
Also moves to WX_GRID to get rid of some wxGrid bugs, and moves the
provision of attrs to the GRID_TABLE (as those applied to the grid
are ignored when a table is specified).

Fixes https://gitlab.com/kicad/code/kicad/issues/5260
2020-09-04 20:47:50 +01:00
Jeff Young 2736becb8b Fix typo in Toggle Layers action and add descriptions to hotkeys lists.
Fixes https://gitlab.com/kicad/code/kicad/issues/5494
2020-09-04 17:45:07 +01:00
Jeff Young 3573c8b967 ADDED hotkey for comment/uncomment line(s) in Scintilla.
Useful primarily for DRC Rules editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/5480
2020-09-03 20:37:05 +01:00
Jeff Young d1006138fd ADDED holeWallPlatingThickness to AdvancedCfg.
Used for zone filling and DRC hole collision testing.  Allows us to
calculate the actual hole size from the finish hole size.

Fixes https://gitlab.com/kicad/code/kicad/issues/5468
2020-09-03 16:00:07 +01:00
Jeff Young 38e9217d54 Consolidate all DRC epsilon/threshold values to a single advancedCfg setting.
Fixes https://gitlab.com/kicad/code/kicad/issues/5464
2020-09-03 15:03:09 +01:00
Jeff Young 450519a4bd Sometimes a DRAW_PANEL_GAL wants its immediate parent and sometimes not.
For instance, we get things like high-contrast-mode from the pad
dialog when rendering a pad preview, but we want the colours from the
parent PCB_BASE_FRAME.
2020-09-03 15:03:09 +01:00
Ian McInerney cb36006406 First round of cleanup for the PCB groups
ADDED: Leave group action

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5324
2020-09-02 00:10:25 +01:00
Ian McInerney 1b4ec6ccb5 Display symbol libraries that couldn't be loaded as disabled text
Fixes https://gitlab.com/kicad/code/kicad/issues/5092
2020-09-02 00:10:25 +01:00
jean-pierre charras 9fdadcbcf5 EDA_BASE_FRAME::windowClosing( wxCloseEvent& event ): fix incorrect behavior.
windowClosing() calls Destroy() when the wxCloseEvent has no veto.
This is fine for usual EDA_BASE_FRAME frames, but not for frames shown in modal mode.
In modal mode, windowClosing() should not call Destroy(), because the calling frame
expects the instance not deleted after closing.
(the caller has to call Destroy() only once the frame can be actually deleted)
2020-09-01 17:46:17 +02:00
Mark Roszko 9f128f942c Move shutdown blocker to kiplatform 2020-09-01 10:14:51 +00:00
Mark Roszko a9532c2fa1 Add browse button to footprint 3d settings
Add normalization to 3d settings and footprint library table editor
2020-09-01 02:00:38 +00:00
Jeff Young 2697fc3864 Remove canvas-switching from OSX.
The Cairo renderer doesn't work on Retina displays.

Fixes https://gitlab.com/kicad/code/kicad/issues/4788
2020-08-31 18:48:25 +01:00
Jeff Young 64c4d3e532 Fix bone-headed comment from previous commit. 2020-08-31 14:33:08 +01:00
Jeff Young 88635ee5b6 Clean up error messages.
Convert a lot of nags to InfoBar errors/warnings/messages, and some
that never should have been exposed to wxFAIL_MSGs.
2020-08-31 14:19:57 +01:00
Jeff Young 091f769106 Add infobar error message for Autoplace when board not defined.
Fixes https://gitlab.com/kicad/code/kicad/issues/5425
2020-08-31 12:54:45 +01:00
Jon Evans 9f7bca38b3 A better way of handling standalone project files 2020-08-30 16:04:39 -04:00
Jeff Young 20211eed49 Unroll a level of prefs for fieldname templates.
It was playing havoc with the saving of project and global templates
without one overwriting the other.

Fixes https://gitlab.com/kicad/code/kicad/issues/5415
2020-08-30 18:58:18 +01:00
Jeff Young 305abb210f Add a mode to allow zone smoothing to produce external fillets.
Fixes https://gitlab.com/kicad/code/kicad/issues/5306
2020-08-30 15:20:59 +01:00
Fabien Corona 4a0d6297ab pcbnew: Add an alternate edit method for arcs
The alternate edit methods keeps the radius constant

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5182
2020-08-29 20:53:53 +01:00
Jon Evans 19832c7599 ADDED: Tool for converting shape types in PcbNew
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2406
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2507
2020-08-28 21:16:06 -04:00
Ian McInerney a0d84e94fd Use move to trash to the project manager instead of immediate delete
CHANGED: Delete in the project manager now moves files to the trash can

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/2465
2020-08-27 10:34:12 -07:00
Mark Roszko 1082402b33 Convert UNDO_REDO_T to an enum class 2020-08-26 18:04:32 +00:00
Reece R. Pollack 6f1204cfd7 Add Display Origin Transforms support to the PCB_BASE_FRAME class
This commit adds support for display origin transforms to the PCB_BASE_FRAME
class. This instantiates a PCB_ORIGIN_TRANSFORMS object, and overrides the
GetOriginTransforms method in the EDA_DRAW_FRAME class to reference it.

The formatting of the status line has been updated to display coordinates
relative to the user-selected origin, and with the coordinates increasing
in the user-selected direction.
2020-08-26 17:54:22 +00:00
Reece R. Pollack 2895d664e6 Add Display Origin Transform data to the PCB_DISPLAY_OPTIONS class
This commit adds the user configuration options to support display
origin transforms to the PCB_DISPLAY_OPTIONS class. This data is
configured by the "Origins & Axes" preferences panel added in a
later commit.
2020-08-26 17:54:21 +00:00
Reece R. Pollack 6e25b7d455 Add ORIGIN_TRANSFORMS to the UNIT_BINDER and EDA_DRAW_FRAME classes
This commit modifies the UNIT_BINDER class to invoke the ORIGIN_TRANSFORMS
methods to support Display Origin Transforms.

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

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

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

The expectation is that the different KiCad applications will create
derived classes from this base class and override the functions as
needed. Protected template functions are provided for the standard
translations to maintain consistency within the derived classes.
2020-08-26 17:54:21 +00:00
Jeff Young 050bbcdb4f Fix error reporting from function pre-flighting. 2020-08-26 12:56:17 +01:00
Jeff Young 1138c32bf3 Don't pass Cancel event where there was a specific action cancelled.
For instance, if during a move the user hits ESC they only want the
move cancelled, not (for instance) the selection dropped.

Fixes https://gitlab.com/kicad/code/kicad/issues/5356
2020-08-25 12:54:40 +01:00
Jon Evans 24435fcc62 Don't create new project files when opening boards/schematics
Display warning infobar in the board/schematic setup when no project
is loaded, since most of the settings in those dialogs are saved in
the project and not in the board/schematic file.

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

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

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

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

See: https://gitlab.com/kicad/code/kicad/-/issues/4412
2020-08-23 19:01:08 +00:00
Jon Evans 6720473db9 Move net visibility/color controls to a wxGrid
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5235
Might improve https://gitlab.com/kicad/code/kicad/-/issues/5210
2020-08-23 13:15:07 -04:00
Jon Evans 625f0afcff Fix link issue on MSVC (thanks @mroszko)
wxScrolledCanvas is not properly exported, so when we
add a wxGrid it has a chance of creating linker errors.
Including the wx/grid.h ensures that the linker does not
see two conflicting symbols between gal and the other
place where wxGrid is used.
2020-08-23 12:57:44 -04:00
Jeff Young 80846dcbc7 Improve shutdown performance. 2020-08-21 19:12:51 +01:00
Jeff Young 97c34e2516 ADDED alternate pin definitions and assignments.
Fixes https://gitlab.com/kicad/code/kicad/issues/2002
2020-08-21 18:29:36 +01:00
Seth Hillbrand 1e315bc3fe pcbnew: Add "Select All" Action to pcbnew and fpedit
Fixes https://gitlab.com/kicad/code/kicad/issues/2497
2020-08-20 16:07:10 -07:00
Ian McInerney c479deaf02 Use groups when doing graphics import
ADDED: Allow DXF/SVG graphics to be imported as a group

Also, cleanup the placement routine to allow the edit tool's flip
and rotate routines to be used when placing the items.
2020-08-20 01:22:48 +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
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
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 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
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
jean-pierre charras 5b365053db Fix a few I18n issues.
Especially, only ASCII7 chars can be used in messages.
Do not mark debug messages as I18n strings
2020-08-17 09:18:49 +02: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 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 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
Jon Evans 0db00046d1 Fix rendering of net colors on items 2020-08-15 18:50:44 -04:00
Jon Evans 2f604b4494 Add selection filter to footprint editor 2020-08-15 16:42:19 -04: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 edda024285 Fix up some Coverity and CLion warnings. 2020-08-14 12:41:20 +01: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