Commit Graph

2931 Commits

Author SHA1 Message Date
Maciej Suminski 759359f602 Moved path normalization functions to a separate file
Normalizing paths to environmental variables might be useful in
many places, therefore it is better to keep them accessible.
2017-11-18 20:05:08 +01:00
Wayne Stambaugh a0473614b5 Remove all schematic object load and save code.
All of the schematic object load and save code is implemented in the
legacy schematic plugin so it is no longer required.

Remove unused file with old schematic file loader.

Doxygen comment cleaning.
2017-11-18 08:53:13 -05:00
Wayne Stambaugh e97ce6ee4f Use legacy schematic plugin for loading schematics in all code paths.
Use the legacy plugin schematic loader in the sheet edit and append
schematic code paths.

Check for fully qualified LIB_ID objects (must have library nickname)
when loading existing schematics when edit sheets.

Rewrite append schematic feature to handle import issues rather than
change the name and file name of all of the sheets in the imported
schematic.  This includes the following:
- Load the schematic into a temporary SCH_SHEET object.
- Make sure the imported schematic does not cause any hierarchy
  recursion issues.
- Verify the imported schematic uses fully qualified #LIB_ID objects
  (symbol library table).
- Check to see if any symbol libraries need to be added to the current
  project's symbol library table.  This includes:
- Check if the symbol library already exists in the project or global
  symbol library table.
- Convert symbol library URLS that use the ${KIPRJMOD} environment
  variable to absolute paths.  ${KIPRJMOD} will not be the same for
  this project.
- Check for duplicate symbol library nicknames and change the new symbol
  library nickname to prevent library name clashes.
- Update all schematic symbol LIB_ID object library nicknames when the
  library nickname was changed to prevent clashes.
- Check for duplicate sheet names which is illegal and automatically
  rename any duplicate sheets in the imported schematic.
- Clear all of the annotation in the imported schematic to prevent
  clashes.
- Append the objects from the temporary sheet to the current page.
- Replace any duplicate time stamps.
- Refresh the symbol library links.

Add support code to SCH_SCREEN object to assist with schematic import.

Doxygen comment cleaning.

Fixes lp:1731760

https://bugs.launchpad.net/kicad/+bug/1731760
2017-11-18 08:10:58 -05:00
Seth Hillbrand b6884d3423 Eeschema: Improve wire merging
CHANGED: wires now merge along the full length rather than just
endpoints.  Wires also merge at oblique angles when aligned.
2017-11-17 17:44:18 +01:00
Seth Hillbrand d24c88f254 Eeschema: Show abbreviated units
CHANGED: Edit Line Style shows "in" and "mm" instead of full word
2017-11-17 08:20:00 +01:00
jean-pierre charras a3c4b508f8 Fix a very minor issue in eeschema when plotting in SVG format. 2017-11-16 19:49:07 +01:00
jean-pierre charras bdc6a5950b rename plot_common.h to class_plotter.h, a better name, consistent with other class definitions. 2017-11-16 15:53:30 +01:00
Seth Hillbrand af8b71ac87 Eeschema: Fix bug in block selector
The block selector needs to add all connected items
to the block.  Lines marked skip should not affect
the next item tested.
2017-11-16 08:30:39 +01:00
jean-pierre charras df6d005fd3 A few cosmetic enhancements in dialog_edit_line_style 2017-11-15 20:28:44 +01:00
Wayne Stambaugh 41a9007b6d Fix assertion in symbol library remap dialog.
Do not attempt to normalize environment variables that are not valid
paths, paths that do not exist, or paths that the user does not have
read access to.

Fixes lp:1731655

https://bugs.launchpad.net/kicad/+bug/1731655
2017-11-15 12:24:51 -05:00
jean-pierre charras eaaa85c2c0 Make a few sentences more easy to translate. 2017-11-15 15:38:45 +01:00
jean-pierre charras 0517f78085 eeschema: store line style using a more readable format 2017-11-15 14:08:27 +01:00
Seth Hillbrand 634fc80916 Eeschema: Update line syle colorbox
Line style colorbox is updated to follow Kicad colorbox
convention.  The alpha channel is also forced to opaque.
2017-11-15 08:10:51 +01:00
Seth Hillbrand 7c0a7f9f7b Adds plot functionality to Eeschema line formats
Dotted, dashed and dash-dot lines are provided in
HPGL, PDF, PS and SVG plot outputs along with line
width and color formatting.

DXF format does not currently provide any dashed
line functionality

A bug in HPGL plotted is corrected.  Previous HPGL
dashed line commands were incorrect, plotting all
lines as solid.
2017-11-15 08:10:51 +01:00
Seth Hillbrand b576189a00 Eeschema: Adding line styling options
NEW: Adds support in eeschema for changing the default line style,
width and color on a case-by-case basis.

CHANGED: "Wire" lines now optionally include data on the line style,
width and color if they differ from the default.

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

Fixes: lp:1405026
* https://bugs.launchpad.net/kicad/+bug/1405026
2017-11-15 08:10:51 +01:00
Wayne Stambaugh d98fc85a83 Improve assert message in symbol table remap dialog.
Fixes lp:1731655

https://bugs.launchpad.net/kicad/+bug/1731655
2017-11-13 14:17:49 -05:00
Wayne Stambaugh 7e7d3004fb Fix UI string typo in rescue dialog error message. 2017-11-12 11:38:31 -05:00
Maciej Suminski 75d9a18fc0 VIEW_LIB_FRAME: catch exceptions for invalid libraries 2017-11-12 14:36:20 +01:00
Wayne Stambaugh 620251de69 Fix UI string typo. 2017-11-12 07:38:39 -05:00
Wayne Stambaugh 652b969193 GTK+ file dialog wildcard improvements.
The GTK+ file dialog is case sensitive however it does support regular
expressions.  Most of the file dialog wildcards are lower case so only
files with the lower case extensions will show up in the file dialog.
This code adds a method to convert file extensions of any case to the
appropriate (sch -> [sS][cC][hH]) regular expression on GTK+ builds so
all file extension case combinations will show up in the file dialog.

A note to developers: make sure to add a file extension when setting
when setting the default file argument.  If you do don't set an
extension, the GTK+ file dialog will happily append the regular
expression as the file extension which is surely not what you want.

There are still a few known places (mostly gerbview) where there are
some complex wildcard code that has not been converted.

Fixes lp:1720542

https://bugs.launchpad.net/kicad/+bug/1720542
2017-11-11 19:32:26 -05:00
Maciej Suminski 61578f9da8 SYMBOL_LIB_TABLE: replaced wxASSERTs with wxCHECKs
The replaced wxASSERTs notify the developer that a variable is a
null pointer, but continue code execution and lead to a crash.
Instead, they are changed to wxCHECKs, that give the same type
of notification, but return from a function before the crash
happens.
2017-11-12 01:10:11 +01:00
Baranovskiy Konstantin 1412296398 Fix field align settings in dialogs of Eeschema. 2017-11-11 19:48:28 +01:00
Seth Hillbrand 0017c701c7 Eeschema: Draw junctions last
Places junctions on the schematic after all other items
to avoid visual clutter when a pin overlaps a junction.

Fixes lp:1582343

https://bugs.launchpad.net/kicad/+bug/1582343
2017-11-11 13:41:52 -05:00
Wayne Stambaugh 5181c0ac75 Minor symbol library table edit dialog fix.
A copy and paste error was causing to footprint library table file name
and path to be shown in the symbol library table edit dialog.  Factor
out code in PROJECT::FootprintLibTblName() to PROJECT::libTableName()
to handle both symbol and footprint library table names and create a
new PROJECT::SymbolLibTableName() method to fix the path and file name
in the symbol library table edit dialog.
2017-11-11 10:33:06 -05:00
jean-pierre charras 4af85239ba Internationalize dialog_symbol_remap_base 2017-11-11 11:35:06 +01:00
Wayne Stambaugh 9f0b2e4bb0 Fix project symbol library table load bug in Eagle plugin.
Remove functional code inadvertently added to wxASSERT macro in symbol
library table loader.
2017-11-10 17:55:37 -05:00
Baranovskiy Konstantin 0b34d09bc0 Fix double "choose to" in symbol remap dialog. 2017-11-10 07:31:27 -05:00
Wayne Stambaugh 610ff7485f Fix more bugs in the schematic symbol rescuer.
In the rare case when something goes wrong with the symbol library
table remapping, do not attempt to rescue symbols that are neither
in the cache nor in any of the libraries.

The legacy rescue library code overwrote the existing library so
previous rescues would get lost.  If the rescue library exists,
copy it's contents into the new rescue library before adding the
new rescued symbols so no previously rescued symbols are lost.

Fix a null pointer bug in the symbol library editor when no symbol
is loaded.

Set LIB_ID item name to name passed to LIB_PART ctor.

Copy LIB_ID in LIB_PART copy ctor.
2017-11-09 21:24:43 -05:00
Wayne Stambaugh 6d63873128 Fix a bug in the schematic symbol rescuer.
If a library disappears all together or a symbol name is changed, force
the rescuer to add it to the rescue library.  The current rescue code
only looked for differences if they existed between libraries.  This was
causing symbols to be unceremoniously dumped from the symbol library
table remapping.

Don't search for cache rescue candidates in the symbol library table
rescuer.
2017-11-09 18:50:23 -05:00
Wayne Stambaugh a2e7e7aed4 Clear symbol library list from project file after remapping.
The old symbol library list save/load code does not get called in the
schematic project file configuration code.  Use the LibNamesAndPaths
static function from the PART_LIBS object.

Bump schematic file version from 3 to 4 which represents the switch to
the library table symbol linking which is incompatible with all previous
versions.

Refresh the schematic after running remapping dialog manually.
2017-11-09 18:50:23 -05:00
Wayne Stambaugh 44d81e4005 Minor fixes broken by symbol library table changes.
Add missing CMP_TREE_NODE_LIB_ID type that was inadvertently deleted by
the symbol library table implementation that broke the preselected symbol
tree expansion and highlighting.

Changed CMP_TREE_NODE_LIB_ID type from ALIAS to LIBID for more accurate
description.

Use LIB_ID in COMPONENT_SELECTION object instead of strings of the
library and symbol names.
2017-11-09 18:50:22 -05:00
Wayne Stambaugh 168bf5e4b0 Symbol library archive bug fixes.
Move FindAlias() inside a try/catch block as is can throw an exception.

Don't abort adding symbols to library when a symbol cannot be found in
the symbol library table or the cache library.  Instead, queue up error
messages and display them after attempting to add all of the symbols.

Always save the library file even if some of the symbols could not be
archived.

Catch IO_ERRORs in SCH_COMPONENT resolve to prevent unhandled exceptions
further up the stack.
2017-11-09 18:50:22 -05:00
Wayne Stambaugh 56d73f837d Fix build error caused by rebasing against commit 5eb56dd8. 2017-11-09 18:50:21 -05:00
Wayne Stambaugh 8fd89c881d Final symbol library table changes before merge.
Remove all symbol libraries from the project file after remapping to
prevent symbols that should be loaded from the cache being loaded from
a library further up the search order.  Save the project file to clear
all of the libraries so they never get reloaded again.

Remove the symbol library management dialog and menu entries.

Rename the symbol library table dialog menu entry.

Remove all symbol libraries from default project file to prevent clashes
with the cache library.

Fix illegal symbol naming in Eagle plugin.
2017-11-09 18:50:21 -05:00
Wayne Stambaugh 8d995f48de Update Eagle plugin to use symbol library table. 2017-11-09 18:50:21 -05:00
Wayne Stambaugh c1f7c1778a Revise symbol rescuer to support symbol library table.
Refactor rescue objects so that they can support derivation.

Factor out legacy rescuer code to perform legacy project rescues.

Create new symbol library table rescuer for rescuing symbol library table
based projects.

Perform the correct rescue type on project load.

Add symbol library table remapping support to the tools menu for run on
demand as applicable.

Add flag to SCH_SCREENS::UpdateSymbolLinks() to allow forcing the symbol
link updates when the library modification hash has not changed.
2017-11-09 18:50:20 -05:00
Wayne Stambaugh 36f6d4a1f4 Convert symbol library editor over to use symbol library table.
Simplify some of the library editing code.  There have been a few minor
changes in the behavior of the editor.  If the current symbol is deleted
from the library, the next symbol in the library is not loaded.  The
deleted symbol is cleared and the current symbol is empty.

Change component to symbol to align with the preferred terminology
discussed on the developer's mailing list.

Add separate update UI event for save library as to enable the menu entry
whenever a library is selected.

Change the select symbol list dialog to a single column using the LIB_ID
format LIB_NICKNAME:LIB_ITEM_NAME so that the selection can be parsed by
LIB_ID.

Add method to expand URI to LIB_TABLE_BASE.

Override wxApp::OnExceptionInMainLoop() in debug builds to make debugging
easier when an unhandled exception occurs in a wxUpdateUIEvent handler.

Change SCH_SCREENS::HasNoFullyDefinedLibIds() to return false when the
schematic has no symbols to prevent the remapping dialog from being run.

Use SCH_COMPONENT part reference when creating netlist rather than looking
up the library symbol.
2017-11-09 18:50:20 -05:00
Wayne Stambaugh 329fc18732 Convert component chooser dialog over to use symbol library table.
Change all of the component tree helper objects to use LIB_IDs instead of
LIB_ALIAS pointers.  LIB_ALIAS pointers are dangerous to use because they
can be deleted in the symbol library editor while the component chooser
dialog has copies of them.  With LIB_IDs, the LIB_ALIAS pointer is found
on demand and can be guaranteed to be valid.

Update the chooser dialog to load the symbol library table instead of the
libraries defined in the project file and return a LIB_ID instead of a
LIB_ALIAS pointer.

Modify SCH_BASE_FRAME::SelectComponentFromLibrary() to handle the LIB_IDs
returned from the component chooser dialog.
2017-11-09 18:50:18 -05:00
Wayne Stambaugh 81e8d8fd89 Symbol library table remapping fixes.
Use GetPath() instead of GetFullPath() when initializing environment
variable table entries KICAD_SYMBOL_DIR and KICAD_PTEMPALTE due to
unexpected trailing path separator which was causing find libraries
by URI to fail.

Don't create a project symbol library table when there are no libraries
not found in the global symbol library table.

Don't add non-existent libraries to project symbol library table.

Clear symbol library table when loading a new schematic.

Minor remapping status message improvements.
2017-11-09 18:50:18 -05:00
Wayne Stambaugh 0cf2df51c6 Convert symbol library viewer over to symbol library table.
Remove all instances of PART_LIBS and replace them with SYMBOL_LIB_TABLE
except for the CMP_TREE_MODEL_ADAPTER which requires updating as well.

Return the selected symbol using the LIB_NICKNAME:SYMBOL_NAME format when
viewer is launched as modal.

Add code to SYMBOL_LIB_TABLE object to allow enumerating symbol library
power symbols only.

Add a non-const version of LIB_TABLE::findRow().

Remove redundant information from Doxygen comments.
2017-11-09 18:50:17 -05:00
Wayne Stambaugh 96c3d5ff21 Enable symbol library table remapping.
Check the if the schematic being loaded has been remapped (no symbol
library table nicknames defined) and remap accordingly.

Fix issues when resolving the library symbol links in the schematic
symbols.

Add cache library fallback when resolving symbols that cannot be
remapped.

Add remap complete message to remap dialog.

Add HasLibrary() helper to LIB_TABLE_BASE.

Fix issues when loading library symbols using symbol library table.

Add hashing function to symbol library table.

Improve the symbol panel message to warn user when cache library is
used to resolve symbol.
2017-11-09 18:50:17 -05:00
Maciej Suminski 636298b5dc Fixed 2 warnings in eeschema/sch_plugin.cpp
- removed an implicit conversion of NULL to boolean false
- removed an unused variant of not_implemented() function
2017-11-10 00:33:26 +01:00
Marvin Schmidt 69974b73db Remove some extra semicolons 2017-11-09 19:52:18 +01:00
Marvin Schmidt a155a5c780 Remove some dead code 2017-11-09 19:52:17 +01:00
Marvin Schmidt 7daaa3e9d9 Remove unused #define 2017-11-09 19:52:17 +01:00
Maciej Suminski cd21218c34 Fixed a memleak in libedit undo buffer, minor code cleanup
In LIB_EDIT_FRAME::GetComponentFrom{Undo,Redo}List() methods, the
PICKED_ITEMS_LIST object which was retrieved from undo/redo list has not
been destroyed.

Rewritten SCH_SCREEN::ClearUndoORRedoList() to be easier to read.

Minor whitespace formatting.
2017-11-08 17:32:59 +01:00
Wayne Stambaugh d5290bdfe0 Fix malformed symbol libraries when importing Eagle schematics.
KiCad library symbol text objects cannot contain carriage returns and/or
line feeds which isn't the case with Eagle symbol libraries.  Otherwise,
the library file will be corrupt when it is saved.  Fixing this in the
legacy plugin would break the current file format so just replace them
with underscores.  Ideally these text objects should be broken into
multiple text objects but the current plugin design doesn't support
this.
2017-11-04 21:36:47 -04:00
Tomasz Włostowski b945d2a708 cleanup: replace CLASS_MIRE with CLASS_PCB_TARGET for naming clarity 2017-11-03 20:02:06 +01:00
jean-pierre charras 08a9dc01c5 Fix minor coding style issues 2017-11-03 10:22:34 +01:00
Maciej Suminski 5eb56dd8b0 Coverity fixes
CIDs:
102571
168696
168701
168704
168706
168708
168710
168713
168716
168717
2017-11-01 10:24:26 +01:00