GAL highlight net tool does not restore colors

Bug #1757446 reported by Wayne Stambaugh
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Jon Evans

Bug Description

When the GAL highlight tool is closed by selecting another tool or pressing the escape key, the current highlighted pads and color scheme remain in place rather than restoring the color palette. To duplicate:

1. Select the highlight net tool.
2. Left click any pad to highlight a net.
3. Press escape key to exit highlight tool.

Application: kicad
Version: (5.0.0-rc2-dev-261-g7b4a8d7eb), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.57.0 OpenSSL/1.0.2n (WinSSL) zlib/1.2.11 libidn2/2.0.4 libssh2/1.8.0 nghttp2/1.29.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.66.0
    Curl: 7.57.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Jon Evans (craftyjon) wrote :

I thought this was by design (so you can leave a net highlighted while using other tools)
If it's not the intended behavior it's an easy fix.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1757446] Re: GAL highlight net tool does not restore colors

Maybe, but the router highlights pads automatically so I don't know what
other tool where this would be useful. The router tool does restore the
color palette when it is exited so there is a difference in behavior.

On 3/21/2018 12:53 PM, Jon Evans wrote:
> I thought this was by design (so you can leave a net highlighted while using other tools)
> If it's not the intended behavior it's an easy fix.
>

Revision history for this message
Michael Geselbracht (mgeselbracht) wrote :

I think that the current behavior is an advantage. Eagle unselects highlighted pads when you exit the (show) tool. I am glad that pcbnew doesn't do that.

A simple use case: You have imported a netlist and have placed the ICs. Now you want to move the decoupling caps. The highlight feature will show you where to put them. But it is useless if the pads are unelected as soon as you switch to the move tool.

Revision history for this message
Jon Evans (craftyjon) wrote :

Yeah, when I was working on the highlight earlier I almost "fixed" this, and then thought about it and decided that it would be really nice for placement of components, etc.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

It's not really that nice because as soon as you use the move hotkey,
the highlight tool is disabled and the select tool is disabled requiring
you to select the highlight tool every time you want to highlight a
different net. The legacy canvas allows moving footprints while the
highlight tool stay active.

On 03/21/2018 05:06 PM, Jon Evans wrote:
> Yeah, when I was working on the highlight earlier I almost "fixed" this,
> and then thought about it and decided that it would be really nice for
> placement of components, etc.
>

Revision history for this message
Jon Evans (craftyjon) wrote :

I think what I would like eventually is a way to control highlighting without using a particular tool, that way you can enter/exit/change what is highlighted without having to change tools.

For example, if there is a hotkey that highlights the net of whatever object is selected, or clears the highlight if no object is selected (this might need a bit of UX refinement; it's just my first thought)

One step in this direction would be to add hotkeys for starting the highlight tool and clearing the highlight. This would be the least-intrusive improvement I can think of in case you want it for V5. We could also add an option to immediately jump back to the previous tool when you select a net to highlight, instead of remaining with the highlight tool.

Do you have thoughts on either of those options?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

On 03/21/2018 05:58 PM, Jon Evans wrote:
> I think what I would like eventually is a way to control highlighting
> without using a particular tool, that way you can enter/exit/change what
> is highlighted without having to change tools.
>
> For example, if there is a hotkey that highlights the net of whatever
> object is selected, or clears the highlight if no object is selected
> (this might need a bit of UX refinement; it's just my first thought)
>
> One step in this direction would be to add hotkeys for starting the
> highlight tool and clearing the highlight. This would be the least-
> intrusive improvement I can think of in case you want it for V5. We
> could also add an option to immediately jump back to the previous tool
> when you select a net to highlight, instead of remaining with the
> highlight tool.
>
> Do you have thoughts on either of those options?
>

I just don't like the overly restrictive tool mentality concept used in
the gal canvas. It's a lot better than it was but it's still not as
convenient as the behavior of the legacy canvas for some editing. It's
extra effort to have to constantly change tools. I am less concerned
about how we get there but rather that we do get there.

Revision history for this message
Michael Geselbracht (mgeselbracht) wrote :

I'm currently at a fair and won't have access to a sane computer until Saturday.
Just to make sure that we talk about the same thing I'm talking about the Ctrl+LMB feature/hotkey. The highlight tool that is (also) used for cross probing might be something different.

Revision history for this message
Jon Evans (craftyjon) wrote :

Michael, yes that's the same underlying code, just invoked a different way.

Wayne, I will see if I can come up with something simple that I like and send it out for comment.

Changed in kicad:
assignee: nobody → Jon Evans (craftyjon)
milestone: none → 5.0.0-rc2
Jon Evans (craftyjon)
Changed in kicad:
status: Triaged → In Progress
Revision history for this message
Jon Evans (craftyjon) wrote :

Hi Wayne, the attached patch adds two hotkeys to make net highlighting more convenient.
The first will highlight the net of the selected item.
The second will clear the highlight.
Let me know what you think of this approach.

Revision history for this message
Jeff Young (jeyjey) wrote :

Any reason we can’t do a single hotkey that toggles? It would be less to remember….

> On 25 Mar 2018, at 04:53, Jon Evans <email address hidden> wrote:
>
> Hi Wayne, the attached patch adds two hotkeys to make net highlighting more convenient.
> The first will highlight the net of the selected item.
> The second will clear the highlight.
> Let me know what you think of this approach.
>
> ** Patch added: "0001-Add-hotkeys-to-highlight-net-of-selected-item-and-cl.patch"
> https://bugs.launchpad.net/kicad/+bug/1757446/+attachment/5089648/+files/0001-Add-hotkeys-to-highlight-net-of-selected-item-and-cl.patch
>
> --
> You received this bug notification because you are a member of KiCad Bug
> Squad, which is subscribed to KiCad.
> https://bugs.launchpad.net/bugs/1757446
>
> Title:
> GAL highlight net tool does not restore colors
>
> Status in KiCad:
> In Progress
>
> Bug description:
> When the GAL highlight tool is closed by selecting another tool or
> pressing the escape key, the current highlighted pads and color scheme
> remain in place rather than restoring the color palette. To
> duplicate:
>
> 1. Select the highlight net tool.
> 2. Left click any pad to highlight a net.
> 3. Press escape key to exit highlight tool.
>
> Application: kicad
> Version: (5.0.0-rc2-dev-261-g7b4a8d7eb), release build
> Libraries:
> wxWidgets 3.0.3
> libcurl/7.57.0 OpenSSL/1.0.2n (WinSSL) zlib/1.2.11 libidn2/2.0.4 libssh2/1.8.0 nghttp2/1.29.0
> Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
> Build Info:
> wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
> Boost: 1.66.0
> Curl: 7.57.0
> Compiler: GCC 7.3.0 with C++ ABI 1011
>
> Build settings:
> USE_WX_GRAPHICS_CONTEXT=OFF
> USE_WX_OVERLAY=OFF
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_SPICE=ON
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1757446/+subscriptions

Revision history for this message
Jon Evans (craftyjon) wrote :

Only reason would be that you could not clear a highlight while having anything selected

Revision history for this message
Jeff Young (jeyjey) wrote :

Let me see if I’m following you. So I select a footprint pad and highlight its net. Then I select a different footprint pad, but the original net is still highlighted. Is that right?

So if we used only a single hotkey, the first press would un-highlight the original net and highlight the second net, while the second press would unhighlight everything?

That still sounds better than two hotkeys.

> On 25 Mar 2018, at 14:19, Jon Evans <email address hidden> wrote:
>
> Only reason would be that you could not clear a highlight while having
> anything selected
>
> --

Revision history for this message
Jon Evans (craftyjon) wrote :

It could be implemented that way, sure

Revision history for this message
Jon Evans (craftyjon) wrote :

OK, here's the one-hotkey version. I like it too.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Jon, I would expect the highlight toolbar button to toggle on/off when
pressing the ` key. On linux at least, this doesn't happen. I have to
select a pad then hit the ` key toggle the net highlighting. This is
counter intuitive to the normal hotkey behavior where you can hover over
an object and it will select the object and enter the correct tool mode.

On 03/25/2018 10:37 AM, Jon Evans wrote:
> OK, here's the one-hotkey version. I like it too.
>
> ** Patch added: "0001-Add-hotkey-to-toggle-net-highlighting-of-selected-it.patch"
> https://bugs.launchpad.net/kicad/+bug/1757446/+attachment/5090074/+files/0001-Add-hotkey-to-toggle-net-highlighting-of-selected-it.patch
>

Revision history for this message
Jon Evans (craftyjon) wrote :

Hmm, I'm confused about what you actually want Wayne. I thought you were saying that it was inconvenient to have a separate tool for highlighting, so I just added a keyboard shortcut that lets you highlight without entering the tool (basically a keyboard shortcut to work kind of like Ctrl+LeftClick does). If I change it to behave the way you describe, we will be right back to having no easy way to highlight and return to the previous tool.

Revision history for this message
Jon Evans (craftyjon) wrote :

Think of this new hot key kind of like the 'I' and 'U' hotkeys: you can use them in the middle of your workflow to change what is selected, and this hotkey lets you change what is highlighted in the middle of your workflow.

I actually kind of think the "highlight tool" as a dedicated tool button should maybe not exist, but that's too drastic a change for right now.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Any time you implement a hotkey, it should consist of a tool and/or menu
selection followed by an equivalent left click action at the current
cursor position. The problem is that the current behavior disables the
highlight tool and enables the selection tool every time you perform a
move (and I'm guessing other hotkey tools as well). I would be happy if
you just implemented a short cut to enable the highlight tool so I
didn't have to constantly move the cursor to the right toolbar to
re-enable the highlight tool after a move action using the 'm' hotkey.
The other option would be to reselect the highlight tool after the
hotkey move action was complete.

On 03/25/2018 01:46 PM, Jon Evans wrote:
> Think of this new hot key kind of like the 'I' and 'U' hotkeys: you can
> use them in the middle of your workflow to change what is selected, and
> this hotkey lets you change what is highlighted in the middle of your
> workflow.
>
> I actually kind of think the "highlight tool" as a dedicated tool button
> should maybe not exist, but that's too drastic a change for right now.
>

Revision history for this message
Jon Evans (craftyjon) wrote :

I am hesitant to just do a hotkey to enter the highlight tool without also providing some keyboard way to clear highlight. Having used Jeff's suggested method of combining both functions into one hotkey for a bit, I think it is a way better user experience than needing to enter a special "highlight mode" before choosing a net to highlight.

Do you think there is value in having a separate highlight tool?

I could add a "highlight net" menu item to the context menu when you right click on something in addition to the hotkey. That would mean you can access the functionality either through the mouse or keyboard.

Then you would have three ways to control highlight:

1) Control+LMB on an item to highlight, or on empty space to clear highlight
2) Right-click on an item and choose "highlight net" (if the item is part of a net)
3) Press the hotkey to highlight the net of the selection, or press again to clear highlight

In that scenario, (and in my opinion) the "highlight net" toolbar button could be completely removed. The only loose end to tie up would be cross-probing: right now highlights are only cross-probed when the tool is active. We could make highlights from eeschema automatically enter highlight mode on pcbnew to solve that issue (as an option that users can disable).

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I would just like to avoid the extra selection step and have your
current patch select the net object (if it's a net object) under the
cursor. If your patch did that, that would be more than adequate for my
needs. Anything else would just be icing on the cake. Hotkeys should
always perform some action on the object(s) under the cursor without
having to first select them or begin drawing an object without having to
click on the current cursor location. The fewer steps I need to take to
perform an action the better. I know not everyone agrees with me but I
think it's important.

On 3/25/2018 8:38 PM, Jon Evans wrote:
> I am hesitant to just do a hotkey to enter the highlight tool without
> also providing some keyboard way to clear highlight. Having used Jeff's
> suggested method of combining both functions into one hotkey for a bit,
> I think it is a way better user experience than needing to enter a
> special "highlight mode" before choosing a net to highlight.
>
> Do you think there is value in having a separate highlight tool?
>
> I could add a "highlight net" menu item to the context menu when you
> right click on something in addition to the hotkey. That would mean you
> can access the functionality either through the mouse or keyboard.
>
> Then you would have three ways to control highlight:
>
> 1) Control+LMB on an item to highlight, or on empty space to clear highlight
> 2) Right-click on an item and choose "highlight net" (if the item is part of a net)
> 3) Press the hotkey to highlight the net of the selection, or press again to clear highlight
>
> In that scenario, (and in my opinion) the "highlight net" toolbar button
> could be completely removed. The only loose end to tie up would be
> cross-probing: right now highlights are only cross-probed when the tool
> is active. We could make highlights from eeschema automatically enter
> highlight mode on pcbnew to solve that issue (as an option that users
> can disable).
>

Revision history for this message
Jon Evans (craftyjon) wrote :

OK, that's easy enough. Should the hotkey also switch to the dedicated highlight tool after that happens, or leave the selected tool alone?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I think selecting the highlight tool makes sense for consistency. This
is the way most of the other hotkeys work where a tool is involved.

On 3/26/2018 1:32 PM, Jon Evans wrote:
> OK, that's easy enough. Should the hotkey also switch to the dedicated
> highlight tool after that happens, or leave the selected tool alone?
>

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 0ded476f9de56b4ca00aa1ee1f90efb59b872c0a
https://git.launchpad.net/kicad/patch/?id=0ded476f9de56b4ca00aa1ee1f90efb59b872c0a

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Jon Evans (craftyjon) wrote :

I just pushed an updated version. I think it addresses all your concerns. Give it a try and let me know if you want any tweaks.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I just gave your changes a try and they seem to work as expected except
the right toolbar button state seems to be messed up. The select tool
stays selected even when the highlight tool is enable with the '`' key.
You are not toggling the toolbar button states in code are you? If so,
you should be using wxUpdateUIEvents for this.

On 3/26/2018 11:09 PM, Jon Evans wrote:
> I just pushed an updated version. I think it addresses all your
> concerns. Give it a try and let me know if you want any tweaks.
>

Revision history for this message
Jon Evans (craftyjon) wrote :

Is this on Windows? I tried it on Mac and Linux and can't see that behavior (when I press '`' the highlight tool get selected, and when I press 'ESC' it goes back to the selection tool)

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

It was on windows but now I cannot duplicate this behavior. I wonder if
the tool framework was in some weird state loop due some mystical
operation order that triggers the issue. I've seen things like this
before with the tool framework and if you don't remember the exact
sequence of actions, you cannot duplicate it. If I manage to duplicate
this issue, I will try to remember to at least take a screen shot of the
behavior.

On 3/27/2018 3:18 PM, Jon Evans wrote:
> Is this on Windows? I tried it on Mac and Linux and can't see that
> behavior (when I press '`' the highlight tool get selected, and when I
> press 'ESC' it goes back to the selection tool)
>

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.