Commit Graph

3439 Commits

Author SHA1 Message Date
Wayne Stambaugh b8c00a0d07 Fix hierarchical schematic file sheet path bug.
Sheet file name paths were not being saved and restored properly under
certain conditions when walking the sheet hierarchy causing schematic
load errors.

Changed debugging output to use wxLogTrace left over from last fix.

Fixes lp:1748401

https://bugs.launchpad.net/kicad/+bug/1748401
2018-02-14 13:45:41 -05:00
Seth Hillbrand fd0b364b91 Eeschema: Ensure all items in a block are deleted
Deleting lines can create new ones when old lines are merged as the
result of a delete operation.  This checks that all items inside a
selection block are deleted before finishing.

Fixes: lp:1748907
* https://bugs.launchpad.net/kicad/+bug/1748907
2018-02-14 13:16:42 -05:00
Jeff Young 4bae901dc8 Centralize zoom-to-fit code.
Fixes a bunch of errors:
- libedit and libbrowser would zoom to bounding box but centre on canvas
- libedit, libbrowser and gerbview didn’t take the scroll bars into account
- pcbnew didn’t take scroll bars into account or apply the 10% margin
- appending a board file would re-centre, but not re-zoom

Fixes: lp:1504302
* https://bugs.launchpad.net/kicad/+bug/1504302
2018-02-13 20:06:03 -05:00
Maciej Suminski ac9fc949bd Code formatting for 013f7b4d 2018-02-13 14:56:11 +01:00
Russell Oliver 34b52c91b7 Add empty eeschema page layout for Eagle schematic import.
Fixes: lp:1729722
* https://bugs.launchpad.net/kicad/+bug/1729722
2018-02-13 14:56:11 +01:00
jean-pierre charras a1af13f34d replace '%s' by \"%s\" in a few sentences to be consistent with all other messages 2018-02-13 10:22:05 +01:00
Maciej Suminski c9d9cec6ad LIB_MANAGER: exception handlers display error messages 2018-02-13 08:50:51 +01:00
Jeff Young ac09cfaef4 Wire up <return> for eeschema find dialog.
Fixes: lp:1749026
* https://bugs.launchpad.net/kicad/+bug/1749026
2018-02-12 19:41:34 -05:00
Wayne Stambaugh 01faca2799 Fix release build error caused by previous commit. 2018-02-12 13:36:03 -05:00
Jeff Young 9d26253b2c Don't rely on live pointers in search data.
Try as you might to keep them fresh, there's no gaurantee.
Instead, just treat them as weak references and search the
existing items for a pointer-value match.

This also allows us to remove some code which kept recycling
the search position back to the start ever time a replace
was done.

Fixes: lp:1559258
* https://bugs.launchpad.net/kicad/+bug/1559258
2018-02-12 11:46:39 -05:00
Russell Oliver e340e8a838 Eagle Schematic Import: Label Placement fix.
Extra labels to preserve eagle named nets feature are now placed at the
end of a wire segment instead of the middle of a wire. Prevents a label
being placed on crossing wires that are not connected by a junction
resulting in an incorrent netlist.
2018-02-12 15:35:28 +01:00
Jeff Young 0bbf961881 Clean up Cancel vs Close buttons in dialogs.
Many had already been fixed but weren't working on Mac because
of the DIALOG_SHIM hack (now fixed).  Others hadn't been updated
yet.  Also includes some cleanup for elipses in buttons and
layout.

Fixes: lp:1748506
* https://bugs.launchpad.net/kicad/+bug/1748506
2018-02-10 17:53:12 -05:00
Jeff Young 1afbfad44a Use "..." uniformly in menus.
See the bug report for some wording changes and a couple of
menu restructurings that were also cleaned up.

Fixes: lp:1597827
* https://bugs.launchpad.net/kicad/+bug/1597827
2018-02-10 17:32:28 -05:00
jean-pierre charras dba198e576 Fix code after renaming files
Change class names according to the new name of the main dialog
2018-02-09 17:36:54 +01:00
jean-pierre charras 35a0688bf7 rename dialog_bom_editor* files to dialog_fields_editor_global*
rename also associated files
2018-02-09 17:36:52 +01:00
Kristoffer Ödmark 8f4a954236 Differ the dialog text for when choosing power-symbols and all symbols 2018-02-09 11:00:32 +01:00
Maciej Suminski 2c3a7c9dc4 CMP_TREE_MODEL: Reset SearchTextNormalized flag when a node is updated 2018-02-09 11:00:32 +01:00
jean-pierre charras 07fff6ed35 Eeschema, choose component dialog: remember the relative size of the component tree and the symbol viewer canvas during a session 2018-02-09 08:08:14 +01:00
Michael Geselbracht b04b1dcfb5 Update fields: Add option to omit empty fields
Fixes lp:1747405

https://bugs.launchpad.net/kicad/+bug/1747405
2018-02-08 21:05:10 -05:00
Jeff Young 6c61a46721 Rationalize label orientations for dialog display.
Fixes: lp:593795
* https://bugs.launchpad.net/kicad/+bug/593795
2018-02-08 20:16:26 -05:00
Jeff Young 17ce87a7a5 Add library descriptions to component tree.
Fixes: lp:1747547
* https://bugs.launchpad.net/kicad/+bug/1747547
2018-02-07 08:45:33 +01:00
Chris Pavlina d1a45d1476 Remove icon scaling diagnostic from eeschema 2018-02-05 19:49:07 -07:00
Wayne Stambaugh 00749af914 Eeschema: fix using subpaths in sheets.
Fix double path name issue when using sheet file name paths that differ
from the project path.

This fix also allows for nesting schematics in subfolder in multiple
root paths.

Fixes lp:1745109
https://bugs.launchpad.net/bugs/1745109

Fixes lp:1735982
https://bugs.launchpad.net/bugs/1735982
2018-02-05 17:07:33 -05:00
Maciej Suminski 351a8d72b8 Better test whether a symbol library is saved to its original file
File names can be reliable compared only after normalization. The
problem is the easiest to observe on Windows, where one can use slash or
backslash as path separator, so even though C:/file.txt and C:\file.txt
pointed to the same file - simple string comparison would indicate they
are different files.

Fixes: lp:1744724
* https://bugs.launchpad.net/kicad/+bug/1744724
2018-02-05 17:04:10 +01:00
jean-pierre charras 821668d96c rename class_collector.h to collector.h 2018-02-04 10:49:37 +01:00
Seth Hillbrand fddd5abef1 Merges a line after manually removing its junction.
Fixes: lp:1746998
* https://bugs.launchpad.net/kicad/+bug/1746998
2018-02-03 10:50:10 +01:00
Maciej Suminski 0668cd9d4c Symbol Library Editor: save sym-lib-table only if it had been modified 2018-01-31 10:46:39 +01:00
jean-pierre charras 39b4afecfa fix code after file renaming 2018-01-31 09:24:02 +01:00
Jeff Young 99ad5cf394 More performance optimizations for symbol libraries
1) don't call UI-level LIB_PIN routines when reading library --
not only are they a performance hit, they set the modified flag
too
2) limit progress dialog updating to 15 times a second (this
had crept back up to 31% of the time spent loading libraries)

Fixes: lp:1734773
* https://bugs.launchpad.net/kicad/+bug/1734773
2018-01-30 10:31:51 -05:00
jean-pierre charras 8022f1cc01 fix code after renamin files 2018-01-30 11:49:51 +01:00
jean-pierre charras 833d6223a0 rename files 2018-01-30 11:08:03 +01:00
jean-pierre charras 2bc9cac234 rename files 2018-01-30 10:51:55 +01:00
jean-pierre charras 1f88b466de move SCH_EDIT_FRAME methods from netlist.cpp to netform.cpp 2018-01-30 10:45:35 +01:00
jean-pierre charras 795a36c9fe Fix code after renaming files, and a bit of code cleanup (remove useless includes and multiple includes of the same files) 2018-01-30 09:57:25 +01:00
jean-pierre charras 87a437c26e rename files in eeschema 2018-01-30 09:57:22 +01:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras d0754acf00 Fix code after renaming files 2018-01-29 11:37:29 +01:00
jean-pierre charras d44494beda Update code after file renaming 2018-01-29 09:39:49 +01:00
jean-pierre charras 4c5bd01887 Rename a few files 2018-01-28 22:02:31 +01:00
jean-pierre charras e499d337d8 rename files: update filenames in sources 2018-01-28 19:12:26 +01:00
Jeff Young 899afa1e90 Reinstate OSX cursor shape selection
Mark it as not supported in Legacy graphics.

Fixes: lp:1745097
* https://bugs.launchpad.net/kicad/+bug/1745097
2018-01-28 10:47:20 -05:00
Martin Sivak d5cdd78062 eeschema: keystroke zoom should obey disabled centering
Keystroke zoom (F1/F2) always centered the screen, because it
was handled as ID_POPUP_ZOOM_IN event. Mousewheel scrolling
was ok, because it is handled using different event based
on the configuration.

This patch introduces special event ids for keystroke
zooming that are then properly translated to either
ID_POPUP_ZOOM_IN or ID_OFFCENTER_ZOOM_IN depending
on the configuration.

The same issue is fixed for legacy canvas pcbnew.

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

Signed-off-by: Martin Sivak <mars@montik.net>
2018-01-27 20:20:32 -05:00
Jeff Young 7a28f3d4cf Implement undo/redo for origins in legacy
PICKED_ITEMS_LIST knows the architecture of the undo commands so
that it can delete those ITEMs which it owns.  This represents poor
encapsulation so instead of adding yet another case, I added a
UR_TRANSIENT item flag which is set by callers whenever they create
new objects to “give to” the undo/redo stack.  This allowed some
cleanup of other code, but cleaning up UR_DELETE and UR_WIRE_IMAGE
will be a bigger task and have to wait for another day.

Fixes: lp:1542018
* https://bugs.launchpad.net/kicad/+bug/1542018
2018-01-27 19:51:44 -05:00
Jeff Young f88c4ccb02 Add an Edit button to the Symbol Properties aliases list
Fixes: lp:1248451
* https://bugs.launchpad.net/kicad/+bug/1248451
2018-01-27 18:57:33 -05:00
Jeff Young 829c236437 Symbol library load performance enhancements.
1) Edit Symbol gets similar fix as Place Symbol
2) progress dialog updating reduced to once every 50ms
3) SearchText gets lazy normalization
4) TypeNames get lazy translation
5) default fieldNames get translated a single time per language change

These fixes reduce first-load-time of both Edit Symbol and Place Symbol
by about 2/3, and second-load-time of Edit Symbol to near-instantaneous.
2018-01-27 08:29:43 -05:00
jean-pierre charras 54ebd45749 DIALOG_EDIT_COMPONENT_IN_SCHEMATIC: ensure mandatory field names are always correctly translated after changing the locale. 2018-01-26 20:21:12 +01:00
Tomasz Włostowski 7a6e3bf3ed eeschema: remember last browsed directory in the Symbol Lib Table dialog 2018-01-26 18:39:09 +01:00
jean-pierre charras d54418c14a Fix minor compil warnings 2018-01-26 09:35:22 +01:00
ludovic léau-mercier 0d532b43de Support .title directive in spice netlist exporter
Spice netlist exporter processes all texts on the exported schematic
sheet to find spice directives and include them in the output file.
By default it also added ".title KiCad schematic" in the first line, so
if there was another .title directive in the exported schematic sheet,
the generated file would contain two .title directives.

This patch looks for .title directive and when one is found - it uses
the specified title in the first line.
2018-01-26 08:57:35 +01:00
Maciej Suminski 8e18aea11d New ERC rule verifying if all units of a component use the same footprint 2018-01-25 12:19:41 +01:00
Maciej Suminski 0ef785981b Add pin numbering exception to sync pin edit mode description 2018-01-25 12:08:29 +01:00
Maciej Suminski 6c32b6f955 Pin edit coupling: renamed and changed the description
This commit aims at making the pin edit coupling easier to understand.
It renames the mode to 'synchronized pin edit', shortens the description
and inverts the logic to avoid double negation.

To make the code clearer, two items have their name changed to fit the
new description:
- m_editPinsSeparately       -> m_syncPinEdit
- ID_LIBEDIT_EDIT_PIN_BY_PIN -> ID_LIBEDIT_SYNC_PIN_EDIT
2018-01-25 11:45:34 +01:00
Seth Hillbrand 7a2d9dff62 Sets additional conditions for when a wire is trimmed
This adds a set of conditions that will prevent a wire from being
automatically trimmed.  Wires that are currently being moved or are
newly created or are explicitly avoided will not be removed.  This also
adds a function to set a flag on items in a block.

Fixes: lp:1744632
* https://bugs.launchpad.net/kicad/+bug/1744632
2018-01-24 19:47:14 -05:00
Wayne Stambaugh 2b460bc1ff Eeschema: improve alias load performance.
Don't use wxFileName == operator when comparing cache file name.  There
is a lot of overhead the wxFileName == operator that is not necessary
so just do a comparison with the original string used to create the
cache.
2018-01-24 19:37:07 -05:00
Jeff Young eb7ecf1dfd Load each symbol library atomically for better performance. 2018-01-24 19:21:56 -05:00
Maciej Suminski a99d0c44e1 Code comments 2018-01-24 15:18:19 +01:00
jean-pierre charras 270a63daac DRAWSEGMENT, S_POLYGON shape: remove useless copies or conversion to std::vector<wxPoint> of SHPE_POLY_SET polygon shape.
Rename GetPolyPoint() to BuildPolyPointsList(), because GetPolyPoint() looks like an accessor, but it is not an accessor.
(Using it as accessor can creates a *very long calculation time* for very basic access to polygon vertices)

Fixes: lp:1745050
https://bugs.launchpad.net/kicad/+bug/1745050
2018-01-24 14:22:43 +01:00
Jeff Young c6d0075076 Keep value, footprint and datasheet in sync in multi-unit parts
Fixes: lp:1731743
* https://bugs.launchpad.net/kicad/+bug/1731743
2018-01-23 11:46:27 -05:00
Jeff Young 76885169c4 Fix delete issues in symbol aliases list in libedit.
The alias list now displays the user model (multiple aliases *of*
a root part, rather than a collection of names *including* the
root part).  This simplified the error detection logic, fixing
the first bug in the bug report.

Updating the part in the library is now done uniformly on OK
(which was the second bug in the bug report).

Fixes: lp:1744656
* https://bugs.launchpad.net/kicad/+bug/1744656
2018-01-23 14:49:20 +01:00
Maciej Suminski cbf433fe04 Symbol Library Editor: save anchor position when modified
OnModify() stores the edited symbol in its edit buffer, therefore it has
to be called after a modification.

Fixes: lp:1744540
* https://bugs.launchpad.net/kicad/+bug/1744540
2018-01-23 14:04:31 +01:00
Maciej Suminski 2d3ef0fa6e Symbol Editor: Remove a redundant separator from symbol context menu 2018-01-23 12:19:19 +01:00
Maciej Suminski 6b9a286a85 Fix crash when a renamed part is saved
The crash happened when during rename operation, when the original part
buffer has been marked as deleted, but its memory was not yet freed. The
renamed part was still using the original SCH_SCREEN object, which was
freed together with the original part buffer.
2018-01-22 17:46:30 +01:00
jean-pierre charras 6322c90c50 Symbol editor: Fix incorrect pin edition coupling for non interchangeable multi-units symbols.
Fixes: lp:1744680
https://bugs.launchpad.net/kicad/+bug/1744680
2018-01-22 13:33:24 +01:00
Jeff Young 2201482e47 Add '*' to modified files in libedit cmptree, and change highlighting.
The highlight colour on some platforms (OSX, for instance)
renders nearly invisible against a white background.  However,
wxWidgets doesn't handle background colours on OSX and GTK+.
A separate commit to the new kicad/wxWidgets fork fixes OSX,
and we continue to use the old highlighting on GTK+

Fixes: lp:1741719
* https://bugs.launchpad.net/kicad/+bug/1741719
2018-01-22 10:37:06 +01:00
Jeff Young 6b9866de8b Sort pins in pin-table.
Fixes: lp:1744509
* https://bugs.launchpad.net/kicad/+bug/1744509
2018-01-21 08:47:26 +01:00
Jeff Young cba430deab Fix undo/redo and revert for libedit name changes and aliases
Three interrelated issues:
1) Implement an undo/redo type for renames so that we know to delete
the old lib entry and add a new lib entry
2) When doing so (for the undo/redo OR the original edit), we must
make a copy of the 'original' LIB_PART which is used for revert, and
hand it to the new lib entry
3) When comparing a modified component tree item with the current item
we must also check for aliases.

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

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

Fixes: lp:1744373
* https://bugs.launchpad.net/kicad/+bug/1744373
2018-01-20 11:20:22 +01:00
jean-pierre charras 448dbf476c Dialog symbol lib table editor: fix incorrect tool tips
Fixes: lp:1744416
https://bugs.launchpad.net/kicad/+bug/1744416
2018-01-20 10:47:19 +01:00
jean-pierre charras d4dbdcd638 Symbol editor, Pin table editor: always display a icon in Pin Type column
At least on Linux, if a null icon is used as icon in Pin Type column, other icons are not
displayed. So the workaround is to use a neutral icon when a specific icon cannot be used
(i.e. when pins are grouped)

Fixes: lp:1559542
https://bugs.launchpad.net/kicad/+bug/1559542
2018-01-20 09:59:15 +01:00
jean-pierre charras afeaf909fa Better error message 2018-01-19 11:51:01 +01:00
Jon Evans 10b635ffe2 Clear autoplaced flag when modifiying field orientation/justification
Fixes: lp:1743893
* https://bugs.launchpad.net/kicad/+bug/1743893
2018-01-19 10:09:00 +01:00
Jeff Young 959767c09f Don't warp mouse when context menu was cancelled.
Fixes: lp:1674199
* https://bugs.launchpad.net/kicad/+bug/1674199
2018-01-18 13:43:24 -05:00
Maciej Suminski 8721f7ed70 Changed remaining occurences of 'part' to 'symbol' in the symbol editor 2018-01-18 11:24:02 +01:00
Jeff Young 17e6720bc9 Implement undo for eeschema's "Import existing drawings"
Fixes: lp:1522189
* https://bugs.launchpad.net/kicad/+bug/1522189
2018-01-17 15:30:36 -05:00
Seth Hillbrand 2fa5c723d8 Don't cleanup schematic when symbols are rescued.
Schematic cleanup only makes sense after the libraries are fully updated
and loaded.  Before pin caching, this was a minor difference but once we
needed to update pin caches, schematic cleanup can remove junctions from
pin-wire connections incorrectly.

Instead, we use the global OpenProjectFiles() schematic cleanup call to
be sufficient and not call a second time, prior to all libraries being
rescued and loaded.

Fixes: lp:1743148
* https://bugs.launchpad.net/kicad/+bug/1743148
2018-01-17 12:53:38 -05:00
Maciej Suminski 60963fe2fc Fixes for 590cac9d
The original patch did properly recognize the case when all transient
source definition fields are empty, which is perfectly valid.
2018-01-17 10:37:57 +01:00
Dan Weatherill 590cac9d55 Fix transient SPICE source field check logic
Fixes: lp:1743486
https://bugs.launchpad.net/kicad/+bug/1743486
2018-01-17 10:36:35 +01:00
Maciej Suminski ac1771a9f0 Handle block selection removal of libraries in SYMBOL_LIB_TABLE dialog
Fixes: lp:1741543
* https://bugs.launchpad.net/kicad/+bug/1741543
2018-01-17 09:59:48 +01:00
jean-pierre charras 2e79b93b99 Eeschema: fix issue (2 tools not working in left vertical toolbar) created by commit 7e6a6540c8 2018-01-16 19:39:31 +01:00
Jeff Young 947a4839fd Use generic Save (and New and Open) commands where unambiguous.
Fixes: lp:1743426
* https://bugs.launchpad.net/kicad/+bug/1743426
2018-01-16 08:39:12 -05:00
Oliver 195b85b0c5 Cleanup of KiCad Icons
Major cleanup of many icons (started as a simple effort to tweak libedit and modedit icons)
Ref: https://lists.launchpad.net/kicad-developers/msg32860.html
* Each application icon has been updated
* Consolidated icon "modifiers" across many icons
* Replaced confusing arrows with "load" and "save" icons
* Slight code updates to reference correct icons
* Consolidate multiple representations of single icon type(s)
2018-01-12 14:06:45 -05:00
Seth Hillbrand 98c8a5ac0c Fix non-conforming signbit test
Fixes: lp:1742803
* https://bugs.launchpad.net/kicad/+bug/1742803
2018-01-12 19:58:33 +01:00
Wayne Stambaugh 41f5c754e5 Eeschema: fix minor component tree model bug.
The component tree model was always saving the root symbol name which
prevented the actual alias from be selected in the symbol chooser
dialog.  This also prevented the correct documentation information
from being shown in the information panel.

Fixes lp:1740742

https://bugs.launchpad.net/kicad/+bug/1740742
2018-01-12 11:59:26 -05:00
Wayne Stambaugh 3c9316957d Eeschema: allow remapping if a project symbol library table exists.
Change the behavior of the remapping algorithm to remap even if a
project symbol library table exists in the project file in case a
previous attempt to remap failed.  The existing symbol library table
is backed up to the back folder and rebuilt.

Fixes lp:1741983

https://bugs.launchpad.net/kicad/+bug/1741983
2018-01-12 10:13:41 -05:00
jean-pierre charras de9161be85 Larger dialog size. 2018-01-11 14:21:36 +01:00
jean-pierre charras 47dfabc6c8 Add size control to HTML_MESSAGE_BOX. Fix incorrect default size of a few dialogs.
Clean code: remove useless code and not used parameters.
2018-01-11 10:48:52 +01:00
Chris Pavlina 7e6a6540c8 Implement primitive icon scaling for high DPI
This is meant as a stopgap for 5.0, with plans to add proper scaled
icons in the 6.0 cycle. A function KiScaledBitmap() is added, which
works like KiBitmap() except it scales the bitmap according to the
calling window's font size. Controls have been added to all the main
applications to let the user select scaling manually (these were omitted
from smaller apps that didn't already have a place to put them).

In addition, in eeschema only, the pixel height of the system font is
shown in the options dialog for diagnostics. This is only for collecting
feedback before 5.0 release from users with different displays and will
be removed.
2018-01-10 21:26:06 -07:00
Wayne Stambaugh 998d9179e9 Eeschema: fix library naming bugs in symbol rescuer and re-mapper.
File names with spaces were causing invalid symbol names in both the
rescue library and the cache which would cause both libraries to fail
to load because library symbol names are not escaped so the spaces
tripped up the library parser.  Replace the spaces in the file names
with hyphens and in both the rescuer and the remapping code so the
library nickname in the symbol library table does not contain spaces.

Update the symbol library table dialog to prevent users from defining
library nicknames with spaces.  This is different than the footprint
library table which allows nicknames with spaces.  This solution is
a temporary fix until the new symbol library and schematic file formats
are implemented.

Fix off by one row in illegal nickname error message in the symbol
library table editor.
2018-01-10 16:04:32 -05:00
jean-pierre charras 87045ea94c Fix tipo and tooltip 2018-01-10 14:48:14 +01:00
Maciej Suminski efe55b6f0a Symbol Library Editor: fix renaming symbols with multiple aliases
Fixes: lp:1737964
* https://bugs.launchpad.net/kicad/+bug/1737964
2018-01-10 12:15:12 +01:00
Maciej Suminski c09cf252c6 Symbol Library Editor: update node information on library sync 2018-01-10 12:04:34 +01:00
Maciej Suminski 12041551a1 Removed unnecessary debug messages 2018-01-10 12:03:53 +01:00
Maciej Suminski 8c42abc10c Symbol Library Editor: fix crash after renaming a symbol
Crash was caused by removal of the selected item from the
wxDataViewModel, which was later accessed in
COMPONENT_TREE::GetSelectedLibId(). To avoid the problem, the selection
is validated before regenerating the tree widget.

Fixes: lp:1740952
* https://bugs.launchpad.net/kicad/+bug/1740952
2018-01-10 08:52:17 +01:00
Maciej Suminski 6e65049a56 Do not modify LIB_ID in LIB_PART::SetLib()
This commit is a partial revert of aa81f5b9 & 445ac505. LIB_ID should
not be modified when a library is assigned to its part, as the library
nickname cannot be evaluated during the assignment and might be
different than its filename.
2018-01-10 08:52:17 +01:00
Camille f5f7ba4746 Fix loop variable copy in for-range loop, use const reference instead 2018-01-09 19:18:44 -05: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
Camille 3168d03fe5 Fix unnecessary copy initialization detected by clang-tidy 2018-01-09 18:22:10 -05:00
Wayne Stambaugh 28692c40e1 Eeschema, project rescue bug fix and other minor improvements.
Fix a bug where the full LIB_ID was not being used to look up the name
of the symbol in the cache library preventing the rescue to work when
rescuing symbol library table projects.

Add information as to why a symbol was rescued rather than only showing
what symbols were rescued.

Do not add rescue suffix to symbol name for symbol library table rescues
because if a symbol name exists in multiple libraries that need rescued
at the same time will cause subsequent symbol rescues to be overwritten.
Append the nickname of the schematic symbol library to prevent symbol
name clashes in the rescue library.
2018-01-09 15:41:26 -05:00
Wayne Stambaugh 00fb70088f Eeschema: fix progress dialog title capitalization. 2018-01-09 10:58:01 -05:00
Wayne Stambaugh 69560ec587 Eeschema, fix bug in edit one field dialog.
Verify the library symbol of the field being edited still exists rather
than use an assertion because it is entirely feasible that the library
symbol or library containing this symbol has been deleted and will cause
a segfault.  Unfortunately there is no way to determine if the symbol is
a power symbol or not so just set it as a regular symbol so the user can
still edit the schematic symbol field.

Fixes lp:1742111

https://bugs.launchpad.net/kicad/+bug/1742111
2018-01-09 09:20:54 -05:00
Maciej Suminski 82fc038c9b Fixed wxLogTrace for LIB_ALIAS
When a LIB_PART object is removed, it deletes all of its aliases.
When the last one is removed, it tries to report the name of the
parent part, but as it has no aliases - it cannot return a valid name.
2018-01-09 09:55:05 +01:00
Maciej Suminski ee140ce6c8 Symbol Library Editor: do not leave the old part after renaming 2018-01-09 09:55:01 +01:00
jean-pierre charras 019eed0d28 Symbol editor: rework on multi-unit symbols: pin edition synchronization is now only between units (Work in progress)
The synchronization between body styles of the same units is removed.
This is easier to understand by users.
2018-01-09 08:54:48 +01:00
jean-pierre charras 1d2752ee47 Symbol editor: rework on multi-unit symbols are pin edition synchronization between units (work in progress)
User Interface: better tooltips and better messages.
Code: better comments, and better member name.
Fix a few minor issues.
2018-01-09 08:54:47 +01:00
Wayne Stambaugh 0e9c8a4238 Prevent segfault when remapping project with corrupt cache library.
Use the symbol found in the library when the symbol is not in the cache
library.

Add an assert to prevent dereferncing a null pointer in the future even
thought this should not happen as the rescue algorithm does not add a
candidate when a symbol cannot be found in either the cache or any other
library.

Fixes lp:1741964

https://bugs.launchpad.net/kicad/+bug/1741964
2018-01-08 17:33:32 -05:00
Maciej Suminski 7fe6249ac3 Alternative fix for lp:1741050
Calling wxListBox::SetSelection( wxNOT_FOUND ) changes the internal
state of the widget without the intended visual effect (show nothing
selected). It leads to a situation when the default choice is overridden
with wxNOT_FOUND, even though the list box shows a valid value.

As there is no point in calling wxListBox::SetSelection( wxNOT_FOUND ),
the confusing call has been removed.
2018-01-08 16:02:34 +01:00
Maciej Suminski 12c6b3337b LIB_MANAGER does not hold a SYMBOL_LIB_TABLE pointer
SYMBOL_LIB_TABLE might be destroyed without a forewarning, so
it is safer to request it every time it is needed.

Fixes: lp:1741820
* https://bugs.launchpad.net/kicad/+bug/1741820
2018-01-08 15:19:25 +01:00
ludovic leau-mercier 31902f967a Fixed an assert when selected the default semiconductor model
Fixes: lp:1741050
* https://bugs.launchpad.net/kicad/+bug/1741050
2018-01-08 12:53:57 +01:00
Chris Pavlina 6cee19d37d eeschema: neatly wrap placeholder text in symbol chooser 2018-01-07 19:30:56 -07:00
Jon Evans ca264f8982 Add bidirectional net highlight cross-probing
Fixes: lp:1738875
* https://bugs.launchpad.net/kicad/+bug/1738875
2018-01-07 14:12:50 -05:00
jean-pierre charras 504e7a4a51 Very minor fix in a menuitem label 2018-01-07 16:31:15 +01:00
jean-pierre charras 20e66253bb symbol editor: add icons in popup menus of the symbol tree list. 2018-01-07 13:18:18 +01:00
Chris Pavlina c5b2ad9595 simulator: DPI-independent default size 2018-01-06 22:23:58 -07:00
Chris Pavlina 7b1c9c145f DIALOG_BOM_EDITOR: DPI-independent size 2018-01-06 20:37:49 -07:00
Chris Pavlina e971b0e698 Don't call FinishDialogSettings in DIALOG_EDIT_COMPONENTS_LIBID
Dialogs displaying a lot of scrollable data should use SetSizeInDU()
instead, as FinishDialogSettings() will set a minimum size equal to
whatever can contain all the data (making it overflow the screen for
large amounts).
2018-01-06 20:08:57 -07:00
Chris Pavlina 917804ef12 Make eeschema color select widget DPI-independent 2018-01-06 17:29:07 -07:00
Chris Pavlina 119a0f665b DIALOG_SYMBOL_REMAP: raise after remap is complete
On macOS in particular, there is a tendency for this to fall behind
other windows where the user has no clue it's still up.
2018-01-06 14:51:53 -07:00
Chris Pavlina 13bc706518 Fix several dialogs with bad default sizing
- Add helper methods for DPI-independent sizes
- Make splitter sashes visible on macOS
- Remove SetSizeInChars() - wx has a built-in way that I missed
- DIALOG_CHOOSE_COMPONENT: DPI-indep splitter sizes
- DIALOG_RESCUE_EACH: DPI-indep default size and sensible HTML window
  size
- COMPONENT_TREE: DPI-indep sizing
- DIALOG_FP_LIB_TABLE, DIALOG_SYMBOL_LIB_TABLE
2018-01-06 14:39:17 -07:00
Dan Weatherill 0dcf95ee1a automatically add extension to sim workbook files
CHANGED: When a workbook file is saved from the simulation dialog
in eeschema, the extension is automatically added if it is not
specified. This behaviour is consistent with the workbook loading
dialog, which filters the filelist for only ".wbk" files with no
"all files" option.
2018-01-06 12:04:53 -05:00
jean-pierre charras b98f6a2fd1 Minor fixes in strings and I18N fix. 2018-01-06 10:57:46 +01:00
jean-pierre charras cb60da3bc5 Fix Symbol editor: some hotkeys are not working (Delete item and Drag item)
Fixes: lp:1741145
https://bugs.launchpad.net/kicad/+bug/1741145
2018-01-06 10:36:56 +01:00
Mark Roszko b98cc0b937 Some coverity fixes 2018-01-05 22:51:03 -07:00
Chris Pavlina 57fe3739ca Symbol chooser: base default size on font for DPI flexibility 2018-01-05 22:02:05 -07:00
Wayne Stambaugh c842787492 Minor UI menu string improvements.
Change term "Flip Horizontal" to "Mirror About Horizontal(X) Axis" in
the schematic editor symbol context menu to improve clarity.

Change term "Flip Vertical" to "Mirror About Vertical(Y) Axis" in the
schematic editor symbol context menu to improve clarity.

Change to the same mirror terminology in the block context menu.

Change "Exchange Footprint" to "Change Footprint" in the board footprint
context menu for improved clarity.

Fixes lp:1740593

https://bugs.launchpad.net/kicad/+bug/1740593
2018-01-05 13:07:59 -05:00
Chris Pavlina 0945c319f0 eeschema: make footprint preview optional
The footprint preview and selection has been problematic for some users;
I'd rather option it out for 5.0 and work on polishing it for 6.0.
2018-01-03 18:28:44 -07:00
Wayne Stambaugh 4298d4ff4e Change missed UI string termonology from part/component to symbol. 2018-01-03 14:19:26 -05:00
Wayne Stambaugh 202cd43864 Eeschema: minor remapping improvements.
Create separate folder in project path to backup files changed during
remapping.

Add time stamp to backup file names in case multiple remappings are
performed.

Add backup file information to report panel instead of using debug
trace messages.

Disable the remap button if the user does not have write privileges to
the current project path.
2018-01-03 11:25:19 -05:00
Wayne Stambaugh bf44d394c3 Eeschema: fix remapping bug on windows builds.
The Windows drive specifier C: was being interpreted as a valid URL by
wxURI which was performing a URL comparison instead of a file comparison
which always failed in LIB_TABLE_BASE::FindRowByURI().  Change test for
URI to search string for "://" to determine if the comparison should be
a URI (string) comparison or a file (wxFileName) comparison.

Don't run final rescue unless the user performs the remapping.
2018-01-03 08:37:54 -05:00
jean-pierre charras c5b8c749da minor fix: use right parent to show the symbol or footprint viewer in dialog 2018-01-01 18:06:02 +01:00
jean-pierre charras 7d6230ab38 Eeschema: Cannot close opening Library Browser frame when reassigning symbols from the Library Browser (wxGTK specific)
Fixes: lp:1740607
https://bugs.launchpad.net/kicad/+bug/1740607
2018-01-01 13:40:23 +01:00
jean-pierre charras 6bb349e933 Better management of KIWAY_PLAYER frame when called in modal mode, and having the wxFLOAT_ON_PARENT style option.
(previously, did not use the actual parent)
2018-01-01 10:41:43 +01:00
jean-pierre charras 2fd7ab248e Fix compil warnings 2018-01-01 09:20:23 +01:00
Wayne Stambaugh 03e9f0c94a Eeschema: fix broken library symbol link for missing libraries.
When an attempt to resolve a library symbol link having a library
nickname that was no longer found in the symbol library table, the
symbol resolution was not falling back to the cache library due to
a silently handled exception.  Add check for valid symbol library
table nickname before attempting to resolve symbol link to prevent
exception bypassing falling back to the cache library.

Fixes lp:1740609

https://bugs.launchpad.net/kicad/+bug/1740609
2017-12-31 10:07:58 -05:00
Jeff Young fb597f4298 Enable tab navigation and shift-return-for-OK in multiline text controls for text objects.
Fixes: lp:1420916
* https://bugs.launchpad.net/kicad/+bug/1420916
2017-12-31 09:08:42 -05:00
Wayne Stambaugh b55eb0b5f1 Eeschema: fix assertion in LIB_PART destructor.
A new legacy symbol library plugin deletes all of the aliases from each
LIB_PART object that it owns cause an assertion in the dtor which calls
GetName() which checks for an empty alias list to prevent a segfault.
Remove the call to GetName() from the dtor trace message.

Fixes lp:1740597

https://bugs.launchpad.net/kicad/+bug/1740597
2017-12-30 19:55:11 -05:00
Seth Hillbrand e062780e9c Eeschema: Clears the active block after mirroring
Fixes: lp:1740549
* https://bugs.launchpad.net/kicad/+bug/1740549
2017-12-30 09:37:11 -05:00
Seth Hillbrand cfe20e22fb Eeschema: Correcting missing cleanup calls
Adds cleanup (wires and junctions) to two commands:
rotate/orient and drag without block.

Fixes: lp:1739951
* https://bugs.launchpad.net/kicad/+bug/1739951
2017-12-29 16:24:58 -05:00
Seth Hillbrand 6073bf3ea7 Library Editor: Moving current item to the base screen
Store the currently-edited item in the base screen class
instead of the libedit_frame.  This allows us to access it
for double-click disambiguation and harmonizes the library
editor with the schematic editor code that already does this.

Fixes: lp:1738694
* https://bugs.launchpad.net/kicad/+bug/1738694
2017-12-29 15:51:51 -05:00
Wayne Stambaugh 09cff5d8ed Eeschema: minor UI string spelling and coding policy fixes. 2017-12-29 10:44:33 -05:00
Wayne Stambaugh ae7cc5c868 Eeschema: only show the symbol library load progress dialog once. 2017-12-29 10:26:05 -05:00
Wayne Stambaugh 51717aad22 Eeschema: fix segfault bug when LIB_PART has no aliases.
The GetName() method attempts to access the first LIB_ALIAS pointer in
the m_aliases member without checking if m_aliases is empty.  This
should never happen because a new LIB_PART creates a LIB_ALIAS object
in the ctor.  Some how, this is getting bypassed and causing Eeschema
to crash in the LIB_PART dtor on debug builds.  GetName() now checks
for an empty alias list to prevent a null pointer segfault.

Fixes lp:1739614

https://bugs.launchpad.net/kicad/+bug/1739614
2017-12-29 09:57:12 -05:00
Wayne Stambaugh 70f516bde4 Eeschema: changed missed instances of component in UI strings.
Fixes lp:1740440

https://bugs.launchpad.net/kicad/+bug/1740440
2017-12-29 08:46:24 -05:00
Nick ?stergaard 4f1b510750 Use same path icon for the Configure Paths menu option
Also move the path configure item above the General Options to align
better with the menu in pcbnew.
2017-12-28 17:08:15 -05:00
Jeff Young 8a21641639 Eeschema: fix block copy and cut command event handlers.
Popup menu IDs must be between START_RANGE and END_RANGE to get bound to
the right event handler.

Fixes: lp:1667730
* https://bugs.launchpad.net/kicad/+bug/1667730
2017-12-28 16:12:33 -05:00
Wayne Stambaugh 1175d50486 Eeschema: fix default ERC dialog tab. 2017-12-28 14:17:47 -05:00
Simon Richter b4ad8ec560 Order source file names alphabetically 2017-12-27 14:01:05 -05:00
Wayne Stambaugh 71ea6dc2b9 Common, 3D viewer, CvPcb, and Eeschema dialog tweaks.
Improve dialog layout and fix UI policy issues with all of the dialog
boxes in the common, 3D viewer, CvPcb, and Eeschema code paths.

Updated the use of component to symbol.
2017-12-26 09:38:45 -05:00
Wayne Stambaugh 570866557f Add environment variable configuration dialog to Eeschema.
Fixes lp:1739910

https://bugs.launchpad.net/kicad/+bug/1739910
2017-12-24 12:57:57 -05:00
Wayne Stambaugh f7ab50f791 UI string normalization.
Replace all instances of "component" and "part" with "symbol" when
referring to schematic and library symbols.

Replace all instances of "component" with "footprint" when referring to
board and library footprints.

Minor dialog layout fixes to some of the dialogs impacted by the UI
string changes.
2017-12-24 10:04:32 -05:00
jean-pierre charras fe6ade185a DIALOG_UPDATE_FIELDS: make it resizable and fix a few very minor UI policy issues. 2017-12-24 10:38:10 +01:00
Wayne Stambaugh 8f0e6469ca Minor symbol remapping fixes.
The remapping utility would create a new project specific library when a
symbolic link pointed to a library already defined in the symbol library
table.  Now the comparison checks to see if the library path and file
name are actually a symbolic link if the file names are not the same when
the symbol library table entry is a file name rather than a URL.  URLs
are simple string comparisons.

Disable the remap button after the remapping completed.

Remove some commented out code from the edit symbol in schematic dialog.

Fixes lp:1738634

https://bugs.launchpad.net/kicad/+bug/1738634
2017-12-22 08:03:49 -05:00
Seth Hillbrand 1396ab0941 Eeschema: Consider buses for junctions
Allows buses to acquire junctions based on their connections.  Buses
can only have junctions with other buses.  Also allows buses to be
draggable junctions for collections
2017-12-21 11:04:46 -05:00
jean-pierre charras 23d71cfa93 fix typo 2017-12-21 15:08:10 +01:00
Maciej Suminski 783b5e2616 Forbid colon, slash and backslash characters in symbol names 2017-12-21 13:56:35 +01:00
Seth Hillbrand a061fe1f99 Eeschema: Adding connection block selections
This adjusts the selection addition criteria for
blocks to allow items such as labels to connect to
lines not at the endpoints.  It also uses the same
logic to correctly gather bus-wire, bus-bus entries.

Fixes: lp:1738941
* https://bugs.launchpad.net/kicad/+bug/1738941
2017-12-20 10:04:25 -05:00
Maciej Suminski 7f9876ec27 Fix lexical sort in component tree widget on Windows
Apparently explicitly requesting a column to be sorted breaks component
filtering on Windows. Without SetSortOrder() call the list is sorted and
filtering still works as expected.

Fixes: lp:1739412
* https://bugs.launchpad.net/kicad/+bug/1739412
2017-12-20 14:50:36 +01:00
Maciej Suminski 320fa7120d Expand/collapse library nodes with Enter key in component chooser 2017-12-20 12:25:12 +01:00
Maciej Suminski 5fac73fc21 Fixed browsing order with arrow keys in component chooser on Windows
As Windows displays the component list in inverted order, the direction
of scrolling had to be reversed as well.
2017-12-20 12:23:05 +01:00
Maciej Suminski 6344e238b3 Fix random node selection in symbol library editor on Windows
Selecting a node while wxDataViewCtrl is frozen selects a random node on
Windows.

Fixes: lp:1739202
* https://bugs.launchpad.net/kicad/+bug/1739202
2017-12-20 12:06:21 +01:00
Maciej Suminski 457bbbed15 Added a comment for a1b70601 (fixed filtering in component chooser) 2017-12-20 11:48:00 +01:00
Maciej Suminski f3a6bc6651 Fix crash on cut/remove a part in symbol library editor
Fixes: lp:1738635
* https://bugs.launchpad.net/kicad/+bug/1738635

Fixes: lp:1738999
* https://bugs.launchpad.net/kicad/+bug/1738999
2017-12-20 09:46:02 +01:00
Seth Hillbrand f4f0c09fe4 Eeschema: Clear drawing state when loading project
Prevents stray flags from entering schematic editing process

Fixes: lp:1738894
* https://bugs.launchpad.net/kicad/+bug/1738894
2017-12-19 11:49:25 -05:00
Maciej Suminski a1b7060189 Fixed filtering in component chooser on Windows
Please never ask me about the SetSortOrder() part. When it is set to
'true', wxDataViewCtrl::EnsureVisible() does not always work correctly,
so sometimes the best search result is not shown in the window (no
pattern found). Now it is set to 'false' to avoid the described
behavior, but the sorting order is reversed on Windows, not on Linux.
I could not test it on OSX, but I am sure it paints walls in your room
pink. /me burst into tears.

Fixes: lp:1738696
* https://bugs.launchpad.net/kicad/+bug/1738696
2017-12-19 15:19:04 +01:00
Maciej Suminski d4c8e1b5e9 Fixed ignored hot keys for save part/library commands in Symbol Editor
Previously wxUpdateUIEvent::SetText() stripped hotkey from menu entries.

Fixes: lp:1737819
* https://bugs.launchpad.net/kicad/+bug/1737819
2017-12-19 12:21:07 +01:00
Maciej Suminski 017fc4da8f Fixed capitalization and accelerators in Symbol Library Editor
Menu item labels follow the KiCad UI guideline.
Removed an accelerator conflict for 'Place' and 'Part' menus.
2017-12-19 12:21:07 +01:00
jean-pierre charras 9d4bfbded8 libedit, UI very minor change:
Enable "save curr lib" tool of main toolbar when modified even if this lib is empty.
It happens when all items are erased, and it is consistent with the close libedit dialog
that ask for saving all modified libraries
2017-12-18 09:50:28 +01:00
Christian Jacobsen ff4829eee6 Added a validity check in SIM_PLOT_PANEL::IsGridShown()
Fixes: lp:1712086
* https://bugs.launchpad.net/kicad/+bug/1712086
2017-12-18 09:34:25 +01:00
Andrew Wygle 9413793ef4 Eeschema: Correctly assign unit when copy/pasting
Fixes: lp:1738656
* https://bugs.launchpad.net/kicad/+bug/1738656
2017-12-17 22:27:31 +01:00
Seth Hillbrand 3f24128f17 Eeschema: Updates pin cache correctly for multi-unit components
Fixes: lp:1738615
* https://bugs.launchpad.net/kicad/+bug/1738615
2017-12-17 14:44:12 -05:00
Maciej Suminski 378846c2e3 Eagle Schematics Importer: support for UTF-8
Fixes: lp:1736083
* https://bugs.launchpad.net/kicad/+bug/1736083
2017-12-17 19:54:21 +01:00
Maciej Suminski 124c82f1cf Eagle Schematic Import: fixed imported libraries location
Standalone eeschema did not have the project path set when importing
a non-KiCad sheet. Due to this any libraries created during the import
were saved to the directory of eeschema executable instead of the actual
schematic directory.
2017-12-17 18:45:40 +01:00
Maciej Suminski 7665a839cd Eagle Schematic Import: try harder to generate a meaningful library name
The previous implementation relied only on the project name. When it is
set, the imported library was named '-eagle-import'. Now it tries
the project name and then the file name, using 'noname-eagle-import'
as fallback.

The library name is stored in the plugin to avoid changing the library
name after the project name has been set.
2017-12-17 18:45:40 +01:00
Seth Hillbrand 0ef2a7f08b Eeschema: Mark wire-bus entries correctly
Marks wire-bus entries as not dangling if there is at least a wire
and a bus on each end.  Corrects behavior when wires and buses overlap
at the endpoint.
2017-12-16 09:03:23 -05:00
jean-pierre charras 2398d5ef8b DIALOG_EDIT_COMPONENTS_LIBID: enhancement in orphan automatic remap:
add dialog to choose the right candidate when more than one is found
2017-12-16 14:50:37 +01:00
Seth Hillbrand 6f3e55d344 wx: Add double-click handling in disambiguation cases
Fixes: lp:1154020
* https://bugs.launchpad.net/kicad/+bug/1154020
2017-12-15 16:32:19 -05:00
Simon Richter a9ccf1161b Fix quotes in UI messages
This replaces all single and angle bracket quotes in UI messages with
double quotes, for consistency.

Sorry to all translators.
2017-12-15 07:33:07 -05:00
Seth Hillbrand 87938b06b4 Eeschema: TestDanglingEnds on Cross-probe
Fixes: lp:1672381
* https://bugs.launchpad.net/kicad/+bug/1672381
2017-12-14 16:04:30 -05:00
jean-pierre charras dee93e5eeb Minor fix: rename LIB_PART::m_dateModified to LIB_PART::LIB_PART::m_dateLastEdition
and use m_dateLastEdition type for LIB_PART::m_dateLastEdition
2017-12-14 17:27:40 +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 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
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
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
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
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
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
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
Simon Richter 0dad728e86 Pass -DBOOST_TEST_DYN_LINK to all parts of test 2017-12-06 19:28:57 -05:00
Simon Richter 227afe77c0 Avoid C-style array member init (illegal in C++)
This is not part of the C++ language, and only supported in some compilers.
2017-12-06 19:28:17 -05:00
Wayne Stambaugh 8af9aa7574 Eeschema: allow for partial schematic loading.
With the implementation of the legacy schematic plugin, any I/O error
when parsing the schematics would prevent the entire schematic from
being loaded.  This change restores (somewhat) the previous behavior
where as long as the root schematic is loaded properly, then all of
the remaining sub-sheet will attempt to load.

Add GetError() method the SCH_PLUGIN object to allow for partial
schematic loading.

Check the error message contents when no exception was caught to warn
the user of any accumulated errors.

Fixes lp:1690644

https://bugs.launchpad.net/kicad/+bug/1690644
2017-12-06 19:11:09 -05:00
Bernhard Stegmaier 1e88695001 Fix initial sizing of 'Fields' table columns in component table view. 2017-12-06 07:30:44 -05:00
Seth Hillbrand 8b68a1736a Eeschema: Set "edited" flag on newly created sheets
Forces newly created sheet to be considered for saving when created.

Fixes: lp:1736054
* https://bugs.launchpad.net/kicad/+bug/1736054
2017-12-05 08:19:55 -05:00
Seth Hillbrand bdc1fb04be Eeschema: Correct wire/bus/entry connections
Fixes the connection display and dragging behavior of wires,
busses and their entries.

The implemented drag logic is:
-busses and bus-bus entries drag each other when connected at endpoints
-wires and wire-bus entries drag each other when connected at endpoints
-entries do not drag wires or busses when connected to wire middles
-wire-bus entries do not drag busses

The implemented connection logic is:
-bus-bus entries connect busses to busses but not wires
-wire-bus entries connect wires to busses but not wire to wires or
busses to busses
2017-12-04 15:19:46 -05:00
jean-pierre charras cd3122d8cd Refactor hierarch.cpp: remove old dead code and clean current code. 2017-12-04 12:46:13 +01:00
jean-pierre charras c0a539959e Fix a few Coverity warnings 2017-12-04 12:46:11 +01:00
Maciej Suminski 36a54aef21 Component Tree: fixed the sort order 2017-12-04 10:52:05 +01:00
Maciej Suminski 45bf919923 Restoring the previous performance of COMPONENT_TREE widget
It turns out the fastest way to update wxDataViewCtrl is to nuke the
model and rebuild it from scratch rather than via
ItemAdded()/ItemDeleted() update notifications.

Fixes: lp:1734773
* https://bugs.launchpad.net/kicad/+bug/1734773
2017-12-04 10:42:37 +01:00
Seth Hillbrand a240f88785 Eeschema: Remove wire under a placed component
CHANGE: In Eeschema, when placing a component directly over an existing
wire, the wire is automatically removed where it shorted pins.

This helps workflow in Eeschema, allowing one to quickly add components
to existing lines.

Fixes: lp:1678449
* https://bugs.launchpad.net/kicad/+bug/1678449
2017-12-03 18:42:57 -05:00
jean-pierre charras 6be5596620 Symbol Editor: fix a bug in global pin edit: changes were not always taken in account when saving the symbol in lib. 2017-12-03 11:50:50 +01:00
jean-pierre charras 3109343b96 Fix a compil issue with gcc 4.8.4
Fixes: lp:1735909
https://bugs.launchpad.net/kicad/+bug/1735909
2017-12-02 14:22:43 +01:00
Wayne Stambaugh 694ad93385 Move LIB_PART save code to legacy schematic plugin.
This is the last of the object save/load code that was not moved into
the SCH_LEGACY_PLUGIN object.  All schematic and library I/O is now
performed in the SCH_LEGACY_PLUGIN object and as been removed from the
schematic and library objects.

The old single symbol file format has been replaced with the normal
symbol library file format since there was no difference between them
except the SYMBOL token.  The SYMBOL token was no longer being read
since the introduction of the SCH_LEGACY_PLUGIN symbol library loader.

Update the Doxygen comments in all of the modified files.
2017-12-01 11:49:44 -05:00
Seth Hillbrand 76dbbfdf92 Eeschema: Clarify disambiuation of entry types
Replace the disambiguation menu entry for
wire2bus and bus2bus entries with their menu icon.
2017-12-01 08:19:52 +01:00
Seth Hillbrand 069448f20e Eeschema: Automatically manage junctions
CHANGE: eeschema automatically adds and removes junctions
when required by the schematic

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

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

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

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

Fixes: lp:1491052
* https://bugs.launchpad.net/kicad/+bug/1491052
2017-11-30 10:02:24 -05:00
Seth Hillbrand b5ec5f9a73 Eeschema: Moving BreakSegment into SCH_EDIT_FRAME
BreakSegment now breaks a known segment and BreakSegments
breaks all segments. This allows functions to break a
segment without needing to iterate through the whole list.
2017-11-30 10:02:15 -05:00
Seth Hillbrand e9a297de5b Eeschema: Removing DC dependencies 2017-11-30 10:02:05 -05:00
Seth Hillbrand bf32cc2555 Eeschema: Moving SchematicCleanup to SCH_EDIT_FRAME
SchematicCleanup function moved from SCH_SCREEN to
SCH_EDIT_FRAME to allow access to the undo stack as we
are changing the schematic.
2017-11-30 10:01:58 -05:00
Seth Hillbrand c6632bdded Eeschema: Remove zero-length wires in RemoveBacktracks
RemoveBacktracks call removes zero-length wires as well
2017-11-30 10:01:50 -05:00
Seth Hillbrand 692fecea9a Eeschema: don't cleanup unseen schematics
Changes to the schematic shouldn't be made
where the user isn't looking.  Removing the
cleanup in ERC and netlisting prevents
unintended consequences

CHANGE: ERC and Netlist calls do not modify schematic
2017-11-30 10:01:34 -05:00
Seth Hillbrand 0fd2405c00 Eeschema: Add two utility functions to sch_line
Add IsSameQuandrant and IsParallel functions
2017-11-30 10:01:26 -05:00
Seth Hillbrand d0b2f078fe Eeschema: Unify delete operations
DeleteItemsInList now shares the code for DeleteItem.
SCH_FRAME::DeleteItem removes junctions that are no longer needed.
2017-11-30 10:01:21 -05:00
Seth Hillbrand f8e0099ecc Eeschema: Add 'append' option to undo
Allows eeschema to add elements to previous undo commits,
permitting stacking of changes through multiple calls
2017-11-30 10:01:15 -05:00
Seth Hillbrand 7b1938d999 Eeschema: IsCorner check for layer match
SCH_LINE can represent a bus, wire or graphic line.  Checking
for the corner needs to distinguish between these types.

Fixes: lp:1635984
* https://bugs.launchpad.net/kicad/+bug/1635984
2017-11-29 08:54:00 -05:00
jean-pierre charras f992d144d9 Eeschema, LIB_PIN::SetNumber(): ensure spaces are replaced by _ and set modify flag on change.
Fixes: lp:1734187
https://bugs.launchpad.net/kicad/+bug/1734187
2017-11-28 21:02:29 +01:00
Wayne Stambaugh 0acdd9f02e Remove obsolete symbol library item load code. 2017-11-27 14:42:22 -05:00
Maciej Suminski 480b1c2592 Fixed a crash when _cvpcb.kiface is not available when opening cvpcb 2017-11-27 17:11:12 +01:00
Wayne Stambaugh b4e9d9b6f7 Symbol rescue dialog improvements.
Make the user prompt an HTML control for improved layout.

Fix some column title sizing issues.  This is not a complete fix but
it seems better than the default sizing done by wxWidgets.

Use symbol terminology instead of part and/or component.

Create trace string source files for a common place for them and their
Doxygen comments.
2017-11-26 18:14:10 -05:00
jean-pierre charras 6e728739bb Eeschema: multi part with empty value (~) generates incorrect netlist
Fixes: lp:1734453
https://bugs.launchpad.net/kicad/+bug/1734453
2017-11-26 10:51:14 +01:00
Wayne Stambaugh 84e360dd0d Symbol library table remapping improvements.
Don't back up schematic files unless the user requests a remap.

Back up all files that could be changed by a remap including the
schematic file(s), cache library, project file, and rescue library
files.

Use an HTML control instead of a static text control for improved layout
of the user remap prompt.

Improve the user prompt in the remap dialog to make it clear that changes
will be made to project files.
2017-11-24 11:43:42 -05:00
Maciej Suminski 1d48fd28e3 Generate safe alias names in case of name collisions
Duplicated aliases were given " (copy x)" suffix. There are two
problems: aliases cannot contain spaces and the string was translatable
which could create more issues. Now duplicated aliases receive "_x" suffix.
2017-11-24 17:39:58 +01:00
jean-pierre charras 37f68f824b minor cosmetic enhancement: menu "Edit Components to Symbol Library Links": add specific icon. 2017-11-24 10:19:23 +01:00
jean-pierre charras cd9d81d720 dialog_edit_components_libid: add a tool to remap orphan components.
Orphan components are components that have a link (lib_id) pointing to a non existent symbol in any loaded libraries.
2017-11-23 19:49:53 +01:00
Wayne Stambaugh b82bd8e0c5 Fix symbol names with illegal library ID characters.
Change the legacy schematic plugin to preserve illegal LIB_ID characters
when load schematics prior to version 4.

Check for illegal LIB_ID symbol names during project rescue.  Rename and
rescue any symbols with illegal LIB_ID names.

Add static methods to LIB_ID object for testing for and fixing names
with illegal characters so there is uniform code for doing so.

Update the Eagle plugin symbol loader to fix symbol names using the new
LIB_ID fix illegal names method.

Fixes lp:1732236

https://bugs.launchpad.net/kicad/+bug/1732236
2017-11-23 10:52:55 -05:00
jean-pierre charras d52fd5769d Show a tooltip if dialog_choose_component has no symbol selected. 2017-11-23 13:24:02 +01:00
jean-pierre charras 1aff677562 Eeschema, getpart.cpp: fix incorrect call to lib browser
(was not called if a symbol was not previously selected)
2017-11-23 12:09:35 +01:00
jean-pierre charras fea9d121b7 dialog_edit_components_libid: UI enhancements, and use viewlib for LIB_ID selection 2017-11-23 10:40:14 +01:00
jean-pierre charras c3015f4671 Fix incorrect LIB_ID exported by viewlib when used as component chooser
(was not to the new format libname::symbol_name)
2017-11-23 10:40:13 +01:00
Seth Hillbrand faadbea10e Eeschema: Select component connections in drag
Dragging a full line that is connected to a component
now drags the component as part of the block, maintaining
connections.

Fixes: lp:1167714
* https://bugs.launchpad.net/kicad/+bug/1167714
2017-11-22 12:01:58 -05:00
jean-pierre charras 76d08c8bd2 UI fixes and enhancements in dialog_edit_components_libid. 2017-11-22 17:54:17 +01:00
jean-pierre charras 4d0d56fbd7 Fix incorrect handling of the last component in the component list. 2017-11-22 17:54:16 +01:00
Maciej Suminski 6b74f8ef48 Library Editor: fixed an assert after removing libraries with Symbol Library Table dialog 2017-11-22 14:15:51 +01:00
Maciej Suminski d76f7d7bd2 Library Editor: fixed an assert after canceling add library action 2017-11-22 14:03:01 +01:00
Maciej Suminski baec127852 Library Editor: show also empty libraries 2017-11-22 13:40:14 +01:00
Maciej Suminski aaabf8ab78 Library Editor: fixed a crash when creating a new library with existing file 2017-11-22 13:40:14 +01:00
Maciej Suminski 8b0041bf9a Library Editor: progress dialog when loading libraries 2017-11-22 13:40:14 +01:00
Maciej Suminski 1625129054 Library Editor: removed duplicated 'Duplicate Block' (doh..) 2017-11-21 23:40:21 +01:00
Maciej Suminski e25a1feb25 Component Tree: restore expanded nodes after search query is cancelled 2017-11-21 23:18:55 +01:00
Maciej Suminski 4a942a9810 Library Editor: do not change background for the active part/library 2017-11-21 23:18:55 +01:00
Maciej Suminski ed059383c7 Library Editor: removed library actions from the part context menu 2017-11-21 23:18:55 +01:00
Maciej Suminski 0b7ab40288 Updated cut/copy/paste toolbar icons
Removed cut & copy toolbar icons in the schematic editor, as they
were inaccessible. One cannot have an item selected and move the
mouse outside the canvas area due to autopanning.

Added paste icon to the library editor.
2017-11-21 23:18:55 +01:00
Maciej Suminski 256276cf1c Library Editor: copy/cut/paste for graphical items 2017-11-21 23:18:55 +01:00
Maciej Suminski 4fe06656a6 Minor refactor in LIB_EDIT_FRAME::Process_Special_Functions()
Shortened 'screen->m_BlockLocate' to 'block'.
2017-11-21 23:18:55 +01:00
Maciej Suminski 6b87c2d6b1 Library Editor: faster filtering on Windows
Preventing redraw by freezing wxDataViewTreeCtrl significantly
improves the performance.
2017-11-21 23:18:55 +01:00
Maciej Suminski e0e4e5f1be Library Manager: alternative way to manage dynamic fixes
Tree nodes now have an additional field 'InTree' to determine
if the view is aware of its existence. This way, there is no need
to rebuild the data structures from scratch when they need to be
filtered.
2017-11-21 23:18:55 +01:00
Maciej Suminski db4bd0c2db Library Editor: fixed dynamic updates
Duplicate entries were caused by multiple model assignment done by
CMP_TREE_MODEL_ADAPTER_BASE::AttachTo().
2017-11-21 23:18:55 +01:00
Maciej Suminski 891cf783fb Library Editor: Windows fixes 2017-11-21 23:18:55 +01:00
Maciej Suminski d3d2770093 Library Editor: fixed library manager synchronization to sym-lib-table 2017-11-21 23:18:55 +01:00
Maciej Suminski b229286313 Library Editor: fixed a crash after a library is removed 2017-11-21 23:18:55 +01:00
Maciej Suminski 6400e31d5b Library Editor: more coherent icons for part import/export 2017-11-21 23:18:55 +01:00