Commit Graph

217 Commits

Author SHA1 Message Date
Maciej Suminski 985aed36c7 Moved FMT_UI & FMT_ANGLE macros to a separate header 2017-10-20 09:34:32 +02:00
jean-pierre charras 72d4889a6d Remove duplicate code (pcbnew saves twice 'general' and 'layers' keys in 'kicad_pcb' file)
Fixes: lp:1724522
https://bugs.launchpad.net/kicad/+bug/1724522
2017-10-18 18:01:34 +02:00
Kristoffer Ödmark 4a5d400ec2 pcbnew: copy/paste code cleanup & formatting 2017-09-30 14:28:54 +02:00
Tomasz Włostowski c6a0ad895b pcbnew: code formatting, removed previous module editor copy/paste functions 2017-09-30 14:28:54 +02:00
Kristoffer Ödmark 7ff096fbac updating patch to master 2017-09-30 14:28:53 +02:00
Kristoffer Ödmark 05d8f1071e Made the formatHeader into multiple small functions 2017-09-30 14:28:53 +02:00
Kristoffer Ödmark c0981b8444 Added a new plugin that can save and load to clipboard, using ctrl+shift+c/v for copy pasting
Added the needed kicad_clipboard files and made copy pasted modules have no path
2017-09-30 14:28:53 +02:00
Oliver Walters c977c88a10 Zone keepout exclusion now works on multiple layers!
Bug fixes for keepout layers

- Changed LSET::size() -> LSET::count()
- Save/load functions no longer depend on zone being a keepout
2017-09-27 10:35:00 +02:00
Oliver Walters 0f6ec7632b Enable multi-layer for keepout zones
- Load / save from PCB file correctly
- Doesn't display properly yet
- Keepout only actually applies to one layer (for now)
2017-09-27 10:34:59 +02:00
Wayne Stambaugh cb764d73c5 Minor trace logging improvements.
Make all trace environment variable strings upper case and prefix with
KICAD_TRACE_ for consistency.

Add Doxygen group for the trace environment variable strings.
2017-09-21 08:58:41 -04:00
jean-pierre charras a43f3ab1fe replace "BasicShape" by "Primitive" in code, a better name 2017-09-20 12:51:10 +02:00
Maciej Suminski cca63801bf Renamed D_PAD::{Set,Get}PadName() to D_PAD::{Set,Get}Name() 2017-09-19 18:23:50 +02:00
jean-pierre charras e2d3fcec02 Add support for custom pad shape. Full support in DRC and PnS.
add option to use shape or convex hull as clearance area in zones.
simplify code to handle clearance area
2017-09-19 09:02:53 +02:00
Dick Hollenbeck 19e6bde09a Rewrite class UTF8 to contain rather than extend std::string storage.
This forces the compiler class specific features rather than borrowing
from the base class's std::string.  In some cases prior to this,
wxString( std::string ) was being called rather than UTF8::operator
wxString() leading to garbled wxStrings.

Added function UTF8::wx_str() which is of great convenience also.

Implicit conversions still work as before, and hopefully more reliably.
2017-07-26 08:30:12 -04:00
Dick Hollenbeck 4e7de8a761 Reverse commit 4011ed4e31.
This commit was too broad and not cognizant of the purpose of the class
UTF8.

Add MAYBE_VERIFY_UTF8() macro, which can trap non-UTF8 encoded strings in
debug builds.

Use that macro conditionally in class UTF8 to trap non-UTF8 encoded strings
being put into UTF8 instances.
2017-07-26 08:26:56 -04:00
Maciej Suminski 5774fd284e pcbnew: Do not sove 'no_connects' and 'area' in .kicad_pcb
These data are redundant as they are calculated by pcbnew.
2017-06-26 08:59:20 +02:00
Maciej Suminski 544e944647 pcbnew: Do not save 'links' information
It is not parsed anyway and the new connectivity algorithm
does not calculate it.
2017-06-26 08:40:50 +02:00
Maciej Suminski f3fbce9560 Code formatting and clean-up 2017-06-23 15:43:13 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 3cba1007eb Removed legacy connectivity/ratsnest algorithm, replaced with the new one. No legacy autorouting for the moment 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 08314082db Hide DLISTs behind iterators, first step towards refactoring the storage model 2017-06-23 11:12:36 +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 096d9fbbf9 Pcbnew: continue loading footprints after first failure.
The footprint library cache handler would throw an exception on the
first error it encountered preventing all subsequent footprint files
from being parsed even if there was nothing wrong with them.  This
commit queues errors until all of the footprint files in the folder
have been parsed.

Fixes lp:1416736

https://bugs.launchpad.net/kicad/+bug/1416736
2017-05-03 15:27:07 -04:00
jean-pierre charras 70c961fe6a Pcbnew: fix serious issues (broken files) when saving and loading .kicad_pcb files when zones have holes in outlines. 2017-04-07 08:02:26 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04: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
Alejandro García Montoro f68ce306bd CPolyLine -> SHAPE_POLY_SET refactor.
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.

The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.

The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
2017-03-24 10:43:47 +01:00
Maciej Suminski 389c7b2bbc Added AUTOROUTER_CONTEXT to keep objects used by autorouter
The main reason is to keep cached board bounding box and limit repeating
parameters in functions used by the autorouter.
2017-03-03 13:28:19 +01:00
jean-pierre charras 6c5808fd18 Update dale of last change. Add a small comment about CTL_OMIT_HIDE. 2017-01-29 09:29:49 +01:00
Dick Hollenbeck 35fc1f3361 Move "hide" back to prior fp_text location 2017-01-28 09:33:25 -05:00
Dick Hollenbeck d4acfb9f5a Remove doubled fp_text "hide" output, change *.kicad_pcb format under authorization of Wayne. Fix exceptions.cpp PARSE_PROBLEM which was missing the offset %d. 2017-01-26 08:02:35 -05: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
Simon Richter b0f9864bc4 Clean up warnings from exception handlers
The exception objects caught are either not referenced at all, or only in
debug builds. This avoids the warnings for the unused variables.
2016-10-10 11:08:49 -04:00
Wayne Stambaugh 9490b02cb8 Pcbnew: fix board I/O plugin formatter build warnings.
Internally time stamps are defined as unsigned long.  On some platforms,
time_t is defined as unsigned long long.  Cast all time_t instances to
unsigned long to prevent the compiler from complaining.
2016-09-24 11:53:22 -04:00
Chris Pavlina 910cafe72e FUTURE_FORMAT_ERROR: don't nest errors unnecessarily 2016-08-16 22:02:05 -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
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 7b5ab741bb Fix null dereference for certain bad PCB files
Coverity: CID 147344 Unchecked dynamic_cast

If a file that parses validly in Parse() but does not return a BOARD is loaded,
no exception will be thrown but the dynamic_cast will return NULL. This NULL
is tested by wxASSERT(), which does not actually halt anything (especially in
release builds), and then we proceed to board->SetFileName().

This can be demonstrated quickly by renaming a .kicad_mod to .kicad_pcb and
trying to load it. pcbnew will crash.
2016-05-10 22:36:39 -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
Simon Richter da9ca2def2 Avoid cast from const_iterator to iterator
The standard library requires iterators passed to functions that modify the
container to be mutable iterators, but GCC's implementation accepts
const_iterator in some places where these are only used to mark a place,
but the actual modification happens through a different parameter.

As this breaks implementations that use the passed iterator to modify the
container (e.g. because they use a different data organization), this is
not portable; because we already have a non-const reference to the
container anyway, this is trivially fixed as well.
2016-01-17 12:31:00 -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
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
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
jean-pierre charras 0d77a8600d Pcbnew: always save the line width of footprint graphic edges in files, to allow width = 0 in polygon outlines.
(should not change anything currently for all existing footprints).
2015-04-08 15:45:34 +02:00