7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-03-30 01:56:58 +00:00
Commit Graph

1754 Commits

Author SHA1 Message Date
jean-pierre charras
7bd4fa3fa6 Fix a Coverity and a compil minor warning 2025-03-26 13:19:00 +01:00
Jeff Young
0a4533703c Performance. 2025-03-24 10:28:41 +00:00
Brendan Hickey
33a8cd942f Increase GerbView max DCode Id to 2^31-1
I (charrasjp) fixed the compil issues of the Brendan Hickey's initial work and some other minor issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20323
2025-03-20 11:27:53 +01:00
Jeff Young
877c6bce89 Printing is not zoom-specific.
(Some of these items don't currently get printed, but
there's no sense in leaving a latent bug around in case
we ever change our minds.)
2025-03-07 13:01:00 +00:00
jean-pierre charras
eaa1e6d594 Fix a collision with a Windows define and our use of the same var name.
We use IN for INCH as units, but IN is defined in a Windows header
2025-03-02 11:34:30 +01:00
Jeff Young
f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
Ian McInerney
85810510f4 Tweak toolbar settings a bit
* Manage the settings using the settings manager for better lifetimes
* Better architect the internals and JSON to make it easier to identify
  the various tool types
2025-02-28 01:57:37 +00:00
Ian McInerney
548334b4e2 Load toolbar configuration from settings 2025-02-28 01:57:37 +00:00
Ian McInerney
fc6f3f2332 Formatting tweak 2025-02-28 01:57:37 +00:00
Ian McInerney
7ad1103f55 Move toolbars to a serializable storage format 2025-02-28 01:57:37 +00:00
Ian McInerney
c24dbc17bf Move toolbar setup flags into the action definition
This makes them centrally defined, and removes the need to specify them
when creating the toolbar.
2025-02-28 01:57:37 +00:00
Jeff Young
6a3f52dbaf Ignore negative layers when exporting Gerbers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16871
2025-02-19 23:43:53 +00:00
Jeff Young
ec649593ae Fix layout issues in print dialog controls. 2025-02-03 21:41:03 +00:00
Jeff Young
8874f137fa Read hotkeys from disk after they change.
(Otherwise we'll write the old versions back out
when closing one app.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19612
2025-02-01 20:01:13 +00:00
jean-pierre charras
89e80586cd Gerber export to pcb: handle rect aperture to draw lines on non copper layers
On copper layers, all lines are exported as tracks, so they always use a round
aperture.
Note also rect aperture to draw lines and arcs are deprecated since 2020

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19553
2025-01-09 11:02:15 +01:00
Seth Hillbrand
066380ffeb Clean up a few gerbview export to pcbnew layers
There's a lot of hard coded stuff in gerbview.  This removes a few
duplicated functions and gets the layer export back into working shape

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19552
2025-01-08 16:00:44 -08:00
jean-pierre charras
162d87f271 Gerber export to pcb fixes: update to use recent changes in Pcbnew V9
Use new layers id, arcs in tracks, and some recent changes in Sexpr
2025-01-08 20:32:53 +01:00
Seth Hillbrand
f38e661a02 Revert "Move GL Context into Singleton class"
This reverts commit 5326c36a5f.
2025-01-03 21:22:37 -08:00
Seth Hillbrand
5326c36a5f Move GL Context into Singleton class
The GL context lock needs to be shared across kifaces.  Otherwise, we
can end up blocking the lock from one kiface.  Unfortunately, I can't
find the issue in GitLab right now for where the footprint viewer shows
a blank screen after opening too many contexts.  But that's what this
fixes.
2025-01-03 17:26:23 -08:00
John Beard
520a7cf62c GAL: ViewGetLOD should not be able to change the VIEW
Make the VIEW* parameter const. Since PCB_TEXT does a null-check,
it's not very clear if this can ever be null (and if it is,
why don't the other VIEW_ITEMs check?), so don't make them
all references too at this time.

Also dereference a few pointers a bit earlier to make non-null
promises sooner rather than later.
2025-01-02 22:59:31 +08:00
John Beard
527faddbfd GAL: provide constants for LoD HIDE/SHOW and a scale helper
Saves a mishmash of local HIDE/SHOW defs along with various literals.

Also provide a function that computes the scale at which a given
IU size becomes (notionally) a certain size on screen. While this
is a simple division, it's a bit opaque in terms of meaning.

Also it means the divide by zero case can be more universally
defended-against, which has traditionally been a bug opportunity.
2025-01-02 22:59:31 +08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
e9bc8cfe9d Give Clipper1 a Viking funeral
Clears out the last spot where we were only using Clipper1 (how'd I
miss that?) and remove all calls to the Clipper1 structures
2024-12-23 17:12:09 -08:00
Jeff Young
753d385473 Reduce dependency on dynamic_cast.
Also switches to checking __clang__ instead of __WXMAC__.
2024-12-08 21:46:54 +00:00
Seth Hillbrand
bf6a255a3e Move more elements from fixed size arrays
Refactor layer data storage from compile-time array sizes to run-time
map storage
2024-12-03 13:25:11 -08:00
Seth Hillbrand
d7137c4a05 Cleanup VIEW class
Ununsed m_dynamic class variable
2024-11-21 18:59:48 -08:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
jean-pierre charras
2d36a5d4f9 Gerbview: make buffer to read a line of Gerber file bigger.
Currently, the Gerber file is parsed line by line, This is most of time OK.
But warning: in rare cases some files can have *very long* lines (in fact
have only one line),  so the buffer must be very large.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18890
2024-10-10 18:33:33 +02:00
John Beard
c9a231610a 3DConnexion navlibs need kiplatform
This worked in Pcbnew because pcbcommon happened to include
kiplatform, but gerbview didn't.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18825
2024-10-01 17:11:01 +01:00
John Beard
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
jean-pierre charras
f737d8f2db Gerbview: make my fix about MINGW specific to MINGW (commit b5cb0087 broke QA build) 2024-09-21 17:38:31 +02:00
jean-pierre charras
b5cb008734 Gerbview: fix a link issue (symbol not found) on MINGW/MSYS2
It was due to a link order with libgerbview_navlib
2024-09-21 16:37:23 +02:00
jean-pierre charras
b6bf7d6f44 Revert "Gerbview: Add build option do enable/disable the 3Dconnexion support."
This reverts commit 336532303e.
A better fix for the link issue on MSYS2 will be committed
2024-09-21 16:28:05 +02:00
jean-pierre charras
336532303e Gerbview: Add build option do enable/disable the 3Dconnexion support.
On msys2 a link issue (3 undefined symbols) prevent Gerbview to be built.
So I added this option (KICAD_ENABLE_3DMOUSE_GERBVIEW, enabled by default)
to disable 3Dconnexion support on request.
2024-09-21 13:24:43 +02:00
Kamil Galik
2068ed31a4 ADDED: 3D Mouse support in Gerber Viewer and Drawing Sheet Editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13306
2024-09-21 08:22:19 +00:00
John Beard
a3a3f7648e Break ERROR_LOC out to its own header
Having this in geometry_utils.h means that touching
that header affects nearly every file, as this type is used
in EDA_SHAPE, BOARD_ITEM and SHAPE.
2024-09-11 22:08:36 +01:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
Alex Shvartzkop
36019314e9 Make simulation reporter warnings non-fatal.
Adds REPORTER::HasMessageOfSeverity for WX_STRING_REPORTER,
which allows us to show simulation warnings and fail only if there's errors.

Also fixes a crash when SPICE_GENERATOR_KIBIS throws an IO_ERROR.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18143
2024-09-05 05:59:35 +03:00
jean-pierre charras
4ce9648d34 Fix a few minor Coverity and compil warnings. 2024-08-23 09:54:29 +02:00
jean-pierre charras
55e1b6a80e Gerbview: fix arc to segment approximation when drawing Regions (polygons)
The approx was 36 segments per 360 deg. But this is not good for arcs having
A small arc angle and a large radius.
The fix uses a max error (currently 5 microns) to calculate the approximation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18587
2024-08-22 18:29:43 +02:00
Jeff Young
535aca7a8d Remove redundant tooltips.
Also fixes grammar and capitalisation in a few tooltips.

Also standardises some terminology, such as
"Add" vs "Draw"/"Place" and "Assignment" vs "Association".

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17694
2024-08-18 17:18:07 -06:00
Tomasz Wlostowski
9963b9dd9f TOOL_INTERACTIVE: only create the context menu when we are running in GUI mode
TOOL_MENU::m_menu was unconditionally created by the TOOL_INTERACTIVE constructor, resulting in crashes if
we wanted to run the TOOLs in headless  mode, e.g. in unit tests. This commits makes
the creation of the menu object dependent on Pgm::IsGui().
2024-08-13 22:50:26 +02:00
John Beard
d933ed964e Move LAYER_PRESENTATION to widgets/
Since this is code used by widgets for UI presentation purposes.

Also saves some unnexessary includes in headers.
2024-08-07 06:49:53 +08:00
John Beard
db457f52fa Move layer presentation logic to a separate class
The separates it from the LAYER_SELECTOR class - deciding
what color a layer is (say) is separate to managing the
actual selection of the layer. For example, sel_layer.cpp
only needs the presentation logic. This also makes it eaiser
to compose rather than inherit.

Additonally, break out the layer pair swatch function
to this class.

This will also be needed by the layer pair manager UI.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/15227
2024-08-06 23:45:55 +08:00
jean-pierre charras
4091eda7dc Gerbview: minor fix: Show a warning if the deprecated %IPNEG% is found in file.
%IPNEG% is deprecated since 2012 and ignored by Gerbview. However it is better
to warn the user this command is found and ignored.
2024-08-03 18:19:58 +02:00
Seth Hillbrand
e0453d9bcc Further cleanup of LSET
Remove duplicative functions.  Standardize on C++ stdlib formatting
2024-07-08 22:00:53 -07:00
Seth Hillbrand
cc850d0da0 Split out LSEQ/LSET from LAYER_ID
Separate the layer grouping classes for easier modification
2024-07-08 20:59:46 -07:00
Seth Hillbrand
293075426b Clean up some LSEQ functions
We are derived from std::vector now.  We don't need our own prima donna
increment and dereference overload as these just create bloat and
non-standard coding practices
2024-07-08 20:59:46 -07:00
Seth Hillbrand
c0bf866c58 Speed up shutdown
When shutting down, we shouldn't need to do a lot of things like
resyncing the PNS world multiple times that can really slow down the
process
2024-07-05 11:16:20 -07:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00