Commit Graph

7474 Commits

Author SHA1 Message Date
Jeff Young b52529521e Replace individual LIB_* shapes with LIB_SHAPE (based on EDA_SHAPE).
Also moves to more capable FILL_T model that can be shared.
2021-10-15 12:45:43 +01:00
Jeff Young 9b9e379aa0 Overhaul arc internal model to not over-specify information. 2021-10-15 12:45:43 +01:00
Wayne Stambaugh c61af21da8 Eeschema: don't stat files when updating title bar text.
The tests for file existence and write status perform two file stats
which cause performance issues on slow network shares.  Now the file
state is determined at load time and stored in the SCH_SCREEN object
so file access is no longer required.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9343
2021-10-14 10:52:58 -04:00
Wayne Stambaugh c4d0a06701 Eeschema: fix broken auto save feature.
Make auto save recover all auto saved sheet files not just the root sheet.

This does not fix existing auto save issues because recovery would require
an iterative reload for each automatically saved sheet file and would only
happen once.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9288
2021-10-13 14:51:00 -04:00
Mikolaj Wielgus 5f53019290 Substitute all wxHtmlWindow with HTML_WINDOW
Remove other places where <body> tag is used to override the default
black-on-white theme.
2021-10-12 07:07:15 +00:00
Roberto Fernandez Bautista 7aa3514042 CADSTAR Schematic: Add net labels for named nets on symbol pins
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9371
2021-10-11 18:30:21 +01:00
Seth Hillbrand 52bbfb9109 Remove dependency of dot size on linear mils
Changes a dot to be a square pixel (linewidth x linewidth).  This allows
the removal of IU dependencies and ensures that a dot is always visible
on screen.  Also makes sure that cairo is setting the current linewidth
during its stroke routines

Fixes https://gitlab.com/kicad/code/kicad/issues/9362
2021-10-10 09:40:26 -07:00
Seth Hillbrand 48f9dfa988 Revert "Fix grid cell highlight not functioning on Windows in the symbol pin table"
This reverts commit 94552ed838.

Breaks cell-based copy/paste
2021-10-10 08:04:11 -07:00
Jeff Young 57c7d663b0 Fix bone-headed mistake when moving panel disabling. 2021-10-07 00:17:42 +01:00
Seth Hillbrand b5cd976845 Don't arbitrarily exclude components from BOM
We already exclude components based on the schematic property when
generating the XML.  Don't make a hidden second pass in the python
netlist reader by default

Fixes https://gitlab.com/kicad/code/kicad/issues/9326
2021-10-06 12:58:05 -07:00
Seth Hillbrand 2c7da5e2bd Handle deleting segment
Edited point needs to clear to allow us to use the click timer for
left-click after the drawing is deleted.

Fixes https://gitlab.com/kicad/code/kicad/issues/9320
2021-10-06 10:21:04 -07:00
Jeff Young 95f841a037 A more nuanced method of making Board & Schematic Setup read-only.
This one still allows you to scroll to see all contents.

Fixes https://gitlab.com/kicad/code/kicad/issues/9302
2021-10-06 11:16:46 +01:00
Jeff Young 935a307674 Formatting and iterator safety. 2021-10-06 11:13:16 +01:00
Seth Hillbrand bb5c58b3cf Set default force cursor off in auto-lines
Leaving the forced position on results in the auto-line linking to a pin
for far longer than we intend if there are other hits in the area of the
cursor

Fixes https://gitlab.com/kicad/code/kicad/issues/9321
2021-10-05 20:28:05 -07:00
Seth Hillbrand 854472d550 Prevent automatic RTree recaching
Calling UpdateItem() may be performed by in a common loop, e.g. for(
SCH_ITEM* item : GetScreen()->Items() ) or similar.  We cannot call
GetScreen()->Update( SCH_ITEM* ) in this routine as it will remove and
re-add the item to the RTree, invalidating iterators.  If needed, the
items need to be cached to an external container before updating

Fixes https://gitlab.com/kicad/code/kicad/issues/9318
2021-10-05 20:13:15 -07:00
Seth Hillbrand 9a8d1246cc We don't keep a CHANGELOG.TXT
Direct interested readers to AUTHORS.TXT instead.
2021-10-05 19:46:53 -07:00
Seth Hillbrand 548e5f49bd Clean up unused variable usage
Unused variables in function calls can be commented out.  Unused
return variables get a new routine `ignore_unused()` that silences the
warnings with zero overhead.
2021-10-05 10:00:30 -07:00
Jeff Young 92008a089a Disable Board & Schematic Setup controls when project is locked.
(or missing).

Fixes https://gitlab.com/kicad/code/kicad/issues/9302
2021-10-04 16:47:27 +01:00
Jeff Young 7c432d7a50 When annotating for another feature, make sure scope is entire schematic.
Fixes https://gitlab.com/kicad/code/kicad/issues/9303
2021-10-03 19:42:29 +01:00
Jeff Young 574bef2237 Normalize drawing sheet path to env vars & prj, not just prj.
Also cleans up the dialog a bit.

Also changes the workings of NormalizePath to return the input if
it couldn't be shortened which saves open coding that behaviour in
all its callers.

Fixes https://gitlab.com/kicad/code/kicad/issues/9036
2021-10-02 23:39:45 +01:00
Jeff Young 10dd70881c New paramaterized interface doesn't like quoted parameters.
(At least on MSW, anyway.)
2021-10-02 14:08:36 +01:00
Marek Roszko 94552ed838 Fix grid cell highlight not functioning on Windows in the symbol pin table
Fixes https://gitlab.com/kicad/code/kicad/issues/9290
2021-10-01 23:44:16 -04:00
Jeff Young ef74421922 Move centering of lib-tree item to idle event.
Fixes https://gitlab.com/kicad/code/kicad/issues/9294
2021-10-01 22:46:14 +01:00
Jeff Young 5f5ee7335d Formatting. 2021-10-01 21:49:14 +01:00
Jeff Young f606679164 Proper numeric sorting for intersheet refs.
Also expunges the horrifically named std::remove and std::remove_if
(neither of which remove anything).
2021-10-01 18:29:21 +01:00
Jeff Young 5d579d14c1 Give intersheet refs a bit more breathing room. 2021-10-01 18:29:21 +01:00
Seth Hillbrand dd1d36d40a Fix segfault when check for editing points
The point editor is not always available when checking for points.  We
need to handle the missing tool without crashing
2021-09-30 17:25:33 -07:00
Jeff Young b9596a0a5d Update dangling flags in color settings' preview. 2021-09-30 18:53:39 +01:00
Jeff Young c7e6c273b4 Fix missing RTREE update. 2021-09-30 18:53:39 +01:00
Seth Hillbrand 13d913a014 Choose centering after zoom
When we zoom after centering, the screen does not display the item at
the appropriate location until you center again.  Choose the zoom first
to set the appropriate scale before translating the viewport
2021-09-29 16:30:52 -07:00
Jeff Young 12b726ba2f Prevent the point editor from fighting with other tools.
1) Don't start a long-click timer when the point editor is active.
2) Don't auto-start a wire when the point editor is active.

Fixes https://gitlab.com/kicad/code/kicad/issues/9270
2021-09-29 19:16:06 +01:00
Jeff Young 9cf9abbd66 Don't allow Text Properties dialog on intersheets references field. 2021-09-29 16:04:36 +01:00
Jon Evans 62ef27e372 Remove hard-coded anchor color in eeschema 2021-09-28 20:26:47 -04:00
Seth Hillbrand 2225c4e4ed Replace GetRows() with GetNumberRows() because wx 2021-09-28 10:48:04 -07:00
Seth Hillbrand 880f209563 When deleting pin row, show new highlight
When the user deletes a pin row, they need to see which row is now
selected for them to delete again.  Otherwise, deleting will have
unexpected consequences
2021-09-28 09:29:55 -07:00
Seth Hillbrand 42a21e15f0 Check before dereference
Fixes a crash where the screen was destroyed during new loading but
still gets dereferenced by the UI update.  Also puts defensive checks in
the UI conditions against null configuration settings
2021-09-28 08:42:55 -07:00
Jeff Young f73042fe24 Some minor performance enhancements. 2021-09-28 14:28:35 +01:00
Roberto Fernandez Bautista 7089a837f6 Update Editing Options Panel in eeschema with latest modifier keys
We now use Long Click, Ctrl and Shift (Alt is no longer used)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9234
2021-09-27 21:11:56 +01:00
Mike Williams d90dc77e00 Selection: Don't drop small moves
If we do a real drag, the timer will be cancelled. If we don't, then
the user is still holding the mouse button down and would probably like
to see the menu. Otherwise it appears the action is dropped.
2021-09-27 16:44:32 +00:00
jean-pierre charras d362cbc530 EEschema: change Save Copy As... to Save Current Sheet Copy As...
Save Copy As did not work with hierarchies (was not able to manage subsheets)
Fixes #9245
https://gitlab.com/kicad/code/kicad/issues/9245
2021-09-27 18:23:11 +02:00
Jeff Young c508c89a81 Pretty-up some warning messages. 2021-09-27 13:24:53 +01:00
Jeff Young 5f3c67bd2b Fill in some missing GetMsgPanelItems and make some others consistent.
Also expunges a std::vector<MSG_PANEL_ITEM> cover type.
2021-09-27 00:23:40 +01:00
Jeff Young 8636afdc73 Use FocusOnLocation for symbol fields cross-probing too. 2021-09-27 00:23:40 +01:00
Jeff Young 5bf042fcc1 Use individual parameter version of wxExecute.
Fixes https://gitlab.com/kicad/code/kicad/issues/9236
2021-09-26 15:03:06 +01:00
Jeff Young f6571c18cb Formatting. 2021-09-26 11:02:57 +01:00
Jeff Young c9aebb8529 Fix symbol fields sorting.
In the symbol fields table the reference contains only the letter, so
the number must be appended.  Conversely, we don't want the unit suffix
as all units are folded into a single symbol.

Fixes https://gitlab.com/kicad/code/kicad/issues/9238
2021-09-25 21:24:16 +01:00
jean-pierre charras f11687c5e5 Do not allow sheet filename change from DIALOG_SCH_FIELD_PROPERTIES.
It does not work. Changing a sheet filename is complex, and can be
made only in sheet properties dialog.
2021-09-25 18:28:19 +02:00
Jeff Young 0dc585e518 Use different dangling state initialization for wires and graphic lines. 2021-09-25 00:34:51 +01:00
Jeff Young 1b8506c6b6 Default dangling state to true. A wire on it's own is dangling. 2021-09-24 20:59:37 +01:00
Jeff Young 7901d705ba Fix optimization to not fetch all possible endpoints for non-connectable. 2021-09-24 20:08:42 +01:00
Jeff Young fad385785d Fix botched merge. 2021-09-24 20:08:29 +01:00
Jeff Young a1a2076aee Include pin roots for symbols that don't have well-defined bodies.
Fixes https://gitlab.com/kicad/code/kicad/issues/8508
2021-09-24 16:19:54 +01:00
Jeff Young a4f83073e3 Use RTree to optimize searches.
Should produce an order of magnitude speedup on dangling end tests
in some documents.
2021-09-24 12:42:22 +01:00
Jeff Young 2d72ccb6ae Simplify dangling end stuff a bit and remove graphic lines from it. 2021-09-24 12:19:27 +01:00
Marek Roszko d39f79b55b Fix schematic custom paper size check to use same limits as rest of eeschema
Fix #9223
2021-09-24 00:46:02 -04:00
Jeff Young 42687f5d9d Give selection preference to pins over wires.
Fixes https://gitlab.com/kicad/code/kicad/issues/9063
2021-09-23 23:59:20 +01:00
Jeff Young 9ea6b44ee8 Formatting. 2021-09-23 23:59:20 +01:00
Marek Roszko 064ab933dd Always update the hierarchy navigator when setting the current sheet in the frame
Fix #9221
2021-09-23 18:14:44 -04:00
Seth Hillbrand 71602475eb Allow rotate/mirror even when dragging
Keeps the lines connected but doesn't solve the crossed-wire mixups.
This allows common usage (mirroring labels/rotating segments) and leaves
prevention of the crossed wires to the user.

We can't really prevent crossed wires when rotating e.g. a part with
wires connected to 4 sides and users will not expect that.  But we
should not disable useful features like mirroring multiple parallel
items to avoid a known impossible situation

Also provides an alternative solution to 345f506f0c that allows us to
rotate groups without destroying connections on hover

Fixes https://gitlab.com/kicad/code/kicad/issues/8403

Fixes https://gitlab.com/kicad/code/kicad/issues/8523
2021-09-23 14:47:49 -07:00
Jeff Young 4b38bd1543 Favour junction dots to wires inside the dot.
Fixes https://gitlab.com/kicad/code/kicad/issues/9187
2021-09-23 22:13:56 +01:00
Jeff Young 552f053a55 Remove pins from symbol hit-testing.
Fixes https://gitlab.com/kicad/code/kicad/issues/8508
2021-09-23 22:07:51 +01:00
Seth Hillbrand 671aec5da6 In fallback selection, handle cancelled menu
doSelectionMenu returns false to indicate a cancelled menu.  This needs
to be handled in selectPoint when directly accessing doSelectionMenu in
the same manner as SelectionMenu() events

Fixes https://gitlab.com/kicad/code/kicad/issues/9218
2021-09-23 11:48:29 -07:00
Seth Hillbrand 3b04b602d9 Don't walk text/labels when mirroring
We have a fixed bottom-align for the text and labels in eeschema.
Therefore, mirroring vertically needs to account for the text's offset
from the bounding box center.

Fixes https://gitlab.com/kicad/code/kicad/issues/9208
2021-09-22 09:24:16 -07:00
Jeff Young ec2ac181a2 Further simplify selection logic.
The select-single-wire stuff is no longer needed, and the prefer-wire-ends
stuff needs to be distance-based.

Also improved wire hit-testing to include bubbles the size of the dangling
symbol at each end.

Fixes https://gitlab.com/kicad/code/kicad/issues/9187
2021-09-21 20:27:35 +01:00
Jeff Young 2ec1c215cd Drop selection after hiding items.
Fixes https://gitlab.com/kicad/code/kicad/issues/8605
2021-09-21 17:02:34 +01:00
Jeff Young 469d3ea329 Don't add global labels when a power symbol is connected.
Fixes https://gitlab.com/kicad/code/kicad/issues/7497
2021-09-20 21:31:19 +01:00
Jeff Young ae8f817938 Use consistent label size and fix issues with rotation.
Fixes https://gitlab.com/kicad/code/kicad/issues/5950
2021-09-20 21:31:19 +01:00
Jeff Young 40b4e5c024 Formatting. 2021-09-20 21:31:19 +01:00
Seth Hillbrand c67d560538 Remove unused and shadowed variables 2021-09-20 11:45:27 -07:00
jean-pierre charras fada53d90c Fix SCH_SCREENS::HasNoFullyDefinedLibIds(): incorrectly returned true if no symbol found.
Fixes #9195
https://gitlab.com/kicad/code/kicad/issues/9195
2021-09-20 18:29:26 +02:00
Jeff Young 6e7ce09572 Use more descriptive terminology for preferred text editor.
Also improves execution to allow the preferred editor to include
parameters, such as "/usr/bin/open -e".

Fixes https://gitlab.com/kicad/code/kicad/issues/9131
2021-09-19 15:17:26 +01:00
Marek Roszko e7814915db Call UpdateHierarchyNavigator on find jump in schematic in case we cross pages
Fix #8971
2021-09-19 08:35:51 -04:00
Jeff Young 0400c0a775 Prevent crash with RTree modification invalidating iterator. 2021-09-19 11:34:43 +01:00
Jeff Young a5c4bace60 Improve (and simplify) wire and pin hit-testing.
1) Expand the accuracy to at least the grid spacing
2) Move pin-selects-symbol logic to Selectable()
3) Recode pick-closest algorithm to handle exactHits and inexactHits
separately
4) Remove pin target from bounding box in favour of expanding it to
at least as wide as the pin decoration (this prevents the accuracy
off the end of the pin from growing too large)
2021-09-19 11:34:43 +01:00
Jeff Young a291cae2fd Make sure intersheetRef bounding boxes get updated in RTree.
Fixes https://gitlab.com/kicad/code/kicad/issues/9177
2021-09-18 18:32:19 +01:00
Jeff Young 4779850c10 Add done messages to various plotters.
Fixes https://gitlab.com/kicad/code/kicad/issues/9172
2021-09-18 10:39:57 +01:00
Jeff Young 4b3490a2b9 Intercept rotate command when drawing wires.
If unfolding from bus rotate the label; otherwise beep.

Fixes https://gitlab.com/kicad/code/kicad/issues/9178
2021-09-17 22:01:17 +01:00
Jeff Young 5c07441e24 Remove Setup Dialog assignment of netclasses to buses.
Also removes the message bar display of assigned netclass for
buses and bus-to-bus entries.

Also fixes a bug where assigning a netclass via the canvas only
looked at the first level of bus members (and not any nested
members).

Also fixes a bug where the bus name validator tried to validate
a vector bus first -- which doesn't work as a vector bus may be
nested in a group bus.

Also fixes a bug where we were failing to check for illegal
chars in bus definitions which otherwise passed the bus parsers.

See additional comments in the bug report.

Fixes https://gitlab.com/kicad/code/kicad/issues/9160
2021-09-17 22:01:17 +01:00
Jeff Young d32ca5b287 Fix bus validation.
Bus groups must be checked first as they can contain vectors inside
them.
2021-09-17 22:01:17 +01:00
jean-pierre charras ca33ec05df Eeschema: fix incorrect rotation (CW versus CCW) of some items.
For some (not all) items and for blocks the rotation CCW was in fact a CW rot.
Fixes #9176
https://gitlab.com/kicad/code/kicad/issues/
2021-09-17 18:30:23 +02:00
Jeff Young cc14dfe3ca Make canvas netclass assignment mirror Setup Dialog assignment.
While it would make more sense to have them both use the old canvas
algorithm (of only assigning to the members), I'd be *very* hesitant
to change the Setup Dialog and underlying machinery this late in the
6.0 release.

Fixes https://gitlab.com/kicad/code/kicad/issues/9160
2021-09-17 14:40:12 +01:00
Jeff Young d7bfd1eb77 Restore use of floating point precision in pin name/number placement.
It's actually required here to get the shadows centred directly under
the text.
2021-09-17 12:37:53 +01:00
Jeff Young b10f337299 Don't auto-zoom when page settings were cancelled.
Fixes https://gitlab.com/kicad/code/kicad/issues/8978
2021-09-17 12:37:53 +01:00
Wayne Stambaugh d90094de39 Fix progress dialog main frame focus issue on Linux.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8718
2021-09-16 15:53:18 -04:00
Jeff Young 2479e1d7b1 Improve common settings property grouping.
Also moves apply-icon-scaling-to-fonts to its own checkbox.  (We used
to try to infer when to do it, but that turns out to be a rathole.)
2021-09-16 18:31:44 +01:00
jean-pierre charras 8aa7e8d9f4 Fix compil warning (shadowed vars) 2021-09-16 18:21:07 +02:00
Wayne Stambaugh 4663da4709 Eeschema: don't escape document file alias names in legacy plugin.
Escaping the document file (.dcm) alias names breaks the link between the
document file and the library (.lib) file.  This causes the information in
the document file to be lost.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9130
2021-09-16 09:09:44 -04:00
Jeff Young 684d15895c Box highlighting of selected text was never finished.
In particular, pin numbers and names weren't done.
2021-09-15 21:17:18 +01:00
Jeff Young e2ce2e6ca9 Correct slight misalignment in Library Link fields. 2021-09-15 21:17:18 +01:00
Seth Hillbrand ca6e43d1e1 Fix segfault when discarding changes on open
When opening new schematic, the undo/redo list is invalidated.
CleanupSchematic uses it before presenting the new schematic to the
user, so we need to make sure that old data are not preserved here past
their pointer lifetimes
2021-09-14 16:41:25 -07:00
Jeff Young b84d1456d5 KIFACE_I -> KIFACE_BASE. 2021-09-14 23:45:14 +01:00
Jeff Young 3aae3c6f65 Dark mode for a bunch of HTML dialogs.
WX_HTML_REPORT_BOX
WX_HTML_REPORT_PANEL
HTML_MESSAGEBOX
DIALOG_DISPLAY_HTML_TEXT

Fixes https://gitlab.com/kicad/code/kicad/issues/9157

Fixes https://gitlab.com/kicad/code/kicad/issues/9156
2021-09-14 21:23:57 +01:00
Jeff Young 3b121359ae Fix a couple of escape-string issues.
Fixes https://gitlab.com/kicad/code/kicad/issues/9167
2021-09-14 18:30:19 +01:00
Seth Hillbrand 4b436fb86d Narrow down collector
RTree keeps track of position as well.  We can use this to reduce the
amount of time spent in the collector routine
2021-09-13 20:24:07 -07:00
Seth Hillbrand 1c409ff90a Fix typo in previous commit 2021-09-13 20:23:52 -07:00
Seth Hillbrand 2fdd805eda Override SCH_GLOBALLABEL::HitTest
Global labels can optionally have intersheet references.  When enabled,
they expand the bounding box of the label.  Because they can be far away
from the actual label, the bounding box is not a good approximation for
the hittest
2021-09-13 19:55:48 -07:00
Seth Hillbrand 484eaa01b9 Try harder to avoid loop contention
We have two cases where we might be requesting a disambiguation menu.
In one case, we already have the event loop waiting and we need to run
the selectionMenu through the action system.  In the other case, the
tool isn't on the stack and won't activate.  Here we need to run
directly and we are assured of not crashing because the tool isn't
active.

Fixes https://gitlab.com/kicad/code/kicad/issues/9154
2021-09-13 10:17:04 -07:00
Jeff Young fdfecf5932 Don't push view control settings to the previous active tool.
See further comments in bug report.

Fixes https://gitlab.com/kicad/code/kicad/issues/9147
2021-09-13 13:28:05 +01:00
Jeff Young efc9279a19 Fix unfortunate line-break. 2021-09-13 13:28:05 +01:00
Jeff Young 52f99e41e6 Fix merge screw up. 2021-09-12 22:57:25 +01:00