Commit Graph

2854 Commits

Author SHA1 Message Date
Fabrizio Tappero deeeed38a1 deleted several redundant icons in right-click menu. The objective is to get to a more uniforme right click menu look
Signed-off-by: Fabrizio Tappero <fabrizio.tappero@gmail.com>
2017-07-21 10:28:42 -04:00
Fabrizio Tappero cef616fcd8 fixed text titles that should have only the first word capitilized 2017-07-21 10:19:29 -04:00
Fabrizio Tappero 269238a7ee fixes label text, now only first word is capitilized 2017-07-21 10:19:29 -04:00
Fabrizio Tappero 7be14f774d fixed plot menu labels 2017-07-21 10:19:29 -04:00
Chris Pavlina c78a2ba4f8 Render symbols correctly with convert=0 in chooser
Fixes: lp:1705315
* https://bugs.launchpad.net/kicad/+bug/1705315
2017-07-19 11:43:39 -06:00
Chris Pavlina 04d299ae0e libedit: add correct unit/convert from component chooser
Fixes: lp:1705073
* https://bugs.launchpad.net/kicad/+bug/1705073
2017-07-19 11:35:11 -06:00
Chris Pavlina e34f1222fa Fix LIB_VIEW_FRAME only returning Unit A
Due to library list repopulation on refresh, the unit was being
overwritten with 1. Now, we track whether the unit needs to be
overwritten.

Fixes: lp:1677736
* https://bugs.launchpad.net/kicad/+bug/1677736
2017-07-19 11:12:14 -06:00
Oliver Walters f509ccc7cf Search component footprint text
- Added footprint text to search string for each component.
2017-07-18 08:58:03 -04:00
Chris Pavlina 94b9524f6d Fix documentation error in DIALOG_CHOOSE_COMPONENT 2017-07-17 15:00:13 -06:00
Wayne Stambaugh 0633d90ae4 Remove leading/trailing white space error message from field validator.
The illegal white space testing for reference and value (library editor
only) fields are adequate to ensure the user cannot enter invalid white
space characters.  Leading and/or trailing white space should not be an
issue for field storage in the schematic file as they are quoted.  Rather
than silently removing the leading and/or trailing white space which is
frowned upon, let the user fix it.

Fixes lp:1659526

https://bugs.launchpad.net/kicad/+bug/1659526
2017-07-13 13:45:25 -04:00
Wayne Stambaugh e01eb29758 Symbol and footprint library table parser fixes.
Fix potential memory leak in both footprint and symbol library table
parsers when a duplicate library nickname entry exists.

Parse entire symbol library table before raising duplicate nickname
exception.

Improve the duplicate library table nickname error message to make
life easier for users to fix broken tables.
2017-07-13 10:09:38 -04:00
jean-pierre charras c93ab4d5da Fix possible crash and issues when a incorrect fp lib table is loaded:
correct lines are loaded, and pcbnew / eeschema is no more aborted.
Fixes: lp:1701627
https://bugs.launchpad.net/kicad/+bug/1701627
2017-07-12 20:24:35 +02:00
jean-pierre charras 459fd9e584 Better fix for bugs 1703258 and 1702707: better detection of cache lib modifications, not always detected previously.
The component to symbol links were previously not always updated after a library change,
if the change is made outside the library editor.
2017-07-12 16:07:08 +02:00
jean-pierre charras d7a4fb7d8b Fix a crash in Eeschema when creating a netlist just after saving the project.
This is more a workaround than a fix.
The crash was due to the fact the library cache is modified on the disk with the saving process.

Fixes: lp:1702707
https://bugs.launchpad.net/kicad/+bug/1702707
2017-07-09 20:17:18 +02:00
jean-pierre charras 83b4e45eb4 Fix a memory leak, if an error occurs. 2017-07-09 10:16:00 +02:00
jean-pierre charras 895c0bb716 Fix a compil warning and a wxASSERT in netlist dialog and component_tree.cpp 2017-07-08 15:58:22 +02:00
Maciej Suminski e18475f220 Renamed remaining constants to match the action (see ab44e7cc) 2017-07-04 10:08:33 +02:00
Maciej Suminski 2300697f02 Added 'Cut Block' to right-click menu in eeschema 2017-07-03 18:03:34 +02:00
Maciej Suminski e981eedf64 Renamed cut_button icon to cut, removed delete_text icon 2017-07-03 18:03:34 +02:00
Maciej Suminski ab44e7cc72 Renamed constants to match actions in eeschema 2017-07-03 17:39:07 +02:00
Fabrizio Tappero 0c8200aaeb Rename actions in eeschema: copy->duplicate, save->copy 2017-07-03 17:22:00 +02:00
Fabrizio Tappero 50f6d28e25 Replaced a few icons with generic variants in eeschema 2017-07-03 17:13:13 +02:00
Kristoffer Ödmark 4fb2f80dd4 Eeschema copy/cut/paste to ctrl+c/x/v cut is now undoable Highlight net is now at ctrl+b by default 2017-07-03 16:41:47 +02:00
jean-pierre charras 9a2322cfcd New fix for bug 1700331 (Filenames with Double Period Invalid).
The previous fix was building the full name incorrectly, when this name contains a path not relative to the project.

Fixes: lp:1700331
https://bugs.launchpad.net/kicad/+bug/1700331
2017-07-02 10:30:21 +02:00
Tomasz Włostowski 0f5ab1bc87 Reverted commit 4130083445. 2017-07-02 00:34:41 +02:00
jean-pierre charras 22a8df69c4 Fix a few doxygen warnings 2017-06-30 16:03:17 +02:00
Wayne Stambaugh 4130083445 Eeschema: fix loading symbol libraries with dot in file name.
Initializing wxFileName objects by using string assignment or the single
string argument ctor will cause wxFileName to parse everything to the
right of the first dot as the file extension.  Therefore, file names such
as foo.1.lib and bar.baz.lib will fail.  This is probably not the only
place in the KiCad source where this can occur.

Fixes lp:1700331

https://bugs.launchpad.net/kicad/+bug/1700331
2017-06-29 10:36:12 -04:00
Wayne Stambaugh 85a0a371b1 Add support to resolve schematic symbol links using symbol library table.
Add Resolve() and ResolveAll() methods the SCH_COMPONENT object to use the
symbol library table to obtain links to the library symbols.

Add LoadAlias() method to SYMBOL_LIB_TABLE to find an alias by it's LIB_ID.

Clean up Doxygen comments to match coding policy changes.
2017-06-27 11:22:58 -04:00
jean-pierre charras 3c3ee9b8c3 Fix a few doxygen warnings 2017-06-26 18:12:57 +02:00
Maciej Suminski ac688e688a Fixed selecting components with Enter (DIALOG_CHOOSE_COMPONENT)
Added dedicated event types: COMPONENT_SELECTED, COMPONENT_PRESELECTED.
2017-06-25 23:13:39 +02:00
Wayne Stambaugh 375ec9fec6 Eeschema: remove hierarchy navigation tool from right vertical toolbar.
The hierarchy navigation tool did not seem to be used frequently and was
deemed redundant.
2017-06-21 16:44:46 -04:00
jean-pierre charras e5137f4eb4 Fix a few doxygen warnings 2017-06-21 10:01:39 +02:00
Maciej Suminski 6733101c6f Flags to select additional widgets for COMPONENT_TREE 2017-06-19 14:48:54 +02:00
Maciej Suminski f667f54c52 Moved component tree widget to a separate class 2017-06-19 14:48:53 +02:00
jean-pierre charras dfc49da29b Fix issues in strings that need to be translated (non ASCII7 strings, trailing spaces...) 2017-06-18 21:35:37 +02:00
jean-pierre charras 1466d0cee6 Fix a few doxygen warnings 2017-06-18 09:18:41 +02:00
Maciej Suminski 2018d48946 Fixed removal order in SIM_PLOT_PANEL::DeleteTrace() 2017-06-16 23:17:34 +02:00
Wayne Stambaugh dab73e172b Doxygen warning fixes and coding policy comment changes. 2017-06-16 10:08:28 -04:00
jean-pierre charras 996bcdf458 Fix a few doxygen warnings 2017-06-16 09:18:31 +02:00
Wayne Stambaugh 66e97fa905 Doxygen comment improvements.
Fix lots of Doxygen warnings.

Fix Doxygen comment for IO_MGR::FootprintEnumerate() which was recently
changed.
2017-06-13 19:47:46 -04:00
Kristoffer Ödmark 19d5cc7548 Removed all exception specifiers since deprecated.
Exception specifiers are deprecated in cpp11, so went through them all
and removed them from the code.
2017-06-12 13:54:55 -04:00
jean-pierre charras ad48cd435d Replace SetToolID( ID_NO_TOOL_SELECTED, ...) by SetNoToolSelected() in code 2017-06-12 16:17:48 +02:00
jean-pierre charras 526b5e2cd3 Fix broken behavior of the "Zoom to selection" tool in Gerbview and Eeschema. 2017-06-10 09:07:17 +02:00
jean-pierre charras 51bed4bae9 Fix incorrect handling of wxID_CANCEL and Close events in DIALOG_BOM_EDITOR. 2017-06-07 18:43:53 +02:00
danngreen a18d72b5d6 Made BOM editor dialog quasi modal 2017-06-06 13:43:08 -04:00
Bernhard Stegmaier 0e71686bfd Reunion of zoom toolbar buttons.
The zoom window toolbar button is on the right toolbar separated from the
other zoom buttons on the top toolbar.  Move the zoom window button to the
top toolbar beside the other zoom buttons.
2017-06-06 09:35:20 -04:00
Cheng Sheng 521e18ddbd "Show Datasheet" button: Resolve env-vars (like ${KIPRJMOD}) if appears.
This way, the datasheets can be stored within the project dir, and referred as ${KIPRJMOD}/relative/path/to/datasheet.
2017-06-06 08:30:35 -04:00
jean-pierre charras bea4664311 Fixes: lp:1695751 (EEschema: "Not-connected" flag not movable)
https://bugs.launchpad.net/kicad/+bug/1695751
2017-06-05 18:16:08 +02:00
jean-pierre charras 0d2634fe2d Fix incorrect declaration of a translatable string. 2017-06-05 18:16:08 +02:00
Fabrizio Tappero ac9a64a173 general UI fix. Fixed a lot of icons and a lot of menu.
Also a few no longer used .cpp icon files are removed.
2017-06-02 11:51:11 +02:00
Andrey Fedorushkov ddec8036c1 Eeschema: fix an other erroneous "unit value out of range" test. 2017-05-31 15:43:28 +02:00
jean-pierre charras c0bb8a30c2 Fixes: lp:1694456
https://bugs.launchpad.net/kicad/+bug/1694456

EEschema load: report "unit value out of range" in sub-sheet, although it is not the case.
2017-05-31 10:20:49 +02:00
jean-pierre charras e9577a1025 Fixes: lp:1692706 (eeschema cache lib not rebuilt when saving schematic, and existing symbols already in cache are not updated)
https://bugs.launchpad.net/kicad/+bug/1692706
2017-05-29 18:22:36 +02:00
jean-pierre charras 2100c29a1a Fixes: lp:1692436 (reset to defaults in Eeschema, edit component properties, puts fields in the wrong position)
https://bugs.launchpad.net/kicad/+bug/1692436
2017-05-24 21:19:26 +02:00
Oliver Walters ea855c1abf Fixed duplicate field names
- Now works correctly even if users overload default field names
2017-05-22 15:29:33 -04:00
Oliver 2a3a699d98 Component table is left aligned 2017-05-18 08:37:08 -04:00
Maciej Suminski e79f97860c Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only
once, at other times they were just straight lines or crashed the
application.
2017-05-16 17:58:09 +02:00
jean-pierre charras c5b09696ab Eeschema bom scripts: move python scripts to eeschema/plugins/python_scripts and xsl scripts to subdir xsl_scripts.
Python scripts are now installed (previously: were ignored by the make install command)
2017-05-13 16:52:56 +02:00
jean-pierre charras 305a166e95 Pcbnew: update immediately the 3D viewer opened from the footprint editor/viewer/wizard after a change. 2017-05-13 08:17:06 +02:00
Wayne Stambaugh 747583606b Eeschema: fix regression when sheet files are not in project path.
Fixes lp:1683921

https://bugs.launchpad.net/kicad/+bug/1683921
2017-05-10 16:05:06 -04:00
Oliver Walters d4e41c4f97 Component table improvements 2017-05-08 12:43:20 +02:00
Wayne Stambaugh c70adcdf31 Don't apply last line width to text thickness in symbol library editor.
The symbol library header was setting the text thickness using the
last line thickness setting which is incorrect so use the default
thickness when creating new text objects.

Fixes lp:1635344

https://bugs.launchpad.net/kicad/+bug/1635344
2017-05-03 16:20:46 -04:00
jean-pierre charras 342f28f106 dilaog bom editor: fix min sizes. 2017-05-03 08:56:32 +02:00
Oliver Walters 5fe13c01c7 Improvements for component table 2017-05-03 08:56:31 +02:00
jean-pierre charras e4d2924ee2 Make a sentence translatable in dialog_bom_editor. 2017-05-02 19:51:02 +02:00
Oliver Walters 29e3e55ad3 Removed BOM functionality
- Removed ability to generate BOM to file
- Removed Save/Cancel window when closing table
- No longer updates table <after> table is closed
- Bugfix for field names (previously comparison was case insensitive)
2017-05-02 09:40:02 -04:00
Oliver Walters 48893ab2b1 Fixed UNDO behaviour
- Undo actions are pushed to the appropriate sheet(s)
- Each sheet's actions are grouped together
2017-05-02 09:39:56 -04:00
Oliver Walters 47ee2773d2 Reworked field association
- Allow duplicate components to access same field data
2017-05-02 09:39:51 -04:00
Oliver Walters d792e36151 Reworked UI
- Buttons are enabled/disabled within wxUpdateUI events
- Save/Cancel dialog used to close window and apply (or reject) changes
2017-05-02 09:39:40 -04:00
Oliver Walters 59470c3b5e Fixed display of references for duplicate sheets
Display part reference rather than REFERENCE field value
2017-05-02 09:39:34 -04:00
Oliver Walters 8dd4aca73b Mark schematic as dirty
Notify schematic of changes when window is closed
2017-05-02 09:39:24 -04:00
Oliver Walters 5126332c57 Fixed wxString::Format assert 2017-05-02 09:39:08 -04:00
Oliver a39856485c Added component table dialog
- Allows grouping of matched components
- Bulk edit of components in a spreadsheet window
- User can choose to save / undo changes
- All changes are pushed to the undo stack in a single operation
- Export table to HTML / CSV output
2017-05-02 09:39:01 -04:00
Dick Hollenbeck 50716c9015 Fix BOM generation bug for components with multiple units.
Sadly, each unit of a component can have its own unique fields. This
change finds the last non blank field and records it. Last guy wins
and the order of units occuring in a schematic hierarchy is variable.
Therefore user is best off setting fields into only one unit. But this
scavenger algorithm will find any non blank fields in all units and use
the last non-blank field for each unique field name.

Fixes lp:1471417

https://bugs.launchpad.net/kicad/+bug/1471417
2017-04-24 10:16:32 -04:00
Maciej Suminski 801e50450b Revert "Fix component chooser dialog crash if there are no FPs available"
This reverts commit 0a8a659ff7.
The patch is incorrect, as it removes the FP chooser drop-down list.
I cannot reproduce the crash with the patch reverted, so there must
have been something specific to my configuration at that time.
2017-04-13 10:58:10 +02:00
jean-pierre charras 02abf18046 Eeschema: speed up netlist creation. 2017-04-12 08:18:46 +02:00
Wayne Stambaugh 578f01bfd9 Fix debug build error in symbol remap dialog. 2017-04-05 08:43:05 -04:00
Wayne Stambaugh 36606ceeb7 Add symbol library table remapping dialog.
Create dialog and code to allow legacy schematic symbols to be remapped
from the old library path look up method to the new symbol library table
method by using the following steps:

  1) Create a project symbol library table containing all of the symbol
     libraries defined in the old library look up list not found in the
     global symbol library table.

  2) Map each symbol to the correct symbol in the symbol library table
     if possible.

Recreate library link to symbols so look up method can be converted to
symbol library table properly.

Add function to SCH_COMPONENT to link library symbols using the symbol
library table.
2017-04-04 18:31:28 -04:00
jean-pierre charras 1f3fe6fefb Fix Eeschema: Part library editor "save current library as" crash if no current library selected.
Fixes: lp:1678698
https://bugs.launchpad.net/kicad/+bug/1678698
2017-04-03 07:58:34 +02:00
jean-pierre charras 2f9be81b19 Very minor change in 2 strings to help I18n translations. 2017-04-02 11:51:40 +02:00
Wayne Stambaugh 9c2ebf32f1 Initial symbol library table implementation prep work.
Add loading symbol library table code to schematic PROJECT object.

Fix minor issues with loading global symbol library table.

Add default symbol library path environment variable to the environment
variable list and change the variable name to KICAD_SYMBOL_DIR.

Add code to SCH_SCREENS to test if all library nicknames of the symbol
library IDs are empty.

Remove unnecessary KICAD_USE_SCH_IO_MANAGER build option.
2017-03-31 16:29:34 -04:00
Fabrizio Tappero dcaa0559de Minor edit component properties dialog improvements. 2017-03-31 15:30:00 -04:00
Maciej Suminski 0a8a659ff7 Fix component chooser dialog crash if there are no FPs available 2017-03-31 17:15:09 +02:00
Chris Pavlina 3234087dc9 Move wxDataViewCtrl manipulators out of dialog_choose_component.cpp
Fixes: lp:1677925
* https://bugs.launchpad.net/kicad/+bug/1677925
2017-03-30 21:47:14 -04:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
Wayne Stambaugh 40f60c9871 Fix netlist generation bug cause when component unit is set to zero.
Fix if statement logic to ensure the unit number is never set to zero.

Add logic to the legacy schematic plugin to automatically convert any
schematic files that have components with a unit setting of zero.  Set
the schematic modified flag so that the user will be notified of a
changed schematic.

Add a user warning when the schematic parser fixes the bug and sets
the file modified flag.

Fixes lp:1677282

https://bugs.launchpad.net/kicad/+bug/1677282
2017-03-30 15:44:47 -04:00
Chris Pavlina feba091594 Highlight the first choice in rescue dialog
Fixes: lp:1455970
* https://bugs.launchpad.net/kicad/+bug/1455970
2017-03-27 08:45:05 -04:00
Chris Pavlina a9afb872d5 libedit: fix crash on Delete Component with no selection
This bug was actually here before the new component chooser this time;
I'm not sure what the purpose of this error message was since it is
being displayed in a non-error state. Maybe a copy/paste bug from when
Delete Component was changed to use the main component chooser?
2017-03-27 08:07:30 -04:00
Chris Pavlina d2b0a4b358 Component chooser: show aliases better
- In the listing, display alias names in italics
- In the info panel, display per-alias description correctly, as well as
  root description

Fixes: lp:1676190
* https://bugs.launchpad.net/kicad/+bug/1676190
2017-03-27 07:55:26 -04:00
jean-pierre charras cfac7bd31c Eeschema: fix a crash when closing the choose component dialog by OK button, if no component selected. 2017-03-27 08:53:19 +02:00
Chris Pavlina 4011ed4e31 Convert UTF8 to/from wxString correctly around LIB_ID
Fixes: lp:1675942
* https://bugs.launchpad.net/kicad/+bug/1675942
2017-03-24 21:38:00 -04:00
Chris Pavlina 849b3c2a4b Add footprint select dropdown to component chooser, serious refactoring
- DIALOG_CHOOSE_COMPONENT has footprint select widget
- FOOTPRINT_SELECT_WIDGET
- FOOTPRINT_CHOICE widget (customized wxComboCtrl)
- FOOTPRINT_FILTER class
- FOOTPRINT_INFO rework:
    - FOOTPRINT_ASYNC_LOADER to load without freezing UI
    - Rewrite loader threads as queue-driven thread pool
    - Make FOOTPRINT_INFO available via kiway
- FP_LIB_TABLE::PrefetchLib
- Access to global fp-lib-table via kiway
- SYNC_QUEUE threadsafe queue template
- Remove KICAD_FOOTPRINT_SELECTOR build option
2017-03-24 09:20:27 -04:00
Maciej Suminski b47a6e415b Fixed a memleak in DIALOG_CHOOSE_COMPONENT 2017-03-23 16:52:33 +01:00
John Beard e98ae3e463 Move executable name constants to own file
The executable name constants are only used by two files, they do not
have to be in common.h.

Also converted to const wxString for better type-safety and removed
old-style wxT macros.
2017-03-23 09:23:45 -04:00
Chris Pavlina 72cfd38979 De-templatify CMP_TREE_MODEL_ADAPTER::FindAndExpand
std::function lets this be a plain method instead of a template; this
cleans up the header a bit and possibly reduces a bit of bloat
2017-03-21 22:45:36 -04:00
Chris Pavlina b2f1d22bbf Fix preselect in CMP_TREE_MODEL_ADAPTER 2017-03-21 22:45:17 -04:00
Chris Pavlina ef12f0bcbc Fix warning: shadowed wxWindow::IsShown in sim_plot_panel.h 2017-03-19 09:18:28 -04:00
Chris Pavlina bfa22c6ce8 Fix warning: uninitialized constant in sim_plot_panel.h 2017-03-19 09:18:23 -04:00
Wayne Stambaugh 9ddb4fe67e Fix uncaught exception in footprint and symbol library table parsers.
Fixes Coverity CID 154580
Fixes Coverity CID 154581
Fixes Coverity CID 154582
Fixes Coverity CID 154583
Fixes Coverity CID 154584
Fixes Coverity CID 154585
2017-03-17 07:56:47 -04:00
jean-pierre charras ccfad8306b eeschema: fix an annoying issue created by commit fdb53f28e6b666f242c3d24dfbfb0e4050bfa2ad: enter a label size starting by 0 (like 0.3) was not possible. 2017-03-14 20:40:21 +01:00
Oliver fdb53f28e6 Improvement for label edit dialog in eeschema:
- Added wxTE_RICH property to label text controls (allows ctrl+backspace in Windows)
- Added numeric validator to text size
2017-03-14 13:08:36 -04:00
Oliver 3fc62d5fcd Improve right-click menu entry for doc
- Changed "doc" to "Open Documentation"
2017-03-13 09:58:05 -04:00
jean-pierre charras 8f3fc7b858 Optimization in class_library.cpp: speed up power component list creation. 2017-03-13 12:49:24 +01:00
jean-pierre charras 28a6ca1e23 Eeschema: fix wrong position of symbol fields when adding a symbol in a schematic
Fixes: lp:1665718
https://bugs.launchpad.net/kicad/+bug/1665718
2017-03-12 17:04:42 +01:00
Chris Pavlina 5e5259b59c CMP_TREE_MODEL*: fix uninitialized members
Coverity CID 157141
Coverity CID 157136
2017-03-11 19:27:44 -05:00
Chris Pavlina bbaa29fbc4 Refactor FOOTPRINT_PREVIEW_PANEL
- Pull out compound widget bits into FOOTPRINT_PREVIEW_WIDGET
- Move all pcbnew-specific bits *inside* pcbnew; implementation should
  be private for users
- Make a few class members and inner types private
2017-03-10 23:26:45 -05:00
jean-pierre charras de30dc9f5d Speed up schematic libraries loading. 2017-03-10 21:17:56 +01:00
Chris Pavlina a72d32d3fd Test for dangling pins after symbol is edited
Fixes: lp:1562897
* https://bugs.launchpad.net/kicad/+bug/1562897
2017-03-10 12:01:12 -05:00
Wayne Stambaugh 9636086f52 Fix build bug for const incorrectness. 2017-03-10 10:09:55 -05:00
Wayne Stambaugh cc64c6af1d Fix broken symbol link in schematic after editing.
The save current symbol command had a different code path then save current
library so the schematic symbol was not being refresh after is was modified
in symbol editor.

Split out the save current symbol command from Process_Special_Functions()
to help reduce function growth hormone imbalance syndrome.

Some coding policy fixes and wxT() macro removal.

Fixes lp:1671456

https://bugs.launchpad.net/kicad/+bug/1671456
2017-03-10 08:39:29 -05:00
Chris Pavlina 7bf4c90be5 Component chooser: properly normalize description/keywords
Fixes: lp:1671814
* https://bugs.launchpad.net/kicad/+bug/1671814
2017-03-10 08:34:20 -05:00
jean-pierre charras 0be56451b1 More optimization in project rescue. 2017-03-10 10:31:50 +01:00
jean-pierre charras 4605cae588 Displays the number of instances to modify in rescue dialog. 2017-03-09 19:16:24 +01:00
jean-pierre charras ae7e3f725b Speed up project rescue calculations, by optimizing the number of searches in libs. 2017-03-09 18:13:03 +01:00
jean-pierre charras 2a91d7bc21 Speed up SCH_COMPONENT::ResolveAll(). 2017-03-09 15:46:12 +01:00
Chris Pavlina 82f587f4ff Show the busy cursor while loading component chooser 2017-03-08 15:34:11 -05:00
Chris Pavlina 2e4e0a9a05 Minor cleanup in cmp_tree_model_adapter.h 2017-03-08 14:49:00 -05:00
Chris Pavlina 7ee0adabd7 Optimize component chooser startup time more
- Stop wx from sorting the items. We've already sorted them, and
  profiling shows our sort is faster than theirs.

- Go back to using strings as cache keys, because using pointers means
  the cache doesn't survive from one invocation to the next. Switch to
  wxHashMap because it can use wxString keys in an unordered (faster)
  map.
2017-03-08 14:41:34 -05:00
Chris Pavlina 28848373ce CMP_TREE_MODEL: add the correct number of units
Fixes: lp:1671174
* https://bugs.launchpad.net/kicad/+bug/1671174
2017-03-08 12:39:44 -05:00
Chris Pavlina 3bddc14dc6 CMP_TREE_MODEL_ADAPTER: use more suitable cache type
Fixes: lp:1671086
* https://bugs.launchpad.net/kicad/+bug/1671086
2017-03-08 12:34:11 -05:00
Chris Pavlina 2232edfb87 Rewrite DIALOG_CHOOSE_COMPONENT without wxFormBuilder
This will allow near-future use of controls not supported by
wxFormBuilder with minimal hackery.
2017-03-08 12:00:49 -05:00
Chris Pavlina 36e400ec5b Avoid collapsing component chooser column widths to zero
Fixes: lp:1670762
* https://bugs.launchpad.net/kicad/+bug/1670762
2017-03-07 14:59:51 -05:00
Chris Pavlina 2bb234d3f5 Fix assert in DIALOG_EESCHEMA_CONFIG when removing many libs at once 2017-03-06 17:24:12 -05:00
Simon Richter 12c1339296 Remove false "override" comments. 2017-03-06 16:34:56 -05:00
jean-pierre charras 0b3e5952b7 Eeschema: fix a crash if a schematic project was not loaded due to a incorrect file format error (Linux only)
Fixes: lp:1670322
https://bugs.launchpad.net/kicad/+bug/1670322
2017-03-06 21:41:43 +01:00
Chris Pavlina f8415633bd Switch component chooser to wxDataViewCtrl, refactor
This refactors COMPONENT_TREE_SEARCH_CONTAINER into a Model-View-Adapter
architecture comprising:

- eeschema/cmp_tree_model.h
    - CMP_TREE_NODE: Base class representing a searchable library
        set with scoring and sorting

        - CMP_TREE_NODE_UNIT
        - CMP_TREE_NODE_ALIAS
        - CMP_TREE_NODE_LIB
        - CMP_TREE_NODE_ROOT

- eeschema/cmp_tree_model_adapter.h
    - CMP_TREE_MODEL_ADAPTER: mediator between wxDataViewCtrl (via
        wxDataViewModel) and CMP_TREE_NODE*

                   +---+                      +------------------+
 +---+  Generates  | A |                      |       VIEW       |
 | M |  from libs  | D |   wxDataViewModel    |------------------|
 | O | <---------- | A | <------------------> |  wxDataViewCtrl  |
 | D |             | P |                      |------------------|
 | E | <---------> | T | <------------------- |    wxTextCtrl    |
 | L | UpdateScore | E | UpdateSearchString() |------------------|
 +---+             | R |                      |                  |
                   +---+                      +------------------+

Representing the data with a proper model allows the wxDataViewCtrl to
be updated in bulk, which is significantly faster than the old method of
populating it one item at a time. This also adds flexibility if more
data is to be added in the future (which may come in handy with the
upcoming .sweet format, as that adds more ways components can be related
to each other).

Replacing the wxTreeListCtrl with a wxDataViewCtrl also significantly
reduces the general GUI quirkiness, as wxDataViewCtrl is much more well
behaved.
2017-03-06 09:50:48 -05:00
Wayne Stambaugh d9260d42c8 Fix broken schematic symbol library links in sub-sheets.
Only the root sheet symbol library links were being updated when the
schematic was loaded so changed call to update all sheets.

Fixes lp:1670079

https://bugs.launchpad.net/kicad/+bug/1670079
2017-03-05 13:18:26 -05:00
Wayne Stambaugh f181961866 Remove excessive schematic symbol library re-linking.
For some reason, the schematic symbol library link was being regenerated
every time the schematic was redrawn in SCH_SCREEN::Draw().  Remove the
re-link call from the Draw() and Plot() functions.

Add function the SCH_SCREENS to update the links in all of the schematic
sheets.

Update all schematic sheet symbol library links whenever the symbol
library list is modified or any library in the library list is modified.
That should cover all cases where the symbol library links could be
broken.

Refresh schematic window after applying library changes to update any
possible symbol changes.

Add KIWAY message to update the schematic when symbol library changes
could change the schematic.  The KIWAY mail was used because the schematic
frame is not a parent of the symbol library editor so wxEvents cannot be
used.
2017-03-04 16:02:33 -05:00
Wayne Stambaugh 84835ed4e1 Use component library symbol when looking for a pin in the schematic.
For some reason, rather than using the LIB_PART object reference by an
SCH_COMPONENT to check if a pin was at a given position in the schematic,
a LIB_PART search was performed for every component in a schematic.  This
made absolutely no sense and was changed to use the LIB_PART referenced
by the SCH_COMPONENT object.  This should significantly speed up any
operations that call SCH_SCREEN functions, IsTerminalPoint(),
MarkConnections(), and IsJunctionNeeded().

Add function to SCH_COMPONENT to access PART_REF object.
2017-03-04 15:16:44 -05:00
Chris Pavlina 551b2b2312 Component chooser: fix ugly border on macOS 2017-03-04 12:29:49 -05:00
jean-pierre charras 5b3d7962bb Fix questionable code and memory leak. 2017-03-04 17:35:34 +01:00
Chris Pavlina 4618e6c7f8 Component chooser: event and focus cleanup 2017-03-04 11:14:04 -05:00
Simon Richter 1502e27695 Remove debug code matching on specific component names 2017-03-03 08:30:48 -05:00
jean-pierre charras 4eeed8d04f Icons options menu: code rework 2017-03-03 14:18:25 +01:00
Kristoffer Ödmark dda51ab550 CrossProbes Schematics from eeschema to pcbnew
Adds a similar crossprobe as modules has in pcbnew. When clicking a
sheet in eeschema, the items that are exclusive in that scheet will be
selected in pcbnew if using the GAL canvas.
2017-03-03 07:25:32 -05:00
jean-pierre charras e7e972804a Make show/hide icons in menus a run time option, instead of compil option. 2017-03-02 15:45:54 +01:00
Maciej Suminski d7e1152aa3 Correct way of freeing memory in NGSPICE class
Strings created with strdup() should be deleted using free(), not
delete.
2017-03-01 13:56:24 +01:00
Martin Stoilov fc0814caef More flexible node mapping in Spice netlist exporter
Allows to map nodes to pins for Spice models that have more pins than
corresponding schematic symbol. An example is a MOSFET model containing
gate, source, drain & body, whereas schematic symbol part has only gate,
source & drain with body and source connected inside the part.
2017-03-01 13:51:21 +01:00
Maciej Suminski 7034ea0c95 Added missing PROPERTIES parameter to function calls in PART_LIB 2017-02-28 15:19:03 +01:00
Maciej Suminski 8b8de76aa5 Store information about buffering & caching in properties
PROPERTIES object has been recreated every time it was needed, using
two fields in PART_LIB class. Now the buffering & caching settings are
stored directly in a PROPERTIES object.
2017-02-28 15:18:58 +01:00
jean-pierre charras be10de8d28 Eeschema: Fix crash when reading a library if a symbol having aliases generates a parse error after its ALIAS list definition 2017-02-28 12:52:37 +01:00
jean-pierre charras 94037f4d3d Fix eeschema crashes when a library has a component where the name under "DEF" does not agree with the name under "F1"
(now "F1" is forced to name given by "DEF", like in stable version)
Fix also an incorrect parsing of .dcm file, if  a component was not found in corresponding symbol lib.
(Can happen for not updated .dcm files)
2017-02-28 11:48:01 +01:00
jean-pierre charras 64d6c3f91c eeschema segfault when a library "T" command is missing Halign Valign values
Fixes: lp:1668082
https://bugs.launchpad.net/kicad/+bug/1668082
2017-02-27 17:22:06 +01:00
jean-pierre charras f35cb6cd6a Fix: if a part description has a problem in a library, Eeschema crashes due to a double deletion. 2017-02-27 16:13:16 +01:00
jean-pierre charras 6b431b4791 Fix transaltion issue.
Rebuild dialog_display_options_base with a recent wxFormbuilder version.
2017-02-26 13:03:38 +01:00
Chris Pavlina e6de99cc86 No more wxSearchCtrl in DIALOG_CHOOSE_COMPONENT
It is buggy on several platforms
- macOS: eats Esc key
- Windows: poor text alignment
2017-02-24 16:01:58 -05:00
jean-pierre charras 6bd2110449 Remove a printf clearly for debug, certainly a very old bug 2017-02-24 20:51:50 +01:00
jean-pierre charras 6ae7c15d89 Rework on pcbnew menubar: make code more easy to read and modify. 2017-02-24 20:51:49 +01:00
Chris Pavlina 23d4da9e49 Optimize TWO_COLUMN_TREE_LIST column sizing
This was particularly slow for very long lists on macOS.
2017-02-24 12:51:53 -05:00
Chris Pavlina 9effcb80e7 Optimize SCH_PLUGIN enumeration for populating the component chooser 2017-02-24 11:47:27 -05:00
Chris Pavlina d3cb23b7d7 Remove unneeded state member in DIALOG_CHOOSE_COMPONENT 2017-02-23 20:59:15 -05:00
Chris Pavlina 2683af26c0 Fix DIALOG_CHOOSE_COMPONENT enter and double-click events 2017-02-23 20:51:29 -05:00
jean-pierre charras 039910cb21 Fix incorrect initialization of a color parameter, which make the drawings in black in libedit 2017-02-23 17:55:55 +01:00
jean-pierre charras 11dcb76fc9 Add -Wshadow compil option, if exists to warn about shadowed variables.
Swig auto generated .cxx file has a lot of shadowed variables, so this option cannot be used to compil all files.
2017-02-23 13:17:23 +01:00
Joseph Y. Chen ed16beb5cd Rearranged Part Editor Icon Positions
The changes were made to rearrange the positions of the first 5
icons in the part editor so that they are consistent with footprint
editor.

Signed-off-by: Joseph Y. Chen <joseph.chen59@yahoo.com>
2017-02-22 13:24:49 -05:00
Maciej Suminski d7bf44eee0 Removed a few more headers from base_struct.h 2017-02-22 17:54:01 +01:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans 3ec8941ffc Revert from wxColourPickerCtrl to wxBitmapButton
wxColourPickerCtrl apparently looks bad on Windows 10
2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Chris Pavlina 35a8d78921 Fix component selector segfault on MacOS
Fixes: lp:1666081
* https://bugs.launchpad.net/kicad/+bug/1666081
2017-02-21 18:37:37 -05:00
John Beard a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

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

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

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

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00
Chris Pavlina ca7f1d5a08 Remove accidentally committed diodes.lib 2017-02-20 14:57:45 -05:00
Chris Pavlina 57de6ec0af Remove SetFocus hack after changing to wxSearchBox 2017-02-20 14:41:21 -05:00
Joseph Y. Chen cc11c269e3 Swapped part editor icon order to be consistant with footprint editor
Signed-off-by: Joseph Y. Chen <joseph.chen59@yahoo.com>
2017-02-20 13:38:32 -05:00
Chris Pavlina a416f3a4e4 Remove unnecessary TRANSFORM::operator=
The default assignment operator is significantly more efficient - often
inlined, and has no branches...
2017-02-19 22:13:50 -05:00
Chris Pavlina 0182e454c5 Adjust component chooser GUI slightly 2017-02-19 19:31:53 -05:00
Wayne Stambaugh 1672d37782 Fix bug in legacy schematic I/O plugin.
When part definition contained in line comments, the next line was not
being loaded causing and infinite loop.

Fixes lp:1666024

https://bugs.launchpad.net/kicad/+bug/1666024
2017-02-19 17:44:53 -05:00
Chris Pavlina 70301a6244 Component chooser: display correct unit in reference field 2017-02-19 15:11:35 -05:00
Chris Pavlina 69165aa0a0 Do not show hidden fields in the component selector
This is not necessary anymore, as they are displayed in the info box.
2017-02-19 13:43:50 -05:00
Chris Pavlina a61be7e00e Move LIB_PART::Draw drawing options into a struct
This makes configuring the options clearer, avoiding the long list of
non-self-explanatory arguments at the small cost of requiring a few more
lines.
2017-02-19 13:40:26 -05:00
Chris Pavlina 5dea5e2ada Component chooser: add missing info panel updates 2017-02-19 10:01:45 -05:00
Chris Pavlina b4f4ff9353 Clean up updateSelection() megafunction 2017-02-19 09:24:40 -05:00
Chris Pavlina 3d88cc2a36 Rename method for consistency with similar class
FOOTPRINT_PREVIEW_PANEL::AddToPanel -> InstallOnPanel
2017-02-19 07:53:02 -05:00
Chris Pavlina fb6bf0c861 Fix SetColumnWidth() assertion in TWO_COLUMN_TREE_LIST
Fixes: lp:1665982
* https://bugs.launchpad.net/kicad/+bug/1665982
2017-02-19 06:38:53 -05:00
Chris Pavlina 2632b1d1a0 Revamp component chooser and add footprint preview
This commit brings several changes:

- Add a footprint preview pane to the eeschema component selector
- Upgrade component list to wxTreeListCtrl
- Factor out wxTreeListCtrl subclass TWO_COLUMN_TREE_LIST which
  patches a column size bug
- Linkify datasheet URL in info pane
2017-02-18 21:39:55 -05:00
Wayne Stambaugh 0898b6c94d Prevent symbol libraries from being unnecessarily reloaded.
When Eeschema is relaunched from KiCad, the symbol libraries were always
reloaded which isn't necessary as they are maintained by the kiface project
object until the project is changed.

Fix minor title capitalization in symbol library progress dialog.
2017-02-17 19:31:47 -05:00
Wayne Stambaugh ccbdb41186 Remove conversion from wxString using FROM_UTF8() when loading symbols.
A conversion from wxString using FROM_UTF8() was inadvertently used when
loading and enumerating symbols from the legacy plugin.  This conversion
would break any non-ascii characters in the symbol name.

Fixes lp:1664642

https://bugs.launchpad.net/kicad/+bug/1664642
2017-02-16 14:03:19 -05:00
Wayne Stambaugh 9375e18fb6 Fix broken symbol library alias root symbol links.
Check to see if the root symbol alias already exists before adding it to
the symbol library alias list in the legacy schematic I/O plugin.  There
currently about six different ways that the root alias can be changed in
the root symbol which causes issues.  This really needs to be cleaned up.

Use buffering when updating a symbol in a library to prevent the library
file from being written before it is backed up.

Update the alias and unit selection menubar drop down lists.

Delete the output formatter so the file is closed so that reading the
file time stamp can be performed to prevent unnecessary cache reloads.

Fixes lp:1664834

https://bugs.launchpad.net/kicad/+bug/1664834
2017-02-15 20:28:36 -05:00
Wayne Stambaugh 58ed5466b4 Fix legacy schematic I/O symbol library parser bug.
Apparently symbol definition blocks can have a '0' character in the lock
position which is typically defined as 'L' or 'F'.  This must have been
a oversight at some point since both versions of the DEF parameters
exist in library version 2.3 files.

Disable the symbol library cache buffering after saving.
2017-02-14 14:49:22 -05:00
Jon Evans 92a2b2b684 Correctly filter copyable objects for copy hotkey (Fixes lp:1571316) 2017-02-14 09:48:28 -05:00
Wayne Stambaugh 175d68fbb1 Fix schematic cache library broken by schematic I/O plugin changes.
Check for existence of cache library when before attempting to rebuild
the cache.  Create a new cache library object if no cache library was
loaded.

Add missing buffering and cache properties to LIB_PART::FindAlias() to
prevent the plugin from reloading the cache library that may not exist.

Add method to find library by full path and file name.

Revert the check for a symbol in the cache library remove from last
patch.

Add checks for plugin cache file name validity and existence of a the
file before attempting to verify the file modification time to prevent
wxWidgets from raising an assertion in debug builds.

Clear modified flag when saving buffered and/or cached library.
2017-02-13 13:47:46 -05:00
jean-pierre charras 010c10853c Libedit: add "create new lib" in file menu (was only available from the main toolbar)
Make also "Save Lib" shortcut modifiable by user, like other shortcuts.
2017-02-13 09:53:47 +01:00
Wayne Stambaugh d5bf465dc6 Fix library save bug in legacy schematic I/O plugin.
Add the ability to save empty symbol library file for caching and empty
schematic.

Remove check for existing symbol in cache populating routine.  Just perform
a complete rebuild of the cache library and overwrite the existing one.

Fixes lp:1663871

https://bugs.launchpad.net/kicad/+bug/1663871
2017-02-12 18:40:53 -05:00
Wayne Stambaugh e8cf4f0724 Fix bug in legacy schematic I/O plugin.
Move adding LIB_PART to library until the part is fully parse.  The problem
was unique_ptr was cleaning up the part when an exception was thrown during
parsing causing a double free when the cache was deleted.

Add missing try/catch block when loading the cache library during an append
schematic operation.

Fixes lp:1663869

https://bugs.launchpad.net/kicad/+bug/1663869
2017-02-11 20:19:52 -05:00
Wayne Stambaugh eb06b35852 Eeschema: fix schematic I/O plugin symbol name issue.
LIB_ID was changing the symbol name due to the parser dropping everything
past the first '/' character which is interpreted by LIB_ID as the item
version.  Add flag to ignore this in LIB_ID::SetLibItemName() and add a
new ctor so the library nickname, item name, and revision can be set as
required to prevent the standard LIB_ID parsing.

Fix a few places where PART_LIBS functions FindLibraryAlias() and
FindLibPar() were translating wxString symbol names to LIB_IDs where the
LIB_ID parser was truncating the symbol name.
2017-02-11 13:44:17 -05:00
Wayne Stambaugh 7ccdca5ced Use library ID to store library symbol information in the schematic symbol.
Use LIB_ID instead of wxString for storing the library symbol information
in the schematic symbol in preparation for the upcoming symbol library table
implementation.

Change the FindLibAlias and FindLibPart functions in the PART_LIBS object
instead of wxString.  Please note that only the library ID name is used to
search the list of libraries.  The library nickname is ignored.  Once the
symbol library table is implemented and full LIB_IDs are defined, the
library search code will no longer be used and will only be kept to load
older schematics that have not been converted.

Move SCH_LEGACY_PLUGIN_CACHE definition so that the legacy plugin knows
how to properly delete the cache object.
2017-02-10 08:36:59 -05:00
Wayne Stambaugh ebfbbcc1f5 Fix missing part library broken by schematic I/O plugin changes.
The LIB_PART object stores a pointer to the PART_LIB that it belongs to.
Now that the PART_LIB is no long responsible for loading the library, add
the PART_LIB pointer after the library is loaded by the plugin.
2017-02-10 08:36:58 -05:00
Wayne Stambaugh fda677eecc Prevent schematic I/O plugin from setting the library cache to null.
Don't call init() when performing library functions as it was always
setting the m_cache variable to null which cause the library to be
reloaded every time a library command was performed as well as a
memory leak.

Delete cache object when the plugin is destroyed.
2017-02-10 08:36:58 -05:00
Wayne Stambaugh 73bbc35c3e Make the schematic I/O plugin the only option.
Add SCH_PLUGIN object to PART_LIB object.

Convert all PART_LIB I/O to use SCH_PLUGIN.

Remove library caching from PART_LIB and use caching provided by SCH_PLUGIN.

Add support to use PROPERTIES for buffering and document file write control
instead of adding code the SCH_PLUGIN object in the SCH_LEGACY_PLUGIN that
will not be required when the new file formats are implemented.

Add buffering to SCH_LEGACY_PLUGIN to prevent cache from writing file on
every change to library.  This is to prevent the cache library from being
written every time a new symbol is added.

Add option to not save library document file when saving library.  This is
primarily used by the cache library write code.

Move symbol library write code out of LIB_PART and into SCH_LEGACY_PLUGIN.

Add exception handling where LIB_PART caught the exception and returned
an error status.

Remove KICAD_SCH_IO_MANAGER build option as it is no longer optional.
2017-02-10 08:36:57 -05:00
Chris Pavlina 9bb1b33e89 libedit: menu bar UI compliance tweaks 2017-02-07 16:38:23 -05:00
Chris Pavlina 93a90926c2 eeschema: menu bar UI compliance tweaks 2017-02-07 16:38:18 -05:00
Chris Pavlina bca74853d1 Display more information in component selector 2017-02-07 15:01:20 -05:00
Oliver a5dcc192dc Fix for bug where rotating / editing a selected item would remove it from screen
- Added test to see if there was a currently-editing item

Fixes: lp:1661866

https://bugs.launchpad.net/kicad/+bug/1661866
2017-02-07 09:12:38 -05:00
Chris Pavlina 431abcff0c libedit: no units in the new Delete Part dialog 2017-02-05 09:08:07 -05:00
Oliver 4cd7514c8e libedit: Improved selection process for DeleteComponent
- Reused SelectComponent dialog
- Reduced selection to current library only
- Ability to filter component for deletion
- Automatically pre-select the current component
2017-02-05 08:50:22 -05:00
jean-pierre charras 7dddb1d1c1 When editing a label property it always goes to right orientation by itself
Fixes: lp:1661264
https://bugs.launchpad.net/kicad/+bug/1661264
2017-02-02 16:50:49 +01:00
Chris Pavlina 1ab1d8e7e6 Revert "libedit: Improved selection process for DeleteComponent"
This reverts commit 4ba0fef8c1.

This was accidentally merged before review due to clumsiness, and has a
bug.
2017-02-02 06:28:56 -05:00
Oliver 4ba0fef8c1 libedit: Improved selection process for DeleteComponent
- Reused SelectComponent dialog
- Reduced selection to current library only
- Ability to filter component for deletion
2017-02-02 06:14:32 -05:00
Oliver 702795f4a9 Added progress dialogs for library loading
- Modal wxProgressDialog when loading symbol libraries (eeschema / libedit)
2017-02-02 06:14:32 -05:00
Wayne Stambaugh 9319ef034d Fix rotate bug in symbol library editor.
The rotate hotkey was rotating individual items when a block was selected
which is invalid behavior.  Add check for block mode and disable rotating
items when block mode is active.

Fixes: lp:1660875

https://bugs.launchpad.net/kicad/+bug/1660875
2017-02-01 13:07:20 -05:00