Commit Graph

11973 Commits

Author SHA1 Message Date
Maciej Suminski 4671b9b34e Fixed module removal when rotating/flipping a placed module
Module placer did not mark the newly placed modules as selected,
but all edit functions (rotate/place/etc.) rely on getting a selected
item. When a rotation/flip command was issued, the newly placed module
was dropped and the one underneath the cursor has been rotated.

To fix this the newly placed modules are marked as selected.
It also simplifies the placer code a bit.

Fixes: lp:1738148
* https://bugs.launchpad.net/kicad/+bug/1738148
2017-12-14 17:13:42 +01:00
Maciej Suminski 9c2d1cf890 Fixed BOARD_COMMIT::Revert()
Revert() method was still not aware of CHT_DONE flag, therefore
the switch statement was always invalid. To fix it, the commit
type is split to type and flags as is done in Push() method.
2017-12-14 17:13:42 +01:00
Maciej Suminski d599a83c4b Removed unused variables in PCB_VIEW 2017-12-14 17:13:42 +01:00
jean-pierre charras dc6c98310f Export drawing in symbol editor results in error message and no drawing file (.sym file) saved
Fixes: lp:1737875
https://bugs.launchpad.net/kicad/+bug/1737875
2017-12-14 16:45:30 +01:00
jean-pierre charras a287748921 Cosmetic enhancement: Add icons to track length tuner menu. 2017-12-14 14:33:20 +01:00
Tomasz Włostowski b47a06e42a poly2tri: include stdexcept in each file throwing an std::exception. 2017-12-14 02:29:33 +01:00
Tomasz Włostowski a83ece88fd poly2tri use std::runtime_error, fixes builds on many Linux distributions 2017-12-14 02:14:35 +01:00
Tomasz Włostowski eed924fe45 Fixed zone filling crash & thermal stubs inconsistency
Fixes: lp:1737557
* https://bugs.launchpad.net/kicad/+bug/1737557
Fixes: lp:1737542
* https://bugs.launchpad.net/kicad/+bug/1737542
Fixes: lp:1737541
* https://bugs.launchpad.net/kicad/+bug/1737541
2017-12-14 01:29:08 +01:00
Tomasz Włostowski 2831268b60 PROGRESS_REPORTER: KeepRefreshing shouldn't block on non-OpenMP systems
Fixes: lp:1737277
* https://bugs.launchpad.net/kicad/+bug/1737277
2017-12-14 01:26:41 +01:00
Tomasz Włostowski 941ebe376c poly2tri: throw exceptions instead of crashing on non-supported polygons 2017-12-14 01:25:28 +01:00
jean-pierre charras c18b638c17 Cosmetic enhancement in GAL: disambiguationMenu: add icons in menuitems, like in Legacy mode. 2017-12-13 19:42:33 +01:00
Maciej Suminski 8ab8a11cf8 Faster zone and custom shape pad drawing, minor PCB_PAINTER refactor
Zones: it turned out that for every zone point, the set of hatch lines
has been drawn, resulting in numerous redundant lines. Now the set is
drawn only once per zone.

Custom shape pads: as GAL supports SHAPE_POLY_SETs, there is no need to
create a temporary vector to copy there a list of points to be drawn.
Changed the drawing calls to use SHAPE_POLY_SETs directly.

Thanks to Andreas Buhr patch, code for drawing filled polygons and their
outlines has been unified. Previously it was done by changing the
drawing method (GAL::DrawPolygon() vs GAL::DrawPolyline()), now it is
done by modifying attributes (stroke/fill).
2017-12-13 17:01:32 +01:00
Andreas Buhr 6205363b50 bugfix: OPENGL_GAL::DrawPolygon did not close closed polygons
The polygon drawing routing in the OpenGL-GAL did
not plot polygons which are "closed", i.e. have a segment
from their last point to their first point, correctly.
That segment was omitted.
This commit fixes this bug.
2017-12-13 17:01:32 +01:00
Jeff Young df76380a2d Don't leave a hidden item behind.
If the object changes between a TA_CONTEXT_MENU_UPDATE
event and a TA_CONTEXT_MENU_CHOICE event (usually as
a result of a cancel), the old code would leave the
last item hidden.

Fixes: lp:1737562
* https://bugs.launchpad.net/kicad/+bug/1737562
2017-12-13 15:59:21 +01:00
Jeff Young dc9d17100b Fix update of brightened objects on OSX.
The OSX implementation needs to be poked to update the
brightening / unbrightening during running of the
disambiguation menu.  (FWIW, now that I've finally seen
it in action, it's a REALLY cool feature.)

Fixes: lp:1715440
* https://bugs.launchpad.net/kicad/+bug/1715440
2017-12-13 11:31:24 +01:00
jean-pierre charras 33c2d6e4ba Fixed disappearing components in COMPONENT_TREE in library editor
The reason the component tree widget was cleared on Windows is the fact
m_adapter->UpdateSearchString( m_query_ctrl->GetLineText( 0 ) ) is
called on any change of the symbol. But if m_query_ctrl is empty,
m_query_ctrl->GetLineText( 0 ) returns the "hint" (currently the word
"Search") not the actual value, so there is no "candidate" symbol in
list. Using m_query_ctrl->GetValue() returns the actual value and fixes
this issue.

Fixes: lp:1737132
* https://bugs.launchpad.net/kicad/+bug/1737132
2017-12-13 10:34:14 +01:00
Seth Hillbrand 8e764f85a4 Optimizing speed of sch_component pin references
Pins are weak_ptrs to the library, so they require a lock() before
accessing.  This imposes a performance hit on fast loops that access
the pin list repeatedly.  This patch caches the pin position locally
for each component, updating only when needed.

Fixes: lp:1737363
* https://bugs.launchpad.net/kicad/+bug/1737363
2017-12-12 17:48:50 -05:00
Oliver 0871719cc9 Add links to list of library contributors on GitHub
- Apologies to "leet hackers"
- Add URL option to contributor entity
2017-12-12 07:40:15 -05:00
jean-pierre charras 5f6f03b16c HIERARCHY_NAVIG_DLG: allows closing the dialog by ESC key (like other dialogs)
cleanup hierarch.cpp code
2017-12-12 09:54:42 +01:00
jean-pierre charras b395b55a20 Fix a few (minor) issues in microwave tools. 2017-12-11 12:54:44 +01:00
Maciej Suminski aedf24d944 Fix crash when renaming a component in symbol library editor
COMPONENT_TREE::STATE used wxDataViewItem to store the selection, but it
will point to a deleted object if the selection was removed. Switched to
storing the selection using LIB_ID as it is much safer to use.
2017-12-11 11:22:24 +01:00
Maciej Suminski f19aed9d5c Workaround for OSX freeze when filling zones in GAL
More details:
https://lists.launchpad.net/kicad-developers/msg32306.html
2017-12-11 10:39:58 +01:00
Andreas Buhr 5572183c22 bugfix: OPENGL_GAL::drawPolygon did not respect fill settings
The OPENGL_GAL::drawPolygon function and all functions using it
did not respect the isFillEnabled member set by
GAL::SetIsFill. This is fixed by this patch.
2017-12-11 10:21:37 +01:00
Andreas Buhr 084eea6781 Bugfix: EDA_RECT to BOX2I generated wrong boxes
The "operator BOX2I() const" of EDA_RECT produced
wrong boxes, usually much to big. It passed its
end-position as second argument to the constructor
of BOX2I. However, BOX2I expects its size as second
argument.

This caused a dramatic performance penalty in some
cases.
2017-12-11 09:48:13 +01:00
Jon Evans b6ac603f0a Fix AlignLeft / AlignRight when using Flip Board view
Fixes: lp:1734377
* https://bugs.launchpad.net/kicad/+bug/1734377
2017-12-11 09:40:08 +01:00
Jon Evans 6ee26fdd8c Remove LAYER_WORKSHEET from forced visibility since it now has a control
Fixes: lp:1737315
* https://bugs.launchpad.net/kicad/+bug/1737315
2017-12-10 17:41:00 -05:00
Jon Evans 1955f25226 Remove outdated check on endAngle to fix arc draw direction
Fixes: lp:1737420
* https://bugs.launchpad.net/kicad/+bug/1737420
2017-12-10 11:45:33 -07:00
Jon Evans 48388695ae Use explicit shift in hotkeys instead of mixed-case characters
Because of how wxMenuItem decodes the label text, the case of
alphabetic hotkeys is not preserved when displaying the menu.  So,
alphabetic hotkeys that use the Shift key must be defined this way.

Fixes: lp:1737303
* https://bugs.launchpad.net/kicad/+bug/1737303
2017-12-09 19:59:55 +01:00
Seth Hillbrand cb422e29df Eeschema: Filter out empty libraries
Fixes: lp:1736930
* https://bugs.launchpad.net/kicad/+bug/1736930
2017-12-09 08:33:58 -05:00
Seth Hillbrand 394749f1d6 Eeschema: calculate not-connected pins correctly
Show the NC box only on pins connected via the same component,
indicating a stacked pin group.  Do not show NC box on pins for
different components with the same symbol.
2017-12-08 17:20:08 -05:00
Seth Hillbrand f0fecba9e1 Eeschema: add junction to 3-component/wire connection
Fixes: lp:1737014
* https://bugs.launchpad.net/kicad/+bug/1737014
2017-12-08 17:19:47 -05:00
Maciej Suminski d205366da7 Add support for wchar_t to SWIG 2017-12-08 18:04:51 +01:00
jean-pierre charras 4c4b11b45f change UTF8& operator+=( wchar_t ch ) to UTF8& operator+=( unsigned ch ), because swig does not like wchar_t.
(on Linux, wchar_t is a unsigned int, on Windows a unsigned short, so always using a unsigned int do not create issues)
2017-12-08 17:57:53 +01:00
Andreas Buhr b33bf2eafe fix double free and memory leak in SHAPE_POLY_SET
There were two problems in the triangulation caching
of SHAPE_POLY_SET:
First there was a double free:
While SHAPE_POLY_SET implements the copy constructor,
it did not implement the operator=, which resulted
in the default operator= being generated by the
compiler. The default operator= copied the member
m_triangulatedPolys, which is a std::vector of pointers.
So after operator= execution, there are two SHAPE_POLY_SET
having pointers to the same TRIANGULATED_POLYGONs, each
of them deleting them in their destructors. This led
to segfaults, because calling
TransformShapeWithClearanceToPolygon on a Zone
uses operator= to copy the contained SHAPE_POLY_SET.
The new SHAPE_POLY_SET then went out of scope and
deleted the cached triangulation within the Zone.

This first problem is fixed by implementing operator=
for SHAPE_POLY_SET.

Second, there was a memory leak: Calling
"CacheTriangulation" on a SHAPE_POLY_SET,
then changing the polygon and then calling
"CacheTriangulation" again led to
leaking the
triangulations generated in the first call.

This second problem is fixed by holding
the cached triangulations in a unique_ptr.
2017-12-08 14:55:46 +01:00
jean-pierre charras d958ab9460 Fix operator+= for UTF8 class
Added operator+=(wchar_t), as operator+=(char) was not sufficient to
handle multibyte characters present in UTF8.

Fixes: lp:1737143
* https://bugs.launchpad.net/kicad/+bug/1737143
2017-12-08 14:37:55 +01:00
Wayne Stambaugh 7ca7d9078e Eeschema: fix potential symbol cache library name collisions.
If a schematic contains two symbols with the same name from different
libraries, the cache will contain the last symbol saved with that name.
Prepend the library nickname with the original schematic symbol library
nickname when saving the cache library to prevent name collisions.
2017-12-08 08:32:23 -05:00
Maciej Suminski f7072cc7c6 Moved DRC::doEdgeZoneDrc to drc_clearance_test_functions.cpp 2017-12-08 11:33:40 +01:00
Maciej Suminski 9b5dc5c215 GAL show markers for zone outlines gap test
Moved a DRC function (BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines)
from BOARD class to DRC (DRC::TestZoneToZoneOutline). Added BOARD_COMMITs
to handle marker visibility updates.

Fixes: lp:1619124
* https://bugs.launchpad.net/kicad/+bug/1619124
2017-12-08 11:33:32 +01:00
Maciej Suminski 693c8bce40 Moved text_utils.cpp from libcommon to libgal 2017-12-08 09:01:49 +01:00
jean-pierre charras 81357eb584 Update demo to use latest libraries. 2017-12-07 18:28:11 +01:00
Maciej Suminski 9da8398cf3 Added files missing in 602ecf75 2017-12-07 18:14:19 +01:00
Maciej Suminski ef8f5db024 Handle space character in OPENGL_GAL::BitmapText()
Fixes: lp:1668455
* https://bugs.launchpad.net/kicad/+bug/1668455
2017-12-07 17:58:54 +01:00
Maciej Suminski 602ecf7502 Fix overbar display in OpenGL canvas
Moved the code handling text overbars to a single function
(ProcessOverbars()) to replace similar pieces of code trying to do the
same thing.

Fixes: lp:1735906
* https://bugs.launchpad.net/kicad/+bug/1735906
2017-12-07 17:58:54 +01:00
Seth Hillbrand 86b4a3c3e6 pcbnew: Correct spectra output default filename
Fixes: lp:1736724
* https://bugs.launchpad.net/kicad/+bug/1736724
2017-12-07 09:07:47 -05:00
jean-pierre charras bfc3804115 Minor fixes related to timestamp_t. Move timestamp_t definition to base_struct.h 2017-12-07 13:33:59 +01:00
Henner Zeller 3f57fa5d24 Change time_t in the functions that deal with timestamps to a new typedef timestamp_t (defined as a long).
that makes sure the c++ side and swigged Python side agree on the type, because time_t create problems in Python scripts.
2017-12-07 13:16:33 +01:00
Seth Hillbrand a63e9b863b pcbnew: Fix multiple delete bug
Delete events when using GAL are handled by only one tool handler
instead of ROUTER_TOOL and EDIT_TOOL both deleting items.

Fixes: lp:1715158
* https://bugs.launchpad.net/kicad/+bug/1715158
2017-12-07 09:31:20 +01:00
Seth Hillbrand ee56e21f81 Fix touchpad scrolling with mousewheelPan
Fixes: lp:1735669
* https://bugs.launchpad.net/kicad/+bug/1735669
2017-12-06 19:52:52 -05:00
Simon Richter 0dad728e86 Pass -DBOOST_TEST_DYN_LINK to all parts of test 2017-12-06 19:28:57 -05:00
Simon Richter d075387c24 Link pcb_test_window with /SUBSYSTEM:WINDOWS
This is required for wx apps.
2017-12-06 19:28:32 -05:00