Commit Graph

173 Commits

Author SHA1 Message Date
Jeff Young 996a5b85a6 Overhaul IsJunctionNeeded logic to support all the different cases.
Several clients were using this with different needs.  The API is
now more explicit (and there are more options under the hood).

Fixes https://gitlab.com/kicad/code/kicad/issues/9518
2021-11-04 12:57:16 +00: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
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
Jeff Young 0598c82972 Terminology (use present tense for flags). 2021-05-31 12:26:44 +01:00
Wayne Stambaugh 1786ae8773 Eeschema: use symbol nomenclature for object file naming. 2021-02-24 08:48:02 -05:00
Jeff Young b938df0e46 Coding policy. 2021-02-23 12:49:02 +00:00
Seth Hillbrand 24795f5b12 Fix overzealous breakSegments()
We cannot break segements that are merely close or on endpoints, so we
filter these prior to the break routine.  Failing to do this was
overloading our undo stack with bogus values

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/7554
2021-02-16 10:12:30 -08:00
Seth Hillbrand 02c7fcdc84 Fix BreakWire tool
Adds ability to start new commit to eeschema, allowing all
AddItemsToUndoList to always append without foreknowledge.  Keeps newly
split wires on the tool until placed

Fixes https://gitlab.com/kicad/code/kicad/issues/7512
2021-02-12 17:17:12 -08:00
Seth Hillbrand b2cd1fddf9 Prevent invalidating iterators
When iterating over RTree, we cannot modify the RTree without
invalidating our iterators, so we use a temporary structure to hold the
schematic items

Fixes https://gitlab.com/kicad/code/kicad/issues/7228
2021-01-23 13:41:00 -08:00
Jeff Young ad281f7538 Remove duplicated TestDanglingEnds routines.
Also adds a changedItemHandler so that the single remaining version
can update the view.

Fixes https://gitlab.com/kicad/code/kicad/issues/6581
2020-12-06 21:24:16 +00:00
jean-pierre charras 976b7e1c47 Eeschema: Move last netlist code to netlist_exporters folder 2020-10-26 18:40:58 +01:00
Marek Roszko 1c0700fbc4 Quiet gcc warning about assignment 2020-10-24 00:50:02 -04:00
Jeff Young 176f461b2c Fix a corner case of wire merging.
We want to look for a junction before merging two touching colinear
segments, but the old code would also check for a junction when
merging two overlapping segments, which is not what you want.

Fixes https://gitlab.com/kicad/code/kicad/issues/5960
2020-10-21 18:51:47 +01:00
Jeff Young 339fa5e0e3 Hack around the mess that we've made of line styles. :(
Fixes https://gitlab.com/kicad/code/kicad/issues/5960
2020-10-21 18:51:47 +01:00
Marek Roszko 12d21e34e2 Remove trigo.h from eda_text.h 2020-10-13 23:37:48 -04:00
jean-pierre charras 7865d8de43 more cleanup about removing useless include 2020-10-02 15:50:46 +02:00
Seth Hillbrand 02a5d47de9 Avoid passing references in EESchema
This returns the connection list by value.  This allows easier Python
use

Also renames m_End() to GetEnd()
2020-09-08 06:29:27 -07:00
Mark Roszko 1082402b33 Convert UNDO_REDO_T to an enum class 2020-08-26 18:04:32 +00:00
Seth Hillbrand ee5c991d2f eeschema: Ensure all wires are joined
When running the cleanup routine, we should check that we haven't
changed our lines during the process.  If we have, we run again to pick
up the new merges

Fixes https://gitlab.com/kicad/code/kicad/issues/5265
2020-08-20 06:49:05 -07:00
Jeff Young 827138f6b4 Remove left-over debug code. 2020-08-10 14:17:17 +01:00
Jeff Young f4ab14f32d Performance improvements for SchematicCleanup().
Fixes https://gitlab.com/kicad/code/kicad/issues/4563
2020-08-10 12:41:52 +01:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

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

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

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jeff Young 20c00cbb21 Finish off "busses" -> "buses".
Fixes https://gitlab.com/kicad/code/kicad/issues/4144
2020-04-02 18:27:05 +01:00
Seth Hillbrand ef00fa6008 Cleanup busses
At some point the buses were no longer being addressed in
SchematicCleanup().  This re-adds bus segments to the checklist for
segments to merge/clean
2020-01-22 05:53:40 -08:00
Seth Hillbrand 6e5e453d0d Replace EESchema DLIST
This moves EESchema DLIST structures to rtree.  These changes are more
fundamental than the pcbnew changes from 9163ac543 888c01d11 d1877d7c1
and 961b22d60 as eeschema operations were more dependent on passing
drawing list references around with SCH_ITEM* objects.
2020-01-10 06:37:08 -08:00
Ian McInerney 079423c3cc eeschema: Remove unused include of eeschema_id.h 2020-01-03 16:04:54 +00:00
Seth Hillbrand cda291adae eeschema: Clean bits of DLIST
Removes the extra DLIST manipulation from SCH_LINE_WIRE_BUS_TOOL and
moves the static storage into class storage
2019-12-13 11:22:18 -08:00
Jeff Young 9d288968e7 Be more explicit about extent of schematic cleanups.
The new connectivity algorithm had a tendency to cleanup
globally, but that could insert undo records from other sheets
into the current screen's undo stack.  Needless to say, this
was a recipie for segfaults.

Fixes: lp:1846247
* https://bugs.launchpad.net/kicad/+bug/1846247
2019-11-10 23:25:54 +00:00
Jeff Young 33606431cc Fix an insidious bug where DoDelete() and DeleteJunction() were fighting over who owned the STRUCT_DELETED flag.
Fixes: lp:1844620
* https://bugs.launchpad.net/kicad/+bug/1844620
2019-09-19 19:11:19 +01:00
Jeff Young 7ad98b8a7d Fix bug in JunctionNeeded and selection around adding/removing junctions.
When checking for 3 or more connections, at least one of them must be
a pin.  Otherwise we need to fall down to the next check which also
ensures that at least one of them is not parallel.

Fixes: lp:1841458
* https://bugs.launchpad.net/kicad/+bug/1841458
2019-09-12 20:10:47 +01:00
Jeff Young b4c8657904 Fix non-visible-part or conversion items from getting selected.
Also renames lib_draw_item to lib_item to match the class.

Fixes: lp:1840170
* https://bugs.launchpad.net/kicad/+bug/1840170
2019-08-15 10:00:23 +01:00
Seth Hillbrand 91446c1515 eeschema: Fix list invalidation
When removing a junction, we need to keep the next pointer for deleted
item, marking them with a flag until committed.

Fixes: lp:1837398
* https://bugs.launchpad.net/kicad/+bug/1837398

(cherry picked from commit 4363e6a213)
2019-08-05 09:04:47 -07:00
Jeff Young d03041b565 Cleanup. 2019-07-02 21:36:42 +01:00
Seth Hillbrand 0b629b4bd4 eeschema: Limit normalization on load
When loading a new file, we do not want to add junctions where they did
not exist before.  This could generate invalid netlists by breaking a
wire at a pin connection point.

We do break/add connections when the user modifies the schematic but
this happens while the user is actively working with the component and
sees the action.

Fixes: lp:1830411
* https://bugs.launchpad.net/kicad/+bug/1830411
2019-05-28 13:29:20 -07:00
Jeff Young 25209516a6 Adjust net highlighting after edits.
Fixes: lp:1800291
* https://bugs.launchpad.net/kicad/+bug/1800291
2019-05-12 18:20:41 +01:00
Jeff Young 7995b5cc3c Restore selection on abort and undo/redo.
Also includes a related bug fix to not create an undo record for
the initial schematic cleanup.

Fixes: lp:1825975
* https://bugs.launchpad.net/kicad/+bug/1825975
2019-05-11 15:38:49 +01:00
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young b97d65e791 Fix crash bug when deleting sheet pin and disappearing bug when moving them.
Fixes: lp:1827890
* https://bugs.launchpad.net/kicad/+bug/1827890
2019-05-06 16:31:02 +01:00
Jeff Young 6e695aac25 Move bus unfold and symbol unit selection to modern toolkit. 2019-05-05 17:14:30 +01:00
Jeff Young f4b92e6acf Refactor as SCH_DRAWING_TOOL was getting too big. 2019-05-05 17:14:30 +01:00
Jeff Young 902be18a04 More modern toolset context menu work.
Text/label type changes and bus entry shape changes.  And some
context menu bug fixing.
2019-05-05 17:12:59 +01:00
Jeff Young eacc3e67a5 Implement repeatDrawItem in modern toolkit and fix bugs.
Fixes moving of SCH_FIELDS.
Fixes undo operations around SCH_FIELDS and SCH_PINS.
2019-05-05 17:12:59 +01:00
Jeff Young a461eae8b9 Fix 100s of usages of GetFlags() which conflated != 0 with being edited.
While this was true long ago, many flags have been added since which
have nothing to do with editing (HIGHLIGHTED, BEGIN_ONPAD, etc.)
2019-04-22 09:58:06 +01:00
Jeff Young c88fd514a0 Implement drawing tools in modern toolset.
Fixes: lp:1825192
* https://bugs.launchpad.net/kicad/+bug/1825192
2019-04-17 21:49:50 +01:00
Seth Hillbrand 3e7969ab8d eeschema: Place bus unfold on the stack
When activating a bus unfold, the results should be placed with the new
line generation to allow proper undo ordering.
2019-04-13 07:28:22 -07:00
Seth Hillbrand 3bdd69ad6b eeschema: Fix undo stacking for break wire
The break wire command is actually two commands: modify the existing
wire and add a new wire.  This means that the command must append to the
previous commit to avoid breaking the undo stack

Fixes: lp:1824251
* https://bugs.launchpad.net/kicad/+bug/1824251
2019-04-13 07:11:24 -07:00
Seth Hillbrand 822cd9c6ef eeschema: Remove UR_WIRE_IMAGE
The wire image undo/redo option required special handling and was only
used in a single location.  Replacing with single change handling
reduces the code complexity
2019-04-13 07:11:24 -07:00
Jon Evans 232b1c799f Add a workaround for bus unfolding without real-time connectivity
Fixes: lp:1822728
* https://bugs.launchpad.net/kicad/+bug/1822728
2019-04-11 00:17:22 -04:00
Jon Evans 9589427960 Refactor how at-load schematic normalization is called
Don't prepend "/" for nets at the top level

Revert "Don't prepend "/" for nets at the top level"

This reverts commit fa9533222f7d33eee5f3fa2320bd9f3167e28076.
2019-03-31 19:57:00 -04:00