Commit Graph

1177 Commits

Author SHA1 Message Date
Ian McInerney 3b67e3d0a4 Rewrite window positioning logic
Now only reposition a window if it is completely on a
disconnected display or if only one corner is on screen
and it is within a region close to the screen border.

CHANGED: Window position on startup should be preserved more
2020-04-18 00:47:38 +01:00
jean-pierre charras 9e656fe5eb Gerbview: fix incorrect rendering of oval vertical standard aperture with hole.
Fix also incorrect display of dcode size in toolbal: was Y size  X size.
Now is X size Y size, as expected.
2020-04-10 16:02:15 +02:00
jean-pierre charras 4bfd5f8197 typo 2020-04-10 13:41:33 +02:00
jean-pierre charras d146839f0f Gerbview: add a error message for invalid files missing G74 or G75 commands.
They are mandatory to read arc coordinates.
2020-04-10 12:57:29 +02:00
Jeff Young 4990d1e7b2 Variable substitution framework.
This implements editing of variables and moving SCH_FIELDs,
TEXTE_MODULEs, TEXTE_PCB and worksheet items over to the new
framework.
2020-03-30 14:15:59 +01:00
jean-pierre charras 6e47f147aa A few Coverity fixes. 2020-03-30 09:50:26 +02:00
Jeff Young 5134856f18 Rationalise 3D settings data-structure.
Move the camera out to its own so that everything else is board-
related, and then rename BOARD_ADAPTER.

At some point the flags should probably be moved out too, and they
can have the EDA_3D_SETTINGS name.
2020-03-28 16:09:40 +00:00
jean-pierre charras 873a633181 Gerber: fix a minor issue in OBLONG standard aperture:
- incorrect (too big) bounding box.
- HitTest did not test the exact shape.
2020-03-27 16:15:39 +01:00
jean-pierre charras cc47062b17 Fix a few Coverity issues 2020-03-23 16:17:22 +01:00
jean-pierre charras 4d9d1a5380 Fix a few compil minor warnings and Coverity minor issues 2020-03-22 09:45:51 +01:00
jean-pierre charras b7cd0c54c2 Fix compil issues, especially on Windows:
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
2020-03-04 10:48:18 +01:00
Jeff Young 85c2e0d23a Add user-defined severities, exclusions and colors to DRC markers.
Exclusions are currently persisted in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-04 00:39:28 +00:00
Jon Evans 7825809b3a Fix Linux build 2020-02-29 22:20:29 -05:00
Jon Evans 90bd351807 Properly flush color settings after migration
Also fix missing gerbview migration

Fixes #3965
2020-02-29 21:49:35 -05:00
Ian McInerney 879a8f4efb Rework the file history menus to not need references to the file history
Keeping a pointer to the actual file history inside a special
file history menu led to many cases of use after free crashes,
so instead rework the actual file history to add the menu
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/3741
2020-02-25 16:18:10 +00:00
jean-pierre charras 7206b567ac Gerbview: Gerber attributes display: fix incorrect attributes deletion.
The Gerber attribute deletion command (%TD,xxx) always cleared all attributes,
instead of clearing xxx attribute.
Therefore some attributes were not always displayed.
2020-02-23 09:42:02 +01:00
Jeff Young 4014afad54 Remove unused functionality. 2020-02-20 21:29:52 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Ian McInerney b1240b5b1e Gracefully shutdown tools when frames are closed
If the tools are not gracefully exited, then the stack variables are
never destroyed, so variable lifetime issues can occur.

Fixes https://gitlab.com/kicad/code/kicad/issues/1753
2020-02-05 22:23:24 +00:00
Jeff Young a04fdf64da Improve directory handling for Project Save As.
1) don't change directory names that we don't recognize
2) when we do, make sure the child files get copied to the
changed name.

Fixes https://gitlab.com/kicad/code/kicad/issues/3834
2020-02-03 15:08:01 +00:00
Ian McInerney 88e0ef548d gerbview: Add default filename to export to pcbnew function
Some platforms (such as Linux) don't automatically append file
extensions, so we should ensure extensions are correct and the user is
prompted accordingly.

Fixes https://gitlab.com/kicad/code/kicad/issues/3817
2020-01-26 15:44:30 +00:00
Ian McInerney 06c979dfaa Convert all CMake paths to absolute instead of relative
It is cleaner and safer to handle the include and source paths
as absolute from the source directory instead of relative to every
path.
2020-01-22 23:27:20 +00:00
Jeff Young 45ca0a5ab8 Avoid divide-by-zero. 2020-01-15 18:50:47 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Jeff Young 7bb9551801 Handle boost exceptions. (From Coverity scan.) 2020-01-11 00:04:01 +00:00
Seth Hillbrand 77c60d9655 Remove the last vestiges of dlist
It served us (mostly) well for more than a decade.  It helped KiCad grow
before the std:: came into decent shape or speed.  It was a good little
list.

RIP DLIST 2008-2020
2020-01-10 06:37:08 -08:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Jon Evans 4ae4c4e243 Switch from JSON11 to nlohmann/json in GerbView
See #3638
2020-01-04 10:46:49 -05:00
Jon Evans 0748ec16ed Fix assertions in progress bar on MSW64 2020-01-04 10:46:49 -05:00
Ian McInerney b18b08e944 Deprecate DLIST in GerbView 2020-01-03 19:40:11 +00:00
jean-pierre charras baa1db031e Fix incorrect arc bounding box calculation.
add comments to SHAPE_ARC ctor.
2020-01-03 14:27:00 +01:00
jean-pierre charras ce77106994 Remove code only used during a test. 2020-01-02 20:44:43 +01:00
jean-pierre charras 3543de039b More about code cleaning.
Remove useless includes and dead code
2019-12-31 13:08:50 +01:00
jean-pierre charras 8d649b5351 Gerbview: cleanup code.
Remove GERBER_FILE_IMAGE_LIST dependency to EDA_ITEM, useless.
GERBER_FILE_IMAGE: replace DLIST by std::deque to store gerber draw items.
Remove dead code
2019-12-31 11:58:43 +01:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Ian McInerney 25a302758e Fix macos plist version string generation
Generate these resource files similar to how it is done one Linux.

Fixes mac-builder issue https://gitlab.com/kicad/packaging/kicad-mac-builder/issues/275
2019-12-26 12:42:25 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney 0259e0ba07 Cleanup struct initialization and formatting 2019-12-17 16:09:32 +00:00
jean-pierre charras 25504319df Gerbview,export to pcbnew: avoid exporting not valid polygons.
Gerber regions are exported as polygons (they are filled polygon).
The fix ensure the polygons are simple and valid.
2019-12-15 11:50:19 +01:00
jean-pierre charras 962baf8b6c Gerbview: fix crash or incorrect drawings after code change in shape_line_chain 2019-12-14 10:14:50 +01:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
Seth Hillbrand a2edf9c442 Unified update to C++14 std::make_unique
This update replaces the existing uses of unique pointer creation with
the C++14 std::make_unique call that provides proper memory release in
event of an exception.
2019-12-05 10:43:55 -08:00
John Beard 44a6a61ff9 Gerbview: fix formatting assert
In GERBVIEW_FRAME::loadListOfGerberAndDrillFiles, the variables
ii and aFilenameList.GetCount() are unsigned and size_t, respectively.

This means the format string must be %u and %lu, respectively.
2019-11-24 12:27:23 +08:00
Ian McInerney 99b9354a51 Add clear recent files action to the menus
ADDED: Menu item to allow the recent file lists in each program to be
cleared

Fixes: lp:1821685
* https://bugs.launchpad.net/kicad/+bug/1821685
2019-11-23 23:35:21 +00:00
jean-pierre charras 71cd8c57bf ADDED: Pcbnew, add "pin function" (pin name in eeschema) to pads.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
2019-11-23 09:12:43 +01:00
jean-pierre charras 32043cfa26 Gerbview: add parsing of optional Aperture Macro parameter.
AMP_CIRCLE primitive has 4 or 5 parameters (last is optional)
Reading the optional parameter was missing.

Fixes: lp:1852924
https://bugs.launchpad.net/kicad/+bug/1852924
2019-11-18 09:06:43 +01:00
Jeff Young 04b0feb365 Fix a couple of issues in new Save As command.
Handle symbols as well as strings in the "source" lists of
netlist files.

Handle Protex gerber file extensions.

Check for project_name-whatever pattern for files that we
don't recognize (such as project_name-NPTH-drl_map.ps)
2019-11-11 20:36:48 +00:00
Jeff Young 10abc6097f Cleanup, commenting, etc. 2019-11-10 14:52:01 +00:00