Commit Graph

222 Commits

Author SHA1 Message Date
Roberto Fernandez Bautista 35438d3533 Add more bounds checking in KIwxExpandEnvVars
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7461
2021-03-21 20:13:20 +00:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Seth Hillbrand d9d906e652 Take file size into account in cache hash
Revision control systems can play games with file timestamps.  If the
file has changed size, we should reload it as well.

Fixes https://gitlab.com/kicad/code/kicad/issues/7627
2021-02-20 06:27:12 -08:00
Marek Roszko b609c7dcd6 Kick the osx specific path helpers into PATHS 2021-02-16 23:29:26 -05:00
Jeff Young 02aca4a7d7 Don't run off the end of a string.
Fixes https://gitlab.com/kicad/code/kicad/issues/7461
2021-02-08 12:28:15 +00:00
Jeff Young f1221a9ca3 Resolve text variables in title blocks for outputing to netlist.
Fixes https://gitlab.com/kicad/code/kicad/issues/7153
2021-01-17 16:24:22 +00:00
jean-pierre charras 005c3b84ad Better fix for incorrect page preview in Page Settings when the worksheet contains a bitmap
The actual size of pixels was incorrectly set.
Fix also bad names for a few vars and methods in BITMAP_BASE.
2020-11-28 10:53:26 +01:00
RigoLigoRLC ef75ce9035 Fix: refusal of creation of non-existent directory tree on plotting
Fixed https://gitlab.com/kicad/code/kicad/-/issues/6394
wxWidgets uses wxFileName::Mkdir to create a directory tree like `mkdir
-p`.
2020-11-27 07:24:14 +00:00
Marek Roszko 1167862c86 Split wx_filename out of common 2020-10-25 20:01:13 -04:00
Marek Roszko 14c18b7e64 Move ui functions out of common and into ui_common 2020-10-25 20:01:12 -04:00
Marek Roszko e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko 64484f5fc4 Split KIID out of common.h 2020-10-24 00:17:08 -04:00
Marek Roszko 304e5faf36 Move wxStringSplit to kicad_string 2020-10-24 00:17:07 -04:00
Marek Roszko 1d559108c8 Move LOCALE_IO out of common.h 2020-10-23 21:49:42 -04:00
Jeff Young 41fd8293e8 Don't apply clearance to keepout zones.
Also improves the clearance and keepout reporting.

Fixes https://gitlab.com/kicad/code/kicad/issues/6118
2020-10-22 21:29:04 +01:00
jean-pierre charras f6b4b66a86 Avoid include wx/wx.h in many files that do not actually use this include.
Including wx.h includes the full set of wxWidgets include files, that is not good,
and can create some conflicts with some Windows headers on msys2.
2020-10-18 18:21:34 +02:00
Ian McInerney b1bd1f2a97 Introduce new action to switch to mils as a unit 2020-10-04 17:53:55 +01:00
jean-pierre charras f702da95c7 Minor code cleanup, step2: remove more useless include.
fix also a minor compil warning
2020-10-01 15:39:47 +02:00
jean-pierre charras 3f8c9d49f8 Revert "Code cleanup: remove useless wx/wx.h include inside a few files."
due to compil issue on Linux

This reverts commit cffccc3970.
2020-09-30 20:47:20 +02:00
jean-pierre charras cffccc3970 Code cleanup: remove useless wx/wx.h include inside a few files.
in most of files, including wx.h is not necessary, when only 2 or 3 wx files must be included.
Moreover, on windows, including wx.h sometimes create compil warnings about
shadowed vars defined in some specific windows headers.
2020-09-30 20:03:27 +02:00
Jeff Young 40d7940d52 Don't trim both back and front if there's only one char.
Fixes https://gitlab.com/kicad/code/kicad/issues/5357
2020-08-26 00:02:37 +01:00
Jeff Young 27b047ab3f Cache project text vars as properties in the PCB board file.
Fixes https://gitlab.com/kicad/code/kicad/issues/5255

Fixes https://gitlab.com/kicad/code/kicad/issues/5005
2020-08-19 19:32:20 +01:00
Jeff Young e86fc64e7d Check envvars as well before flagging as un-resolved.
Fixes https://gitlab.com/kicad/code/kicad/issues/4644
2020-08-01 00:24:26 +01:00
Jon Evans 4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00
Jeff Young 3a9746c657 Add ~ processing in env vars.
Fixes https://gitlab.com/kicad/code/kicad/issues/1829
2020-05-13 23:45:32 +01:00
Wayne Stambaugh 169f63a6c0 Eeschema: make schematic sharing truly safe across all designs.
There has been a long standing (since the beginning of the project?)
issue with sharing schematics between projects.  It has been somewhat
supported for complex hierarchies (a sheet shared multiple times in a
single design) but it has not been well supported for simple hierarchies
(the symbol references cannot be changed in the shared schematic).  This
issue has been resolved by moving all of the symbol instance sheet paths
from the symbol definitions in the all of the project files and save all
symbol path instances in the root sheet.  This ensures that orphaned
symbol instance paths do not accumulate in shared schematic files and
that designs that reuse schematic in simple hierarchies can how have
different references.  It also allows the root schematic from one project
to be uses as a sub-sheet in another project.

When legacy schematics are loaded, all sheet and symbol UUIDs are
converted from time stamps to true UUIDs.  This is done to ensure there
are no sheet path instance clashes between projects.  That being said,
there are no checks for this.  It is assumed that the probability of
UUID clashes is so low that it doesn't make sense to test for them.
2020-05-04 12:40:03 +00:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young 2fb2eac4d5 Performance enhancements. 2020-04-24 22:17:45 +01:00
Jeff Young cc9ac37a0e Add text variable support to envVar processing. 2020-04-05 20:52:26 +01: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 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 21469efa63 Make sure EESCHEMA definition gets passed into common.cpp.
Also includes a fix to seed timestamps that got incorrectly
written out as '00000000' because of the above.

Fixes https://gitlab.com/kicad/code/kicad/issues/3977
2020-03-04 02:04:18 +00: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
Jeff Young ea025a35e5 Change KUUID to KIID. 2020-02-21 22:20:42 +00:00
Jon Evans e8e3b4f11e Rename UUID to KUUID to fix MSVC build
Also add another newly-required boost flag
2020-02-20 22:07:17 -05:00
Jeff Young e69c82f45f Back out changes which updated the eeschema file format.
We'll wait until we have the new eeschema format to turn on UUID
generation for Eeschema.  Right now only Pcnbew generates full UUIDs.
2020-02-20 23:40:30 +00:00
Jeff Young 129042f8a6 Convert timestamps to UUIDs. 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
jean-pierre charras f17f10d2a6 Eeschema, DIALOG_UPDATE_FIELDS: ensure mandatory fields are put in list.
Add also a comment in common.cpp about using wxLocale instead of setlocale.

DIALOG_UPDATE_FIELDS has issues in non English languages, due to its design.
The fix for mandatory fields is only a partial fix that avoid major issues.
2020-02-14 13:07:13 +01:00
jean-pierre charras feab56f6e7 LOCALE_IO: replace the call to setlocale by a call to wxLocale to switch to "C" locale.
Previously we call only setlocale( xx, "C" ), but it was not enough on Windows.
Now we call wxLocale("C")
wxLocale calls setlocale, but also make some others initialization in wxWidgets.
It fixes some issues related to comma versus point as fp separator.
Especially wxWidgets warnings are no longer thrown, and a one case of incorrect
conversion is fixed.
2020-02-11 16:19:00 +01:00
Jon Evans fe375b4419 Allow sheet pins to be strong drivers if they don't conflict with anything
Also try harder to match bus members in case one was renamed by a higher
priority label.

Fixes https://gitlab.com/kicad/code/kicad/issues/3797
2020-02-05 14:23:55 +00:00
Jeff Young 1bdcb33f75 Handle error returns from lstat. 2020-01-13 20:16:42 +00:00
Ian McInerney f896043067 Fix comments for switch statement fall throughs
This cleans up all GCC warnings (-Wimplicit-fallthrough=2) about
implicitly falling through switch cases.
2020-01-11 19:16:32 +00:00
Seth Hillbrand 49e3542662 Remove unused common defines 2020-01-06 05:55:06 -08:00
Seth Hillbrand 850ca98e7b Remove outdated RoundTo0
With internal units in 100nm, there are no rounding errors when
representing mm coordinates in eeschema.
2020-01-06 05:15:14 -08:00
Ian McInerney 18dbe51d66 Remove WINCE check
We don't actually support Win CE
2019-12-17 15:38:38 +00:00
Mark Roszko bf32122134 common: Remove out of bounds and erroenous array access 2019-12-17 14:10:52 +00:00
John Beard 6b4b2d61f8 Common: do not conditionally define wxPoint/Size operator<<
Due to an interaction with old (<1.59) versions of Boost, the ostream
operator<< for wxPoint and wxSize is requried to use
BOOST_CHECK_EQUAL_COLLECTIONS (the print_log_value<T> function is not
used by this macro until 1.59).

Because these functions are available in Debug builds, unit tests that
use such functions will break when compiled as Release or
RelWithDebugInfo.

The change here is to not disable these functions in Release builds.

Also, the functions are moved to common.h, to go with other generic
WX "polyfill" functions. Although they might be commonly used by the
EDA_ITEM::Show functions, they are not specifically related to that
class.

Fixes: lp:1830612
* https://bugs.launchpad.net/kicad/+bug/1830612
2019-05-28 13:52:36 +01:00
Ian McInerney 9e6e9d0910 Replace remaining Boost mutexs with std::mutex
CHANGED: Replaced all MUTEX types with std::mutex
         Replaced all MUTLOCK types with std::lock_guard
2019-05-03 17:13:20 -07:00
Seth Hillbrand 2048114512 Reduce chance for wxPoint hash collision
Hash collisions reduce the speed of unordered maps by increasing the
comparison time of underlying values.  This implements the inverse
golden ration offset into the x value to ensure that consecutive points
are far from each other in the map.
2019-04-09 20:40:04 -07:00