pcbnew: Via netnames visibility

Bug #1852899 reported by Fabien Corona on 2019-11-17
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
New
Undecided
Fabien Corona

Bug Description

-Netnames for vias are not affected by the high contrast display mode.
-Netnames for vias are still visible even when all visible layers a via is on, are not visible.
(the second one actually also happens when all layers are hidden)

Changed in kicad:
assignee: nobody → Fabien Corona (drinausaur)
Fabien Corona (drinausaur) wrote :

Patch proposal:

-Add a high contrast rule for the LAYER_VIAS_NETNAME.
-Check the via netname visibility after the via visibility.

tags: added: pcbnew
Changed in kicad:
milestone: none → 6.0.0-rc1
Ian McInerney (imcinerney) wrote :

@Fabien, thank you for putting this patch together. Hiding the netname when the via is hidden works fine, but I am not sure if your high contrast netname display for the via is working. When I enable the high contrast mode, I don't see a difference between the original and your patch. I have attached screenshots of the two versions. What is the high contrast mode supposed to look like?

Ian McInerney (imcinerney) wrote :
Fabien Corona (drinausaur) wrote :

Sorry, I was not explicit enough.

"Netnames for vias are not affected by the high contrast display mode" when the active layer is a copper layer.

You can see the difference with the attached picture (top is without patch, and bottom is with)

Ian McInerney (imcinerney) wrote :

Ok, so let me just make sure I that am understanding the behavior we are going for.

When the via is on the active layer, both the netname and via should be their normal color.
When the via is not on the active layer (e.g. a blind/buried/micro via between two different layers), then the text and via should be darkened (in their high contrast colors).

If that is the case, then I don't see that still. The netname darkens when I switch to non-copper layers (such as F.Mask), but when I have a blind/buried via between B.Cu and In2.Cu, if In1.Cu is active the netname of that via is still not darkened any but the actual via is.

Am I missing something here?

Fabien Corona (drinausaur) wrote :

I recorded a video, hopefully it clarifies some things :)
Look at the vias on the right side, see how the color of the netnames changes depending on the layer. (but it should not as the via is not on an active layer in both cases)

This does not happen with my patched version, only with the nightly I have.

Application: Pcbnew
Version: 5.99.0-unknown-f8aea24~100~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-54-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    Build date: Nov 16 2019 00:34:10
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.4.0 with C++ ABI 1011

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Ian McInerney (imcinerney) wrote :

@Fabien, the behavior in the video is the behavior I am seeing when I use your patch. I am not sure what is going on here though, since it appears that it is pulling from the high contrast colors for the via netnames layer when it should now. For some reason the via net label is changing colors still.

I have attached a video showing what I see when using your patch, with a slight modification to see what was happening. The output in the terminal are some debug statements I have placed into the color logic (in pcb_painter.cpp) to see what color it was pulling:

if( viaActiveLayer )
{
    if( aLayer == LAYER_VIAS_NETNAMES )
        wxLogDebug( "Via normal" );

    return m_layerColors[aLayer];
}
else
{
    if( aLayer == LAYER_VIAS_NETNAMES )
        wxLogDebug( "Via high contrast" );

    return m_hiContrastColor[aLayer];
}

Based on that it appears to be pulling the high contrast color each time, but for some reason switching to/from the copper layer changes it again. Is there another part of the code that you modified that didn't get included in the patch?

Fabien Corona (drinausaur) wrote :

mmmhh, I don't really understand why. However this patch should be used with a recent commit, because it uses this patch, that has been committed : https://bugs.launchpad.net/kicad/+bug/1844982. (But it seems that you are already using it). I basically added an extra rule based on this patch.

I litteraly just git-cloned the project (e6346c7408e368e95b25e69a4ed08ad951f4a78d) and made it : via netnames are not darkened properly

I add this only line (that is already in the proposed patch), and the via netnames are darkened properly :

diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp
index 61b27eeec..3b08751c2 100644
--- a/pcbnew/pcb_painter.cpp
+++ b/pcbnew/pcb_painter.cpp
@@ -256,6 +256,7 @@ const COLOR4D& PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer
         // For vias, some layers depend on other layers in high contrast mode
         if( m_hiContrastEnabled && item->Type() == PCB_VIA_T &&
                 ( aLayer == LAYER_VIAS_HOLES ||
+ aLayer == LAYER_VIAS_NETNAMES ||
                   aLayer == LAYER_VIA_THROUGH ||
                   aLayer == LAYER_VIA_MICROVIA ||
                   aLayer == LAYER_VIA_BBLIND ) )

Ian McInerney (imcinerney) wrote :

Hmm, that is strange. I applied this on top of the most recent pull.

@devs, can someone else test the high contrast part and see if they see it working?

Ian McInerney (imcinerney) wrote :

@Fabien, we have moved to GitLab now. Please turn any patches attached to these Launchpad issues into new merge requests on the GitLab repository. Also note that the fixes line has changed with the move and needs to use the new GitLab issue number (but the script has been modified accordingly).

This issue is tracked in https://gitlab.com/kicad/code/kicad/issues/2591.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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