Commit Graph

14187 Commits

Author SHA1 Message Date
Seth Hillbrand d669ae043a GRID_HELPER: Standardize grid helper logic to dim
Places dimension tool under same snapping logic as rest of draw tools

Fixes: lp:1796498
* https://bugs.launchpad.net/kicad/+bug/1796498
2018-10-06 09:53:14 -07:00
Seth Hillbrand da3afd4abd GRID_HELPER: Avoid inactive layers when snapping 2018-10-06 09:52:21 -07:00
Seth Hillbrand 776d12c529 GRID_HELPER: Measurement snapping points
Measurements should snap to the points that are used for controlling the
measurement.
2018-10-06 09:29:19 -07:00
Seth Hillbrand f2a49c6bd6 pcbnew: Get anchor from layer when drawing
When drawing segments, the segment will be NULL'd after committing, at
which point we lost our snap layer.  Choosing snap layers from the
current drawing layer is a more robust method.

Fixes: lp:1796467
* https://bugs.launchpad.net/kicad/+bug/1796467
2018-10-06 08:18:31 -07:00
John Beard 86999a2a4d Update testing documentation 2018-10-06 08:46:36 -04:00
Seth Hillbrand 8c56f5b035 pcbnew: Allow deselection when clicking on zone
Deselection by clicking on a zone makes working with plane zones easier
by allowing the selected item to de-selected by clicking on a zone.
Once the selection is cleared, the zone may be re-selected as normal.
Clicking on non-zone items while a separate item is selected will still
select the new non-zone item without requiring a second click.
2018-10-05 21:20:32 -07:00
Seth Hillbrand 502383b759 pcbnew: Adjust selection behavior in highlight net
Prefer non-zones in highlight net in the same way we do for the
selection tool.  Highlight net just has separate logic and was missed
previously.
2018-10-05 21:20:26 -07:00
Seth Hillbrand ceca3e526c view: Do not include hidden items in query
When querying the view, we do not want to including items that are not
on layers that are currently visible.  This routine is currently only
used by the selection tool (pcbnew and gerbview) and the grid helper.
Both expected this logic but were indifferent to the additional items.

Fixes: lp:1796403
* https://bugs.launchpad.net/kicad/+bug/1796403
2018-10-05 16:45:38 -07:00
Seth Hillbrand 4efc8dec88 pcbnew: Skip the full itemlist search when updating
Updating connectivity should not need to iterate over the full item list
in each thread.  Instead, we collect the dirty items first and then
iterate only over the dirty list.
2018-10-05 15:08:25 -07:00
Seth Hillbrand bc02044767 pcbnew: Avoid spinning up thread when routing
Our connectivity data threads the ratsnest update based on the number of
nets that have changed.  If we are only changing one net (the case when
routing) then making a full thread to update the net is pointless
because we wait for the thread to finish before continuing.  This spins
that off to an inline lambda for single updates while still making
threads for multiple ratsnest changes.
2018-10-05 15:04:29 -07:00
Seth Hillbrand 2db3f859f7 GRID_HELPER: Show snap indicator when would snap
This shows the snap indicator even when the item we are snapping to
occurs on a grid point, giving the user an indication that the point is
correctly connected.
2018-10-05 14:33:48 -07:00
Jeff Young 5ce14dad2a Flush out whatever the dialog-is-closing guard was for.
The guard isn't working on GTK (causing eval not to happen on
a kill focus), and I can't remember what issue I put it in to
solve.  I've done a bunch of testing and it appears that we
don't need it, although I'm sure I put it in for something....

Fixes: lp:1793911
* https://bugs.launchpad.net/kicad/+bug/1793911
2018-10-05 20:19:16 +01:00
Jeff Young 9e828e0d94 Don't default Use Netclass Values to on.
Fixes: lp:1795939
* https://bugs.launchpad.net/kicad/+bug/1795939
2018-10-05 15:11:18 +01:00
Jeff Young 9a213207fb Clearer titles for editing board footprints.
Also cleans up the naming on the symbol editor side.
2018-10-05 14:17:58 +01:00
Jeff Young 8015334683 Don't resize hidden columns.
wxGrid columns are hidden by setting their width to 0.  Resizing
them will "unhide" them.

Fixes: lp:1796150
* https://bugs.launchpad.net/kicad/+bug/1796150
2018-10-05 14:17:58 +01:00
Jeff Young 895e187ca0 Add a bit more space for those using larger fonts. 2018-10-05 14:17:58 +01:00
Seth Hillbrand ee676b74d5 pcbnew: Move measure tool to common GRID_HELPER
This removes the last of the Magnetize legacy code from GAL,
standardizing the key bindings and magnetic effects in the GAL canvas
2018-10-04 21:31:57 -07:00
Seth Hillbrand 4c6b84bfdb GRID_HELPER: enable/disable grid in editor with ALT
Apply optional grid while editing
2018-10-04 21:31:28 -07:00
Seth Hillbrand 28c19cb613 GRID_HELPER: Allow grid disable
Many items require precise, non-grid movement.  Adding the ability to
flag a non-grid option will permit this behavior.

This is a required precursor commit to fixing lp:1738818 and lp:1771683
2018-10-04 21:23:50 -07:00
Seth Hillbrand f56b5cf7bd GRID_HELPER: Match layer set when snapping
This allows items to snap to multi-layer target anchors such as vias and
through hole pads.
2018-10-04 21:23:49 -07:00
Seth Hillbrand f8f2af774c GRID_HELPER: Fill out remaining anchor calculations
The computeAnchors function is used to find best drag locations for
items being moved.  All movable PCB items should be handled.

Fixes: lp:1794304
* https://bugs.launchpad.net/kicad/+bug/1794304
2018-10-04 20:25:13 -07:00
Seth Hillbrand 853b9d06ad pcbnew: Fix snapping while moving on pads
When requesting to move a footprint based on the pad, the pad layers
should determine the snapping.  This extracts layers from the selected
pad before allowing the filtering for locked pads

Fixes: lp:1787627
* https://bugs.launchpad.net/kicad/+bug/1787627
2018-10-04 15:53:41 -07:00
Seth Hillbrand 1ff9931333 pcbnew: Remove legacy Magnetize() from GAL picker
Magnetic items handled by GRID_HELPER in GAL.  Also includes the
standard keyboard modifier shift to change magnetic items on/off
2018-10-04 15:48:15 -07:00
Hal Gentz 416e64a334 Spice plot widget: more accurate rendering
Patch modifies the way graphs are displayed: instead of drawing one
point for each X coordinate, there is a line segment joining min and max
values for continuous graphs and all unique points are displayed for
discrete graphs.

Fixes: lp:1674143
* https://bugs.launchpad.net/kicad/+bug/1674143
2018-10-04 22:49:41 +02:00
Maciej Suminski 70c1de3275 Spice simulator: faster graph rendering
Graph rendering takes a lot of time, especially when there is a high number
of points to be drawn. The initial implementation drew all points/lines
even if the the coordinates were duplicates, in the new version duplicated
coordinates are skipped.

Fixes: lp:1674143
* https://bugs.launchpad.net/kicad/+bug/1674143
2018-10-04 22:39:38 +02:00
jean-pierre charras d2585fda50 DIALOG_SHIM: make default style wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER. 2018-10-04 18:03:46 +02:00
Seth Hillbrand 11b45002e1 pcbnew: Code formatting 2018-10-04 08:17:48 -07:00
Seth Hillbrand a4966adb67 pcbnew: Don't call evt->pos for non-mouse events
Since we are handling snapping in the grid helper, we don't need to
enable it in the cursor position return.  This allows the grid helper to
use the frame position while optionally snapping to segments.
2018-10-04 07:29:41 -07:00
John Beard 3a9e7a496a Centralise some UI constants, use in hotkey lists
There are lot of places where constants are used in the KiCad UI
as "magic numbers". The most common one is "5", used in many
wxFormBuilder and manual UI constructions as the margin.

This commit provides a place for all UI to look up shared
constants and other functions, to help create a consistent UI using
functions that provide meaning and intent to these magic numbers.
2018-10-04 07:47:21 -04:00
John Beard 0be9667c96 Add read-only option for hotkey list, use for list dialog
This replaces the flat HTML list dialog with a read-only
version of the editor dialog in a pared-down dialog.

Fixes: lp:1778374
* https://bugs.launchpad.net/kicad/+bug/1778374
2018-10-04 07:47:21 -04:00
John Beard 7c2c8d307e Add tooltips to hotkey dialog buttons
THis is done in the generic widget, so other users can
benefit from it.
2018-10-04 07:47:21 -04:00
John Beard 23038b1550 Simplify hotkey editor widget
This is in preparation for making this widget optionally read-only.

Major changes:

* Construct panel in code, not with wxFormBuilder. This make's it
  easier to conditionally construct elements that won't be used
  in a read-only mode (e.g. the buttons).
* Use a generic "button row panel" widget for the buttons, as the
  sizing and layout logic is reusable in nearly all dialogs, and
  it's simplifies layout in the higher-level dialog widget. This
  widget is one example of many possible "reuable widgets".
2018-10-04 07:47:21 -04:00
John Beard 445a9fa963 Put cursor and pan control in libcommon/tool, enable in Gerbview
Put the cursor and pan control TOOL_ACTIONs in ACTION,
and refer to them in that way.

The handlers are currently identical in Pcbnew and Cvpcb,
and Gerbview (and all canvases) can benefit from them as well
if they are in libcommon. Also saves duplicated code.

Fixes: lp:1795855
* https://bugs.launchpad.net/kicad/+bug/1795855
2018-10-04 11:41:06 +02:00
Seth Hillbrand 03e642a8db pcbnew: Implement consistent graphical snapping
This creates a standard snapping framework in the GRID_HELPER class that
allows snapping to items on the same layer as the object being
created/moved as well as consistent toggling of this using the Shift key
modifier.

Fixes: lp:806260
* https://bugs.launchpad.net/kicad/+bug/806260

Fixes: lp:1604616
* https://bugs.launchpad.net/kicad/+bug/1604616
2018-10-03 17:23:56 -07:00
Seth Hillbrand f714d2fa64 pcbnew: draw polygon and element previews on layer
This ensures that when starting to draw a zone or graphic element, the
preview is drawn in the same color/on the same layer as the element that
will be created.  Previously, beginning a graphic polygon while a copper
layer was active would result in the preview being drawn in the color of
the active copper layer.
2018-10-03 17:23:56 -07:00
Jeff Young c9ca1013b2 Make ModEdit and LibEdit library tree actions more consistent.
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
2018-10-03 22:46:41 +01:00
Jeff Young b08766a2fa Scroll Footprint Viewer to selected item when opening. 2018-10-03 22:46:41 +01:00
Seth Hillbrand 6c693f80a7 pcbnew: Fix polygon corner adding in board editor
Polygon corners were enabled in the footprint editor but the logic
didn't extend to the board editor.  This revises the logic to look for
DRAWSEGMENTs and only reference the PCB_MODULE_EDGE_T where needed to
create a new segment in the footprint.

Fixes: lp:1782966
* https://bugs.launchpad.net/kicad/+bug/1782966
2018-10-03 11:29:02 -07:00
John Beard 3da0d03c36 Centralise utilities for env variables.
This puts generic logic for KiCad environment vars in
one place.

Also updates the DIALOG_CONFIGURE_PATHS help to document
the new KICAD_USER_TEMPLATE_DIR and KICAD_TEMPLATE_DIR.
2018-10-03 11:53:10 -04:00
Seth Hillbrand 6a6d580a1c pcbnew: Improve zone/polygon selection
Allows selection of polygons and zones by their visible area.  Will only
select polygons/filled areas when they are unobstructed by other
elements in the footprint/pcb.  Also adds a "skip heuristics" modifier
key for clicking (ALT) that allows the full disambiguation list to be
displayed without removing less-likely elements.  This dovetails the
zone/polygon selection as it allows selecting even when areas a fully
overlapped.

Fixes: lp:1753153
* https://bugs.launchpad.net/kicad/+bug/1753153
2018-10-03 06:23:35 -07:00
jean-pierre charras 2c0fe8f595 Pcbnew: minor fix: avoid flicker in Layer Manager when closing Pcbnew.
It was due to useless paint events during closing, on some platforms.
2018-10-03 09:46:17 +02:00
Seth Hillbrand 57ceec5606 pcbnew: Allow DRC violations when requested in dp 2018-10-02 14:39:53 -07:00
Jeff Young fb4ae4e218 Update FP editor title after a Save As. 2018-10-02 21:05:14 +01:00
Jeff Young 536451138d Make sure fixes to netlist stuff are done on both sides.
This fixes the CmpNoCase() == 0 bug on one side, and the
footprint == null bug on the other side; both of which were
previously fixed on only one side.

Fixes: lp:1795561
* https://bugs.launchpad.net/kicad/+bug/1795561
2018-10-02 18:18:37 +01:00
Jeff Young afd518d1e8 Better logic for footprint loop.
Fixes: lp:1795288
* https://bugs.launchpad.net/kicad/+bug/1795288
2018-10-01 22:05:47 +01:00
Jeff Young dfe164e0dc Only clear link when adding footprint from library, cache, etc.
Fixes: lp:1792256
* https://bugs.launchpad.net/kicad/+bug/1792256
2018-10-01 19:22:42 +01:00
jean-pierre charras db5386467b Re activate Zone Unfill All command, accidentally removed by a previous commit.
Fixes: lp:1795293
https://bugs.launchpad.net/kicad/+bug/1795293
2018-10-01 09:04:14 +02:00
Seth Hillbrand 89a3d2b451 pcbnew: Force at least one connectivity thread
We want to keep at most 1 thread per 2 connectivity updates but we need
to force that floor to be at least 1 for when there is only 1
connectivity update.

Fixes: lp:1795245
* https://bugs.launchpad.net/kicad/+bug/1795245
2018-09-30 12:13:57 -07:00
Jeff Young 7bcb5fd720 Make app names and tooltips consistent.
Fixes: lp:1795236
* https://bugs.launchpad.net/kicad/+bug/1795236
2018-09-30 17:46:45 +01:00
Jeff Young f06bf81651 Don't deselected items that have been deleted.
De-referencing freed memory is never a good idea.

Fixes: lp:1795195
* https://bugs.launchpad.net/kicad/+bug/1795195
2018-09-30 15:47:18 +01:00