Commit Graph

143 Commits

Author SHA1 Message Date
Maciej Suminski 444811ccfe Added exception handler for SCH_EDIT_FRAME::ImportFile 2017-10-20 09:34:32 +02:00
Maciej Suminski d617021d98 Added 'Import Non-KiCad Schematic' 2017-10-20 09:34:32 +02:00
Maciej Suminski 6b44d12bd8 Revert modifications to SCH_EDIT_FRAME::OpenProjectFiles() 2017-10-20 09:34:32 +02:00
Russell Oliver 2a0a999350 Eeschema Eagle Import: Code clean-up and formatting 2017-10-20 09:34:32 +02:00
Russell Oliver 3b0855d204 Eagle Project Import: Code cleanup and documentation.
- Also makes the project and file import functions filetype dependent.
- The change from IO_MGR::KICAD to IO_MGR::KICAD_SEXP removes a conflict from a compile definition for KICAD when compiling kicad/import_project.cpp
2017-10-20 08:58:40 +02:00
Russell Oliver 869743d573 Kicad Eagle Project Import Improvements. -- schematic and board files are both visible in file selection dialog. -- Allows for the selection of either the board or schematic file. -- silently fails on not detecting the corrosponding board or schematic file. -- all new kicad files are generated in new project directory -- Silently read netlist without generating annotation warnings which synchronises timestamps and paths based on given eagle references, otherwise renumbering schematic references will break links accross schematic and pcbnew. 2017-10-20 08:58:40 +02:00
Russell Oliver 433aa653fe Kicad: Add Project import function. -- add menu entry -- add ImportFile kiway function -- expose functions for creating/reading netlist -- add example eagle boad file as well 2017-10-20 08:38:42 +02:00
Maciej Suminski d6383893a2 eeschema: Iterate through plugins when determining file format. 2017-10-20 08:38:38 +02:00
Russell Oliver 4e69acbb49 Eeschema: Add CheckHeader function to SCH_PLUGIN and cycle through plugins when loading files. 2017-10-20 08:38:38 +02:00
Russell Oliver 7ea33f76b4 Eeschema: Determine file plugin to use from first line of file. 2017-10-20 08:38:38 +02:00
Maciej Suminski c727423979 Work in progress
- !! Eeschema uses Eagle plugin for loading schematics (i.e. it does not
use KiCad format anymore)
- Fixed build errors
- Fixed a few crashes
- Code formatting
2017-10-20 08:38:37 +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
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
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
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 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 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 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
Dick Hollenbeck 9ad49dc2d1 Split IO_ERROR out of richio.* and store Problem() and Where() separately 2016-09-20 11:56:18 -04:00
Nick Østergaard caafcde585 Add KICAD_ prefix to build switches
KICAD_ prefix was added to the USE_OCE and USE_SCH_IO_MANAGER build
switches together with a small description to the devdocs from
compiling.md.
2016-09-05 08:46:01 -04:00
jean-pierre charras 13cfe74956 Simulator dialogs: fix minimal sizes and best sizes. 2016-08-20 17:25:51 +02:00
Wayne Stambaugh 98ad5096b0 Eeschema: add saving schematic files to schematic plugin.
* Add SCH_PLUGIN::Save() for current file format and code for saving all
  SCH_XXX objects.

* Add function to SCH_FIELD to get the position of the field in the component
  not the position added to the component position which is what GetPosition()
  does.  This was required because saving the component field expects position
  of the field sans the position of the component.

* Remove public members from BITMAP_BASE object and fix all associated
  code.

* Fix the never ending coding policy violations found making these changes.
2016-07-11 15:48:46 -04:00
Wayne Stambaugh 3bdca9a821 Eeschema: schematic I/O manager bug fixes.
* Create a new dummy root sheet and screen when the schematic fails to load
  which was causing Eeschema to crash.

* Remove conversion from UTF8 to wxString left over from a previous change
  which hopefully will fix an OSX build error.

* Fix parsing of text objects to handle version 1 schematic files.

* Fix parsing of component fields to handle version 1 schematic files.

* Don't throw a parse error when a version 1 schematic file doesn't end with
  $EndSCHEMATC.
2016-07-07 09:09:32 -04:00
Wayne Stambaugh 4ed346ea64 Eeschema: initial schematic I/O plugin.
* Factor out PROPERTIES object from the PCB plugin code and move it into
  common so it can be used by both the Pcbnew and Eeschema plugins.

* Add schematic I/O plugin manager for loading and saving schematic and
  component library files.

* Add initial attempt at a parser for current schematic file format.  This
  parser will be infinitely more strict than the current parser which is very
  forgiving in what it parses.

* Make minor changes to the base bitmap class to support the new parser.

* Add find root sheet support to sheet object to allow fetching the root
  sheet from any sheet in the stack.
2016-07-06 05:22:56 -04:00
Chris Pavlina 0f407a756c Pull existing settings into Doxygen module 2016-05-12 15:45:47 -04:00
jean-pierre charras c1f0ab91a2 Code cleaning and coding style fix. 2016-04-23 17:44:17 +02:00
Wayne Stambaugh 97949ffde9 Undo commit -r 6353. 2016-02-15 15:24:59 -05:00
Wayne Stambaugh ee23342e31 Undo commit -r6541. 2016-02-15 15:10:57 -05:00
Wayne Stambaugh 61454bf04c Eeschema: fix annotation bugs. (fixes lp:1542579)
* Ensure proper SCH_SHEET object page numbering which caused annotation to
  calculate incorrect reference designators when annotating by using page offsets.
* Added SetPageNumbers to SCH_SHEET for setting sheet page numbers after
  schematic is loaded.
2016-02-07 09:01:28 -05:00
Martin d'Allens d18baf1487 Eeschema: Set modified flag after "Append Schematic Sheet" 2016-01-23 10:25:07 -05:00
Wayne Stambaugh 2667109c44 Eeschema: SCH_SHEET improvements for Eeschema refactor.
* Make SCH_SHEET parent the SCH_SHEET object that loaded it.  This preserves
  the hierarchy when the schematic is loaded.
* Add function to SCH_SHEET to find the root sheet from any sheet in the
  hierarchy.
* Add functions to SCH_SHEET to create the path and human readable paths for
  any sheet without relying on the external SCH_SHEET_PATH object.
* Remove function LocatePathOfScreen from SCH_SHEET since it was not used
  anywhere.
* Add human readable path to message panel information for SCH_SHEET.
* Set the name of the root sheet to "root" instead of the default generated
  when a new SCH_SHEET is created.
* Set the empty sheet name and file name to "root" and "noname.sch" when
  Eeschema is opened with no schematic.
* When no item is at the current position on a left mouse click, show the
  current sheet information in the message panel.
* Add less than operator for sorting SCH_SHEET objects by path length and
  time stamps when the path lengths are the same.
2015-12-07 19:37:11 -05:00
Mark Roszko 33419ee4bf Eeschema: remove unused headers, unused variables, redundant casts, and minor boolean tweaks. 2015-11-03 14:44:05 -05:00
Chris Pavlina fa29c62277 Fix saving undo/redo limits in Eeschema. 2015-08-05 20:10:52 -04:00
unknown 15cc245a83 Eesschema, dialog rescue: enhancements:
- Slightly change the info text in the dialog. Add a definition of  exactly what it means to "rescue" a component.
- Reload the project libraries when a project is opened, even if kicad  is already running and the same project is open (to be sure the lib cache is up to date).
- Set the Modified flag on cancel, because a change has indeed been  made (choosing not to rescue is equivalent to updating the components)
2015-06-29 18:31:00 +02:00
Chris Pavlina 80eb5460f9 Eeschema: component library rescue improvements.
* Fix case sensitive component library name searches
* Factor out rescue code into a generic rescue project class.
2015-06-22 11:38:54 -04:00
Chris Pavlina a543b5063f Work around for assertion in Eeschema when auto save tries to save unnamed schematic. 2015-06-18 14:43:26 -04:00
jp charras 722435f317 Fix issues in auto-save files:
* auto-save was broken for all sub sheets with are in a sub-directory of the project directory. (reason wxFileName::Normalize(), used to create the absolute path  has issues with filenames starting by '$', perhaps due to env var which also start by $). the auto-save prefix is modified ( now AUTOSAVE_PREFIX_FILENAME which defines "_save_"  ) and defined only once.
* auto-save files from sub-sheets were not found due to the fact the path was not set (fixed by Blair Bonnet's patch)
2015-05-03 15:48:05 +02:00
jean-pierre charras 3b9ebd2270 Minor fixes in dialog rescue: missing title, incorrect refresh due to use of a wxPaintDC outside a paint event, and coverity warnings (not initialized members). 2015-04-27 10:44:17 +02:00
Chris Pavlina 26c320db57 Add schematic component library change rescue feature (fixes lp:1435338).
* Add code to test if any of the components in the schematic cache have been changed
  in the component libraries.
* Prompt user to accept or reject components when changes are found.
* If the user chooses to use the components in the cache, create a new library with the old
  components and add it to the beginning of the component library list so the schematic will
  not be changed.
* Create dialogs to handle user feedback and status.
2015-04-25 18:26:51 -04:00
jean-pierre charras c586d9735e Eeschema: fix bug #142970 (broken append sheet function)
Fix a few minor coverity warnings.
2015-03-10 19:31:21 +01:00
jean-pierre charras c6f4f15926 Eeschema: Minor code reorganization:
* move not shared files (sch_item_struct.*, sch_base_frame.h) to eeschema;
* move wxEeschemaStruct.h to eeschema and rename it schframe.h to be consistent with the other corresponding file name schframe.cpp;
* remove few not needed  #include
2015-02-21 10:46:44 +01:00
Dick Hollenbeck 3e861db371 Lock file improvements. 2014-09-07 15:01:26 -04:00
jean-pierre charras 1222924607 Eeschema: Fix some issues (all connections showed as not connected, DRC and NETLIST errors if all sheets in a hierarchy were not open) due to the fact the pointer of a schematic component to its part lib was calculated too late (or never calculated). 2014-08-18 18:39:51 +02:00
Dick Hollenbeck 5f70ec63b1 unused 2014-08-15 07:44:03 -05:00
Dick Hollenbeck 7e483f69bd Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
     get disassociated from their true PROJECT.
  *) Allow loading eeschema library editor from kicad.exe
  *) Allow loading pcbnew library editor from kicad.exe
  *) Rename LIB_COMPONENT to LIB_PART.
  *) Add class PART_LIBS, and PART_LIB.
  *) Make PART_LIBS non-global, i.e. PROJECT specific.
  *) Implement "data on demand" for PART_LIBS
  *) Implement "data on demand" for schematic SEARCH_STACK.
  *) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
  *) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
     a weak pointer.
  *) Remove all chdir() calls so projects don't need to be CWD.
  *) Romove APPEND support from OpenProjectFiles().
  *) Make OpenProjectFiles() robust, even for creating new projects.
  *) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
     and save them in the .eeschema config file, not in the project file.
  *) Fix bug with wxDir() while accessing protected dirs in kicad.exe
  *) Consolidate template copying into PROJECT class, not in kicad.exe source.
  *) Generally untangle eeschema, making its libraries not global but rather
     held in the PROJECT.
2014-08-13 15:28:54 -05:00
jean-pierre charras 33605eaaec Eeschema fixes: fix Bug #1348983 save cmp file crashes cvpcb when eeschema is opened (backannotation crashes). Happens only when some footprint names are not set (blank names).
Also fix incorrect backannotation when footprint names contain spaces (put spaces in names is always a bad idea)
* Fix minor Bug #1349058 Choose component dialog: Search field loses focus after entering a character and internationalize the dialog.
* Fix a subtle bug which prevent eeschema to read the project config file when launched from kicad manager, and when kicad.pro is not found.
2014-07-28 11:24:15 +02:00
Dick Hollenbeck 6beacd6e95 Rework FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer(), fix up comments and warnings. 2014-04-04 09:57:26 -05:00
jean-pierre charras beb33c7522 Eeschema: fix Bug #1298868 (Can't create new schematic from main toolbar icon) - Fix a bug I created in rev 4773 2014-03-28 14:23:26 +01:00
jean-pierre charras 36e62b1047 Eeschema: fix Bug #1298868 (Can't create new schematic from main toolbar icon) 2014-03-28 14:08:48 +01:00
jean-pierre charras f1ee6de025 Eeschema: does not close when the schematic file given in command line to run Eeschema is not found (i.e. when starting a new project). Otherwise one cannot start a new schematic project. 2014-03-23 07:44:15 +01:00