Commit Graph

38 Commits

Author SHA1 Message Date
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02: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
Wayne Stambaugh 3cec63e9b9 Pcbnew: plugin improvements.
Allow partial library reads in libraries that support footprint per file.
This includes the KiCad and GEDA footprint libraries.

Allow for partially cached libraries rather than ignoring all valid files
when an error occurs.
2017-06-11 16:21:19 -04:00
Wayne Stambaugh d37a33723a Pcbnew: GEDA plugin fixes and improvements.
Fix a bug in library cache modification check.  The Pcbnew footprint
file extension (.kicad_mod) was used instead of the GEDA footprint file
extension (.fp) which always caused the cache to reload on every library
call.

Allow for partially cached libraries rather.

Remove #ifdefed out exception throw in FootprintEnumerate().  Exceptions
should not be disabled in plugins.
2017-06-09 09:03:27 -04:00
jean-pierre charras 1a33efa133 Fix an issue when reading a gpcb footprint library when a .fp file has a problem.
Now the full library loading is not aborted (and the other libraries in list are also loaded).
Only the bad .fp file(s) is not loaded.
Mainly, a .fp file load error does not throw a library load error, and this is a temporary fix.
But throwing a library error when a .fp file cannot be loaded is worst (you even cannot import a good .fp file).
2017-05-24 14:38:08 +02:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
Wayne Stambaugh 64c892ee23 Make footprint ID into a generic library ID.
Rename FPID to LIB_ID as is now used as a generic library identifier and
is no longer specific to footprints.

Remove all mention of footprint from the new LIB_ID doxygen comments and
code.

Rename files fpid.h and fpid.cpp to lib_id.h and lib_id.cpp.

Rename fp_lib_table.keywords file to lib_table.keywords and adjust CMake
build dependencies accordingly.

Update all source files effected by the code and file name changes.

Update .gitignore for file name changes.
2016-11-20 18:35:08 -05:00
jean-pierre charras 1ae9175671 A few minor fixes for compil warnings (shadowed variables and deprecated auto_ptr) 2016-05-29 17:02:34 +02:00
Chris Pavlina f9386fcbc0 Add support for PCB and footprint format versioning
Currently, kicad_pcb files have a (version ...) tag, but it is ignored. This
commit does the following:

1. Parse the version. If it's later than the last supported version, present an
alternative error message suggesting an upgrade if the file does not load
correctly. The version will be interpreted as an integer YYYYMMDD to suggest
a KiCad release date.

2. Accept a (version ...) tag also in kicad_mod files, but do not write them
yet. If no version tag is present in these files, assume the version to be that
of the current format version at the time of this commit.

This is meant to be merged to the 4.x stable series, and preps for KiCad 5
which will start emitting version tags also in footprints - users with what
will then be 'old stable' will not get a parse error when we introduce this for
footprints, and we can safely increment the format version later.
2016-05-10 15:07:35 -04:00
Simon Wells 731a137af0 Remove unused items in gpcb_plugin.cpp 2016-01-11 22:07:33 -05:00
unknown 1ee7458140 1. Fixed copy paste error in append_board_to_current.cpp ruining a if else condition, should fix a possible bounding box computation bug
2. Whole bunch of pointless casts removed
3. Unused variables removed
4. Fix bug caused by JP on April 25, 2015 where strings were adjusted for translation and the hotkeys section table accidentally swapped the footprint editor title with tag, resulting in "footprint editor" being exported instead of "[footprinteditor]"
No functional changes besides #4, technically it'll "break" imports hotkeys files but April 25 broke imports as well.
2015-11-04 09:48:34 +01:00
unknown 3ca82446d8 Fixes in GEDA footprint plugin import. 2015-10-14 20:22:47 +02:00
Traumflug c5f9896dec Pcbnew: gEDA plugin fix to recognize values with units. (fixes lp:1427494)
* Recognize values with units in more recent gEDA footprint files and scale accordingly.
* Join both parseInt() implementations.  This should reduce rounding errors as well as
  code duplication.
2015-10-12 19:31:26 -04:00
jean-pierre charras 4fc230b773 Rework on Enum PAD_SHAPE_T, PAD_DRILL_SHAPE_T and PAD_ATTR_T (see rev 6008) : the new and better names are now used in Kicad code and existing python scripts.
PAD_SHAPE_T  and PAD_ATTR_T still have a double definition (new names and old names) to be sure python scripts are nor broken by the change.
 PAD_DRILL_SHAPE_T does not  have a double definition, because it is unlikely oblong holes are used in python scripts.
Double definitions will be removed in the (next) future.
2015-08-23 21:40:33 +02:00
jean-pierre charras 6e8a8a6b25 Fix some coverity warnings (mainly not initialized members) 2015-03-21 10:06:04 +01:00
jean-pierre charras 6a016742c9 Fix a typo. 2015-03-04 21:08:57 +01:00
Wayne Stambaugh d13912c26a Fix bug in gEDA footprint library parser and OpenSSL version CMake file. (fixes lp:1427917)
* Fixed incorrect parameter ordering in gEDA footprint library parser
  which read drill diameter, pad clearance and solder mask clearance.
* Fix FindOpenSSL.cmake version detect bug which was exposed by OpenSSL
  version 1.0.2.
2015-03-04 14:46:06 -05:00
jean-pierre charras d6c6b4debb Fix some coverity warnings (mainly not initialized vars). 2015-02-27 15:33:13 +01:00
Maciej Suminski ae431bbb05 Added MODULE::Add( BOARD_ITEM* )/Remove( BOARD_ITEM* )/Delete( BOARD_ITEM* ).
Removed MODULE::AddPad().
2014-07-09 14:22:29 +02:00
Dick Hollenbeck 4578ea8b9e 1) Add 32 Cu Layers.
2) Change from legacy Cu stack to counting down from top=(F_Cu or 0).
   The old Cu stack required knowing the count of Cu layers to make
   sense of the layer number when converting to many exported file types.
   The new Cu stack is more commonly used, although ours still gives
   B_Cu a fixed number.
3) Introduce class LSET and enum LAYER_ID.
4) Change *.kicad_pcb file format version to 4 from 3.
5) Change fixed names Inner1_Cu-Inner14_Cu to In1_Cu-In30_Cu and their
   meanings are typically flipped.
6) Moved the #define LAYER_N_* stuff into legacy_plugin.cpp where they
   can die a quiet death, and switch to enum LAYER_ID symbols throughout.
7) Removed the LEGACY_PLUGIN::Save() and FootprintSave() functions.
   You will need to convert to the format immediately, *.kicad_pcb and
   *.kicad_mod (=pretty) since legacy format was never going to know
   about 32 Cu layers and additional technical layers and the reversed Cu
   stack.
2014-06-24 11:17:18 -05:00
Dick Hollenbeck 991926d320 Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY.  Now any major
   frame with a "change language" menu can change the language for all KIWAY_PLAYERs
   in the whole KIWAY.  Multiple KIWAYs are not supported yet.

*) Simplify "modal wxFrame" support, and add that support exclusively to
   KIWAY_PLAYER where it is inherited by all derivatives.  The function
   KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.

*) Remove the requirements and assumptions that the wxFrame hierarchy always
   had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
   and editors. This is no longer the case, nor required.

*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
   KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
   quickly.  It also gives control to the KIWAY as to frame hierarchical
   relationships.

*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
   the single KIWAY_PLAYER, see bullet immediately above.

*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
   gives the KIFACEs a chance to save their final configuration dope to disk.

*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
   these modal frames are distinctly different than their non-modal equivalents.
   KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
   so this is another important reason for having a dedicated FRAME_T for each
   modal wxFrame.

On balance, more lines were deleted than were added to achieve all this.
2014-05-03 12:40:19 -05:00
Wayne Stambaugh 2d9385b43a Make old behavior the default in EnumerateFootprint() changes. 2013-12-13 18:14:30 -05:00
Wayne Stambaugh 30a08e2bed Pcbnew: minor Geda and KiCad plugin improvements.
* Make GPCB_PLUGIN::EnumerateFootprints() read the directory contents
  instead of loading the entire cache.
* Make KICAD_PLUGIN::EnumerateFootprints() read the directory contents
  instead of loading the entire cache.
2013-12-13 18:01:42 -05:00
Povilas Kanapickas 7f12513c7e Remove some uses of using namespace std. 2013-12-13 10:27:30 -06:00
Wayne Stambaugh 6c4518b015 Pcbnew: Geda plugin fixes.
* Prevent cache from being reloaded on every footprint file read.
* Fix a bug forming wxFileName in GPCB_FP_CACHE::Load().
* Fix invalid file name time stamp debug assertion.
* Use FPID to set loaded footprint name.
* Remove file name <> from exception strings per UIPolicy.
2013-12-12 12:42:38 -05:00
Dick Hollenbeck f72394cc6b Make PLUGIN::Footprint*() API functions take 'const' PROPERTIES*.
Add const PROPERTIES* to FootprintDelete().
Add {Get,Set}Properties() to FP_LIB_TABLE::ROW.
Touch up fp table dialog.
2013-09-25 14:17:06 -05:00
Lorenzo Marcantonio cb49ca5ae2 More int casts to rounding conversions 2013-05-04 13:57:09 +02:00
Lorenzo Marcantonio 78e41187b3 Moved utilities for angles in trigo.h
New conversion routines and sin/cos implementation for angles in decidegrees
2013-05-02 20:06:58 +02:00
Lorenzo Marcantonio 0e903dba5b Angle and distances cleanup (preparing for angles in doubles)
- Removed spurious int casts (these are truncated anyway and will break
  doubles)

- Applied the Distance, GetLineLength, EuclideanNorm, DEG2RAD, RAD2DEG
  ArcTangente and NORMALIZE* functions where possible

- ArcTangente now returns double and handles the 0,0 case like atan2, so
  it's no longer necessary to check for it before calling

- Small functions in trigo moved as inline
2013-05-01 19:32:36 +02:00
Dick Hollenbeck cca97586a9 revert to using quotes around variable text which may be blank 2013-04-10 10:08:01 -05:00
Lorenzo Marcantonio 42709330e0 Better strings for the translators (converted concatenations to formats) 2013-04-09 19:49:01 +02:00
jean-pierre charras 752e4a4a58 All: change some texts and messages hard to translate, or not translatable (and some incorrect messages).
Pcbnew, layer manager: add option (popup menu) to always keep copper layers not visible but the active layer, even when the active layer is changed.
Usefull for multilayer ( more than 4 layers) PCBs.
2013-04-05 09:38:00 +02:00
Andrey Fedorushkov 5a5b90984a all: new Russian GOST patch - author Konstantin Baranovskiy
pcbnew: fix print format in THROW_IO_ERROR
        fix properties file export_vrml.cpp
2013-03-28 00:38:20 +04:00
Wayne Stambaugh 7d0ec1a138 More encapsulation work.
* Complete encapsulation of the MODULE class.
* Complete encapsulation of the EDA_TEXT class.
* Encapsulate most of the ZONE_CONTAINER class.
* Add pcbcommon library as a dependency for reSWIGging the scripting
  support.  This should cover most dependency cases.
2013-03-18 15:36:07 -04:00
Wayne Stambaugh 42d7bf6c8e Pcbnew encapsulation and code cleaning.
* Encapsulate most of the MODULE class.
* Start encapsulating the DIMENSION class.
* Lay some groundwork for EDA_TEXT encapsulation.
* Move cleverly hidden MODULE functions into class_module.cpp.
* Use std::swap to exchange TEXTE_PCB values for undo/redo.
* Remove unused members from MODULE class.
* The usual coding policy and documentation fixes.
2013-03-13 14:53:58 -04:00
jean-pierre charras 4343eb5b8d Fix Bug #1132416. Minor update in templates. 2013-02-24 18:31:18 +01:00
Wayne Stambaugh ade6ec3256 Doxygen warning fixes. 2013-01-03 15:21:40 -05:00
Wayne Stambaugh 7c86749ca6 Add Pcbnew GEDA PCB module plugin support.
* Create new GEDA PCB plug in.
* Add support for opening GEDA PCB footprints with module editor.
* Make import footprint file dialog remember last selected footprint
  type during current session.
* Update module editor file import to use new GEDA PCB plug in.
* Let IO_MGR know about GEDA PCB plug in.
* Create a WHITESPACE_FILTER_READER to simplify parsing GEDA PCB footprint
  files.
2012-12-28 15:52:12 -05:00