Commit Graph

52 Commits

Author SHA1 Message Date
Seth Hillbrand 1828e8cb0f pcbnew: Use Default width define instead of nums
The board design settings file keeps our default values for various
thicknesses.  We use this to replace a number of magic numbers with the
defined value to help self-document the code.
2018-10-08 09:17:40 -07:00
jean-pierre charras b60c368b3c DXF import: fix incorrect import of arcs.
The new dxflib uses degrees, not radians for angles.

Fixes: lp:1792413
https://bugs.launchpad.net/kicad/+bug/1792413
2018-09-15 18:18:33 +02:00
jean-pierre charras a27ba65ed2 DXF import: verify the layer used to import the DXF drawings is valid (correctly selected). 2018-07-23 13:58:13 +02:00
jean-pierre charras 7291059489 replace lib_dxf by dxflib from qcad in dxf2idf code 2018-07-22 18:39:47 +02:00
jean-pierre charras 72d1597201 DXF import: add import of DXF splines that are converted to Bezier curves.
Fix also a lot of bugs related to Bezier curves (S_CURVE shape in DRAW_SEGMENT class) in Pcbnew code.
Add missing code to handle these Bezier curves
2018-07-22 18:39:47 +02:00
jean-pierre charras 62c5a706d5 DIALOG_GRAPHIC_ITEM_PROPERTIES: fix a not very understandable error message (especially when Dwgs.User layer is disabled).
Rename the method PCB_LAYER_BOX_SELECTOR::SetLayerSet to the better name SetNotAllowedLayerSet
2018-03-31 10:46:52 +02:00
jean-pierre charras 39b4afecfa fix code after file renaming 2018-01-31 09:24:02 +01:00
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
Mark Roszko b98cc0b937 Some coverity fixes 2018-01-05 22:51:03 -07:00
Wayne Stambaugh 5102c8ac1f Gerbview and Pcbnew dialog tweaks.
Improve dialog layout and fix UI policy issues with all of the dialog
boxes in the Gerbview and Pcbnew code paths.

Updated the use of component to footprint where appropriate.
2017-12-27 12:09:56 -05:00
jean-pierre charras c0a539959e Fix a few Coverity warnings 2017-12-04 12:46:11 +01: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
jean-pierre charras 78fa31315c Better Dxf import dialog:
Better look.
Better management of user offset settings (used only in Legacy mode).
The default width of lines and circle can be set.
2017-11-05 15:20:34 +01:00
jean-pierre charras 1929727966 rename dialog_dxf_import.fbp to dialog_dxf_import_base.fbp, like other .fpb files 2017-10-25 10:10:03 +02:00
jean-pierre charras 78ec983632 DRAWSEGMENT fix crash when trying to copy a empty polygon.
SHAPE_POLY_SET: fix crash in VertexCount when it is a empty poly set, or when params are incorrect.

minor other fixes:
warning in degug mode in dialog_dxf_import_base.cpp
pcb_painter.cpp: remove a useless debug line.
2017-10-25 09:39:26 +02:00
Cirilo Bernardo 949b4754e5 DXF: ensure "C" language environment. 2017-10-02 09:16:29 +02:00
Cirilo Bernardo a3dfd2c0dd DXF: fix import of Polyline with bulge 2017-10-02 09:16:29 +02:00
Cirilo Bernardo 453e220fd8 Fix default line widths for non-mm units in DXF import 2017-05-29 09:48:22 +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
jean-pierre charras dec2d6e8cc Fix a few Coverity warnings. A bit of clean code in export_vrml.cpp. 2016-12-30 12:40:05 +01:00
Wayne Stambaugh f14dc8f2be Pcbnew: fix epic footprint editor DXF import fail.
The unfortunate combination of using static_cast to promote board items
to module items then using the assignment operator without any thought as
to what would happen in MODULE::Add() caused the board objects to not be
added to the module.  This is expected because board items cannot be in
modules.  Did this ever work or did someone have a colossal brain cramp?
If it did work, who ever changed it did not test it because in debug
builds, you would have gotten and assertion on every object imported.  On
release builds nothing is imported silently.

Add module object types to the DXF importer and code to choose which type
of object to import.

Remove offending static casts and assignment operator and pass the correct
object directly to the MODULE::Add() function when importing DXF in the
footprint editor.

The usual coding policy fixes.
2016-10-07 21:10:51 -04:00
Simon Richter ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Maciej Suminski 0bf553b06c Recompute local coordinates when an object is added to MODULE. 2016-09-12 11:50:06 +02:00
Maciej Suminski 1dd43d1d98 Unified undo buffer handling code for PCB & module editor.
Replaced UR_MODEDIT with UR_CHANGED.
2016-09-12 11:50:06 +02: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
Cirilo Bernardo a4ba01f42d Various fixes to DXF import
The attached patch makes the following changes to import DXF:

1. correctly implements scaling based on DXF $INSUNITS -
at least where INSUNITS is sensible. I ignore units like miles,
gigameters, AU, lightyear, parsec ...

2. correctly implements LWPolylines, adding an ARC segment
rather than a line segment when bulge != 0.  A number of users
have been complaining about getting the wrong board shape
(chamfered corners rather than rounded corners) on DXF Import,
now they shouldn't complain.
2016-03-20 21:33:53 -04:00
Jon Neal 00f9dbd095 Change misspelled dxf conversion constant from member variable to static const like other conversion constants 2016-03-19 23:51:02 -04:00
Cirilo Bernardo adddfd22a3 Pcbnew: add user position option to DXF import dialog.
* Dialog UI policy fixes and layout improvement provided by Wayne Stambaugh.
2015-08-27 14:10:28 -04:00
Maciej Suminski 2a93d083ee More DXF import fixes. 2015-08-03 21:11:59 +02:00
unknown c636c4e735 Fix to closing polylines in DXF imports.
The DXF format polylines and lwpolylines have a 'flags' field of which bit 0 indicates if the polyline/lwpolyline is to be closed or open.
This flags field is correctly read during the import but in the conversion to board segments, was previously not used.
2015-06-18 17:51:17 +02:00
jean-pierre charras d6c6b4debb Fix some coverity warnings (mainly not initialized vars). 2015-02-27 15:33:13 +01:00
jean-pierre charras ede0daf9db lib_dxf: Update to version 0.5.13 (previous: 0.5.11) due to a bug (memory leak) fixed in 0.5.13, which has also more comments, and try to fix most of coverity warnings (not initialized class members).
These members are now initialized, which also fix some other more serious coverity issues.
2015-02-24 10:07:40 +01:00
jean-pierre charras c1978b3242 Pcbnew: fix crash when undoing a move exact pad in board editor.
Fix also very minor warnings detected by cppcheck.
2015-02-22 10:39:58 +01:00
jean-pierre charras 24f516f6ae Fix many doxygen warnings (due to missing info, old comments, typo ...) when building the doxygen doc. 2014-11-02 17:25:04 +01:00
Maciej Suminski 445d935880 Created dialog_dxf_import.h. Cleaned up some unnecessary stuff and fixed file open dialog DIALOG_DXF_IMPORT. 2014-07-09 15:02:56 +02:00
Maciej Suminski da67880907 DXF files import is supported by module editor. 2014-07-09 15:02:56 +02:00
Maciej Suminski b2a601756e Refactored DXF import routines:
- DIALOG_DXF_IMPORT works with PCB_BASE_FRAME instead of PCB_EDIT_FRAME
- imported items are not immediately added to a BOARD
- imported items are held in a list, instead of vector
- imported items are instantly visible in GAL view
- added DIALOG_DXF_IMPORT::GetImportedItems()
- code formatting
2014-07-09 15:02:56 +02:00
Maciej Suminski 4ac277028b Code formatting. 2014-07-09 14:41:52 +02:00
Dick Hollenbeck 60140dfbcf merge 2014-06-30 01:44:46 -05:00
Dick Hollenbeck 1e7495e634 merge 2014-06-30 00:46:18 -05:00
Dick Hollenbeck ad750defb6 LAYER_ID work 2014-06-29 08:05:51 -05:00
jean-pierre charras 96b6e1a5cb Make dialog pns properties resizable. DXF import: add very basic polyline import. 2014-06-24 20:04:16 +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 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
Cirilo Bernardo 5a6665ec08 Dxf import fix (patch from Cirilo Bernardo, with a minor change) 2014-02-02 10:07:02 +01:00
jean-pierre charras 50f6186ebc Dxf export: fix an issue in exported arcs. Update libdfx.
Pcbnew:, libedit, Save lib as...: the new .pretty lib format is the default, instead of legacy .mod format. The legacy format is still selectable in the file selection dialog.
2013-12-19 12:33:57 +01:00
jean-pierre charras 629c932952 Add undo command to dxf file import. Change improper use of __WXDEBUG__ to DEBUG in class_board_connected_item.cpp. 2013-10-30 13:14:45 +01:00
jean-pierre charras 3e3869ed80 dxf import: minor enhancements in dialog. Update libdfxw from git, and uncrustify it. add a test dfx file 2013-10-28 09:06:38 +01:00
jean-pierre charras 6a9ed328a4 Pcbnew, dxf import: Add dialog to choose the board import layer, and the position of dxf coordinates origin 2013-10-26 09:03:06 +02:00