kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30381
Re: Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?
Thank you jp!
This appears to not actually be true and reveals (I think) an inconsistency in the KiCad code.
PCB_DRAW_PANEL_GAL::SyncLayersVisibility
is VERY different from
PCB_EDIT_FRAME::syncLayerVisibilities
PCB_DRAW_PANEL_GAL::SLV modifies the visibility of the layers themselves, taking care of behind the scenes after the visiblity on the layer is changed.
PCB_EDIT_FRAME::sLV seems to only update the checkboxes based on what is retured from IsLayerVisible().
My current problem I think is solved by PCB_DRAW_PANEL_GAL::SLV, while another problem I have worked around is solved by PCB_EDIT_FRAME:sLV.
See workaround for checkboxes here:https://github.com/HiGregSmith/LayerViewSet/blob/master/layerviewset.pyLines 483-504 def GetCheckBoxes()Lines 523-526 Using GetCheckBoxes()
References:
PCB_DRAW_PANEL_GALhttp://docs.kicad-pcb.org/doxygen/classPCB__DRAW__PANEL__GAL.html#a7ecbe9cb97f645749c4217c71244aad9
Function SyncLayersVisibility Updates "visibility" property of each layer of a given BOARD.
which includes:m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
which is defined as: { 389 wxASSERT( aLayer < (int) m_layers.size() ); 390 391 if( m_layers[aLayer].visible != aVisible ) 392 { 393 // Target has to be redrawn after changing its visibility 394 MarkTargetDirty( m_layers[aLayer].target ); 395 m_layers[aLayer].visible = aVisible; 396 } 397 }
While PCB_EDIT_FRAMEsyncRenderStates () to update checkboxes from "IsElementVisible"syncLayerVisibilities () to update checkboxes from "IsLayerVisible"
Function syncLayerWidgetLayer updates the currently layer "selection" within the PCB_LAYER_WIDGET
On Tuesday, August 22, 2017 10:03 AM, jp charras <jp.charras@xxxxxxxxxx> wrote:
Le 22/08/2017 à 14:42, Greg Smith a écrit :
>
> How do I call PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python? I can't find where it exists in
> the python hierarchy.
> https://bugs.launchpad.net/kicad/+bug/1712233
>
> I believe it's the solution to fixing a bug that prevents LayerViewSet.py from working well.
> https://github.com/HiGregSmith/LayerViewSet
> https://forum.kicad.info/t/layerviewset-main-thread-a-python-script-for-manipulating-visible-layers/7400/23
> <https://forum.kicad.info/t/layerviewset-main-thread-a-python-script-for-manipulating-visible-layers/7400/23?u=higreg>
>
> Tomasz Wlostowski (twlostow) was kind enough to point out the possible solution to getting the layer
> visibilities updated in OpenGL canvas. Thank you, Tomasz!
>
You could need to call:
ReFillLayerWidget();
ReCreateLayerBox();
syncLayerVisibilities();
syncLayerWidgetLayer();
syncRenderStates();
All are methods of the board editor (PCB_EDIT_FRAME) not the PCB_DRAW_PANEL_GAL.
--
Jean-Pierre CHARRAS
_______________________________________________
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
Follow ups
References