Commit Graph

141 Commits

Author SHA1 Message Date
Seth Hillbrand b3a5e08c2f pcbnew: Rename PCB_ZONE_T and remove from connectivity
SEGZONE types were confusingly named PCB_ZONE_T.  Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.

This also removes processing of the SEGZONEs from connectivity
calculations.
2018-09-29 15:09:15 -07:00
Seth Hillbrand 491098af35 pcbnew: Deselect all items in a delete commit at once
Deselecting each individually had the side-effect of possibly re-drawing
the view in between actions, leading to visible artifacts in the router
(where invisible items are set visible before committing a change)
2018-09-26 05:41:14 -07:00
Seth Hillbrand 7470d5ba98 pcbnew: retain selection between edits
We had been deselecting items after calling edits to be safe in case the
item was deleted/exchanged by the edit.  The item pointer itself remains
valid even when deleting as it is assigned to the undo stack.  But it
should not remain visible or selected on the schematic if it is removed.

This tests for removed items by checking whether it (in the case of
first-level BOARD_ITEMS) or its parent (in the case of footprint item
components) remain in the view list after editing.  If they are still in
the view list, then we re-select them.

( cherry-picked from 2c6d0ffe2 )
Fixes: lp:1765774
* https://bugs.launchpad.net/kicad/+bug/1765774

Fixes: lp:1775946
* https://bugs.launchpad.net/kicad/+bug/1775946
2018-09-17 10:58:42 -07:00
Jeff Young a40ab768fc Allow deletion of non-Reference/non-Value module text items.
Fixes: lp:1781226
* https://bugs.launchpad.net/kicad/+bug/1781226
2018-09-17 18:01:08 +01:00
Jeff Young 84151990cd Don't set dirty bit when adding MARKERs.
They're not saved in the file, so they shouldn't dirty it.

Fixes: lp:1762497
* https://bugs.launchpad.net/kicad/+bug/1762497
2018-04-09 21:19:11 +01:00
Maciej Suminski 3e54e16bdc Update ratsnest after a footprint change
PCB_BASE_FRAME::PlaceModule() calls CN_CONNECTIVITY_ALGO::Update()
on the new footprint that does not have nets assigned. The Update()
method first removes the footprint (but it has not been added, so
nothing happens) and then adds it with all pads marked as not connected.
Later, when BOARD_COMMIT is pushed - it tries to add the same footprint
again with nets assigned, but the pads are already registered, therefore
they are discarded.

To prevent this, PlaceModule() does not call CN_CONNECTIVITY_ALGO::Update()
for the just created footprint, as it is handled by BOARD_COMMIT later.
2018-03-05 16:42:30 +01:00
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
Maciej Suminski 9c2d1cf890 Fixed BOARD_COMMIT::Revert()
Revert() method was still not aware of CHT_DONE flag, therefore
the switch statement was always invalid. To fix it, the commit
type is split to type and flags as is done in Push() method.
2017-12-14 17:13:42 +01:00
Tomasz Włostowski 00ad8f24a0 pcbnew: Minor changes in CONNECTIVITY_DATA interface:
- renamed connectivity.[h|cpp] to connectivity_data [.h|.cpp] so that the file name matches the main class name.
- GetNetItems() now returns a vector instead of a list
2017-11-15 18:34:08 +01:00
Tomasz Włostowski c9817df9db refactoring: implemented BOARD-specific view Add()/Remove()/Update() methods in PCB_VIEW, moved to libpcbcommon 2017-11-03 20:02:06 +01:00
Tomasz Włostowski d0ef881a53 refactoring: make BOARD_COMMIT independent from pcbnew 2017-11-03 20:02:06 +01:00
Maciej Suminski 05ab44f463 Fixed a memleak when no undo entry is requested in BOARD_COMMIT 2017-10-31 09:14:03 +01:00
jean-pierre charras 56d42c776a Replace assert() by wxASSERT to make debug more easy. 2017-10-19 09:49:09 +02:00
Tomasz Włostowski c6a0ad895b pcbnew: code formatting, removed previous module editor copy/paste functions 2017-09-30 14:28:54 +02:00
Tomasz Włostowski 5731000135 pcbnew/copy&paste: multiple improvements:
- fixed netcode propagation bug
- factored out EDIT_TOOL::m_offset, now selection offset is stored in SELECTION class
- added VECTOR2I-based Move/Flip/Rotate methods in BOARD_ITEM
2017-09-30 14:28:54 +02:00
Tomasz Włostowski 931a1ccaff Improved copy/paste functionality by Kristoffer:
- added selection of reference point
- added snapping when pasting
- some minor code refactoring
- disabled pasting between footprint and pcb editors due to model incompatibility
2017-09-30 14:28:54 +02:00
Tomasz Włostowski c229063d9e Fixed crash when redrawing ratsnest after swapping pad net assignments 2017-07-02 02:05:42 +02:00
Seth Hillbrand 8201e2cbff Footprint editor crashes when deleting pads and undoing this command.
Fixes: lp:1701092
https://bugs.launchpad.net/kicad/+bug/1701092
2017-06-29 20:43:38 +02:00
Tomasz Włostowski 9ad886344b New connectivity algorithm. 2017-06-23 11:12:36 +02:00
Tomasz Włostowski 966052272f Coding style fixes 2017-03-03 20:27:05 +01:00
Tomasz Włostowski 9e73c3117e Added possibility to disable undo entries creation in COMMIT/BOARD_COMMIT 2017-03-03 20:26:34 +01:00
Jon Evans 0afb249447 Add drawing priority support to VIEW
Call UseDrawPriority( true ) after creating GAL to enable.

VIEW::Add() gets a new optional argument to specify the draw order
when adding an item.  If the new argument is left default, the draw
order will increment with each call of VIEW::Add().

Fix std::bind calls after change to VIEW::Add
2017-02-28 14:47:20 +01:00
Maciej Suminski 3c61b16e7b Code formatting 2017-01-18 13:22:40 +01:00
Maciej Suminski c96db4f5c4 Removed aCreateUndoEntry flag from COMMIT::Push()
It was not used anywhere and COMMIT should handle creating
undo buffer entries.
2016-12-12 16:45:52 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 3f7c5a0845 fixed post-rebase issues 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 1c1f4e9a50 Refactoring of VIEW/VIEW_ITEM classes:
- Remove dependency of EDA_ITEM on VIEW
- VIEW_ITEM is now a pure virtual interface
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 27a10e8597 Multiple simplifications to GAL tools in PCBNew:
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
2016-12-12 16:45:52 +01:00
Maciej Suminski e37488f145 Minor code simplification in BOARD_COMMIT 2016-12-07 16:50:23 +01:00
Maciej Suminski 89a5f8ce69 Remove boost::bind from BOARD_COMMIT 2016-11-28 15:51:18 +01:00
Maciej Suminski 7f9380af26 Update the status panel after every commit. 2016-09-19 12:08:29 +02:00
Maciej Suminski 65b1225231 Added CHT_DONE flag to COMMIT::Stage to skip add/remove step 2016-09-12 13:45:57 +02:00
Maciej Suminski 86895822b7 BOARD_COMMIT retracts changes in reversed order 2016-09-12 13:45:57 +02:00
Maciej Suminski 32c4bec31c Implemented BOARD_COMMIT::Revert() 2016-09-12 11:50:06 +02:00
Maciej Suminski 08d15a9961 BOARD_COMMIT::Revert() marked as not tested 2016-09-12 11:50:06 +02:00
Maciej Suminski f1b37109e3 BOARD_COMMIT code cleaning
Moved a few conditionals to scopes where they can be executed.
Simpler way to create ITEM_PICKERs.
2016-09-12 11:50:06 +02:00
Maciej Suminski c7ce82a4bf BOARD_COMMIT creates only one copy of a modified module 2016-09-12 11:50:06 +02:00
Maciej Suminski 992ca6e7c7 Fixed removal function in BOARD_COMMIT. 2016-09-12 11:50:06 +02:00
Maciej Suminski 2ab7196035 Reenabled and corrected BOARD_COMMIT::Revert(). 2016-09-12 11:50:06 +02:00
Maciej Suminski 497fb31ae0 BOARD_COMMIT can be constructed using a PCB_BASE_FRAME*. 2016-09-12 11:50:06 +02:00
Tomasz Wlostowski 9588a7974c Added classes COMMIT & BOARD_COMMIT. 2016-09-12 11:50:06 +02:00