Commit Graph

144 Commits

Author SHA1 Message Date
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
Henner Zeller cd49ff0120 Pcbnew: prevent reversal of pad loading order when loading board.
When opening a board file and storing it again, the pads in all
embedded modules get reversed.  This is generally not really nice
if the PCB is managed by version control as it creates churn and
could make merges hard.
2016-10-17 10:07:29 -04:00
Dick Hollenbeck 7311f07eaf SWIG Improvements
*) Extend SWIG support deeper into the BOARD class.
*) Move swig *.i files into a directory identified for SWIG, in preparation
   for a parallel universe involving Phoenix's SIP.
*) Move swig files which will be common to both eeschema and pcbnew into
   common/swig.
*) Sketch out a "common" python module, and plan on dovetailing that into a
   libkicad_shared.{dll,so}
*) Add common/swig/ki_exceptions.i and define a macro HANDLE_EXCEPTIONS()
   which is to be applied to any function which needs C++ to python
   exception translation.
*) Move the test for SWIG tool into top level CMakeLists.txt file for use
   in all python modules beyond pcbnew, i.e. eeschema and common.
*) Add SWIG_MODULE_pcbnew_EXTRA_DEPS which generates a better Makefile, one
   which rebuilds the swig generated *.cxx file when one of its dependencies
   change.
*) Re-architect the board.i file so that it can be split into multiple *.i
   files easily.
*) Make some KIWAY from python progress, in preparation for Modular KiCad
   phase III.
2016-09-20 11:59:43 -04:00
Maciej Suminski 0cc2c87ef8 Removed BOARD::AppendNet()
It is handled by BOARD::Add() now.
2016-09-12 13:45:57 +02:00
Tomasz Wlostowski e5524832a9 pcbnew: added diff pair gap & width to Design Rules dialog & PCB file format. 2016-08-15 17:16:49 +02:00
Cirilo Bernardo 8fdd6b1627 Fix 3D model file name parsing bug. (fixes lp:1609122) 2016-08-03 13:39:39 -04:00
Mrio Luzeiro d8eab321f7 3D Viewer: complete refactor of the 3D viewer.
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
  for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.
2016-07-19 13:35:25 -04:00
Simon Richter da5699de0a Replace boost::shared_ptr with std::shared_ptr. 2016-06-29 11:09:55 -04:00
jean-pierre charras 6d1e904334 Code cleanup: Remove outdated decimils to/from iu defines and conversion functions (decimils are no more in use since a long time).
Remove convert_from_iu.h file, only used for one define, and containing brokenand duplicate defines. Only convert_to_biu.h is now used.
2016-06-05 13:49:25 +02:00
Chris Pavlina 5044fc5799 Fix build error on some platforms from r6788
r6788 = git f9386fc
2016-05-10 18:57:10 -04: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
jean-pierre charras 4a838fb8c3 Pcbnew: Add rounded rect pad shape. 2016-04-06 20:15:49 +02:00
jean-pierre charras 44fc6cb337 Fix issue: "Malformed footprint causes crash on load" (in fact, no crash: just an assert dialog is shown) 2016-03-13 16:39:18 +01:00
Dick Hollenbeck 7c637ea7be github fix and comment improvements:
* Fix a StrPrintf() %s count mismatch bug
* Better comments
* Use std::string::data() instead of a ref to the first char to get the str::string buffer  (should not change anything with GNU lib)
2016-02-04 17:49:20 +01:00
jean-pierre charras 50db57f4d5 Pcbnew: fix Bug #1540967 (zone keepout incorrectly created if previously a corner-smoothed copper zone was created). This option (non relevant for a zone keepout) is now cleared. 2016-02-02 21:32:11 +01:00
jean-pierre charras 21d700facc Replace "module" by "footprint" in a few messages. 2015-11-17 17:18:00 +01:00
Wayne Stambaugh 41242a5a00 Pcbnew: fix error message on footprint ID load failure. 2015-09-22 13:05:07 -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
unknown cc7549a2a5 * Python scripting: brings pad.GetZoneConnection() and in example pad.SetZoneConnection(pcbnew.PAD_ZONE_CONN_FULL) to full workable.
* Cleanup namespace  in enum ZoneConnection in pcbnew/zones.h to self-explained names unification:  PAD_ZONE_CONN_INHERITED, PAD_ZONE_CONN_NONE,PAD_ZONE_CONN_THERMAL,PAD_ZONE_CONN_FULL, PAD_ZONE_CONN_THT_THERMAL
2015-08-18 16:19:17 +02:00
unknown 07ad6cb0bb Fix potential crash in pcbnew (if if a pad in a footprint in a mal-formed .pretty library contains a reference to a net) 2015-07-29 20:55:56 +02:00
Tomasz Wlostowski 63b35f40a7 Removed all dependencies on boost::polygon except for bitmap2component. Replaced almost all instances of CPOLYGONS_LIST with SHAPE_POLY_SET. 2015-07-27 21:45:57 +02:00
Maciej Suminski d2ebf688f9 Reverted commits that remove boost::polygon dependency (need more testing). 2015-07-14 22:23:13 +02:00
Tomasz Wlostowski 41c753b05d Removed all dependencies on boost::polygon except for bitmap2component. Replaced almost all instances of CPOLYGONS_LIST with SHAPE_POLY_SET. 2015-07-14 13:36:24 +02:00
Chris Pavlina 8b33bfc61b Fix remaining invalid net ID bugs in board file parser. 2015-06-12 09:59:58 -04:00
Chris Pavlina 097c73b8eb Fix crash when parsing a PCB file with an invalid net code. 2015-06-08 15:28:04 -04:00
jean-pierre charras bb50e141f4 Pcbnew: Force visibility of items which have no option in dialogs to controle this visibility, when reading the .kicad_brd file.
these options are used in GAL mode, but the usercannot control this visibility. So if the board file does not have these visibility flags set, the GAL never show them.
Fix also a compil warning.
2015-03-26 14:20:11 +01:00
jean-pierre charras 9004ed8801 Remove a few coverity warnings. Fix some comments which were incorrect, due to the changes in code. Remove not compiled code (kept as comments), now outdated or useless
legacy plugin: better compatibility with old brd files (current track width and current vias size, stored in SETUP section, were not read from file and incorrectly set)
2015-03-13 17:48:42 +01:00
Wayne Stambaugh 4c6ca81f2c More Coverity scan error fixes. 2015-02-22 16:25:29 -05:00
Wayne Stambaugh d1d1e2b58a Lots of Coverity scan error fixes. 2015-02-20 19:41:10 -05:00
Wayne Stambaugh f4d5e349bf Fix a bunch of Coverity scan "unhandled exception" errors. 2015-02-17 13:47:21 -05:00
jean-pierre charras b556fb2324 Class BOARD: Rename an overloaded method named SetLayer with the better name SetLayerDescr, and comment it. It also remove some warnings when compiled with option -Woverloaded-virtual 2015-01-29 17:01:48 +01:00
jean-pierre charras ebb967c46f Pcbnew: fix issues and potential issues when reading board files and mainly old board files, and enhance the DRC tests and Delete Single Pad Net option when reading a netlist:
* Delete Single Pad Net option does not delete the net if a zone use this net (i.e. is attached to this pad).
* pcb_parser accept now negative netcodes in zones (can happen with old files, which previously could crash Pcbnew)
* pcb_parser accept now files with incorrect or missing net count  (can happen with old files, which previously could crash Pcbnew)
* if a zone has a non-existent net name it now keep this net name, and DRC detect it (previously, the net name was lost, and the DRC did not tected this issue).
* Drc test: now detect a "dead" net, i.e. a net with 0 pads, but still used by a zone. It happens easily after a schematic modification, when a net disappears or is renamed.
2015-01-22 13:06:34 +01:00
jean-pierre charras 0e996cac9e Pcbnew: fix Bug #1395594 (pcbplotparams parser sensitive to formatting)
Looked like a minor issue, but was due to a more serious bug, when using 2 different DSN_LEXERS which were not synchronized.
The fix is not perfect, but unfortunately, the parser used to read the PCB_PLOT_PARAMS in .kicad_pcb files is also used in legacy board file reader.
Therefore it is better than write 2 parser functions, one for legacy files, the other for the .kicad_pcb files, which make the same thing.
2014-12-04 20:15:26 +01:00
jean-pierre charras 82339a9235 Fix bug #1358742 (drill map file output faulty), which was Gerber format specific.
Minor code change (which removes a SWIG warning)
2014-10-13 10:40:34 +02: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
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 611592029f fix Inner1.Cu in pcb_parser.cpp, start cvpcb work. 2014-07-05 15:42:59 -05:00
Lorenzo Marcantonio e2e4fc4830 Added missing support for reading the *.CrtYd layer token 2014-07-05 14:35:18 +02:00
Dick Hollenbeck 4d9f87bf0b fix BUG parsing the kicad_pcb (layers ..) declaration section. First non-cu was being dropped. 2014-06-30 13:45:43 -05:00
Dick Hollenbeck 575f13d887 fix VIA::IsOnLayer() 2014-06-29 23:40:16 -05:00
Dick Hollenbeck 3aa880dedb fix pcb_parser for new board, coding standards 2014-06-29 16:50:06 -05:00
Dick Hollenbeck 06bf0821b9 fix LSET() constructors, formatting 2014-06-29 15:33:29 -05:00
Dick Hollenbeck add4d5eb6f re-work the LSET(int,...) constructor 2014-06-29 13:09:32 -05:00
Dick Hollenbeck b920fa00a5 1) Fix compiles using wx 3.x and 2.8.
2) Fix passing wxString to common/config_params so lookup keys 
   can be dynamically generated.  This gives ~/.kicad files all the colors.
3) Fix LEGACY_PLUGIN so it loads all layer types and masks properly.
4) Extend the table in router/pns_index.h to 128 from 64.
2014-06-24 23:36:02 -05: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
Maciej Suminski 2af3e5f6e9 bugfix #1325743: cvpcb crashes when opening any netlist. 2014-06-03 09:32:57 +02:00
Maciej Suminski fa846932c1 bugfix 1325375: pcbnew crash while append a board 2014-06-02 11:41:54 +02:00
Maciej Suminski f31f92e45e Fixes the bug that causes pcbnew crash, when there are multiple net classes and the plot dialog was opened.
Changed NETCLASS* to boost::shared_ptr<NETCLASS>.
2014-05-20 11:29:37 +02:00
Maciej Suminski 4fcaf4c586 Minor BOARD_DESIGN_SETTINGS refactoring.
Removed SetCurrentClassName() (it was not used anywhere and less safe than SetCurrentClass()).
Added BOARD_DESIGN_SETTIGNS::GetDefault() to make some pieces of shorter and clearer.
2014-05-15 10:51:08 +02:00
Maciej Suminski d9eb15c9fa Moved NETCLASSES to BOARD_DESIGN_SETTINGS.
Most of the changes are just adding GetDesignSettings() before every occurence of m_NetClasses.
More complex changes:
class_netclass.cpp - NETCLASS does not store the pointer to the parent BOARD anymore. Added function SetParams( BOARD_DESIGN_SETTINGS& ).
class_netclass.h - Removed GetTrackMinWidth(), GetViaMinDiameter(), GetViaMinDrill(), GetuViaMinDiameter(), GetuViaMinDrill() as they were refering to BOARD_DESIGN_SETTINGS anyway (they are not net class specific).
kicad_plugin.cpp - filters out empty nets (that are anyway not saved) when storing net class information. Previously it was done in NETCLASS::Format() function.
2014-05-13 11:22:51 +02:00