Commit Graph

15397 Commits

Author SHA1 Message Date
Jeff Young c3c7f731df Fix usage of AUI SetAuiPaneSize() hack in FOOTPRINT_EDIT_FRAME.
This brings it in line with PCB_EDIT_FRAME, which seems to work
reasonably well.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14297
2023-07-16 22:29:21 +01:00
Jeff Young c2e7827774 Override FOOTPRINT::GetCenter() to ignore text.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15209
2023-07-16 18:01:45 +01:00
John Beard ab55684f0b ADDED: Add step parameter to footprint pad renumbering
Also includes persisting settings for next dialog invocation
and use the TransferDataFromWindow function rather than per-field
accessor methods.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10651
2023-07-16 15:37:12 +01:00
Jeff Young a09a5cb641 More undo cleanup.
The symbol editor has few enough items that it will still be performant
if we always send a selected-item-modifed event.  (As it turns out we
were doing that anyway as the check for child-modified flags didn't
also check for selected.)
2023-07-16 14:43:29 +01:00
Roberto Fernandez Bautista cf0b719a4a Fix some unreachable code msvc warnings 2023-07-16 15:41:05 +02:00
Jeff Young 581cbfc112 Don't treat a rule area as an edge cut in the router.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15200
2023-07-15 18:30:15 +01:00
Jeff Young 0446152d15 (Very) minor performance improvement. 2023-07-15 17:55:12 +01:00
Jeff Young 1218f61d0a Implement undo/redo for footprint children.
Our special-cases to handle the fact that we didn't do this had far
outgrown the code necessary to actually handle it.
2023-07-15 17:37:31 +01:00
Marek Roszko 3233bbe0ba Make exported date time strings use ISO8601 format
Also rename the function to be explicit on its result format

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15185
2023-07-14 23:24:12 -04:00
Jeff Young c3222b0652 Clear edit flags on footprint children in footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15199
2023-07-14 22:16:11 +01:00
Jeff Young d02e94805a Store original boardItem (before promoting ent.m_item to parent footprint). 2023-07-14 20:43:13 +01:00
Jeff Young cbf685ad76 Clear owner of old watcher before resetting std::unique_ptr.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15173
2023-07-14 19:32:20 +01:00
Seth Hillbrand f45883ac3d Ensure watcher is valid
Call ordering appears to allow invalid m_watcher settings for MacOS, so
we need to check if m_watcher has been initialized before clearing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15173
2023-07-14 09:11:08 -07:00
jean-pierre charras 3ac454153e Pcbnew, footprint editor: fix crash due to a null pointer use 2023-07-14 15:13:17 +02:00
Josue Huaroto 4cad021ef4 Add Open preferences folder button in Preferences Dialog 2023-07-13 14:10:31 +00:00
Jeff Young cf8294b5c2 Remove a bunch of blind (and a few redundant) static_casts. 2023-07-13 14:14:45 +01:00
Ian McInerney ae60b57c3d Add default parameter to PCB image placement action 2023-07-13 13:15:19 +01:00
jean-pierre charras 7ac0ca9c14 Pcbnew, undo_redo: Do not cast to BOARD_ITEM items that are only EDA_ITEM
A BOARD_ITEM is derived from EDA_ITEM, so the cast is not possible
Fixes #15177
https://gitlab.com/kicad/code/kicad/-/issues/15177
2023-07-13 10:53:50 +02:00
Ian McInerney e82a58a12e Changed: Allow filling/unfilling individual zones with no selection
The draft fill and single zone unfill would only work if something was
selected first, this allows them to call the selection operation to
request what is under the cursor. Also properly gate the operation to
not cause crashes/issues when the selection contains non-zone items.
2023-07-12 23:00:13 +01:00
Seth Hillbrand dde017cdc2 Force remove tree watcher when setting
The lib watch on Mac may not actually remove the tree on DTOR, so we
need to force the removal.  This also adds some additional debug flags
if the issue continues

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15173
2023-07-12 14:29:06 -07:00
Ian McInerney a8f628d0df Add virtual destructor for base class 2023-07-12 19:39:15 +01:00
John Beard 09c0f713cd Add fillet and chamfer icons 2023-07-12 19:21:47 +01:00
John Beard a72ab9f351 Put fillet, chamfer and extend in a submenu 2023-07-12 19:21:47 +01:00
John Beard 046d978ba7 ADDED: Pcbnew chamfer and extend tools
Using the new ITEM_MODIFICATION_ROUTINE system, drop in two new
tools: chamfer and line extend. These are two geometric operations
that are relatively common when editing footprints in particular.

Chamfer delegates the geometric calculations to a dedicated unit
in kimath/geometry.
2023-07-12 19:21:37 +01:00
John Beard 8e0e9ce752 Generalise fillet tool
Describe the actions of the fillet tools is a generic way, so that the
same general pattern can be used for other tools that modify shapes on
the BOARD.

Basically, an "ITEM_MODIFICATION_ROUTINE" is defined, which is
configured and called multiple times, calling back to the EDIT_TOOL when
it modifies or creates an item.

The motivation here is to make it easier to slot in new line-based
tools like chamfer, extend and so on without having to redo the
complicated item, selection and commit handling each time, and keep the
core "routines" simple and decoupled from the EDIT_TOOL's
internals.

This also resolves #15094 because the new commit handling does the right
thing when items were "conjured up" for the fillet (e.g. when a
rectangle is decomposed into lines).

Fixes: #15094
2023-07-12 19:21:26 +01:00
Seth Hillbrand 3030c80de7 Record hole knockouts in zone filler earlier
Spokes are placed across an entire pad when filling, so the hole
knockouts need to knocked out prior to deflating

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15160
2023-07-12 11:17:57 -07:00
Jeff Young 8f754c7c3e A more performant and slighty more aggressive blob trimmer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14462

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14107
2023-07-12 17:30:42 +01:00
Jeff Young 56752e9bad Move some MRU paths from app to project.
Also augments Save As path updating to handle these newly-moved paths,
and to handle absolute paths that point into the project directory.
2023-07-12 17:30:42 +01:00
jean-pierre charras 2e7db309bd Fix typo 2023-07-12 17:24:03 +02:00
jean-pierre charras b47f172e57 PCB_VIA::SetLayerSet( LSET aLayerSet ): fix bug: it must consider only copper layers.
Its purpose is to initialize the top and the bottom copper layers connected
by this via. So only copper layers in LSET must be analyzed.
2023-07-12 13:02:05 +02:00
Jeff Young be63e1824e Create filled polygons when centerline is chosen. 2023-07-12 10:41:46 +01:00
jean-pierre charras 2cb23bd43a VIA on solder mask: fix incorrect size (radius) of displayed mask 2023-07-11 17:35:30 +02:00
jean-pierre charras 74c5f5a054 Ensure a layer exists before using it.
Fixes #15170
https://gitlab.com/kicad/code/kicad/-/issues/15170
2023-07-11 16:19:46 +02:00
Jeff Young c3d10084b9 ADDED footprint associations dialog. 2023-07-11 14:52:05 +01:00
Mike Williams 3a7de82243 PCB: respect styling settings when inserting footprint from editor
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15155
2023-07-11 08:16:48 -04:00
jean-pierre charras ab4535f01b Pcbnew, show solder mask on VIAS: refinement: take in account the mask expansion. 2023-07-11 11:07:50 +02:00
Jeff Young 879e6c302d Redraw via mask layers when switching Tented Vias on/off.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15164
2023-07-10 23:29:54 +01:00
Ian McInerney aab8d2b036 Give autocomplete routing a default parameter
Fixes KICAD-2M4
2023-07-10 19:41:03 +01:00
Jeff Young 8f5b7569d1 Split StyleFootprints into separate bools for fields vs text & graphics.
Also moves the settings from Board Setup to Preferences > PCB Editor.

Also collapses Track Drag Mode from radio buttons to a choice menu to
save space and allow it to be with the other editing action modes.
2023-07-10 17:15:57 +01:00
Jeff Young db61fe03b3 Prefer MRU path to LastImportExportPath for importing footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15102
2023-07-09 22:28:26 +01:00
Jeff Young df63ca0189 Save a bit of space in FP 3D preview by moving board thickness to dlg.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13896
2023-07-09 20:36:55 +01:00
jean-pierre charras bdaad32dc8 Pcbnew: fix crash when trying to delete a DIMENSION living in a footprint
Fixes #15156
https://gitlab.com/kicad/code/kicad/-/issues/15156
2023-07-09 20:02:56 +02:00
Jeff Young a66360525a Broaden "Style footprint fields" to cover graphics as well.
Also cleans up the layout of the symbol & fp properties dialogs.

Also fixes the background colour of the link textEdit controls on Mac.

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15152
2023-07-09 12:45:55 +01:00
Mike Williams cc7798745e Board Settings: control styling of footprint fields
Can use library values or board default settings. Defaults to board
default settings.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8161
2023-07-08 19:58:11 -04:00
Jeff Young 1d0a5ca34b No point in having a RATSNEST_VIEW_ITEM in FP editor, viewer, etc. 2023-07-08 22:54:14 +01:00
Jeff Young 5bf257cdf6 Don't blindly cast to PCBNEW_SETTING: we may be in CVPCB....
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15153
2023-07-08 22:50:22 +01:00
Mike Williams bfc3dcbe26 Footprint Editor: don't override field text sizes in editor
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15134
2023-07-08 16:50:15 -04:00
StuartTylerRelytDesigns d26aa7dc20 Pcbnew moveIndividually ctrl-M mangles 2+ tracks
CHANGED: moveIndividually ctrl-M not mangle tracks and add grid snapping

Fixes https://gitlab.com/kicad/code/kicad/issues/15124
2023-07-08 09:11:53 +00:00
Jeff Young dc838bc50f Formatting. 2023-07-07 23:41:58 +01:00
Jeff Young 9d9344a815 Save, clear, and restore selection around a footprint reload.
Also fixes a bug with the footprint's UUIDs getting reset.
2023-07-07 23:41:58 +01:00
Seth Hillbrand 954b265839 Check for zone-zone overlap
Instead of just checking for the zone outline, we adjust to check the
full fill area of the zones for intersection and overlaps
2023-07-07 11:52:25 -07:00
jean-pierre charras 27072e52f7 Fix a compil and Coverity warnings 2023-07-07 10:28:01 +02:00
jean-pierre charras 4f7e9bead5 Fix a typo than can create a crash
Fixes #15126
https://gitlab.com/kicad/code/kicad/-/issues/15126
2023-07-07 10:17:02 +02:00
John Beard ef8cf2d12b Avoid inheriting for POSITIONING_TOOLS_MENU
This only uses the public interface of CONDITIONAL_MENU,
so we can just make on of those and save declaring a wrapper
type.
2023-07-06 21:11:51 +01:00
Mike Williams efb452df37 PCB: selectionCursor can optionally take a filter list
Make sure we pass a default nullptr parameter if we want everything.
2023-07-06 11:25:53 -04:00
Mike Williams a1f42b823f PCB: drop unused lockable items list
Unused by any code, and list is incorrect anyway.
2023-07-06 11:25:41 -04:00
Kuba Sunderland-Ober 3b261256e7 Use static casts between related classes. 2023-07-05 10:20:18 +00:00
Ian McInerney 50e0a3a500 Move layer ID to action mapping to PCB_ACTIONS
This mapping function is better suited for a method of the actions
itself rather than just a helper function in one file.
2023-07-05 11:09:34 +01:00
Alex Shvartzkop a80ac8286d EAGLE PCB import: fix footprint text alignment. 2023-07-05 02:56:06 +03:00
jean-pierre charras 33e489c4a8 Pcbnew, PlotInteractiveLayer(): do not print useless info in a PDF plot.
It makes this ifo more easily readable.
- Remove duplicate properties
- Do not plot empty properties
- do not plot lib descr and keywords, useless in a pdf plot.
2023-07-04 20:02:28 +02:00
Alex Shvartzkop e892405738 Altium PCB import: read and apply TrueType font names to text. 2023-07-04 13:29:42 +03:00
Alex Shvartzkop 536744d37a Altium PCB import: fix text positioning when not bottom-left aligned. 2023-07-04 13:16:25 +03:00
Alex Shvartzkop 847f538192 Altium PCB import: turn off Keep upright for footprint texts.
Looks like it was set to true by mistake.
2023-07-04 13:11:43 +03:00
Alex Shvartzkop b09ab2daab Don't duplicate footprint bookmarks when plotting multiple PCB layers. 2023-07-04 08:08:52 +03:00
Jeff Young 67c9d3932b Another attempt to fix qa error. 2023-07-03 16:26:20 +01:00
Jeff Young def1a9f39c Add SHORT_NET_NAME processing to footprint variable resolution.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15095
2023-07-02 10:58:10 +01:00
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