Using SetVisibleLayers or SetVisibleElements does not change on screen until changing canvas.

Bug #1712233 reported by Greg Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Unassigned

Bug Description

In python scripting, when using pcbnew.GetBoard().SetVisibleLayers() or pcbnew.GetBoard().SetVisibleElements(), neither the checkboxes in the LayerManager nor the actually visible layers change in the PCB view. Changing the view from OpenGL and *back* correctly shows both the layers and the checkboxes. Refreshing the wx.Window for the pcbnew window and the LayerManager window does not help the display. Only changing views seems to help.

This greatly affects the usability of [LayerViewSet](https://github.com/HiGregSmith/LayerViewSet).

Application: kicad
Version: (2017-08-11 revision 356f607cd)-makepkg, release build
Libraries: wxWidgets 3.0.3
           libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
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.64.0
Curl: 7.54.1
KiCad - Compiler: GCC 7.1.0 with C++ ABI 1011
        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

Revision history for this message
Tomasz Wlostowski (twlostow) wrote : Re: [Bug 1712233] [NEW] Using SetVisibleLayers or SetVisibleElements does not change on screen until changing canvas.

On 22.08.2017 04:16, Greg Smith wrote:
> Public bug reported:
>
> In python scripting, when using pcbnew.GetBoard().SetVisibleLayers() or
> pcbnew.GetBoard().SetVisibleElements(), neither the checkboxes in the
> LayerManager nor the actually visible layers change in the PCB view.
> Changing the view from OpenGL and *back* correctly shows both the layers
> and the checkboxes. Refreshing the wx.Window for the pcbnew window and
> the LayerManager window does not help the display. Only changing views
> seems to help.

Call: void PCB_DRAW_PANEL_GAL::SyncLayersVisibility( const BOARD* aBoard )

Cheers,
Tom

Revision history for this message
Greg Smith (gmsmith) wrote :

I agree that this appears to be the solution. How do I call PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python? I can't find where it exists in the python hierarchy.

Revision history for this message
Tomasz Wlostowski (twlostow) wrote : Re: [Bug 1712233] Re: Using SetVisibleLayers or SetVisibleElements does not change on screen until changing canvas.

On 22.08.2017 14:22, Greg Smith wrote:
> I agree that this appears to be the solution. How do I call
> PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python? I can't find where
> it exists in the python hierarchy.
>

Perhaps it's not exported. Feel free to submit a patch (I'm not a Python
expert) or ask our Python gurus if they could add this function.

Cheers,
T.

PS. nice feature, this LayerViewSet.

Revision history for this message
Greg Smith (gmsmith) wrote :

Fixed with commit a557838c615c9b268830138348c6a8d6a4cc9ba9
https://git.launchpad.net/kicad/commit/?id=a557838c615c9b268830138348c6a8d6a4cc9ba9

Available on nightly
kicad-r8452.e3c64f1f0-x86_64.exe 27-Aug-2017 17:01

Changed in kicad:
status: New → Fix Committed
Revision history for this message
Greg Smith (gmsmith) wrote :

Further testing reveals that this is not yet fixed. KiCommand on github has the function call after each command string and still some lines don't show up until switching canvasses.

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.