Commit Graph

15331 Commits

Author SHA1 Message Date
Jeff Young bcfb6e4888 Fix diagrams of meander dimensions.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10073
2023-07-01 17:06:00 +01:00
Jeff Young 6da71e5d24 Allow routing to a free pad (even if it has a hole).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15093
2023-07-01 14:23:38 +01:00
Jeff Young 63daf336b8 Formatting. 2023-07-01 14:23:38 +01:00
jean-pierre charras 2c068ab86d Fix incorrect comment. No code change. 2023-07-01 14:17:57 +02:00
Jeff Young 9af065684b Show Properties Manager menu entry for FP Editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15088
2023-07-01 12:01:35 +01:00
Jeff Young 9ff33e5ec6 Remove BOARD_COMMIT( TOOL_MANAGER ).
It initializes both m_isFootprintEditor and m_isBoardEditor to false,
causing all sorts of trouble.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15072
2023-07-01 11:52:46 +01:00
jean-pierre charras 011a8f29a3 Pcbnew, Update footprint: fix broken initialization of fields (especially ref and value)
- Revert commit 86e0e1cc, broken
- add comments to avoid a similar mistake
- ensure Reference and Value are correctly handled.
Fixes #15091
https://gitlab.com/kicad/code/kicad/-/issues/15091
2023-07-01 12:29:02 +02:00
Jeff Young eb8994fde5 Disable locked in the FP Editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15089
2023-06-30 20:51:18 +01:00
Jeff Young 7ed5963b4f Disable positioning tools when a move is in progress.
Also fixes a typo in EDIT_TOOL::doMoveSelection().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15090
2023-06-30 20:37:03 +01:00
Jeff Young 773e1a1ab6 Actions with a COMMIT must be run synchronously.
Note that "immediate" doesn't mean quite the same thing: while it will
enter the tool immediately, it won't necessarily finish the tool during
the call if the tool has an event loop.  So for something like Rotate
"immediate" and "synchronous" have the same behaviour, but for something
like Move they do not.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15085
2023-06-30 18:57:37 +01:00
jean-pierre charras 8d46ed3c72 PCad importer: fix segfault in PCAD2KICAD::PCAD_ARC::AddToBoard
Fixes #15086
https://gitlab.com/kicad/code/kicad/-/issues/15086
2023-06-30 17:51:03 +02:00
Jeff Young dd83217062 Add DRC testing for copper graphic to zone fill collisions. 2023-06-30 14:04:20 +01:00
Ian McInerney 533d7531a1 Via routing actions need to use int flags
The actions the router uses for via placement can be a combination of
enum values, so the actions must use an int parameter instead of the
enum type.

Fixes KICAD-2DS
2023-06-29 23:21:15 +01:00
qu1ck ec94439df4 Footprints swig API: access shown text in fields 2023-06-29 20:36:27 +00:00
jean-pierre charras 5b42348834 Pcbnew: shows the UUID of a footprint in DIALOG_FOOTPRINT_PROPERTIES.
This is an important property of a footprint, but it is never shown to
a user, although it is used in a lot of cases.
2023-06-29 12:36:20 +02:00
Ian McInerney 30f20a694d Give default parameter to net highlight/selection events
Fixes KICAD-2C7
Fixes KICAD-2C3
2023-06-29 00:17:12 +01:00
Ian McInerney 0de6fb03ba Give updateLocalRatsnest action a default parameter
Fixes KICAD-2BX
2023-06-29 00:17:12 +01:00
Ian McInerney 459e6e192a Give placeFootprint action a default nullptr parameter
Fixes KICAD-2BT
2023-06-29 00:17:12 +01:00
Ian McInerney d923b871d7 Remove group reference when exporting individual footprints 2023-06-29 00:17:12 +01:00
Jeff Young 1411b09178 Remove EDIT_TOOL's quasi-global BOARD_COMMIT.
It had several encapsulation leakage issues, as well as poorly-defined
behaviour of undo for chained-actions (append-to-board, and then rotate
while moving, for instance).
2023-06-27 17:04:18 +01:00
jean-pierre charras af71308184 pcb_parser and pcb_plugin: fix incorrect handling of rotation of PCB_TEXTs
in footprints when the text angle is 0 but the fp orientation is not 0.
It was due to the fact angle 0 is not written in file and use the default
value of the created PCB_TEXT in footprint, that is not always 0
Now the angle is always written in file.
Fixes #15054
https://gitlab.com/kicad/code/kicad/-/issues/15054
2023-06-27 08:53:04 +02:00
Seth Hillbrand f3122184df Remove existing footprint when force-reloading
Needs to clear the existing footprint in ReloadFootprint prior to
loading the new one.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15040
2023-06-26 17:04:03 -07:00
Ian McInerney 2fb6f19a84 Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2023-06-27 00:57:59 +01:00
Jeff Young 3bdc66d3ed Save project to disk whenever we save the board to disk.
This prevents data loss in the event of a subsequent crash.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14991
2023-06-26 16:59:47 +01:00
jean-pierre charras 7e8070b700 pcb_parser: fix incorrect handling of rotation of PCB_TEXTs in footprints.
Fixes #15054
https://gitlab.com/kicad/code/kicad/-/issues/15054
2023-06-26 11:27:20 +02:00
jean-pierre charras 44810e8c09 footprint reader: fix broken handling of "Keep Upright" option.
texts inside footprints must have this option ON by default.
When disable, the keyword "unlocked" must be in field description.
2023-06-25 12:44:33 +02:00
Jeff Young 493828cc6b Eradicate a bunch of calls to dyn_cast.
Also deletes PAD::GetParent() which fails to look for parent footprint
through groups.
2023-06-25 11:10:07 +01:00
Jeff Young 300a60e88e Eradicate a bunch of calls to dyn_cast. 2023-06-25 11:10:05 +01:00
jean-pierre charras 994459fd47 fp editor: fix a crash due to a null pointer when reading a .kicad_mod file
It happens if the footprint has some non mandatory fields (user fields).
2023-06-25 10:16:23 +02:00
jean-pierre charras 1094cc5331 Fix issues related to the splash screen when no config file found:
- do not show it before the application is actually started.
- hide the splash screen before displaying dialogs.
Fixes #15047
https://gitlab.com/kicad/code/kicad/-/issues/15047
2023-06-24 18:09:43 +02:00
Jeff Young b3d7aea4df dyn_cast<PCB_TEXT*> won't find PCB_FIELDs.
We really should get rid of dyn_cast entirely....

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15052
2023-06-24 15:48:57 +01:00
Ian McInerney b8e9544828 Remove temporary footprint from pcb group before deletion
Bounding box computation uses a temporary footprint, but the clone
operation keeps the group information. We can't delete a footprint if it
has group information, so just delete the group information.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14909
2023-06-24 00:04:06 +01:00
jean-pierre charras f56ea370be PCB_FIELD::GetCanonicalName() must return the canonical name (not a translation) 2023-06-23 18:48:11 +02:00
jean-pierre charras d8034b9c15 Revert "PCB Fields: save untranslated names"
This reverts commit b47fcac666.
The root issue was a bug in SCH_FIELD::GetCanonicalName(), now fixed.
2023-06-23 17:48:19 +02:00
Mike Williams b47fcac666 PCB Fields: save untranslated names 2023-06-23 09:18:55 -04:00
Tomasz Wlostowski 61391e3984 router: take holes into account when building the restricted items set for collision search 2023-06-23 14:52:45 +02:00
Jon Evans 7804c2177c Do not force focus on dataview in RC dialogs
On GTK, this causes the first item to be selected, firing the
selection handler and causing unwanted side effects.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11925
2023-06-23 08:09:53 -04:00
Jon Evans 504e02192c Relax handling of duplicate netclasses in Altium parser
There are some "good" boards that have this for some reason
2023-06-23 08:09:53 -04:00
Jon Evans 3a0f8214fa ADDED: Properties panel for schematic editor
Initial infrastructure work; follow-ons will add more
properties for schematic items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6351
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14105
2023-06-22 22:32:24 -04:00
Jon Evans 39073642a7 Properties: disable pad y-size when circular
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15038
2023-06-22 19:19:33 -04:00
Tomasz Wlostowski a0a68d198c router: when no collision search context is provided, assume differentNetsOnly is true 2023-06-22 23:52:21 +02:00
Tomasz Wlostowski bd5954242e router: provisional fix for 14926 2023-06-22 16:52:34 +02:00
Wayne Stambaugh a5411218a2 Fix minor board file white space formatting issue. 2023-06-21 13:42:24 -04:00
Jeff Young 0fde88eefc Protect custom rule function caches from transient items. 2023-06-21 18:14:41 +01:00
Jeff Young 94a23971cc Performance improvements. 2023-06-21 17:00:32 +01:00
Kuba Sunderland-Ober b60f7d4136 Make comparison operators const. 2023-06-21 08:49:26 +00:00
Mike Williams fa84575510 FP Text Grid: avoid ambiguous fallthrough
Works, but bug-prone and suspicious looking.
2023-06-20 19:23:29 -04:00
Ian McInerney f14feafc6b Convert selection vector to EDA_ITEMS for base tool call
The base tool expects a generic EDA_ITEMS, but the existing vector
doesn't easily cast, so add a temporary one.
2023-06-20 21:52:50 +01:00
Ian McInerney f899d9676f Remove unneeded parameter from tool call 2023-06-20 21:52:50 +01:00
Ian McInerney 0a3b6c2d23 Fix call to properties when editing newly placed dimension
The edit is intended to be on the newly placed dimension, but the actual
properties tool doesn't take an item, so it was always looking up the
item to edit using the current selection/cursor position. Make this more
robust by just calling the edit properties directly on the item.
2023-06-20 21:52:50 +01:00
Ian McInerney 3c24ddd8cc Fix passing CLIENT_SELECTION_FILTER through the tool framework 2023-06-20 21:52:50 +01:00
Ian McInerney 480223f67c More RunAction specialization 2023-06-20 21:52:50 +01:00
Ian McInerney 3718ecfcd8 Simplify forcing action parameters to have a specific type 2023-06-20 21:52:50 +01:00
Ian McInerney 07cc85e76c Fix more places where casts into RunAction were happening 2023-06-20 21:52:50 +01:00
Ian McInerney 8f3d159905 Update the net highlight action to properly use the action parameters 2023-06-20 21:52:50 +01:00
Ian McInerney 8b833211b5 Add parameter to repair board action
The tool checks for a boolean action, so default to giving false (which
makes it run in interactive mode).
2023-06-20 21:52:50 +01:00
Ian McInerney b04e54dbea Switch TOOL_EVENT and TOOL_ACTION to have a std::any parameter
Using std::any from C++17 allows for proper type handling in the
parameter field, removing the need for casting to void* and then casting
the void* to the desired type.
2023-06-20 21:52:50 +01:00
Mike Williams 1d26b454f4 SCH -> PCB Fields: bump file versions 2023-06-20 18:34:52 +00:00
Mike Williams 86e0e1cccb PCB, Change Footprint: actually update text attributes 2023-06-20 18:34:52 +00:00
Mike Williams a24c55affe PCB Fields: fix up python, API
Remove SetFields from both symbol and footprint, it doesn't handle
mandatory fields and is unlikely to ever be safe.
2023-06-20 18:34:52 +00:00
Mike Williams 85c633eb00 QA: PCB Fields bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams 85f889bc19 Fields: Description now mandatory
Propagate from symbols to footprints, footprints keep a library
description, too. (GetLibDescription())
2023-06-20 18:34:52 +00:00
Mike Williams 636db607c1 Footprints: upgrade Sheetpath and Sheetfile to tagged items in file
Rather than loose kv properties.
2023-06-20 18:34:52 +00:00
Mike Williams 993bb84240 PCB_FIELD: bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams b81fcaeaf7 PCB Fields: use validators in dialogs, restrict editing of footprint 2023-06-20 18:34:52 +00:00
Mike Williams ad7d9ec956 PCB: footprint properties dialog fields fixes 2023-06-20 18:34:52 +00:00
Mike Williams 74606cda9c PCB: text properties dialog should indicate "Offset X/Y:" properly 2023-06-20 18:34:52 +00:00
Mike Williams 78f1040f33 PCB Fields: register with properties manager 2023-06-20 18:34:52 +00:00
Mike Williams 00f6f5011c PCB Fields: add saving / reading support to PCB files
Use common text effects parsing with PCB_TEXT
2023-06-20 18:34:52 +00:00
Mike Williams 6d93950dcc PCB: abolish TEXT_TYPE::TEXT_is_*
PCB_TEXT is now always what was formerly TEXT_is_DIVERS and PCB_FIELDs
now what mandatory field type they are already.
2023-06-20 18:34:52 +00:00
Mike Williams 37837dc392 PCB: introduce PCB_FIELD_T 2023-06-20 18:34:52 +00:00
Mike Williams a859b25d2c PCB: convert footprints to use PCB_FIELDs for fields from schematics 2023-06-20 18:34:52 +00:00
Mike Williams 968785382e PCB_FIELD: add new field item similar to SCH_FIELD 2023-06-20 18:34:52 +00:00
Mike Williams 8e13f2d535 Netlist/Footprints: parse fields out of netlist into footprint
The properties section duplicates all of these fields, but also contains
a large amount of other cruft.
2023-06-20 18:34:52 +00:00
Mike Williams bd5d3533d8 Footprints: rename Fabrication Attributes to just Attributes
Makes it consistent with the Symbol attributes that are often
synchronized.
2023-06-20 18:34:52 +00:00
Mike Williams 028f500cd9 Footprints: rename properties to fields for consistency with symbols 2023-06-20 18:34:52 +00:00
Jeff Young 40abb013ec Don't consider a group to be on a copper layer.
Its members can be on copper layers, but the group itself isn't on any
layer.

Also fixes a bug where we were trying to clone TRIANGULATED_POLYGON::TRI
shapes as indexable sub-shapes.  (The TRI only has indexes into its
parent, so cloning it will only result in segfaults down the line.)

Also fixes a bug where we weren't including copper items inside groups
when checking footprint net ties.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15021
2023-06-20 18:13:21 +01:00
jean-pierre charras 21f2f98270 drc_test_provider_connection_width: fix crash due to a null pointer.
Fix a crash (tested on W10 - MSYS2) when running DRC on the board
attached to issue #15005
Fixes #15005
https://gitlab.com/kicad/code/kicad/-/issues/15005
2023-06-20 16:32:07 +02:00
Jeff Young 4473ebb02d Clear arcs before deflating area outline.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15007
2023-06-20 14:19:21 +01:00
Jeff Young 8c29091001 Add a "hyperzoom" mode for debugging "up close". 2023-06-20 14:19:21 +01:00
Jon Evans 7d6cb4e77b DRC markers should not be considered inactive layers 2023-06-19 21:58:08 -04:00
Jeff Young b1cdcca9e6 Use hypertext link for Edit Ingored Tests in both ERC and DRC.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15010
2023-06-19 23:53:42 +01:00
Jeff Young 30336b2fe3 Unify go-back-one-step processing for drawing tools (and router).
Also warps mouse on all go-back-one-step operations for better feedback.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14981

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9985
2023-06-19 17:14:32 +01:00
Jeff Young 252769d53e ADDED "clear color" command to Appearance/Nets context menu.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14451
2023-06-19 17:14:32 +01:00
Jon Evans 55c00f1845 ADDED: Initial support for importing Solidworks PCB files 2023-06-19 11:57:33 -04:00
jean-pierre charras 9537fd4e45 Pcbnew, graphic importer: convert arc with large radius to segment.
Arcs having a too large radius cannot be safely handled.
The criteria (not perfect) is radius < INT_MAX/2 to use arcs
Fixes #14210
https://gitlab.com/kicad/code/kicad/-/issues/14210
2023-06-19 10:43:30 +02:00
Jeff Young ecb2fcd559 Don't trip over null strings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14989
2023-06-18 20:28:11 +01:00
Jon Evans b424dc11e1 Hotkey feedback for inactive layer display mode 2023-06-17 23:47:26 -04:00
Jeff Young fb40c202a1 Refine track dangling test.
Turns out Clean Up Tracks and Vias wants a different answer from DRC.
2023-06-17 22:56:57 +01:00
Jeff Young 4e3730f653 Track not dangling if entirely covered by pad.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14211
2023-06-17 21:13:30 +01:00
Jeff Young 3b8cc3a3ac Tab-order fix provided by aris-kimi.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9406
2023-06-17 18:41:17 +01:00
Jeff Young 1c7971c4dc Cleanup. 2023-06-17 18:12:13 +01:00
Jeff Young 9fbaa238a2 Don't create 22.5-degree gateways if we're not cardinal or diagonal.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14984
2023-06-17 16:05:35 +01:00
Jeff Young cf4f0723f8 Select first unassigned symbol when running CvPCB.
Also cleans up some dead code, and makes more use of sharing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9938
2023-06-17 12:44:59 +01:00
Jeff Young ef6866757e Treat undo as backspace and/or escape when drawing. Ignore redo.
Undo == backspace when drawing a polygon or chained lines.  Otherwise
it's an escape.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14961
2023-06-16 22:08:21 +01:00
Alex Shvartzkop d3be62f644 Adapt panels to PAGED_DIALOG sizing algorithm.
Also some cosmetic fixes (GTK).
2023-06-16 19:12:37 +03:00
Alex Shvartzkop f5da58e17d PAGED_DIALOG: allow setting initial size in ctor. 2023-06-16 18:53:00 +03:00
Jeff Young da558f57d4 Don't leave selection lying around when swapping out footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14971
2023-06-16 16:29:52 +01:00
Wayne Stambaugh 285f8a0e59 Command line PCB gerber export fix and improvement.
The --board-plot-params argument was never parsed so it was always ignored.

[ADDED] A '--no-protel-ext' option to allow plotting gerbers with the KiCad
        file extension (gbr) instead of the Protel gerber file extensions.

(cherry picked from commit 4e79d1ecdd)
2023-06-16 07:17:39 -04:00
jean-pierre charras c37332bdb3 Plot Solder mask layer: do not add items on edge_cut, but not on mask layer
it happened only when creating a solder mask plot with a minimum thickness.
This was a legacy option, incorrect now.
Fixes #14960
https://gitlab.com/kicad/code/kicad/-/issues/14960
2023-06-16 09:47:58 +02:00