kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30130
Re: [PATCH] More aggressive sheet-selection
After suggestions from chris, I deactivated the "select all items on
sheet" on left-click inside eeschema, and instead added a context menu
for it when rightclicking on a sheet in eeschema.
This is a separate patch to the sheet-selection improvement. I do not
know how to generate a icon for this menu entry, so right now I am
reusing an already existing one.
- Kristoffer
On 07/24/2017 10:19 AM, Kristoffer Ödmark wrote:
Hmm, I was planning to send that mail to the ML. will resend it there.
I am unsure about the separate tool. Most circuits I am using this on is
instant, but I guess that doing both could be a viable option. The tool
is available as a separate tool from pcbnew.
On 07/24/2017 04:50 AM, Chris Pavlina wrote:
What about a slightly different approach? Don't do this on a
single-click on sheet, make it a separate tool. That way it just doesn't
happen accidentally. And give some feedback when it does run by
displaying a progress dialog.
On Mon, Jul 24, 2017 at 12:53:43AM +0200, Kristoffer Ödmark wrote:
Thank you for testing this!
I was not aware of the large pcb problem, and this actually raises a
question of having a large "demo" project to test stuff on. Since I
guess
many do like me and actually do many of the tests on the demo projects.
Also, I am thinking of adding a setting to be able to disable the
automatic
cross-probing for this since I think that getting the speed up will not
really be easy without some major refactor. Any tips and thoughts for
that?
- Kristoffer
On 07/24/2017 12:19 AM, Chris Pavlina wrote:
I like this change, and I was about to push it and suggest we can add
any suggested changes others have later, when I decided to test it on a
large project.
It's REALLY slow now. If I click on a sheet, KiCad freezes for a solid
ten seconds in my larger test project. IMO that isn't acceptable, it's
too easy to do accidentally and way too annoying when it happens.
On Mon, Jul 17, 2017 at 03:00:58PM +0200, Kristoffer Ödmark wrote:
I fixed up some of the code violations I could see, and applied the
patch to
current master, where the sheet selection is working once again.
- Kristoffer
On 07/12/2017 10:01 PM, Kristoffer Ödmark wrote:
The last working revision I copuld test was:
2c21c70f46dd3ef444ac4a909434697cce972f4a
Right before the new connectivty algorithm.
After that the sheet-selection is not working anymore. So It would be
nice if you could file a bug report on it :)
- Kristoffer
On 2017-07-12 13:33, Kristoffer Ödmark wrote:
No worries!
As an example, If i layout a group of components, all which require
the powerpaths as in they need acess to 3v3 lines that are used in
other areas of the board as well. These 3v3 lines might be a bit
annoying to route for certain cases.
As the code is now, since these 3v3 lines are used as an outside
connection of the sheet, they will be ignored, even if they only
connect
between pads on the same subschematic. Say that the connection to
the global 3v3 net is handled later with a via or something like
that.
The same logic applies to all pins that connect outside the block,
and in some cases the layout of the blocks have a non-trivial
routing to get the signal out of the block "area", which is what i
noticed when using these. Hope this explanation made it more clear
With this more aggressive change. It is also more visible from the
pcb side to where this "block" has dependencies, I also find it
easier to deselect segments manually, than to select them if the
block is not very trivial.
Regarding the code violations, I will have a look later when I get
the time as well.
the GND thing must indeed be a bug, which I will look into as well.
On 07/12/2017 10:30 AM, Maciej Sumiński wrote:
Hi Kristoffer,
I apologize for such a long delay. Finally I had to time to look
at the
patch. I tried it out with a few boards, but I could not really
notice a
difference. I read the code and I think I understand what are
you trying
to do, but are you sure it is the right way to go? Hierarchical
sheets
are frequently used as rooms/channels/duplicated blocks and in my
opinion selecting items belonging to a sheet should be
restricted to
items unique to the sheet. Would you give a use case where the new
behavior gives benefits?
Please pay attention to the code formatting, I see a number of
violations there.
Also, I observed a bug when selecting items belonging to the
same sheet.
If you open complex_hierarchy demo and use the select action on
P3 or
P5, you will notice that all components with a pad connected to
GND are
also selected. I can create a bug report if necessary.
Regards,
Orson
On 07/11/2017 05:36 PM, Kristoffer Ödmark wrote:
Well, the sheet-selection code was all submitted by me in the
first
place, It doesnt exist in legacy, so this change to how it
works is
according to me more inline with what I wanted in the beginning :)
- Kristoffer
On 2017-07-10 21:06, Wayne Stambaugh wrote:
Kristoffer,
This appears to only effect the GAL canvases. Would one
of our resident
tool framework experts please take a look at this an see if it
makes
sense? If no one has time, I will try to get to it by
this weekend. It
will take most of the week for me to recover from
vacation before I can
take a look at it.
Thanks,
Wayne
On 7/10/2017 11:21 AM, Kristoffer Ödmark wrote:
Hello!
Second bump, I guess I might be the only one who uses the
sheet-selection then :) My suggestion is to merge this patch
in, It
makes the selection more much more useful!
- Kristoffer
On 2017-06-06 13:44, Kristoffer Ödmark wrote:
Hello again!
I understand that everyone is pretty busy, but I would
appreciate if
someone took a quick glance at this and said what they think.
- Kristoffer
On 2017-05-03 15:51, Kristoffer Ödmark wrote:
Hello everyone!
I made a small change to the "select
hierarchical sheet" function. I
would love if someone tried this and gave some feedback.
Before the function only selected segments belonging to a
netlist
unique to that hierarchical sheet. Now it will use the "select
logical connection" to every segment connected to module
from the
subsheet as well. presonally I think it is more useful now,
but I
want confirmation if possible :)
- Kristoffer
_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help : https://help.launchpad.net/ListHelp
--
-Kristoffer
>From 37b6ca1f4877e5c1758a480de548040b04773209 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20=C3=96dmark?= <kristoffer.odmark90@xxxxxxxxx>
Date: Mon, 24 Jul 2017 21:58:55 +0200
Subject: [PATCH] Disabled the automatic schematic-cross probing due to
performance reasons. Added sheet-context menu entry for the cross-probing
instead.
---
eeschema/controle.cpp | 8 ++++----
eeschema/eeschema_id.h | 1 +
eeschema/hotkeys.h | 3 ++-
eeschema/onrightclick.cpp | 5 +++++
eeschema/schedit.cpp | 25 +++++++++++++++++++++++++
eeschema/schframe.cpp | 1 +
eeschema/schframe.h | 7 +++++++
7 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp
index cb049bb10..82f2ca0a7 100644
--- a/eeschema/controle.cpp
+++ b/eeschema/controle.cpp
@@ -87,10 +87,6 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
SendMessageToPCBNEW( item, component );
break;
- case SCH_SHEET_T:
- SendMessageToPCBNEW( item, nullptr );
- break;
-
case SCH_COMPONENT_T:
component = (SCH_COMPONENT*) item;
SendMessageToPCBNEW( item, component );
@@ -101,6 +97,10 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
component = (SCH_COMPONENT*) LocateItem( aPosition, SCH_COLLECTOR::ComponentsOnly );
break;
+ /* case SCH_SHEET_T: */
+ /* // This may lag on larger projects */
+ /* SendMessageToPCBNEW( item, nullptr ); */
+ /* break; */
default:
;
}
diff --git a/eeschema/eeschema_id.h b/eeschema/eeschema_id.h
index c282b6467..188b130f6 100644
--- a/eeschema/eeschema_id.h
+++ b/eeschema/eeschema_id.h
@@ -128,6 +128,7 @@ enum id_eeschema_frm
ID_POPUP_SCH_DISPLAYDOC_CMP,
ID_POPUP_SCH_ENTER_SHEET,
ID_POPUP_SCH_LEAVE_SHEET,
+ ID_POPUP_SCH_SELECT_ON_PCB,
ID_POPUP_SCH_ADD_JUNCTION,
ID_POPUP_SCH_ADD_LABEL,
ID_POPUP_SCH_ADD_GLABEL,
diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h
index aa7350ed2..c173e95c8 100644
--- a/eeschema/hotkeys.h
+++ b/eeschema/hotkeys.h
@@ -83,7 +83,8 @@ enum hotkey_id_commnand {
HK_LEAVE_SHEET,
HK_DELETE_NODE,
HK_AUTOPLACE_FIELDS,
- HK_UPDATE_PCB_FROM_SCH
+ HK_UPDATE_PCB_FROM_SCH,
+ HK_SELECT_ITEMS_ON_PCB
};
// List of hotkey descriptors for Eeschema
diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp
index 8f96427db..8453f94cd 100644
--- a/eeschema/onrightclick.cpp
+++ b/eeschema/onrightclick.cpp
@@ -762,6 +762,11 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
+ PopMenu->AppendSeparator();
+ msg = AddHotkeyName( _( "Select Items On PCB"), g_Schematic_Hokeys_Descr, HK_SELECT_ITEMS_ON_PCB );
+ AddMenuItem( PopMenu, ID_POPUP_SCH_SELECT_ON_PCB, msg, KiBitmap( drag_xpm ));
+ PopMenu->AppendSeparator();
+
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
AddMenuItem( orientmenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_cw_xpm ) );
diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp
index a1659b46d..6f7da0112 100644
--- a/eeschema/schedit.cpp
+++ b/eeschema/schedit.cpp
@@ -833,6 +833,31 @@ void SCH_EDIT_FRAME::PrepareMoveItem( SCH_ITEM* aItem, wxDC* aDC )
m_canvas->Refresh();
}
+void SCH_EDIT_FRAME::SelectAllFromSheet( wxCommandEvent& aEvent )
+{
+ SCH_SCREEN* screen = GetScreen();
+ SCH_ITEM* item = screen->GetCurItem();
+
+ if( item != NULL )
+ {
+ item = LocateAndShowItem( item->GetPosition() );
+ SendMessageToPCBNEW(item, NULL);
+ }
+ else
+ {
+ // If we didn't get here by a hot key, then something has gone wrong.
+ if( aEvent.GetInt() == 0 )
+ return;
+ EDA_HOTKEY_CLIENT_DATA* data = (EDA_HOTKEY_CLIENT_DATA*) aEvent.GetClientObject();
+
+ wxCHECK_RET( data != NULL, wxT( "Invalid hot key client object." ) );
+
+ item = LocateAndShowItem( data->GetPosition() );
+ SendMessageToPCBNEW(item, NULL);
+
+ }
+
+}
void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
{
diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp
index aa08851c8..dccdbe444 100644
--- a/eeschema/schframe.cpp
+++ b/eeschema/schframe.cpp
@@ -233,6 +233,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_GEN_PLOT_SCHEMATIC, SCH_EDIT_FRAME::PlotSchematic )
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
+ EVT_MENU( ID_POPUP_SCH_SELECT_ON_PCB, SCH_EDIT_FRAME::SelectAllFromSheet )
EVT_MENU( ID_POPUP_SCH_DUPLICATE_ITEM, SCH_EDIT_FRAME::OnCopySchematicItemRequest )
diff --git a/eeschema/schframe.h b/eeschema/schframe.h
index 4bc932901..ab07418ea 100644
--- a/eeschema/schframe.h
+++ b/eeschema/schframe.h
@@ -813,6 +813,13 @@ private:
void OnEditItem( wxCommandEvent& aEvent );
/**
+ * Function SelectAllFromSheet
+ * handles the #ID_POPUP_SCH_SELECT_ON_PCB event used to select items in pcbnew
+ * based on the sheet they are placed on.
+ */
+ void SelectAllFromSheet( wxCommandEvent& aEvent );
+
+ /**
* Function OnDragItem
* handles the #ID_SCH_DRAG_ITEM event used to drag schematic itams.
*/
--
2.13.3
Follow ups
References
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-06-06
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-07-10
-
Re: [PATCH] More aggressive sheet-selection
From: Wayne Stambaugh, 2017-07-10
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-07-11
-
Re: [PATCH] More aggressive sheet-selection
From: Maciej Sumiński, 2017-07-12
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-07-12
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-07-12
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-07-17
-
Re: [PATCH] More aggressive sheet-selection
From: Chris Pavlina, 2017-07-23
-
Re: [PATCH] More aggressive sheet-selection
From: Kristoffer Ödmark, 2017-07-24