Commit Graph

5638 Commits

Author SHA1 Message Date
jean-pierre charras 9c7b0c2ee5 Fix a compil issue created by may commit 413a3d828a
.
2017-05-24 21:14:24 +02:00
jean-pierre charras 413a3d828a remove dead code in swig 2017-05-24 18:08:15 +02:00
jean-pierre charras 1a33efa133 Fix an issue when reading a gpcb footprint library when a .fp file has a problem.
Now the full library loading is not aborted (and the other libraries in list are also loaded).
Only the bad .fp file(s) is not loaded.
Mainly, a .fp file load error does not throw a library load error, and this is a temporary fix.
But throwing a library error when a .fp file cannot be loaded is worst (you even cannot import a good .fp file).
2017-05-24 14:38:08 +02:00
Maciej Suminski e79f97860c Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only
once, at other times they were just straight lines or crashed the
application.
2017-05-16 17:58:09 +02:00
jean-pierre charras f77db7b4b9 Fixes: lp:1690840 (Pcbnew crashes when creating a drill file)
https://bugs.launchpad.net/kicad/+bug/1690840
2017-05-16 13:00:54 +02:00
Maciej Suminski 499eabceb4 More data validity checks in POINT_EDITOR
Fixes: lp:1690658
* https://bugs.launchpad.net/kicad/+bug/1690658
2017-05-16 11:47:00 +02:00
Maciej Suminski 4336db3a7c Clear selection before 'Global Deletion' action
Fixes: lp:1690783
* https://bugs.launchpad.net/kicad/+bug/1690783
2017-05-16 09:16:12 +02:00
Eldar Khayrullin 14bb238b30 Fix typo (NTPH instead of NPTH) in DIALOG_GENDRILL_BASE. 2017-05-14 19:32:03 +02:00
jean-pierre charras 305a166e95 Pcbnew: update immediately the 3D viewer opened from the footprint editor/viewer/wizard after a change. 2017-05-13 08:17:06 +02:00
Maciej Suminski b823d0b784 Use separate GAL_DISPLAY_OPTIONS instance in pad properties dialog
DIALOG_PAD_PROPERTIES disables the axis display which propagates
back to the parent frame when they share the same GAL_DISPLAY_OPTIONS
instance.

Fixes: lp:1687014
* https://bugs.launchpad.net/kicad/+bug/1687014
2017-05-12 01:01:38 +02:00
Maciej Suminski b71fc5564a Code formatting fixes 2017-05-10 11:40:49 +02:00
Oliver Walters cd738297b0 SELECTION_AREA color now indicates selection mode
BLUE = Normal
GREEN = Addition
RED = Subtraction

Line color indicates "window" or "crossing" selection mode
2017-05-10 10:57:29 +02:00
Oliver Walters 2ae47d31cc Fix for Arc HitTest
compureArcBBox does not account for line width
2017-05-10 10:57:29 +02:00
Oliver Walters a2fda9bd39 Fixed selection filtering
- Fixed "double selection" of pads and pad parents in PCBNEW
- Disabled selection of entire module in MODEDIT
2017-05-10 10:57:29 +02:00
Oliver Walters b53ba56ac2 Use CTRL modifier to deselect items 2017-05-10 10:57:29 +02:00
Oliver Walters c8fe9ffa79 Adjusted selection for ZONE 2017-05-10 10:57:28 +02:00
Oliver Walters 9c80d63b5c Fixed HitTest for text and modules 2017-05-10 10:57:28 +02:00
Oliver Walters d9308fcab1 Fixed HitTest for ZONE_CONTAINER 2017-05-10 10:57:28 +02:00
Oliver Walters 6aadc703f0 Updated HitTest for PCB_TEXT and TEXT_MOD 2017-05-10 10:57:28 +02:00
Oliver Walters e29abd6204 HitTest for trapezoid pad 2017-05-10 10:57:28 +02:00
Oliver Walters 7cfc882448 HitTest for RoundRect pad 2017-05-10 10:57:28 +02:00
Oliver Walters 8caef05ad6 HitTest for Oval pads
HitTest for Oval pads

Required fix for GetBoundingBox method for Oval Pad shape
2017-05-10 10:57:28 +02:00
Oliver Walters f338d46476 HitTest for Rectangular pads
HitTest for Rectangular pads

- Works at any rotation, even with Shape Offset
- Fixed bugs in D_PAD BoundingBox calculation
2017-05-10 10:57:28 +02:00
Oliver Walters a0afcd5a62 HitTest for pads
- Circular pads
2017-05-10 10:57:28 +02:00
Oliver Walters 2b4c2efc85 Fixed HitTest for Arc segment 2017-05-10 10:57:28 +02:00
Oliver Walters f8734bd057 Fixed ::HitTest for Circle shape
- Testing against rectangle intersection now works correctly
- Previously tested against BoundingBox() not circle outline
2017-05-10 10:57:28 +02:00
Oliver Walters ef25ffbab7 Alter selection mode based on drag direction
LEFT > RIGHT = Enclosed selection
RIGHT > LEFT = Touching selection
2017-05-10 10:57:28 +02:00
Maciej Suminski 6cefb68c7d Fixed a crash on Eagle PCB import with dimensions on unsupported layers 2017-05-08 11:04:10 +02:00
Maciej Suminski 2ac8ab2a8f Eagle layers as enums 2017-05-08 10:26:48 +02:00
Maciej Suminski 99f65f4dbf Added const T& to Eagle PCB import plugin methods 2017-05-04 15:44:14 +02:00
Alejandro García Montoro 9cf934ef17 Moves Eagle XML parser to common, replacing boost with wx.
All E'STRUCTS' are moved to common except for ERULES (which is
specific to pcbnew and needs its internal units), still in
pcbnew/eagle_plugin.{h,cpp}

In order to get rid of another boost dependency, this also changes
the parsing of the XML from Boost.PropertyTree to wxXml.

To replace boost::optional, an OPTIONAL_XML_ATTRIBUTE class has
been implemented. This could be replaced with std::optional when
C++17 is ready.
2017-05-04 15:29:45 +02:00
jean-pierre charras 4f2ed1b05f Plot gerber: fix a minor issue: an aperture attribute was incorrectly set on non copper layers when drawing some pads. 2017-05-04 08:55:17 +02:00
jean-pierre charras d1dfa5aba3 Code cleaning: add comments, better names for a function, simplify code. No actual code change. 2017-05-04 08:54:30 +02:00
Wayne Stambaugh 096d9fbbf9 Pcbnew: continue loading footprints after first failure.
The footprint library cache handler would throw an exception on the
first error it encountered preventing all subsequent footprint files
from being parsed even if there was nothing wrong with them.  This
commit queues errors until all of the footprint files in the folder
have been parsed.

Fixes lp:1416736

https://bugs.launchpad.net/kicad/+bug/1416736
2017-05-03 15:27:07 -04:00
Marco Ciampa b50d3966b5 Pcbnew: make ruler tool warning translatable. 2017-05-02 16:30:24 -04:00
Eldar Khayrullin f3457794cf Pcbnew: add option to plot DXF editable text
Add option to plot DXF oneline ASCII text as editable text (in non-outline mode)

Fixes: lp:1423515
* https://bugs.launchpad.net/kicad/+bug/1423515
2017-05-02 15:07:19 -04:00
jean-pierre charras 000ee22e39 Drill dialog: creates the directory, when the path entered in dialog does not exist. 2017-05-01 20:42:18 +02:00
jean-pierre charras c8706e9c15 Fix compil issue in Python support. 2017-05-01 14:19:38 +02:00
jean-pierre charras afe92c7bfc Pcbnew: Add creation of Drill Files in Gerber X2 format.
Gerbview: add support of drill files in Gerber format.
Fix also an issue in drill dialog: Axis choice is now common to plot a drill files.
2017-05-01 12:43:40 +02:00
jean-pierre charras a92ea8c75b Fixes: lp:1687014 Footpring editor disappearing axes crosshair
https://bugs.launchpad.net/kicad/+bug/1687014
2017-04-29 11:43:02 +02:00
Robbert Lagerweij e57c962336 Pcbnew: add option to select origin & anchor in move exactly tool
This patch adds a radiobox to allow the user to select a reference point for
the move. The additional options are: User Origin (set with <space>),
Grid Origin and Sheet Origin (effectively making it an absolute coordinate).

A checkbox is added (where it makes sense) to allow overriding which point
within the component is put on top of the designated coordinate.

Fixes: lp:1460460
* https://bugs.launchpad.net/kicad/+bug/1460460
2017-04-25 11:32:49 -04:00
Eldar Khayrullin 0af5695e51 Pcbnew: add option to plot DXF lines in outline mode.
Add option to plot dialog to plot DXF layers *.Cu, *.Adhes, *.Paste, and
*.Mask in outline mode or line mode.

Fixes lp:1643330

https://bugs.launchpad.net/kicad/+bug/1643330
2017-04-25 08:24:55 -04:00
Maciej Suminski 6507dbf3ad Fixed code formatting & comments typos 2017-04-24 00:02:07 +02:00
jean-pierre charras b385413458 Fix tooltip errors 2017-04-22 10:26:22 +02:00
jean-pierre charras 9e321a4722 Pcbnew: Apply a fix made in stable branch, in AppendBoard, to avoid potential crash. 2017-04-22 09:23:02 +02:00
Maciej Suminski e53c3afc29 Fixed a bug with invisible vias
If there was a board with no copper layers checked as visible, the
initial GAL cache contained an empty entry for them. In such case,
toggling layers visibility have not changed anything.

The visibility condition check has been moved to ViewGetLOD() method
which serves better the purpose of dynamic visibility checks.

Fixes: lp:1639974
* https://bugs.launchpad.net/kicad/+bug/1639974
2017-04-20 18:22:27 +02:00
Maciej Suminski 217593f6bc Fixed selected items drift on rotation/flip 2017-04-20 16:38:19 +02:00
Maciej Suminski 0e14cdf6da Code formatting 2017-04-20 16:37:36 +02:00
Maciej Suminski d452a5a30c Moved ratsnest update from EDIT_TOOL to PCB_EDITOR_CONTROL 2017-04-20 14:43:42 +02:00
Maciej Suminski bc8668b039 Renamed PCB_ACTIONS::editModifiedSelection to selectionModified 2017-04-20 14:11:59 +02:00
Maciej Suminski bb999f1bbf Fixed items disappearing after a rotation/flip
Fixes: lp:1683831
* https://bugs.launchpad.net/kicad/+bug/1683831
2017-04-20 14:11:59 +02:00
Maciej Suminski e2b95cf97a Removed a redundant update/refresh calls
BOARD_COMMIT handles all necessary updates
2017-04-20 14:11:35 +02:00
Maciej Suminski 74847bf8ff Code formatting and clean-up 2017-04-20 14:01:38 +02:00
jean-pierre charras a35a46804e Pcbnew fix: "create array" extremely slow in GAL mode, due to a useless call of a time consuming method for each new item created. 2017-04-19 14:15:11 +02:00
jean-pierre charras 01f5a129a3 Fixes: lp:1683147 (Board append command *extremely* slow)
https://bugs.launchpad.net/kicad/+bug/1683147
2017-04-18 20:10:34 +02:00
jean-pierre charras cf87536322 Fix a focus issue in dialog_edit_module_for_BoardEditor.cpp (Linux only) when creating the dialog.
It prevents ESC or ENTER keys to dismiss the dialog, until the focus is set by clicking on a widgets in the dialog.
2017-04-16 21:48:22 +02:00
jean-pierre charras 4b916b42ed dialog_edit_module_for_BoardEditor.*: fix questionable code. 2017-04-16 20:52:41 +02:00
jean-pierre charras 88105f891f Fixes Pcbnew bug: Drag Zone Outlines no longer working in legacy view 2017-04-16 18:32:47 +02:00
jean-pierre charras 50fd7a27cf Fix a few coding issues in dialog_edit_module_for_Modedit.
(Mainly, remove OnOkClick and OnCancelClick to use default handlers, and use TransferDataFromWindow to update fields)
Fix also a minor issue in lib_id
2017-04-16 15:09:05 +02:00
Miles McCoo 11c42cdff7 Minor Pcbnew Python scripting improvement.
Added NETCLASSPTR constructor to swig interface. This enables scripts to
generate new net classes.
2017-04-14 08:49:51 -04:00
jean-pierre charras 74cd53fb31 finishing work started in commit ba37d6fca35b67fc04a21aa111aba97c80c3a1b0:
Command add corner to zone in GAL mode: fix corner cases (existing when a zone has holes).
(Well, "corner case" is the right word: I can't resist)
2017-04-14 14:39:45 +02:00
jean-pierre charras 83169af988 Code refinement for commit 80371134d7 2017-04-14 14:39:44 +02:00
Lachlan Audas a208ba6566 Fix Eagle plugin board free text rotation import bug.
When using angle's other than 90, 180, and 270, the Eagle plugin did not
correctly set the text angle.
2017-04-14 08:30:57 -04:00
jean-pierre charras b347443b95 Make Help sub-menus working in footprint viewer 2017-04-13 18:36:07 +02:00
jean-pierre charras 80371134d7 better fix than commit 6c083ebf4c, because the issue was existing in other dialogs
Fix incorrect frame deletion, only noticeable when eeschema is run in stand alone mode.
After selecting a footprint using the footprint viewer, the application cannot be closed.
Reason:
the footprint viewer ctor creates an instance (not shown) of a FRAME_PCB.
Unfortunately, this pcb frame was not deleted by Eeschema, in stand alone mode,
preventing the application to be closed because a frame was still active after closing the schematic editor frame.
Now the footprint viewer ctor delete this instance after use, if it was not previously existing.
2017-04-13 18:28:16 +02:00
jean-pierre charras 675eb37163 Fix a typo in a tool tip 2017-04-08 08:21:35 +02:00
jean-pierre charras 9a7abd5914 Pcbnew: fix some issues in GAL when adding holes in zones. 2017-04-07 11:57:02 +02:00
jean-pierre charras 70c961fe6a Pcbnew: fix serious issues (broken files) when saving and loading .kicad_pcb files when zones have holes in outlines. 2017-04-07 08:02:26 +02:00
jean-pierre charras ba37d6fca3 Temporary fix of broken command add corner to zone in GAL mode.
Fixes: lp:1680339
https://bugs.launchpad.net/kicad/+bug/1680339
2017-04-06 19:04:47 +02:00
jean-pierre charras bf21640ae5 Fix a few issues when changing a color in render, in GAL mode.
Now colors of ratsnest, vias, not plated holes and anchors can be set.
However not plated holes still have a color issue.
2017-04-05 16:31:29 +02:00
jean-pierre charras 23a8741b5e Pcbnew: fix a crash when changing a color in render, in legacy mode, if the GAL mode was previously used. 2017-04-05 16:31:29 +02:00
Wayne Stambaugh 5dbfc02334 Board editor footprint properties dialog 3D model viewer fix.
Move the dialog layout refresh from the ctor to TransferDataToWindow which
is called by event after the dialog object is constructed.  This was causing
the 3D view panel to be drawn incorrectly on windows builds.

Remove unnecessary wxT() macros.

Fixes lp:1665888

https://bugs.launchpad.net/kicad/+bug/1665888
2017-04-04 10:05:01 -04:00
Maciej Suminski 2c33fad45f Fixed pad net names display (GAL)
Fixes: lp:1678272
* https://bugs.launchpad.net/kicad/+bug/1678272
2017-04-02 00:56:21 +02:00
Chris Pavlina af88781262 Rewrite pcbnew preferences tooltips for consistency, fix a couple typos
Fixes: lp:1591428
* https://bugs.launchpad.net/kicad/+bug/1591428
2017-03-31 19:40:43 -04:00
Maciej Suminski 0b57907a68 Fix crash on toggling 'Render' tab items visibility
Fixes: lp:1678169
* https://bugs.launchpad.net/kicad/+bug/1678169
2017-03-31 17:50:59 +02:00
Collin Anderson 9b876d9d98 Fix build of Python plugin for macOS 2017-03-31 08:49:48 -04:00
Wayne Stambaugh b4e2757119 Make FP_TBL_MODEL reusable.
Factor out the FP_LIB_TABLE specific content from FP_TBL_MODEL into a new
LIB_TABLE_GRID class that can be used for any library table grid mix in.

Create new FP_LIB_TABLE_GRID object for the footprint library edit dialog.

Add method GetEnvVariables() to return any environment variables found in
a LIB_TABLE object.
2017-03-30 18:36:37 -04:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
John Beard c94269e173 Pcbnew GAL: Switch CW/CCW hotkeys to match legacy mode 2017-03-30 16:05:56 +02:00
John Beard 0b593faa93 Pcbnew: correct CW/CCW rotation.
These were backwards since internal angles are CCW due to the inverted Y
axis.

The hotkeys have NOT changed. This means 'R' is now clockwise and
'Shift+R' is anti-clockwise. This is the same as EEschema, but not the
same as Legacy mode.
2017-03-30 16:05:56 +02:00
John Beard 8f3423b803 Add Select Layer And Add Via actions to GAL router tool
On these actions, invoke the layer select dialog and set the via layer
pairs accordingly.

Fixes: lp:1672820
* https://bugs.launchpad.net/kicad/+bug/1672820
2017-03-28 15:13:27 +02:00
John Beard 69115e4b9d Signal via actions with flags, not event equality checking
This allows actions to encode both via type and other behaviours
intrisically witohut having to individually test for each action.
2017-03-28 15:13:24 +02:00
Chris Pavlina c7c172d368 Fix FP_LOADER_THREAD resource leak
The mechanism of thread termination was changed in 61c2beea and not done
correctly - the thread was not notified that it should terminate.
2017-03-27 14:23:03 -04:00
Chris Pavlina 61c2beea22 Fix FP_LOADER_THREAD access to destroyed dialog
Fixes: lp:1672733
* https://bugs.launchpad.net/kicad/+bug/1672733
2017-03-26 19:44:18 -04:00
jean-pierre charras 0f0cb64a63 Minor fix in DRC test courtyards. 2017-03-26 08:13:23 +02:00
Chris Pavlina 4011ed4e31 Convert UTF8 to/from wxString correctly around LIB_ID
Fixes: lp:1675942
* https://bugs.launchpad.net/kicad/+bug/1675942
2017-03-24 21:38:00 -04:00
Chris Pavlina 68853c988e Fix SYNC_QUEUE build issue on Boost < 1.56
Prior to Boost 1.56, boost::optional had no move constructor, preventing
use of std::unique_ptr inside it
2017-03-24 10:09:08 -04:00
Chris Pavlina 849b3c2a4b Add footprint select dropdown to component chooser, serious refactoring
- DIALOG_CHOOSE_COMPONENT has footprint select widget
- FOOTPRINT_SELECT_WIDGET
- FOOTPRINT_CHOICE widget (customized wxComboCtrl)
- FOOTPRINT_FILTER class
- FOOTPRINT_INFO rework:
    - FOOTPRINT_ASYNC_LOADER to load without freezing UI
    - Rewrite loader threads as queue-driven thread pool
    - Make FOOTPRINT_INFO available via kiway
- FP_LIB_TABLE::PrefetchLib
- Access to global fp-lib-table via kiway
- SYNC_QUEUE threadsafe queue template
- Remove KICAD_FOOTPRINT_SELECTOR build option
2017-03-24 09:20:27 -04:00
Alejandro García Montoro f68ce306bd CPolyLine -> SHAPE_POLY_SET refactor.
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.

The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.

The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
2017-03-24 10:43:47 +01:00
Maciej Suminski f2763e90ea Disable autopanning & cursor capture when drawing is finished 2017-03-23 14:15:34 +01:00
jean-pierre charras 68b141dcb8 Make polygon built by BOARD::GetBoardPolygonOutlines strictly simple.
It fixes issues in 3d viewer (crashes and incorrect 3D board outline in some cases)

Fixes: lp:167484
https://bugs.launchpad.net/kicad/+bug/1674844
2017-03-23 08:56:52 +01:00
John Beard 9fe780f1b3 Rework zone creation in GAL
The zone creation in DRAWING_TOOL was a complex event loop whici
simultaneously managed the event handling, construction of the preview
polygon and the creation and commiting of the zone, all in the same
scope. This has been broken into several pieces:

* POLYGON_ITEM preview item, used to preview the polygon in progress
* POLYGON_GEOM_MANAGER is a class that collects points from user input
  and used them to describe a polygon's geometry, including calculation
  of 45-degree constrained leader lines
* ZONE_CREATE_HELPER is a class which deals with creating zones based on
  geometry from a geometry manager and parameters from the DRAWING_TOOL
* The (much simpler) event loop in DRAWING_TOOL drives the
  POLYGON_GEOM_MANAGER. With a minor refactor, this loop can be reused
  in future for other polygonal tools if wanted.

The polygon preview now has a translucent fill which makes it easier to
visualise the zone.

This also adds the Close Zone Outline and Delete Last Corner actions as
part of the new event loop.

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

Fixes: lp:1667885
* https://bugs.launchpad.net/kicad/+bug/1667885
2017-03-22 17:18:12 +01:00
John Beard 1fd503bf58 Move DIRECTION45 to common/geometry
This class is useful for generic geometric layout of 45-deg constrained
line chains, not only in the PNS router.
2017-03-22 15:23:09 +01:00
John Beard ea10a67d14 Refill zones after editing properties
After editing properties (in Legacy or GAL) using the dialog, zones are
not refilled.

Fixes: lp:1674595
* https://bugs.launchpad.net/kicad/+bug/1674595
2017-03-22 13:31:52 +01:00
jean-pierre charras 0f7e898caa Allow selection of number of segments to approximate a circle in convert_drawsegment_list_to_polygon. 2017-03-22 11:47:03 +01:00
jean-pierre charras 05220a86f1 BOARD::GetBoardPolygonOutlines(): do not generate a separate SHAPE_POLY_SET for holes.
They are already managed by SHAPE_POLY_SET board outline.
2017-03-22 11:47:03 +01:00
John Beard d99fbddc22 Enable angle snap for pcbnew GAL ruler tool
This uses the two-point geometry manager to split the logic of the ruler
geometry and the preview item display. This allows the ruler to use that
manager's angle snap feature.
2017-03-22 10:59:47 +01:00
John Beard b8edecc10f Move cursor shape flag into GAL settings
The motivation here is to concentrate display options in the GAL display
settings, ready for removal of legacy canvases. Instead of having the
property as a member of the DRAW_FRAME, with the GAL canvas retreiving
it from there, it is now in the GAL_DISPLAY_OPTIONS struct, and both GAL
and legacy get it from there.

The options for setting cursor shape are then moved out of the general
options dialog, and into the GAL display options widget, where they can
be used in all GAL-aware programs.

GAL cursor shape works on GAL, but not legacy, so the option is now
available on OSX (but only affects GAL, and is labelled as such).
2017-03-22 10:24:48 +01:00
John Beard b4a4748672 Move sketch mode area in pcbnew display options
This gives a bit more space to the GAL options in the left panel

Also tidy up some code style and unnecessary default arguments in the
GAL display planel widget.
2017-03-22 10:24:48 +01:00
jean-pierre charras 45b10f0f09 Pcbnew: fix a Regression in fallback to bounding box for board render in 3d-viewer
Fixes: lp: 1674844
https://bugs.launchpad.net/kicad/+bug/1674844
2017-03-22 08:40:48 +01:00
jean-pierre charras 12b65cf56b Fix typo 2017-03-21 16:45:35 +01:00
jean-pierre charras 5bd61d7eb6 Pcbnew fix: checking properties on error marker crashed pcbnew
Fixes: lp:1674671
https://bugs.launchpad.net/kicad/+bug/1674671
2017-03-21 16:44:56 +01:00
jean-pierre charras 48f19c031a Fix a few issues when importing a .ses specctra session file.
(potential crash due to missing update of ratsnet data, add missing traces in GAL mode)
2017-03-21 11:22:03 +01:00
jean-pierre charras 806e71b17e update 2017-03-20 20:33:19 +01:00
jean-pierre charras c2227abb36 Specctra import: accept layer names like numbers (i.e. +12). 2017-03-20 19:50:07 +01:00
jean-pierre charras 230980fc9d Compile specctra file with pcbnew files, not with pcbcommon files (they are now used only by pcbnew) 2017-03-20 19:49:10 +01:00
John Beard ce731f8b62 Add GAL microwave tools
This adds the microwave tools to GAL in Pcbnew as a new tool:
MICROWAVE_TOOL.

Some new preview items are introduced to support this:

* TWO_POINT_GEOM_MANAGER for managing construction of two-point
  geometries, such as that used to construct the inductor.
* CENTRELINE_RECT_ITEM a preview item to draw ractangle with a given
  aspect ratio along a line (specified using a TWO_POINT_GEOM_MANAGER)

PCB_TOOL gets a generic event loops which should be useful for more
than just microwave tools:

* doInteractiveItemPlacement() - handles event loops that wait for a
  click, create an item on click and then allow moving it
  around/flipping, etc.

Fixes: lp:1531323
* https://bugs.launchpad.net/kicad/+bug/1531323
2017-03-20 16:10:51 +01:00
John Beard 3994e9a268 Allow calling of MW inductor function externally
This makes it possible to access the creation functions
for the microwave inductor externally, so that it can be
used from GAL.

Unlike the Gap/Stub tools, the inductor tool is more interactive, and
doesn't just return a MODULE*.

Introduces a new directory in pcbnew called 'microwave' to better
isolate generic (i.e. canvas-agnostic) functions, and a namespace MWAVE
to avoid polluting the global namespace.
2017-03-20 16:10:51 +01:00
jean-pierre charras 796e5fdc45 Fix an issue with pads not on copper layers (only on tech layers) when exporting .dsn file.
The pad is invalid in .dsn file and crashes Freeroute.
2017-03-20 15:19:20 +01:00
jean-pierre charras e4b39cfb09 remove duplicate code 2017-03-20 15:19:19 +01:00
jean-pierre charras ecdfa404cb More work courtyard overlap detection: better code. 2017-03-20 13:06:00 +01:00
Tomasz Włostowski 77c1b1b4ea Refresh vias geometry when switching via display mode
Fixes: lp:1674096
* https://bugs.launchpad.net/kicad/+bug/1674096
2017-03-20 12:06:56 +01:00
jean-pierre charras 2637835a1e First version of courtyard overlap detection 2017-03-19 20:27:45 +01:00
jean-pierre charras b365f17e9f First draft of courtyard overlap detection. 2017-03-19 20:27:44 +01:00
jean-pierre charras 98e3bfb95a rebuild dialog_edit_module_for_Modedit.cpp with a more recent wxFormbuilder version to avoid deprecated compil warnings 2017-03-18 10:37:19 +01:00
Chris Pavlina c9936e2a47 Fix warning about shadowing std::ignore 2017-03-17 22:16:32 -04:00
John Beard 5f303f7b25 Enhance Pcbnew arc construction
This adds a richer overlay to the arc-by-three-points tool in Pcbnew,
including more guide-lines and a live display of radius and angle.

Also included is ability to go back to the previous step (if setting end
angle, you can go back to setting start point, etc) using Backspace, and
Ctrl snaps the start/end angles to 45 degree multiples.

This adds new classes

* MULTISTEP_GEOM_MANAGER: represents a generic "geometry manager" that
  builds up some geometrical construction based on a sequence of points.
  Used by:
* ARC_GEOM_MANAGER: handles the logical flow of constructing an
  arc by centre-point, set radius, set angle. This moves the logic out
  of the Pcbnew DRAWING_TOOL event loop in drawArc().
* ARC_ASSISTANT: graphical overlay to communicate current arc shape to
  the user during the drawing process
2017-03-17 20:56:54 +01:00
Miles McCoo db174862c8 Minor Pcbnew Python scripting improvements.
Add typedef for wxCoord to wx.i to enable usage of methods like
EDA_RECT.Inflate.

Added id.h to pcbnew.i to expose window toolbar identifier names.

Added Refresh() and WindowZoom() to pcbnew_scripting_helper.
2017-03-17 10:41:00 -04:00
John Beard 7e1eea4122 Use abbreviated unit (not symbol) in design rule dialog
Fixes: lp:1667644
* https://bugs.launchpad.net/kicad/+bug/1667644
2017-03-16 08:30:00 -04:00
John Beard ef3553c086 Use TransferData* methods for DIALOG_DISPLAY_OPTIONS
Replaces the existing manual evdent handling, in line with UI
Guidelines.

Also remove the wxStaticLine, which is not a standard dialog element.
2017-03-16 08:01:42 -04:00
John Beard bdc9ae75f5 Add a display settings dialog to Modedit
For a start, this contains the GAL display settings (AA settings and
grid styling).

In future, other modedit-specific settings could go here too.

Fixes: lp:1672150
* https://bugs.launchpad.net/kicad/+bug/1672150
2017-03-16 08:01:33 -04:00
John Beard f2aa4d2911 Make GAL options panel a reusable panel
The primary motivation here is to allow other GAL canvas users (eg
Modedit, and soon Gerbview) to be able to easily modify GAL canvas
options.

For now, this doesn't change the display properties dialog in
appearance, but if more GAL options are added, it might need a bit of
tweak and maybe tabs or similar, like Eeschema preferences.
2017-03-16 08:01:26 -04:00
jean-pierre charras 69b350c9b0 Fix can't always group delete in fp-lib-table dialog
Fixes: lp:1672760
https://bugs.launchpad.net/kicad/+bug/1672760
2017-03-14 20:31:44 +01:00
Tomasz Włostowski 2f730cad81 EDIT_TOOL: restore cursor position on exit
Fixes: lp:1671564
* https://bugs.launchpad.net/kicad/+bug/1671564
2017-03-14 10:54:58 +01:00
Julius Schmidt 5b3f6d850d Fix format string assertion in select net dialog. 2017-03-13 16:45:41 -04:00
Maciej Suminski fe4f02f5b9 Coverity fixes
CIDs:
- 153097
- 157120
- 157119
- 155148
- 155146
- 153103
- 153099
- 153095
- 153087
- 153086
2017-03-11 22:20:08 +01:00
Jon Evans 082b8dd2a9 Refactor BRIGHT_BOX to common so it can be used by other programs 2017-03-11 21:38:01 +01:00
Tomasz Włostowski 0a55d8e053 Fixed differential pair gap clearance error when gap equaled minimum clearance.
Fixes: lp:1533551
* https://bugs.launchpad.net/kicad/+bug/1533551
2017-03-11 20:57:59 +01:00
Maciej Suminski 3fafd48764 Fix drawing circles in GAL
Fixes: lp:1672039
* https://bugs.launchpad.net/kicad/+bug/1672039
2017-03-11 20:30:24 +01:00
jean-pierre charras 2c56085f41 Drc calculations fix a minor issue that detected a bad clearance when distance between a circle and a segment was the clearance value.
Also, give a margin of 1 nanometer during DRC calculations to avoid false error DRC detection due to rounding issues.
2017-03-11 18:09:18 +01:00
Chris Pavlina 5af825e21c Use ki_mutex.h in FOOTPRINT_PREVIEW_PANEL 2017-03-11 08:22:08 -05:00
Chris Pavlina 23a23d3c63 Fix typo in fp-lib-table help text
Fixes: lp:1671910
* https://bugs.launchpad.net/kicad/+bug/1671910
2017-03-10 23:44:12 -05:00
Chris Pavlina bbaa29fbc4 Refactor FOOTPRINT_PREVIEW_PANEL
- Pull out compound widget bits into FOOTPRINT_PREVIEW_WIDGET
- Move all pcbnew-specific bits *inside* pcbnew; implementation should
  be private for users
- Make a few class members and inner types private
2017-03-10 23:26:45 -05:00
John Beard 8c3b8ee693 Add a ruler tool to pcbnew GAL
This allows to measure between features on a PCB. It uses a preview
EDA_ITEM in common, but due to the use of the IDs, it's currently
Pcbnew/Modedit only.

This also adds several "utils" for graphical functons useful when
drawing preview items on GAL canvases.

Fixes: lp:1467313
* https://bugs.launchpad.net/kicad/+bug/1467313
2017-03-10 16:21:44 +01:00
John Beard 9c08873210 Make SELECTION_AREA a generic overlay item
This simplifies the (already simple) SELECTION_AREA class. It is also
moved into KIGFX::PREVIEW and put in the common library, where it can be
reused by other GAL-aware tools (not just in Pcbnew) in future.
2017-03-10 16:21:44 +01:00
Maciej Suminski d337d08060 Sketch graphics mode for GAL 2017-03-10 14:08:59 +01:00
Maciej Suminski f21cfa167f Use DECIDEG2RAD function in PCB_PAINTER 2017-03-10 14:08:59 +01:00
Maciej Suminski 737dc20409 Make OpenGL GAL great again
Reenabled VIEW_ITEMs cache. Previously, the first init was called with
GAL_TYPE_NONE, causing all layers to be set to non-cached. During the
proper init, the layers were already set to non-cached and were not
changed.
2017-03-10 14:08:59 +01:00
John Beard c523ba45e1 Fix shadowed variable in python_scripting.cpp 2017-03-10 09:08:45 +01:00
jean-pierre charras a592832886 fix I18n issue (empty string) 2017-03-09 11:47:40 +01:00
Chris Pavlina a73abbfc31 Fix possible threadsafety issue in FOOTPRINT_PREVIEW_PANEL 2017-03-08 17:02:10 -05:00
Maciej Suminski 62235348d1 Use GAL axes instead of a ORIGIN_VIEWITEM in module editor 2017-03-08 10:35:51 +01:00
Chris Pavlina 3854637ec5 Footprint preview: do not Freeze/Thaw
This causes issues under Ubuntu Unity (possibly due to calling Show()
while frozen).

Fixes: lp:1670705
* https://bugs.launchpad.net/kicad/+bug/1670705
2017-03-07 14:32:02 -05:00
Julius Schmidt 29eb696ef7 Fix crash when switching from dragging to routine (PNS router)
The attached patch fixes a bug where triggering InlineDrag while routing
is in progress will crash pcbnew.  The problem is that the InlineDrag
event does not terminate performRouting.  Once InlineDrag is finished
it will call StopRouting which deletes the m_placer.  The Wait() in
performRouting will then return and it will crash as soon as it tries
to access the m_placer.
2017-03-07 13:56:44 +01:00
José Ignacio Romero 45d1082517 Make all layers slightly semitransparent as before 2017-03-07 11:57:52 +01:00
Simon Richter 12c1339296 Remove false "override" comments. 2017-03-06 16:34:56 -05:00
Maciej Suminski 3174573361 Removed code resetting VIEW_CONTROLS settings
As the VIEW_CONTROLS settings are managed for each tool,
there is no need to restore the settings to initial state
when a tool is finished.
2017-03-06 15:04:27 +01:00
Chris Pavlina 541b91fd15 Fix FOOTPRINT_PREVIEW_PANEL loader thread synchronization 2017-03-05 22:22:25 -05:00
jean-pierre charras 7a120ad698 selection_tool.* add comments and use better names for 2 similar methods. 2017-03-04 17:35:34 +01:00
jean-pierre charras 5b3d7962bb Fix questionable code and memory leak. 2017-03-04 17:35:34 +01:00
jean-pierre charras 101a600be6 Fix coding style issue and a minor other issue. 2017-03-04 17:35:34 +01:00
jean-pierre charras af161771b8 Fix compil issue on Windows 2017-03-04 17:35:33 +01:00
Chris Pavlina 4618e6c7f8 Component chooser: event and focus cleanup 2017-03-04 11:14:04 -05:00
Cirilo Bernardo 68bcdec87e Workaround for non-ASCII filenames in Windows 2017-03-03 14:30:47 -05:00
Tomasz Włostowski 966052272f Coding style fixes 2017-03-03 20:27:05 +01:00
Tomasz Włostowski 18a9f037d2 DRC markers can now be selected and deleted in GAL like other items.
Fixes: lp:1621190
* https://bugs.launchpad.net/kicad/+bug/1621190
2017-03-03 20:26:34 +01:00
Tomasz Włostowski cc3d79f932 Reworked selection passing mechanism in SELECTION_TOOL.
- The tools can now specify if the items in the selection must be editable/
deletable. This is groundwork to be able to select/delete DRC markers, which can't
otherwise be edited.
- Fixed disappearing of selected objects
2017-03-03 20:26:34 +01:00
Tomasz Włostowski 9e73c3117e Added possibility to disable undo entries creation in COMMIT/BOARD_COMMIT 2017-03-03 20:26:34 +01:00
Simon Richter 1502e27695 Remove debug code matching on specific component names 2017-03-03 08:30:48 -05:00
jean-pierre charras 4eeed8d04f Icons options menu: code rework 2017-03-03 14:18:25 +01:00
Maciej Suminski 389c7b2bbc Added AUTOROUTER_CONTEXT to keep objects used by autorouter
The main reason is to keep cached board bounding box and limit repeating
parameters in functions used by the autorouter.
2017-03-03 13:28:19 +01:00
Maciej Suminski 2483dab72f Do not cache board bounding box 2017-03-03 13:28:19 +01:00
Maciej Suminski a073a90c45 Remove BOARD::SetBoundingBox()
Bounding box should be computed basing on the items belonging to the
board.
2017-03-03 13:28:19 +01:00
Jon Evans 88f7c55d95 Move ZoomFitScreen and ZoomPreset from PCBNEW_CONTROL to COMMON_TOOLS
BOARD::GetBoundingBox() now directly calls BOARD::ComputeBoundingBox()
and there is a new method BOARD::GetBoardEdgesBoundingBox() used for
call sites that needed to use ComputeBoundingBox( true ) in the past.

This allows COMMON_TOOLS to implement ZoomFitScreen without knowledge
of the BOARD class.
2017-03-03 13:28:19 +01:00
Kristoffer Ödmark dda51ab550 CrossProbes Schematics from eeschema to pcbnew
Adds a similar crossprobe as modules has in pcbnew. When clicking a
sheet in eeschema, the items that are exclusive in that scheet will be
selected in pcbnew if using the GAL canvas.
2017-03-03 07:25:32 -05:00
Kristoffer Ödmark 69a649c093 Refactored out the function that selects items based on the sheetname 2017-03-03 07:21:41 -05:00
Maciej Suminski 906ee77dbf Fixed VIEW_ITEM memory leaks 2017-03-02 23:57:13 +01:00
Chris Pavlina 586c8f0feb Fix signed/unsigned compare warning 2017-03-02 14:46:19 -05:00
jean-pierre charras e7e972804a Make show/hide icons in menus a run time option, instead of compil option. 2017-03-02 15:45:54 +01:00
Maciej Suminski 35c7974a96 Enable grid snapping when dragging items (GAL)
Fixes: lp:1668077
* https://bugs.launchpad.net/kicad/+bug/1668077
2017-03-02 15:21:49 +01:00
Tomasz Włostowski 4a911e0790 Highlight net tool in GAL now cross-probes to EEschema if clicked on a pad
Fixes: lp:1663767
* https://bugs.launchpad.net/kicad/+bug/1663767
2017-03-02 14:43:37 +01:00
Maciej Suminski 275ba503d1 Fix drawing arcs on Edge.Cuts layer
Fixes: lp:1666822
* https://bugs.launchpad.net/kicad/+bug/1666822
2017-03-02 13:52:36 +01:00
Maciej Suminski a5ac165c4b Make 'Enumerate Pad' tool more user friendly
Effects of enumeration are shown instantly, instead of after accepting
the changes.
2017-03-02 12:34:19 +01:00
jean-pierre charras 1cffcafe2d GAL mode: Add small cross option to grid style (now: options are Dots, Grid, Small cross) 2017-03-01 10:29:19 +01:00
Maciej Suminski f4be80a3af Code formatting 2017-03-01 09:50:36 +01:00
John Beard 1d039cb4c1 Break row indicators out to own class
The introduces INDICATOR_ICON, which is a very simple class holding a
bitmap that can toggle on or off.

The ICON_PROVIDER class then provides icons to INDICATOR_ICONS, which
means the class can be used for more than just row indicators.

A default row icon provider is also provided for use in the standard row
selector.
2017-03-01 09:44:41 +01:00
John Beard 72354c5a81 Use Bind rather than Connect in LAYER_WIDGET
Bind is safer than Connect. Bind is more flexible and has a more concise
signature.
2017-03-01 09:44:41 +01:00
John Beard b8d0b0d7be Move layer/render swatches to own class
This introduces COLOR_SWATCH, which is a reusable
widget that shows a color swatch and can invoke the colour picker
when duble/middle clicked.

It uses it's own wxCommandEvent to signal the change.

This makes the layer widget simpler internally, and also allows other
code to show identical swatches if needed.
2017-03-01 09:44:41 +01:00
John Beard e609bc3f0d Use wxStaticBitmaps for layer/render swatches
On Linux with recent GTK+ toolkits, these swatches had very wide
borders, resulting in colour swatches of only a few pixels. On OSX, all
borders were disabled, leaving only the swatch.

This commit changes the wxBitmapButton to wxStaticBitmap, which fixes
the issue on Linux GTK+ and also removes the platform-specific element,
as it will now be the same on all systems.

These widgets aren't used as buttons anyway, a single click is handled
across the whole row, not just the swatch. So using a button was not the
most intuitive affordance.

Fixes: lp:1605411
* https://bugs.launchpad.net/kicad/+bug/1605411
2017-03-01 09:44:41 +01:00
Jon Evans a4fdbe6f2c Register common tools in footprint viewer to fix zoom controls 2017-03-01 08:56:26 +01:00
Jon Evans fd4e2b042c Refactor SELECTION, SELECTION_CONDITIONS, and context menus to common
SELECTION now holds EDA_ITEMs not BOARD_ITEMs so various places had to
change to casting the selected items to BOARD_ITEMs.

Fixed compilation warnings on clang (Tom)
2017-02-28 14:47:20 +01:00
Jon Evans 0afb249447 Add drawing priority support to VIEW
Call UseDrawPriority( true ) after creating GAL to enable.

VIEW::Add() gets a new optional argument to specify the draw order
when adding an item.  If the new argument is left default, the draw
order will increment with each call of VIEW::Add().

Fix std::bind calls after change to VIEW::Add
2017-02-28 14:47:20 +01:00
John Beard a0df0f7f06 When filling/unfilling zones, create undo points in GAL
This is a feature which is apparently not available in legacy, but the
undo points created in GAL do work in legacy mode.
2017-02-27 18:00:51 +01:00
John Beard 796f3219d0 Draw zone hatching in GAL
This just uses the same hatch lines that are built into the zone as
legacy.

They are always drawn, even when there is a fill, as if the fill
doesn't reach the corners, the hatches can be seen.

Fixes: lp:1487043
* https://bugs.launchpad.net/kicad/+bug/1487043
2017-02-27 18:00:46 +01:00
Oliver d6097cf1aa Better footprint association and filtering:
1. If a footprint filter contains a : (colon) character, then the filter is matched against the pattern <LibName>:<FootprintName>
2. If there is *no* : (colon) character present, then it is matched against <FootprintName>
3. The same behaviour applies for the manual filter string in CvPCB
2017-02-26 18:15:23 +01:00
jean-pierre charras 6b431b4791 Fix transaltion issue.
Rebuild dialog_display_options_base with a recent wxFormbuilder version.
2017-02-26 13:03:38 +01:00
jean-pierre charras 1001442a48 Pcbnew: Fix an assert in debug mode, and fix a minor issue in menubar 2017-02-26 11:47:15 +01:00
jean-pierre charras 94bef6abd2 Pcbnew: files written when layers have numeric name (like +24)cannot be read
Fixes: lp:1667867
https://bugs.launchpad.net/kicad/+bug/1667867
2017-02-25 10:10:43 +01:00
jean-pierre charras 6ae7c15d89 Rework on pcbnew menubar: make code more easy to read and modify. 2017-02-24 20:51:49 +01:00
Maciej Suminski d3edc4f843 Disable router menu when the tool is stopped 2017-02-24 13:32:47 +01:00
John Beard c001c6114f Add cancel interactive tool action to GAL
This is used to provide menu entries that allows cancellation of
interactive drawing and routing tools without needing the keyboard.

It is provided in the drawing tools and the router tool.

The cancel event doesn't have any new functionality (e.g. track rip-up
for the PNS router - lp:1448460), this just adds it to the menu, where
it behaves the same as an Escape keypress.
2017-02-24 10:37:07 +01:00
Simon Richter 3bf0b9534c Fix incorrect parameter if the compiler doesn't support -Wshadow option 2017-02-23 17:55:55 +01:00
John Beard 88fb7483eb Register COMMON_TOOLS in modedit
Without this, no actions from that tool will work, which includes things
like settings the grid size.

Fixes: lp:1667264
* https://bugs.launchpad.net/kicad/+bug/1667264
2017-02-23 15:20:22 +01:00
jean-pierre charras 11dcb76fc9 Add -Wshadow compil option, if exists to warn about shadowed variables.
Swig auto generated .cxx file has a lot of shadowed variables, so this option cannot be used to compil all files.
2017-02-23 13:17:23 +01:00
Marco Sterbik d284fb87e8 Change reporter message of footprint missmatch to warning on netlist-import
The message of a changed footprint during netlist-import in pcbnew was declared
as RPT_UNDFINED and therefor the filter didn't work correctly ('Warning' was
in the message-string).
This makes the message a proper warning and enables filtering as expected.
2017-02-23 11:59:00 +01:00
Maciej Suminski 887f2b2a70 Adjusted "Select" context menu conditions
Shows "Select" submenu when there is at least one item selected.
It is necessary to use "select same sheet" and selection filter
effectively.
2017-02-23 10:50:38 +01:00
John Beard c6046d6da2 Add selection filter dialog to GAL
Fixes: lp:1535805
* https://bugs.launchpad.net/kicad/+bug/1535805
2017-02-23 10:50:38 +01:00
John Beard 6ba9a512b6 Factor DIALOG_BLOCK_OPTIONS into separate compilation unit
This means the dialog can be accessed from both GAL and legacy modes.

This also removes the use of static bools for passing the selection
states and instead used a struct of values passed in by the calling
code.
2017-02-23 10:50:38 +01:00
Maciej Suminski d7bf44eee0 Removed a few more headers from base_struct.h 2017-02-22 17:54:01 +01:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Jon Evans 4c83b0a94d Move TOOL_ACTIONs to their corresponding tools; create COMMON_TOOLS
Some grid/zoom tools are left in PCBNEW_CONTROL because they currently
depend on Pcbnew-specific class members.  Once refactoring is done to
make it possible to use all zoom and grid controls outside of pcbnew,
these last tools can be moved to common to match their ACTIONs.
2017-02-22 10:32:48 +01:00
Jon Evans 167f45ca2b Refactor COMMON_ACTIONS into a base and derived class
New virtual class ACTIONS is added as a member to EDA_DRAW_FRAME so
that the TOOL_DISPATCHER can have access to the appropriate derived
version of TranslateLegacyId()
2017-02-22 10:32:48 +01:00
Chris Pavlina 8bed8af03f Add missing break in switch 2017-02-21 15:22:30 -05:00
John Beard a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00
Dick Hollenbeck 45cf772833 Make the python pcbnew native module from the _pcbnew.kiface, phase 1 of a 2 part plan. 2017-02-21 07:56:17 -05:00
Maciej Suminski 6fdccc1829 PAD_TOOL: enable 'Apply' after copying a pad 2017-02-20 11:09:00 +01:00
John Beard 2fa17b4460 Put pad enumerate tool in PAD_TOOL submenu
Prior to this, it was in the top level of the selection
menu, and was always shown, even if the module editor
didn't have a loaded footprint.
2017-02-20 11:08:34 +01:00
John Beard ca91c27852 Adjust pad sub-menu enablements
The apply settings and push settings options now take account of the
validity of the global pad settings when deciding whether to show or
not.

Global pad push now requires a source pad and doesn't push from the
global pad setting when there is no selection.

The whole submenu is hidden when there are no enabled items.

Fixes: lp:1664016
* https://bugs.launchpad.net/kicad/+bug/1664016
2017-02-20 11:08:34 +01:00
John Beard ca75be4b4e Simplify display option selection mappings using CFG_MAP
Rather than defining static functions to do the mapping, this can be mor
concisely done with the UTIL::CFG_MAP utility functions.
2017-02-20 10:52:34 +01:00
John Beard 0bf3a19967 Add user control for grid minimum spacing in GAL
This allows the user to set a thicker grid line without causing the
grid lines to become over dense, or just make the grid denser according
to preference.

The term "density" is modified to "minimum grid spacing", which is
the pixel spacing between adjacent grid lines.

The spacing settings now comes in along, with other GAL display settings,
as part of GAL_DISPLAY_OPTIONS observer functionality. To this end, the
setter in GAL interface is removed, as an external user should be
setting this parameter via the GAL_DISPLAY_OPTIONS interface.
2017-02-20 10:52:34 +01:00
John Beard 970e4f8eb4 Add grid line thickness control to Display Options Dialog
This adds a user-settable control for the grid line thickness on GAL
canvases to the display options dialog.

The thickness settings now comes in, along with other GAL display
settings, as part of GAL_DISPLAY_OPTIONS observer functionality. To this
end, the setter in GAL interface is removed, as an external user should
be setting this parameter via the GAL_DISPLAY_OPTIONS interface.

Fixes: lp:1662482
* https://bugs.launchpad.net/kicad/+bug/1662482
2017-02-20 10:52:34 +01:00
John Beard 061d659bb1 Add a class to govern an "incrementing" text control
This class, INCREMENTAL_TEXT_CTRL, is used to provide a frameworks for
classes that want to control a text control that can be incremented
according to some scheme.

Also provided is a wxWidgets implementation with spin buttons for
control, as well as mousewheel support.
2017-02-20 10:52:34 +01:00
John Beard 971f2db034 Break Display Options control value/enum mapping to functions
The mappings from enums to control settings can be done in static
functions, which makes the set/retreive functions more concise, and also
puts the mapping functions in a clearly delineated place.
2017-02-20 10:52:34 +01:00
John Beard ff3bfaf82b Make KIGFX::GRID_STYLE an enum class
This provides stronger typing to these values.
2017-02-20 10:52:34 +01:00
John Beard 7ad30b7167 Move Grid style to Graphics Options dialog
This puts the graphical/display options with the other similar options
in that dialog, rather than with the dimension options found in the Set
Grid dialog, which is in the Dimensions menu.

Also place the option itself in the GAL Display Options structure, so it
can be updated using the observer mechanism there.

The setter for the style in the GAL interface is removed, as the public
interface for setting this option is now to modify the
GAL_DISPLAY_OPTIONS structure and notify the GAL when done.
2017-02-20 10:52:34 +01:00
John Beard cdfcc9a2ab Put draw_frame.h GAL_DISPLAY_OPTIONS behind firewall
The GAL_DISPLAY_OPTIONS member of EDA_DRAW_FRAME is a private member and
is used in only a couple of places in the class. The real use of this
member is by a by-ref interface, GetGalDisplayOptions.

Because te GAL options are used by a very select few users of
EDA_DRAW_FRAME, it makes little sense to force all the (many) files
including draw_frame.h to also include gal_display_options.h, when the
vast majority have no need for it.

This massively speeds up compilation of the project when
gal_display_options.h is changed.

More isolation could be acheived by separating the GAL config types (eg
OpenGL antialias modes and grid style) from the options header, as,
although the GAL class uses them, not many includers of the GAL header
need the options struct as well.
2017-02-20 10:52:33 +01:00
Chris Pavlina 2e07d83461 Reduce footprint preview flickering in component selector 2017-02-19 14:54:36 -05:00
Chris Pavlina 2632b1d1a0 Revamp component chooser and add footprint preview
This commit brings several changes:

- Add a footprint preview pane to the eeschema component selector
- Upgrade component list to wxTreeListCtrl
- Factor out wxTreeListCtrl subclass TWO_COLUMN_TREE_LIST which
  patches a column size bug
- Linkify datasheet URL in info pane
2017-02-18 21:39:55 -05:00
Jon Evans 7cd72d6ffb Move layer colors from PCB_RENDER_SETTINGS to RENDER_SETTINGS 2017-02-16 17:30:31 +01:00
Jon Evans 7058e4eb21 Setup painter in PCB_DRAW_PANEL_GAL instead of EDA_DRAW_PANEL_GAL 2017-02-16 17:30:31 +01:00
jean-pierre charras 19fef1e9ba Fixes: lp:1664349 (DRC complaining about not connected pads even if they are not on a copper layer)
(happens when creating pads with complex shapes)
https://bugs.launchpad.net/kicad/+bug/1664349
2017-02-14 14:40:34 +01:00
Julius Schmidt 877a65dcc7 Fix ratsnest calculation for pads connected with zones (GAL)
This patch fixes a problem with GAL where zones are ignored in ratsnest
calculation.
The problem is that calling RN_DATA::Update on a zone with no polygons
(an unfilled zone) will remove the zone successfully, but then
RN_DATA::Add is a no-op.
From this point on, because ::Update refuses to work on items that have
not been ::Add'ed, the zone is removed entirely from ratsnest
calculation and will only be reconsidered once it is explicitly ::Add'ed
again.
The fix is to explicitly create an empty RN_ZONE_DATA object for every
zone that is ::Add'ed.

A second problem is that the point editor forgot to call
RN_DATA::Recalculate after calling Fill_Zone.

Fixes: lp:1537120
* https://bugs.launchpad.net/kicad/+bug/1537120
2017-02-14 00:39:41 +01:00
hauptmech 461c72c034 Prevent segfault when aOutline has no vertices.
When attempting to read a pcad file exported from Altium, kicad was
segfaulting because it was trying to access an empty array. This patch
fixes that.

The reason the array was empty was the the board outline in the pcad
file was composed of only arcs and the plugin only processes lines in
the board outline. Adding this functionality is for another patch I
suppose.

Signed-off-by: Clemens Koller <cko@embeon.de>
2017-02-13 17:33:09 -05:00
jean-pierre charras 3f1bcf5be8 Pcbnew: Fix "push pad settings" segfault when no pad selected.
Fixes: lp: 1663915
https://bugs.launchpad.net/kicad/+bug/1663915
2017-02-12 08:09:21 +01:00
Kristoffer Ödmark 37c086896e Enables selection of components and tracks on same sheet.
Modifies the selection menu to be adaptive and disable selection options
that are not possible.

Adds a new selection option that is only available when selecting
modules, this tool will select all footprints on the same sheet level or
belonging to subsheets. It will also search for nets that are only
connecting between modules on the same sheet or lower and select every
segment and via belonging to it.
2017-02-11 07:33:49 -05:00
Maciej Suminski 092c61e021 More robust condition to avoid division by 0 in D_PAD::ViewGetLOD() 2017-02-11 09:18:56 +01:00
Jean-Samuel Reynaud 3ec6f1d33b Fixed crash when pads have negative clearance
Fixes: lp:1663173
* https://bugs.launchpad.net/kicad/+bug/1663173
2017-02-11 09:16:59 +01:00
Maciej Suminski 95794df088 Code formatting 2017-02-10 23:23:56 +01:00
John Beard 728349ea12 Add similar zone tool in GAL
This action launches the normal interactive zone tool, but re-uses the
settings from an existing zone, based on a flag passed to the main zone
function.
2017-02-10 23:23:55 +01:00
John Beard abe83b54ae Add zone cutout tool to GAL
When activated, the zone interactive editor is launched with a flag. The
drawn zone is then used to modify the existing zone at the end of the
action.
2017-02-10 23:23:55 +01:00
John Beard d37586aeaf Refactor GAL dialog prompt for new zone settings
Break a chunk of the new zone tool out into a separate function to keep
the code clear. When zone cutouts and similar zone tools are added,
they'll get the settings from existing zones.

This commit now used std::unique_ptr for the temporary zone item, which
simplifies handling of the ownership of that item.
2017-02-10 23:23:55 +01:00
John Beard 1f9c483535 Allow delete whole track in GAL
This commit wires up the as-yet-unused "remove alternate" tool action
and uses it to select copper connections (normally 'U') before deleting
segments.

THis also reverses the sense of Delete and Backspace (Delete used to be
'remove' and Backpace was 'remove alt', now it is reversed). This means
that backspace is the key that removes a segment and Delete removes the
track. This is the same as legacy behaviour. Other delete actions are,
for now, the same between Delete and Backspace.

Fixes: lp:1517213
* https://bugs.launchpad.net/kicad/+bug/1517213
2017-02-10 22:42:55 +01:00
John Beard 0cd121049f Allow selectConnection/Copper/Net on multiple items
The previous behaviour was to act on only the first item in the
selection. The new behaviour is to act on every eligible item (in this
case, tracks and vias).
2017-02-10 22:42:55 +01:00
Aurabindo J 112c10fbd9 Pcbnew: Update Ratsnest immediately after rotation/flip/mirror
Provide a visual feedback to the user how each rotation
will affect the routing by immediately reflecting the
change in ratsnest orientation.

Signed-off-by: Aurabindo J <mail@aurabindo.in>

Fixes: lp:1663488
* https://bugs.launchpad.net/kicad/+bug/1663488
2017-02-10 22:25:47 +01:00
Julius Schmidt a54830897b Fix intermittent canvas revert to default
The attached patch fixes a minor bug where opening the 'View' menu
will sometimes revert the canvas to the default canvas.  The problem is
that wxMenuItem::Check will cause a menu event when the status is changed even
if the checkmark is being *unset*.  The workaround is to only call Check with
a true argument.  This works because the menu items are radio buttons.
2017-02-10 14:52:26 -05:00
jean-pierre charras dd5b024903 Pad export/import settings functions: remove duplicate code. 2017-02-10 20:44:35 +01:00
jean-pierre charras 9d43817db8 Make a debug message not translatable. 2017-02-10 20:44:35 +01:00
Maciej Suminski 5f90c0e8b8 Capitalized menu labels to follow the UI policy 2017-02-10 00:08:48 +01:00
John Beard bed0ad142d Add zone duplicate onto layer to GAL
This adds it into the PCB_EDITOR_CONTROL tool, alongside the zone merge
tool.
2017-02-09 12:50:48 +01:00
John Beard 7045ed92fb Add CCW rotation to GAL canvas
This makes "rotate" into two separate TOOL_EVENTs, which each have a
"multiplier" parameter.

Also added is a namespace for 'free functions' that use TOOL_EVENT
public interfaces (perhaps with other inputs too) to centralise some
decision-making and calculations.

Fixes: lp:1660731
* https://bugs.launchpad.net/kicad/+bug/1660731
2017-02-09 12:50:47 +01:00
Maciej Suminski a3e16988be Remove shadow of drawn arcs after undoing them (GAL) 2017-02-09 12:19:16 +01:00
Maciej Suminski 7806cb7bca Drag tracks/vias menu entry (GAL) 2017-02-09 12:03:28 +01:00
Maciej Suminski a16586756f Moved EDIT_TOOL::hoverSelection() code to SELECTION_TOOL::CursorSelection() 2017-02-09 12:03:28 +01:00
Maciej Suminski 14b9e5991b Draw ratsnest lines using the color selected in the layer widget (GAL)
Fixes: lp:1657039
* https://bugs.launchpad.net/kicad/+bug/1657039
2017-02-09 12:03:28 +01:00
Maciej Suminski 2a9c6a6283 Minor DRAWING_TOOL refactor
Automatically switch to a drawing layer, if a copper layer was
preselected. No annoying message boxes.
  Do not deactivate the tool on layer switch.
  Replaced setting updatePreview with direct calls to VIEW::update
  Line width is kept in m_lineWidth for all shapes.
2017-02-09 12:03:28 +01:00
Maciej Suminski 6c5e5c27e2 Fixed bounding box computation for EDIT_POINTS class 2017-02-09 12:03:28 +01:00
jean-pierre charras 0dc11936ad Fixes: lp:1662702 (Pad Properties Dialog not responding to OK button when run from ModEdit toolbar)
https://bugs.launchpad.net/kicad/+bug/1662702
2017-02-08 09:27:52 +01:00
John Beard 2710221f5f Do not include arc centre in bounding box
Arc centres don't land in the bounding box when the arc angle is small.
Currently, there are added to the BB, which leads to surprising
selection beheviour of arc segments (the BB can be much larger than
expected).

This commit omits the arc centre from the calculation.

Fixes: lp:1492734
* https://bugs.launchpad.net/kicad/+bug/1492734
2017-02-07 23:33:18 +01:00
Nick Østergaard 1cb171acf0 Rename bitmaps to match the new pad tool naming 2017-02-07 23:08:09 +01:00
Nick Østergaard 45a8c2e27f Rename pad copy actions in the pad tool
Import becomes apply and export becomes copy.

The term "push" to apply settings globally has not been renamed.

Swap the order of the copy and apply in the context menu.
2017-02-07 23:08:09 +01:00
Chris Pavlina 8f5c3c9e4e pcbnew: menu bar UI compliance tweaks 2017-02-07 16:38:41 -05:00
Chris Pavlina 59a4dffdcb modedit: menu bar UI compliance tweaks 2017-02-07 16:38:34 -05:00
John Beard cdc392867a When 'Find-moving' modules in GAL, pick up at origin
Perviously, the generic snapping code would choose the nearest of the
module origin and origin of each module pad when selecting a module
using the "Find module" tool (T hotkey).

This is unlikely to be expected unless the cursor is already near the
correct pad or the module centre.

New behaviour is to pick up by module origin first, then
select the module. This means that the cursor is already nearest the
main module origin anchor, so that is what will be used.

Fixes: lp:1571214
* https://bugs.launchpad.net/kicad/+bug/1571214
2017-02-07 11:19:38 -05:00
Wayne Stambaugh f96628f5c2 Fix minor layout issues in footprint editor footprint properties dialog. 2017-02-07 08:43:25 -05:00
John Beard 4ffabcc836 Show lines of zero thickness in GAL
If a line has zero thickness, use the outline thickness to draw it.

This avoids having invisible items on the PCB that could still end up in
outputs, or "losing" an item by setting thickness to 0.

This only affects GAL drawing routines, the PCB data structures are not
affected, so any outputs will be the same.

Fixes: lp:1501749
* https://bugs.launchpad.net/kicad/+bug/1501749
2017-02-07 08:33:16 -05:00
Chris Pavlina ec952c9cde Design rule editor: minor UI improvements
- Move Select All buttons, after discussion in IRC found that numerous
users are unclear on exactly what those buttons would do. The <<< in
them was an attempt to associate them with a listbox, but in reality
created an association in the user's mind with the above "move" actions.

- Spacing, punctuation adjustments
2017-02-07 08:08:41 -05:00
Jean-Samuel Reynaud 13395d34dd Action plugins: handle undo/redo feature when running an action plugin. 2017-02-06 08:39:32 +01:00
jean-pierre charras 9a6e5734bf Minor fixes: fix UI capitalization issues, and better comment in a menu. 2017-02-04 10:21:41 +01:00
Maciej Suminski 8dadc18429 Check if selection is not empty before modifying it in EDIT_TOOL
Fixes: lp:1661311
* https://bugs.launchpad.net/kicad/+bug/1661311
2017-02-02 23:32:11 +01:00
Maciej Suminski 77af6547c1 Coverity fixes (mostly initializing variables) 2017-02-01 17:31:55 +01:00
jean-pierre charras 4d3054599b Fix a warning in Debug build on Linux, when there is no wizard loaded. 2017-02-01 13:02:08 +01:00
John Beard fb6de689b9 Factor an EDIT_TOOL selection routine
Also add some commentary to other EDIT_TOOL selection functions.
2017-02-01 09:57:58 +01:00
John Beard 45b60b1bb0 Add exchange modules GAL tool (in EDIT_TOOL)
Includes tool action and the transistion binding in EDIT_TOOL.

Fixes: lp:1541460
* https://bugs.launchpad.net/kicad/+bug/1541460
2017-02-01 09:57:36 +01:00
John Beard 32ddd72038 Move DIALOG_EXCHANGE_MODULE to dialogs dir
DIALOG_EXCHANGE_MODULE class now has its own header file in the
pcbnew/dialogs directory, and the xchgmod.cpp files was moved along with
it. This has two aims:

* (minor) Standardise the location of "base dialog" derived classes,
  like most other dialogs in KiCad.
* (major) Allow inclusion of this dialog class into both legacy-mode
  pcbframe.cpp and into GAL tools.
2017-02-01 09:19:48 +01:00
jean-pierre charras 66ed8f00ca Update a really outdated python script example, and remove a too old example. 2017-01-31 18:39:30 +01:00
jean-pierre charras b66cb871e6 Fix a serious error in SetActiveLayer(): a GAL specific method was called even if a GAL mode was not active 2017-01-31 09:33:44 +01:00
Maciej Suminski 9627f063ff Added missing handler for 'activate' events in EDIT_TOOL
Fixes: lp:1660306
* https://bugs.launchpad.net/kicad/+bug/1660306
2017-01-30 14:05:44 +01:00
Maciej Suminski f0e0254e27 Added missing tool initialization 2017-01-30 13:21:43 +01:00
Maciej Suminski 4b9243e0bf Allow registering TOOLs in any order. 2017-01-30 13:21:43 +01:00
Diogo Condeco 75ffcbcef5 MACOS Setfocus and CancelButtonIssue moved into dialog_shim.
Setfocus now works on macos dialogs by setting DLGSHIM_USE_SETFOCUS.
This option is only enabled __WXMAC__ is defined.

FixOSXCancelButtonIssue() is now called inside DIALOG_SHIM::SHOW.
All other calls from within the dialogs were removed.
2017-01-29 23:51:35 +01:00
John Beard 019b949646 Pre-select highlighted net in zone create dialog
Applies in GAL mode (legacy mode already did this).

Fixes: lp:1482866
* https://bugs.launchpad.net/kicad/+bug/1482866
2017-01-29 23:46:41 +01:00
John Beard bbf8a0fa06 Tidy consts in class BOARD
Add some consts to "getters" in this class.

Remove const from return type of static return-by-value getter - this
has no effect on the caller except disabling move operations and forcing
copy operations.
2017-01-29 23:46:41 +01:00
jean-pierre charras 00641ab056 Pestore a line removed by mistake. 2017-01-29 13:04:47 +01:00
jean-pierre charras 4d28303e04 Fix a coding style issue. 2017-01-29 12:58:04 +01:00
jean-pierre charras 7bda89cdf6 Rework on plugins reload code: avoid duplicate code. 2017-01-29 12:25:19 +01:00
jean-pierre charras 6c5808fd18 Update dale of last change. Add a small comment about CTL_OMIT_HIDE. 2017-01-29 09:29:49 +01:00
jean-pierre charras 70b39d27ae Fix a compil issue due to incorrect conversion. 2017-01-28 20:33:02 +01:00
jean-pierre charras a7c4c8c7f2 Pcbnew: Fix a crash when reloading python scripts, when Kicad uses wxPython.
also, refresh the board editor action plugins menu, when reloading python scripts from the footprint wizard selector.
2017-01-28 18:47:11 +01:00
Dick Hollenbeck 35fc1f3361 Move "hide" back to prior fp_text location 2017-01-28 09:33:25 -05:00
Maciej Suminski 39317eac83 Display clearance for routed tracks (GAL) 2017-01-27 19:11:12 +01:00
Maciej Suminski 487dfeeb01 Display clearance for pads, tracks & vias (GAL)
Fixes: lp:1333100
* https://bugs.launchpad.net/kicad/+bug/1333100
2017-01-27 19:10:40 +01:00
Maciej Suminski fc122834c2 Code formatting 2017-01-27 19:08:32 +01:00
Maciej Suminski 1eb7e7161e Rename DisplayZonesMode enum to DISPLAY_ZONE_MODE 2017-01-27 19:08:32 +01:00
Maciej Suminski 24d63fb5d9 Removed redundant calls to wxUpdateUIEvent handlers
This is done automatically by wxWidgets
and does not need to be called explicitly.
2017-01-27 15:39:51 +01:00
Maciej Suminski 750eed7ff5 Renamed MODULE_TOOLS to MODULE_EDITOR_TOOLS 2017-01-27 15:39:41 +01:00
Chris Pavlina 3ffc17c27b Fix PCB format version after 0c459ce moved 'hide'
Fixes: lp:1659736
* https://bugs.launchpad.net/kicad/+bug/1659736
2017-01-27 07:27:33 -05:00
jean-pierre charras c761d30ade Make FootprintWizardBase.py compatible with last changes in EDA_TEXT. 2017-01-26 20:19:20 +01:00
Dick Hollenbeck d4acfb9f5a Remove doubled fp_text "hide" output, change *.kicad_pcb format under authorization of Wayne. Fix exceptions.cpp PARSE_PROBLEM which was missing the offset %d. 2017-01-26 08:02:35 -05:00
John Beard 0f5bfdb156 Add mirror tool action for GAL module editor
This is basically a simple clone of the legacy tool with a few minor
tidy-ups for GAL mode.

Fixes: lp:1619301
* https://bugs.launchpad.net/kicad/+bug/1619301
2017-01-25 20:17:28 +01:00
John Beard beed72ffbb Add pad import/export/push to GAL canvas
This implements the pad import/export to the board's master pad setting
in the GAL canvases.

Implemented as a new GAL tool: PAD_TOOL.

It uses the same dialog, which has been split out into its own files in
pcbnew/dialogs, rather than along with frame methods in
pcbnew/globaleditpad.cpp.

Fixes: lp:1619304
* https://bugs.launchpad.net/kicad/+bug/1619304
2017-01-25 20:17:28 +01:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
diogocondeco b54e77e466 Macos SetFocus() and SetSelection moved into OnInitDialog
pcbnew/dialog_find and pcbnew/dialog_pad_properties modified so that SetFocus and SetSelection is handled once the dialog is initiated.
2017-01-23 12:30:59 -05:00
Maciej Suminski 1102eb0d0d Store menu titles in CONTEXT_MENU
Previously a title had to be provided when a submenu was added,
but this led to storing the same title in many places.
2017-01-23 14:52:11 +01:00
Maciej Suminski 6362e5cf0f Added create() method for SELECTION_MENU 2017-01-23 14:52:11 +01:00
jean-pierre charras 2b5769c0a8 Action plugins: simplify code, and fix an issue: the menubar was not correctly rebuilt after closing and reopening pcbnew from kicad.
It was also not correctly rebuilt after language change.
2017-01-23 13:27:49 +01:00
Jean-Samuel Reynaud 5ef3e5a15d Pcbnew: Add ACTION_PLUGINS class. It allows loading python scripts in footprint editor and run them from the Tools/External Plugins menu
This plugin mechanism is enabled only if option -DKICAD_SCRIPTING_ACTION_MENU=ON (it is off by default)
It imply -DKICAD_SCRIPTING=0N
This is currently for testing purposes only for developers, not yet for users.
2017-01-23 13:27:49 +01:00
John Beard 7863e70181 Move PostCommandMenuEvent to EDA_BASE_FRAME
There is nothing PCB-frame-specific about this function,
it is equally applicable to an frame, for example
PCB_EDIT_FRAME and CVPCB_MAINFRAME, which have EDA_BASE_FRAME
as the nearest common ancestor, except KIWAY_PLAYER,
which is not really concerned with this kind of UI event method.
2017-01-23 11:41:00 +01:00
Maciej Suminski 59346a6ef1 Alternative way for setting icons for align/distribute actions. 2017-01-23 11:41:00 +01:00
Maciej Suminski f0a7c1715e Fixed warning 'cast pointer from integer of a different size' 2017-01-23 11:40:59 +01:00
Maciej Suminski 682da70a86 Fixed the issue of creating and event handling in context menus (GAL).
When creating a copy of CONTEXT_MENU, always a CONTEXT_MENU instance was
constructed, whereas an inherited type should be used. Solved with
CONTEXT_MENU::create() that has to be overridden in inheriting classes.

Event & update handlers are now virtual functions, instead of setting
the handlers with Set{Event,Update}Handler().
2017-01-23 11:40:59 +01:00
John Beard 6a1b068dd2 Allow editing locked modules in modedit
Since you have to explicitly enter the module editor with the menu or
hotkey, allowing editing of module sub-parts once in should not cause
any unexpected changes.

Fixes: lp:1591625
* https://bugs.launchpad.net/kicad/+bug/1591625
2017-01-22 20:31:59 -05:00
John Beard 5cc2abaa2b Tidy consts for class D_PAD
Some accessors should be const:

* IsFlipped
* GetRoundRectRadiusRatio

Returning a objects by value as const in these cases is not helpful, as
all it does is prevent the caller moving from the return value, it just
forces a copy.

Some of thse functions come from base class overrides, those haven't
been changed.

* ShapePos
* GetPadName
* GetPackedPadName
2017-01-22 10:42:45 -05:00
jean-pierre charras 2de913797a Fix a UI policy issue. Very minor cosmetic change: give same look to Zoom and Grid selection in 2 menus. 2017-01-20 11:35:24 +01:00
jean-pierre charras adb679dc46 ROUTER_TOOL_MENU: add zoom selection to this menu. 2017-01-20 08:51:12 +01:00
jean-pierre charras d51d53c6b9 CONTEXT_TRACK_WIDTH_MENU EventHandler: better filtering of received events ID.
This is mandatory because currently, on Windows, this handler is also called when clicking on an other menu with submenus like the grid menu.
2017-01-20 08:29:24 +01:00
jean-pierre charras e710b8b370 Fix incorrect parameter type when appending zoom and grid menuitems 2017-01-19 20:26:57 +01:00
Tomasz Włostowski ba9576b014 router: snap to clearance boundaries in Highlight Collisions mode
Fixes: lp:1655819
* https://bugs.launchpad.net/kicad/+bug/1655819
2017-01-19 17:47:15 +01:00
Maciej Suminski e5fbd0c442 Fixed crash upon finished zone drawing in GAL.
In principle, this patch reverts 2eefa117. The difference is removal of
one unused method (SELECTION::clear) and fixing hidden overloaded
virtual methods warnings.

Fixes: lp:1657569
* https://bugs.launchpad.net/kicad/+bug/1657569
2017-01-18 22:06:23 +01:00
Tomasz Włostowski bb463ad434 pns: fix assertion fail when placing diff pairs 2017-01-18 15:55:46 +01:00
Maciej Suminski 75fb04d650 TOOL_ACTIONs are handled with transitions, no handlers needed in the event loops
There used to be a number of TOOL_ACTIONs that had entries both in
SetTransitions() and the event loop, which seemed redundant and
troublesome.
Now it is not necessary anymore, transitions setup is enough to execute
associated actions.
2017-01-18 14:20:39 +01:00
Maciej Suminski 2eefa11732 SELECTION has-a VIEW_GROUP instead of being-a VIEW_GROUP
Fixed numerous warnings caused by hidden overloaded methods
provided in both classes (Add(), Remove(), etc.)
2017-01-18 13:22:41 +01:00
Maciej Suminski 3c61b16e7b Code formatting 2017-01-18 13:22:40 +01:00
Maciej Suminski c758f434c0 Removed unused fields in VIEW & ANTIALIASING_SMAA classes 2017-01-18 13:22:18 +01:00
Maciej Suminski ee862e1db4 Fixed a hidden overloaded virtual function warning in PNS 2017-01-18 13:22:18 +01:00
Maciej Suminski ee2b1ac321 Shortened code using VIEW & PAINTER classes in MODULE_TOOLS methods 2017-01-18 13:22:18 +01:00
jean-pierre charras f079b7f98b gendrill_Excellon_writer.*: make 3 helper methods private. Coding style fixes. 2017-01-17 20:37:14 +01:00
Wayne Stambaugh 56fbfeeb4a Do not use default board solder mask clearance in footprint editor.
The footprint editor was displaying the default solder mask clearance
defined by the temporary BOARD object created a start up.  Change the
temporary BOARD default solder mask to 0 so the pad or footprint solder
mask clearance setting is displayed when editing the footprint.

fixes lp:1653980

https://bugs.launchpad.net/kicad/+bug/1653980
2017-01-17 09:05:57 -05:00
jean-pierre charras fef40c96e2 Workaround for this issue: Pcbnew crashes on exit in OpenGL display mode when a footprint on the board was edited in the fp editor
Fixes: lp:1655858
https://bugs.launchpad.net/kicad/+bug/1655858
2017-01-17 13:17:14 +01:00
Maciej Suminski 004ca3c6f9 Fixed a memory leak in VIEW_ITEM (proper way of doing 9bc2bb2)
The problem with simple deleting VIEW_ITEM_DATA upon VIEW_ITEM removal was
caused by the default copy constructors that copied pointers.
Once a copy of an item was destroyed, the VIEW_ITEM_DATA has been
destroyed, effectively invalidating m_viewPrivData for the other item.
2017-01-16 14:57:50 +01:00
Chris Pavlina 8ac4790370 Remove icons from canvas selection menu in modedit
No OS renders the combination of icon AND radio button properly.
2017-01-15 07:12:02 -05:00
Chris Pavlina d442009e84 Use radio buttons in canvas selection menu items 2017-01-15 07:05:24 -05:00
jean-pierre charras d0db2de015 Cosmetic enhancement in pcbnew menubar: use specific icon in menuitems to switch canvases, and add a marker to the mode currently in use 2017-01-14 14:43:45 +01:00
John Beard c50d28d94d Access tools' TOOL_MENUs rather than CONDITIONAL_MENUs
This means that non-top-level tools, for example EDIT_TOOL and
PCB_EDITOR_CONTROL can submit their own menus to the top-level tool's
TOOL_MENU, which will then retain a reference to it and make it
available for the CONTEXT_MENU that is shown.
2017-01-12 14:34:03 +01:00
John Beard d7db84e282 Break out tools' common menu functions and ownership
Add a class TOOL_MENU, which provides a management class for a
CONDITIONAL_MENU and a set of CONTEXT_MENUs. The aim of this is to
provide a central place where all TOOL_INTERACTIVEs can get a "basic"
context menu that either they or other tools can register new items and
sub-menus against.

This means that "top-level" tools no longer need to manage the lifetimes
of any CONTEXT_MENUs that they add, and can also delegate simple menu
display functions.
2017-01-12 14:33:57 +01:00
Maciej Suminski da00d64877 OpenGL antialising code clean up & formatting 2017-01-11 16:20:37 +01:00
decimad 5a4e247564 EDA_DRAW_PANEL_GAL now takes the gal display options per dependency injection
Add a hack so that the pad properties base dialog constructor can pass in the dependency. Since the derived dialog's constructor takes the parent by this exact type, the static cast is safe.
2017-01-11 16:20:37 +01:00
decimad 77138e3702 Add UI control to set up gal opengl antialiasing and load/store the settings 2017-01-11 16:20:37 +01:00
decimad d04b3bdc27 Add Antialiasing option to dialog_display_options (Thank you Simon Richter) 2017-01-11 16:20:37 +01:00
John Beard 378f5cce33 Don't show separator in Select tool if not needed
If the SELECTION_TOOL's Select... menu is not shown, the separator under
it should also not be shown, so use the same SELECTION_CONDITIONS to
enforce this.
2017-01-11 11:15:25 +01:00
John Beard f1c5b9a9ae Add context menu to GAL DRAWING_TOOL, including the zone menu
Includes a tiny class for scoped set-reset of a variable, which is used
here to store the current drawing mode.

Fixes: lp:1218629
 * https://bugs.launchpad.net/kicad/+bug/1518629
2017-01-11 10:41:08 +01:00
John Beard 6baf0edc08 Line segments obey 45 degree preference in GAL
The GAL line segment tool now listens to the global line segment 45
degree locking preference, with Ctrl used to invert the behaviour. The
behaviour therefore follows the setting normally, and the user can
override when needed with Ctrl.

Fixes: lp:1635718
* https://bugs.launchpad.net/kicad/+bug/1635718
2017-01-11 09:57:55 +01:00
jean-pierre charras 853310da6e Remove duplicate definition of LAYER_PAIR, defined both in gendrill_Excellon_writer.h and specctra.h
Now, in gendrill_Excellon_writer.h it is DRILL_LAYER_PAIR, and in specctra.h it is SPECCTRA_ LAYER_PAIR
2017-01-10 20:12:50 +01:00
John Beard 3448698849 Add grid menu to routing context menu
This is a missing GAL feature (though grid cycling by hotkey was already
working fine).

Fixes: lp:1519973
* https://bugs.launchpad.net/kicad/+bug/1519973
2017-01-10 11:18:25 +01:00
jean-pierre charras 4f46f79cf0 dialog_footprint_wizard_list.cpp: allows updating (on request) python modules from this dialog.
This option reloads modules which are more recent than already loaded modules, and load new modules.
2017-01-09 14:44:24 +01:00
jean-pierre charras 9684031bc8 Fix I18n issue in dialog_design_rules.cpp 2017-01-09 14:19:02 +01:00
jean-pierre charras 1039b6dda7 Make dialog_footprint_wizard_list.cpp compilable when scripting is not enabled. 2017-01-08 08:25:04 +01:00
jean-pierre charras e72a3b99ee dialog_footprint_wizard_list: cosmetic enhancements. 2017-01-07 21:10:38 +01:00
jean-pierre charras e6a8294c56 dialog_footprint_wizard_list: add button to show the trace of errors when python scripts wizards failed to load. 2017-01-07 20:43:39 +01:00
jean-pierre charras 44cc728b25 enforce a control to avoid crash if pcbnew.py is an incorrect version (bad install). 2017-01-07 16:25:11 +01:00
jean-pierre charras 76a82dcd3b Dialog footprint wizard selector: better dialog (displays the wizard search path list) and allows double click to select a wizard 2017-01-07 13:39:47 +01:00
jean-pierre charras 56f8e10eb4 Footprint wizards management: Now display the list of not loadable footprint wizards in footprint wizard dialog.
Not loadable wizards are Python scripts having a syntax error or are not compatible scripts due to changes in API.
2017-01-06 20:15:23 +01:00
Chris Pavlina f407450732 Remove code referring to deleted variable 2017-01-05 20:11:37 -05:00
Diego Herranz 50cdd5cdf1 Pcbnew, plot dialog: grey out advanced net attributes if Gerber X2 is unchecked.
m_useGerberNetAttributes is useless if m_useGerberX2Attributes is not checked.
So disabled (greyed out) when Gerber X2 gets unchecked to make it clear to
the user.
2017-01-04 17:13:26 -05:00
Wayne Stambaugh 50a388fe56 Page setting menu entry consistency fixes.
Move the page setting menu entry from the edit menu to the file menu in
Eeschema so it is consistent with Pcbnew.

Change the page setting menu entry tooltip in Pcbnew so it is the same as
Eeschema.
2017-01-04 15:24:45 -05:00
jean-pierre charras 24192ff3d6 Add Micromatch connectors footprint wizard. Unfortunately, I don't remember the initial author of this script. 2017-01-04 20:01:15 +01:00
jean-pierre charras 995940e992 refinement 2017-01-04 16:17:40 +01:00
jean-pierre charras 02fa9639cd DIALOG_FOOTPRINT_WIZARD_LIST: minor enhancement. qrcode_footprint_wizard.py: use filled polygons instead of square pads on silkscren layer. 2017-01-04 15:03:43 +01:00
jean-pierre charras 1a464ab8c8 Coding style fixes 2017-01-03 18:04:35 +01:00
Oliver Walters 66ee44cb1f Footprint Wizards Update 2017-01-03 16:01:47 +01:00
Oliver d1278a48b6 UI Improvements for PCB Design Rules Dialog
* Added floating point validators for wxTextCtrl items relating to via and track sizes
* Prevent entering negative values
* Changed via option wxRadioButton pairs to wxCheckBox
* Toggling the OptAllowMicroVias checkbox toggles the enabled status of the microvia settings controls
* Cleanup of error message(s)
2017-01-02 12:50:13 -05:00
jean-pierre charras fff449ecf0 Performance counter rework: Add comments, fix coding style issues. 2016-12-31 13:00:24 +01:00
jean-pierre charras b8b08dafd6 Code cleaning: remove pcbcommon.* which contains nothing really useful. The very few lines of code are moved to a better place. 2016-12-31 12:56:21 +01:00
Tomasz Wlostowski c45cc1de68 Fixes: lp:1653146 (Assertion failed when trying to delete track with router tool active, in debug mode)
https://bugs.launchpad.net/kicad/+bug/1653146
2016-12-30 20:14:44 +01:00
jean-pierre charras a9fbedfb12 More Coverity warnings fixes. 2016-12-30 14:36:23 +01:00
jean-pierre charras dec2d6e8cc Fix a few Coverity warnings. A bit of clean code in export_vrml.cpp. 2016-12-30 12:40:05 +01:00
Chris Pavlina 6078ca85e5 Improve broken edge outline error message 2016-12-29 12:31:12 -05:00
jean-pierre charras a76f40be3b Pcbnew: fix compil issue when Python scripting isn't enabled. 2016-12-29 08:17:33 +01:00
Oliver 636e060c99 A few enhancements from a larger patch, not yet committed, for footprint wizards 2016-12-28 10:26:01 +01:00
jean-pierre charras 352f1a025c Better compatibility with previous Pcbnew versions: save diff pair prms only when values are not set to default values 2016-12-28 10:00:39 +01:00
jean-pierre charras 2972f6fbc7 Fix shadowed local variable 2016-12-20 17:51:55 +01:00
jean-pierre charras 9be5398cd2 Add bitmaps to Align/distribute menu ans menu items 2016-12-20 17:50:29 +01:00
Tomasz Włostowski b20323dc63 SELECTION: fixed pointer arithmetic-related segfault in operator[] 2016-12-20 12:01:09 +01:00
jean-pierre charras 3ffa37c8b9 Fixes: lp:1650524 (Trapezoidal pad solder mask is incorrect when the minimal solder mask width is 0)
https://bugs.launchpad.net/kicad/+bug/1650524
2016-12-18 13:03:15 +01:00
Maciej Suminski f631ae27b2 Fixed crash on DRC
Fixes: lp:1650360
* https://bugs.launchpad.net/kicad/+bug/1650360
2016-12-16 12:04:15 +01:00
Chris Pavlina 809e71abac Rename footprint attributes more understandably 2016-12-14 15:53:04 -05:00
jean-pierre charras 188d7812ec Disable Flip board view in Legacy mode (because the view cannot be flipped) 2016-12-13 21:24:29 +01:00
jean-pierre charras 0265a5bac5 Add a specific icon to the Flip board menuitem command 2016-12-13 19:36:17 +01:00
Maciej Suminski 139521750b Fixed a crash on finishing line drawing in the legacy FP editor
Fixes: lp:1649597
* https://bugs.launchpad.net/kicad/+bug/1649597
2016-12-13 17:25:34 +01:00
Maciej Suminski b1e37ae1dc Fixed a few warnings (dialog_track_via_properties.cpp) 2016-12-12 18:01:09 +01:00
Maciej Suminski c8676db84e Fixed panning & cursor control with arrow keys in flipped view 2016-12-12 16:45:52 +01:00
Maciej Suminski 027515f4e1 Fixed refreshing after flipping the view 2016-12-12 16:45:52 +01:00
Maciej Suminski 7ad5fca6de More code formatting, updated copyright headers 2016-12-12 16:45:52 +01:00
Maciej Suminski 07c7334238 Moved 'Flip View' menu entry
Under Windows wxWidgets there is a problem with the last menu
item having wxITEM_CHECK flag.
2016-12-12 16:45:52 +01:00
Maciej Suminski f94c10b453 Fixed a warning in release builds 2016-12-12 16:45:52 +01:00
Maciej Suminski c96db4f5c4 Removed aCreateUndoEntry flag from COMMIT::Push()
It was not used anywhere and COMMIT should handle creating
undo buffer entries.
2016-12-12 16:45:52 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski da28e163d2 Optimizations/fixes to the VIEW/GAL classes:
- much faster Cairo rendering (outperforms legacy)
- improvements in VIEW update handling
- fixed issue with grid rendering in flip view mode
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 3f7c5a0845 fixed post-rebase issues 2016-12-12 16:45:52 +01:00
Tomasz Włostowski c661c30f68 pcbnew: added flip view mode 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 1c1f4e9a50 Refactoring of VIEW/VIEW_ITEM classes:
- Remove dependency of EDA_ITEM on VIEW
- VIEW_ITEM is now a pure virtual interface
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 27a10e8597 Multiple simplifications to GAL tools in PCBNew:
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
2016-12-12 16:45:52 +01:00
Tomasz Wlostowski 5476e97bfa Pcbnew: fix segfault when importing netlist with no footprint assignments.
Fixes lp:1647803

https://bugs.launchpad.net/kicad/+bug/1647803
2016-12-10 10:20:21 -05:00
jean-pierre charras 3d89fb640a Fix an issue in github plugin, when a library is not found (perhaps due to changes in curl 2016-12-07 18:06:26 +01:00
Heikki Pulkkinen f660771ecf Fix redundant via removal code 2016-12-07 17:14:41 +01:00
Maciej Suminski 29ab646e7c Fix 'remove dangling tracks' in board cleanup code
Code removing dangling tracks is called in a loop until
there are no more changes, and relies on removing tracks
instanly. Previously the tracks to be removed were added to
a set and removed in one go, so only one segment for each
dangling connection was removed.
2016-12-07 17:10:43 +01:00
Maciej Suminski e37488f145 Minor code simplification in BOARD_COMMIT 2016-12-07 16:50:23 +01:00
jean-pierre charras 6d6542e133 Gerber file generation: in X1 format, in header, use structured comments instead of basic comments.
(a structured comment starts by "G04 #@! " followed by a X2 attribute, and is a comment for old Gerber readers)
2016-11-30 17:48:31 +01:00
Maciej Suminski 524dddaf70 Sync the PNS model when its changed 2016-11-28 15:51:18 +01:00
Maciej Suminski 89a5f8ce69 Remove boost::bind from BOARD_COMMIT 2016-11-28 15:51:18 +01:00
Maciej Suminski bb1390e2f1 Modify TRACKS_CLEANER to use BOARD_COMMIT 2016-11-28 15:51:18 +01:00
Maciej Suminski abb3524563 Code formatting (clean.cpp) 2016-11-28 15:51:18 +01:00
jean-pierre charras 30df041de6 fix shadowed local variables 2016-11-25 18:17:34 +01:00
jean-pierre charras bcfc1e7a3f fix shadowed local variables 2016-11-25 16:00:42 +01:00
jean-pierre charras 6d7f0b45f4 dialog_export_step_base: cosmetic enhancements, add tool tips and better messages. 2016-11-25 12:05:51 +01:00
jean-pierre charras ccdfabc866 Add tool tips to autosave widget in dialogs (pcbnew and eeschema) 2016-11-22 11:26:32 +01:00
Wayne Stambaugh 64c892ee23 Make footprint ID into a generic library ID.
Rename FPID to LIB_ID as is now used as a generic library identifier and
is no longer specific to footprints.

Remove all mention of footprint from the new LIB_ID doxygen comments and
code.

Rename files fpid.h and fpid.cpp to lib_id.h and lib_id.cpp.

Rename fp_lib_table.keywords file to lib_table.keywords and adjust CMake
build dependencies accordingly.

Update all source files effected by the code and file name changes.

Update .gitignore for file name changes.
2016-11-20 18:35:08 -05:00
Wayne Stambaugh b9c296420a Complete library table and library table row refactor.
Derive LIB_TABLE_ROW from boost::noncopyable for use in boost pointer
containers.

Use std::unique_ptr to manage PROPERTIES pointer.

Add clone support for boost pointer containers.

Split common library table code out from FP_LIB_TABLE into base LIB_TABLE
object.  The FP_LIB_TABLE object only contains the code specific to
footprint library tables.

Use boost::vector_ptr for storing library table row objects.

Fix move up and down bugs in footprint library table edit dialog.
2016-11-19 17:16:43 -05:00
Diego Herranz 90897d4983 Pcbnew, plot dialog: fix incorrect wording. 2016-11-19 09:48:32 +01:00
jean-pierre charras 19ce3f276c Fixes: lp:1642864 (Pcbnew Eagle import layer 48 incorrectly mapped)
https://bugs.launchpad.net/kicad/+bug/1642864
2016-11-18 13:19:05 +01:00