Commit Graph

326 Commits

Author SHA1 Message Date
Jeff Young d9bf1550e4 Improve slightly confusing error message. 2018-10-11 18:53:00 +01:00
Jeff Young 0f9ded9563 Space out placed footprints with some padding.
Fixes: lp:1788917
* https://bugs.launchpad.net/kicad/+bug/1788917
2018-09-14 10:21:45 +01:00
Jeff Young 43e99e6df0 Inflate footprint bounding box to include texts.
This makes zoom automatique work much better in the footprint
editor, and should improve other things which probably assumed
the bounding box included everything (such as refresh code).

Callers which still want just the module outline should call
GetFootprintRect() instead of GetBoundingBox().
2018-08-11 17:14:27 +01:00
Jeff Young e55bb9e748 Increment references when creating an array.
While it's not always correct, not doing so is pretty much always
incorrect.

Fixes: lp:1625964
* https://bugs.launchpad.net/kicad/+bug/1625964
2018-07-25 14:41:20 +01:00
Jeff Young 2d4ba56ac0 Promote aperture pads to first-class citizens.
Well, almost anyway.  We can't use a pad attribute for them as
that would change the file format.  So they're currently
defined as a CONN pad with no copper layers.

However, when figuring out of existing pads should be *treated*
as aperture pads, we just check for no copper layers.

Fixes: lp:1781760
* https://bugs.launchpad.net/kicad/+bug/1781760
2018-07-24 14:57:45 +01:00
jean-pierre charras 4cac974420 Add Bezier curve (S_CURVE shape) support in DIALOG_GRAPHIC_ITEM_PROPERTIES.
Fix some issues related to S_CURVE shape support.
2018-07-22 18:39:48 +02:00
Jeff Young eacaa39aa2 Remove global units usage from GetSelectionText...
... and GetMsgPanelInfo.

Step 4 in the g_UserUnit eradication effort.

Also removes a couple of conversion routines that were close
enough to extinction.

(cherry picked from commit c75da51)
2018-07-17 15:11:09 +01:00
Jeff Young f0f9e4a1cb Kicad-ize the numeric evaluator.
Naming conventions, code formatting, and wxStrings.

(cherry picked from commit 4a0d7a8)
2018-07-17 15:10:01 +01:00
Jeff Young b99ea159c8 Rationalize select menu texts.
Be consistent with order, formatting, etc.
Remove debug stuff such as zone timestamp and net code.
Clean up misleading pad messages.

(cherry picked from commit 2132109)
2018-07-17 15:09:48 +01:00
Jeff Young 6ad37972c0 Don't center objects behind the DRC dialog.
(cherry picked from commit d5bb39f)
2018-07-17 15:09:43 +01:00
Maciej Suminski f0b3cf8077 STEP export: Stricter contiguity check
Stricter contiguity check points the user to gaps in the outline.

Fixes: lp:1774351
* https://bugs.launchpad.net/kicad/+bug/1774351
2018-06-19 10:36:21 +02:00
Maciej Suminski 72b49acccf Commit supplementing 9605dd8e
Once SELECTION_TOOL has been changed to use EDA_ITEM::GetBoundingBox(),
selection area had to cover the footprint and its ref/value texts,
even hidden ones. To fix this, ref/val strings are taken into account
only in the ViewBBox().
2018-06-12 17:40:56 +02:00
Seth Hillbrand 4917540069 Clarify timestamp type for wxDateTime 2018-03-29 09:29:05 -07:00
jean-pierre charras d64c89d964 Footprint editor: Graphic polygon don't follow footprint when moving reference anchor
Fixes: lp:1755042
https://bugs.launchpad.net/kicad/+bug/1755042
2018-03-12 13:17:22 +01:00
Jeff Young 8a35e58987 Calculate number of segments based on radius.
Fixes: lp:1754252
* https://bugs.launchpad.net/kicad/+bug/1754252
2018-03-08 18:04:26 +00:00
Jon Evans 1e66a23dbc Rework footprint selection filtering to improve behavior
Fixes: lp:1751960
* https://bugs.launchpad.net/kicad/+bug/1751960
2018-03-07 20:41:10 -05:00
Wayne Stambaugh 1ae721442c Pcbnew: fix invalid footprint name illegal character list.
Footprint names cannot contain ':', '\n', or '\r'.
2018-03-07 14:19:07 -05:00
Jon Evans dfb0dc4dd5 Change algorithm for GetBoundingPoly() to something that works better 2018-02-22 07:58:47 -05:00
Jeff Young c69db55c1f Fix regression in auto-selection-disambiguation.
Fixes: lp:1646339
* https://bugs.launchpad.net/kicad/+bug/1646339
2018-02-22 11:31:11 +01:00
Jon Evans 01ab8b0584 Use polygonal hit testing for module selection 2018-02-20 10:43:43 -05:00
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras e499d337d8 rename files: update filenames in sources 2018-01-28 19:12:26 +01:00
Jeff Young d4ddc009e1 Don't include module drawings in coverage ratio calculation.
If we do, we'll almost always conclude that coverage is near 100%
due to the outline drawing.

Fixes: lp:1743164
* https://bugs.launchpad.net/kicad/+bug/1743164
2018-01-16 13:45:32 +01:00
Camille 9ff66a5274 Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
Jon Evans a4bb6ec3e4 Allow selecting footprints that are only silkscreen using silk layers
In high-contrast mode, items that don't exist on the current layer are
not selectable, but this is problematic since there are library
components that only exist in the silkscreen layer (logos, etc).

By adding one of the silkscreen layers to the ViewGetLayers() output,
these components are now editable when viewing the silkscreen layer in
high-contrast mode.  Silkscreens attached to footprints that have pads
or drawings on non-silkscreen layers are still not selectable.

Fixes: lp:1741350
* https://bugs.launchpad.net/kicad/+bug/1741350
2018-01-07 14:12:50 -05:00
jean-pierre charras 11d1188fdf MODULE::CoverageRatio(): replace wxRegion (not working for us on Windows) by polygons to calculate areas.
At least on Windows, using wxRegion generates crashes.

Fixes: lp:1740646
https://bugs.launchpad.net/kicad/+bug/1740646
2017-12-31 17:46:56 +01:00
Jeff Young 0f943f1e4b Disambiguation menu fix for footprints with a single pad.
Fix selection disambiguation to allow for selecting of footprints which are
mostly covered by their pads, text, etc.

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

Fixes: lp:1723469
* https://bugs.launchpad.net/kicad/+bug/1723469
2017-12-28 15:36:34 -05:00
jean-pierre charras bdc6a5950b rename plot_common.h to class_plotter.h, a better name, consistent with other class definitions. 2017-11-16 15:53:30 +01:00
Tomasz Włostowski 0245912c34 refactoring: split BOARD_ITEM::SwapData to use polymorphic per-item methods 2017-11-03 20:02:06 +01:00
Tomasz Włostowski 90ab5860dc refactoring: removed dependency of libpcbcommon on 3d-viewer. 2017-11-03 20:01:42 +01:00
Maciej Suminski cca63801bf Renamed D_PAD::{Set,Get}PadName() to D_PAD::{Set,Get}Name() 2017-09-19 18:23:50 +02:00
Maciej Suminski 85be485c34 Enable long names for pin numbers and pads
- pad names are stored as wxString instead of a char[4] & integer union
- removed pad name to string conversion functions
- fixed pad & pin properties dialog restrictions regarding the name
length
2017-09-19 18:19:49 +02:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

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

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Oliver Walters 9c80d63b5c Fixed HitTest for text and modules 2017-05-10 10:57:28 +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
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04: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 ecdfa404cb More work courtyard overlap detection: better code. 2017-03-20 13:06:00 +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
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 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
Maciej Suminski 89055c4425 Code formatting 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
jean-pierre charras 45e67d25dd Fixes: lp:1635018 (Per-footprint tedit timestamp updated even when footprint isn't (updated at loading time, not after edit))
https://bugs.launchpad.net/kicad/+bug/1635018
2016-10-20 13:20:00 +02:00
Simon Richter b0f9864bc4 Clean up warnings from exception handlers
The exception objects caught are either not referenced at all, or only in
debug builds. This avoids the warnings for the unused variables.
2016-10-10 11:08:49 -04:00
Tomasz Wlostowski a5b7a7ca0a Changed DuplicateAndAddItem() to parametrized Duplicate(). 2016-09-12 11:50:06 +02:00
Maciej Suminski 0bf553b06c Recompute local coordinates when an object is added to MODULE. 2016-09-12 11:50:06 +02:00
Maciej Suminski a5d32bbd63 Moved method descriptions from .cpp to .h. 2016-09-12 11:50:06 +02:00
Maciej Suminski b897c5f290 BOARD_ITEM_CONTAINER class. 2016-09-12 11:50:06 +02:00
Maciej Suminski 09e0311d4e Replaced Copy() method with operator=. Removed Copy() where default copy ctor was enough. 2016-09-12 11:50:06 +02:00
Mrio Luzeiro d8eab321f7 3D Viewer: complete refactor of the 3D viewer.
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
  for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.
2016-07-19 13:35:25 -04:00
Dick Hollenbeck c2b8a4ee43 Move from class INSPECTOR as the EDA_ITEM::Visit() callback interface to a std::function
callback.  This improves conciseness and encourages use of Visit() due to the lower cost
of entry in C++.
2016-07-12 15:05:54 -04:00
Michael Steinberg fde12ebd25 Replace boost::function and boost::bind with their std:: counterparts 2016-06-29 12:23:11 +02:00
Maciej Suminski cef45c0297 Hide all related layers when footprint rendering is disabled. 2016-06-07 15:07:47 +02:00
jean-pierre charras e2cc78b2b5 Code cleanup: remove dead code (some removed methods were broken), and update or add comments. 2016-06-01 11:28:07 +02:00
jean-pierre charras e46f706d4b Add Set/GetOrientationDegrees and GetOrientationRadians for texts, pads and footprints to avoid internal units to usual angle units conversion in code (and avoid mistakes).
It should help if (or when) the internal angle unit used in kicad will be changed from 0.1 degree (a relic of code written for PCs without fpu) to degree ( a more natural unit).
2016-05-02 12:49:14 +02:00
jean-pierre charras 44fc6cb337 Fix issue: "Malformed footprint causes crash on load" (in fact, no crash: just an assert dialog is shown) 2016-03-13 16:39:18 +01:00
jean-pierre charras b237d81b75 Create Array dialog: some fixes:
*  No initial copied object changed (this was a serious bug to modify these objects. Previous version modified references and other texts using a very stupid algorithm).
  It also fixes bug 1549231
* only new pads are numbered (therefore renumbering is used only in footprint editor)
*  remove not working and useless feature in circular array: now  only use number for pads (others options using alphabetical letters are removed: did not work corectly, and were useless)
* a more clear option is used to choose if the pads are numbered from a choosen value, or from the first avaible value
* Adding a warning messsage if a parameter is incorrect.
2016-03-07 08:13:06 +01:00
Tomasz Wlostowski ee3418e90b One-click PCB update improvements
- Fix repetitive undo/redo segfaults & assertions.
- Add Update menu entry on PCB side.
- Fix Python build error
- Add spread footprints after updating
2016-01-29 15:43:40 +01:00
Tomasz Wlostowski 5ef6001e06 pcbnew: support for removing NETINFO_ITEMS from BOARD for proper netlist undo 2016-01-29 11:29:56 +01:00
jean-pierre charras a356293fee Cvpcb: Fix incorrect unique pad count for footprints using mixed letters/digits in pad name (like AA12, AB12 or Anod for instance.) and skip pads with no pad name. 2015-11-13 12:32:42 +01:00
Damien Espitallier 16c2c398e9 CvPcb: count unique pin numbers when filtering by pin count. (fixes:1300719) 2015-11-11 13:35:26 -05:00
unknown 1ee7458140 1. Fixed copy paste error in append_board_to_current.cpp ruining a if else condition, should fix a possible bounding box computation bug
2. Whole bunch of pointless casts removed
3. Unused variables removed
4. Fix bug caused by JP on April 25, 2015 where strings were adjusted for translation and the hotkeys section table accidentally swapped the footprint editor title with tag, resulting in "footprint editor" being exported instead of "[footprinteditor]"
No functional changes besides #4, technically it'll "break" imports hotkeys files but April 25 broke imports as well.
2015-11-04 09:48:34 +01:00
jean-pierre charras 77f1d8a848 Pcbnew: Fix a bug in exchange footprints: if a set of pads having the same name (complex pads) is found in a footprint, not all pads of this set have the netname updated (however reading the netlist fixes this isssue). 2015-10-28 19:45:20 +01:00
jean-pierre charras d63c017a0a Exchange footprints: remove duplicate code, and keep the "Locked" attribute state after exchange/replace. 2015-10-22 18:50:27 +02:00
jean-pierre charras 4fc230b773 Rework on Enum PAD_SHAPE_T, PAD_DRILL_SHAPE_T and PAD_ATTR_T (see rev 6008) : the new and better names are now used in Kicad code and existing python scripts.
PAD_SHAPE_T  and PAD_ATTR_T still have a double definition (new names and old names) to be sure python scripts are nor broken by the change.
 PAD_DRILL_SHAPE_T does not  have a double definition, because it is unlikely oblong holes are used in python scripts.
Double definitions will be removed in the (next) future.
2015-08-23 21:40:33 +02:00
unknown cc7549a2a5 * Python scripting: brings pad.GetZoneConnection() and in example pad.SetZoneConnection(pcbnew.PAD_ZONE_CONN_FULL) to full workable.
* Cleanup namespace  in enum ZoneConnection in pcbnew/zones.h to self-explained names unification:  PAD_ZONE_CONN_INHERITED, PAD_ZONE_CONN_NONE,PAD_ZONE_CONN_THERMAL,PAD_ZONE_CONN_FULL, PAD_ZONE_CONN_THT_THERMAL
2015-08-18 16:19:17 +02:00
jean-pierre charras 75d02086ad Modedit: fix a minor bug in footprint transform (polygons not mirrored or rotated in global footprint transform).
Code cleaning: in class EDGE_MODULE and TEXTE_MODULE, remove duplicate methods for  fp edition (about rotation, mirroring and move) and add comments.
2015-07-31 21:04:30 +02:00
unknown 71b3125d8e Cleanup: remove unnecessary macros EXCHG and NEGATE. add MIRROR macro. 2015-06-26 15:41:56 +02:00
Maciej Suminski d3b31316ba Fixed module text visibility settings (GAL). 2015-06-16 17:03:36 +02:00
jean-pierre charras 9c43d6f22b Very minor fixes: 3D viewer: remove artifacts with NPTH pads having the save size as their hole. Kicad: remove duplicate submenu in menubar. remove a minor coverity warning 2015-03-23 09:28:12 +01:00
https://launchpad.net/~john-j-beard 0350290499 Fix Bug #1426675 (Undo and cancel commands don't have effect for Duplicate operation in legacy mode) 2015-03-22 10:42:41 +01:00
jean-pierre charras 2427b40271 Fix Bug #1431423 (pcbnew: edited 3d model filename is not saved).
Eechema, libedit, pin dialog editor: show pin texts  in pin  preview canvas.
2015-03-12 18:43:39 +01:00
jean-pierre charras f16e083ecf Fix minor bug #1429990 (3D viewer shows hidden footprint graphic texts ). Fix minor coverity warnings (not initialized members and dead code) 2015-03-11 14:59:43 +01:00
Maciej Suminski 0dd9efd9db Merged the differential pair router & length tuning tool. 2015-03-03 11:50:50 +01:00
jean-pierre charras 4bab8dde65 Fix some minor coverity warnings. Fix a bug in pcad2kicad plugin. Scripting: map BASE_SET. Rename some python bom scripts with better names. Fix erroneous comments and add comments 2015-03-02 09:28:49 +01:00
jean-pierre charras d6c6b4debb Fix some coverity warnings (mainly not initialized vars). 2015-02-27 15:33:13 +01:00
jean-pierre charras c1978b3242 Pcbnew: fix crash when undoing a move exact pad in board editor.
Fix also very minor warnings detected by cppcheck.
2015-02-22 10:39:58 +01:00
Maciej Suminski f06690c8d3 Merged lp:~john-j-beard/kicad/moveexact. 2015-02-18 20:27:00 +01:00
Maciej Suminski 4fb9bce354 Code formatting. 2015-02-18 17:53:46 +01:00
jean-pierre charras 63d3c835cb Pcbnew: refinement to Bug #1422093 fix. 2015-02-18 10:13:17 +01:00
Tomasz Włostowski da9fc84421 improved module locking: lock pads only/lock whole module mode added 2015-02-18 00:58:14 +01:00
jean-pierre charras 39497b109e Pcbnew: fix Bug #1422093 (pcbnew crashes after editing a footprint cominng from the board with the fp editor and saving it on a librray and trying to load it to the board)
Some other very minor fixes.
2015-02-17 17:32:47 +01:00
Maciej Suminski b0ad779ee4 Calming down the Coverity report. 2015-02-15 23:21:52 +01:00
John Beard 8c6313ac1a Extend arrays and duplicate to pcbnew (GAL and legacy), covering modules, text, lines, tracks, dimensions and targets.
Text arrays can now use "%s" as a placeholder to be substituted with the array index.

Also expand menu options for move exact, arrays and duplicate.

Minor fixes for arrays - use proper unit parsing, add numbering start for circular arrays

Add circle radius indicator to array dialogue
2015-02-12 03:22:24 +00:00
John Beard 4f3672da4d Add "move exact" and "duplicate" tools to pcbnew 2015-02-12 03:22:24 +00:00
jean-pierre charras 79e2a41469 Pcbnew: Fix potential bug in DRAG_SEGM_PICKER (a variable type bool was used as int. type is now int). Minor code cleanup. 2015-01-19 09:23:10 +01:00
Wayne Stambaugh 1dc5178095 Message panel consistency improvements and coding policy fixes.
* Make title capitalization consistant.
* Replace some instances of module with footprint.
* Use angle instead of orientation where appropriate.
* Remove abbreviations where it made sense.
* Coding policy fixes.
2014-11-15 14:06:05 -05:00
Maciej Suminski 15aa24afe8 pcbnew: Modules can be selected with block selection tool without including texts & references (GAL). 2014-11-13 17:32:59 +01:00
Mark Roszko fbc4abc55a Update module to footprint in the little info bar at bottom of window
Fix text in Get and Move Footprint Dialog
Fix right click in board editor options
2014-10-08 02:26:26 -04:00
jean-pierre charras 70a61b8028 Pcbnew: fix Bug #1373267 (polygons in footprint outlines do not flip correctly)
Minor other fixes.
2014-09-24 18:42:56 +02:00
Lorenzo Marcantonio 260ca0e79f Added support for decoupling stored text from shown text in EDA_TEXT
Factored out text ellipsing support to max 15 character (for generating menu items)
2014-09-13 20:15:45 +02:00
Lorenzo Marcantonio 424aac6cf2 TEXTE_MODULE cleanup in preparation for text on different layers
- Removed the friends MODULE and FOOTPRINT_EDIT_FRAME from TEXTE_MODULE
  (as in the @todo comment)

- Refactored the Rotate/Flip/Mirror for text in modules into the
  TEXTE_MODULE class itself (members RotateWithModule, FlipWithModule,
  MirrorWithModule)

- New behaviour in coloring text on screen: reference and value still
  take the color from the MOD_TEXT_FR_VISIBLE and MOD_TEXT_BK_VISIBLE
  visibles; other text takes the color of the layer containing it
  (except when hidden, obviously) but still get its visibility
  controlled by those visibles (probably the most intuitive and useful
  behaviour)

- Still need to decide: should text on a layer be hidden when the layer
  is? Probably yes (still to be implemented);

- Some comment fixed and many cast converted to static_cast
2014-09-10 17:18:42 +02:00
jean-pierre charras 5a38d2b657 Rework on env. variable KISYS3DMOD. Until now, was used in different files using different ways, so no consistency between files.
code cleanup.
2014-08-24 09:05:07 +02:00
Maciej Suminski 03a17a284b bugfix: modules are not selectable in the high contrast mode (GAL). 2014-08-04 10:06:24 +02:00
Maciej Suminski 5f297726ca Module anchors are visible in GAL canvas. 2014-07-09 15:02:56 +02:00
Maciej Suminski ae431bbb05 Added MODULE::Add( BOARD_ITEM* )/Remove( BOARD_ITEM* )/Delete( BOARD_ITEM* ).
Removed MODULE::AddPad().
2014-07-09 14:22:29 +02:00