Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-28 Thread jp charras
Le 28/08/2017 à 14:36, Greg Smith a écrit :
> Thank you!!
> 
> I have updated LayerViewSet with fixes for those three problems.
> https://github.com/HiGregSmith/LayerViewSet
> 

Thank you.

Works better now!


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-28 Thread Greg Smith
Thank you!!
I have updated LayerViewSet with fixes for those three 
problems.https://github.com/HiGregSmith/LayerViewSet

 

On Monday, August 28, 2017 6:07 AM, jp charras  
wrote:
 

 Le 27/08/2017 à 23:24, Greg Smith a écrit :
> Tested: kicad-r8452.e3c64f1f0-x86_64.exe
> 
> 
> Great job!
> 
> LayerViewSet now works without having to manually change the canvas type.
> 
> It has gone back to function similar to 4.0.6 stable, requiring the cursor
> to enter the GLCanvas window to see the layer updates.
> 
> In the case of LayerViewSet, pcbnew.UpdateUserInterface() must be called 
> within the script after pcbnew.GetBoard().SetVisibleLayers(). And when I
> do so, the interface flickers (particularly the top tool box "F.Cu (PgUp)"
> layer indicator). Ideally, there'd be a visually cleaner way to do this, but 
> it is
> very functional at the moment.
> 
> When the cursor enters the GLCanvas window, the layers are redrawn. I suspect
> the issue requires a call to SwapBuffers, but it is a common issue with 4.0.6 
> stable.
> 
> 
> 
> On Sunday, August 27, 2017 1:32 AM, jp charras  wrote:
> 

Hi Greg,

I tested your script, but if does not work for me.
- first issue:
  It uses 'F.cu' to find a widgets. However the copper layers names are user 
defined.
  the actual name is board.GetLayerName( pcbnew.F_Cu )
- second issue: it looks for 'Grid'.
  but Kicad is internationalized, so this keyword is not found in non English 
countries (consider
using wxGetTranslation())
- third issue: see attached image.

Thanks.


-- 
Jean-Pierre CHARRAS


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-28 Thread jp charras
Le 27/08/2017 à 23:24, Greg Smith a écrit :
> Tested: kicad-r8452.e3c64f1f0-x86_64.exe
> 
> 
> Great job!
> 
> LayerViewSet now works without having to manually change the canvas type.
> 
> It has gone back to function similar to 4.0.6 stable, requiring the cursor
> to enter the GLCanvas window to see the layer updates.
> 
> In the case of LayerViewSet, pcbnew.UpdateUserInterface() must be called 
> within the script after pcbnew.GetBoard().SetVisibleLayers(). And when I
> do so, the interface flickers (particularly the top tool box "F.Cu (PgUp)"
> layer indicator). Ideally, there'd be a visually cleaner way to do this, but 
> it is
> very functional at the moment.
> 
> When the cursor enters the GLCanvas window, the layers are redrawn. I suspect
> the issue requires a call to SwapBuffers, but it is a common issue with 4.0.6 
> stable.
> 
> 
> 
> On Sunday, August 27, 2017 1:32 AM, jp charras  wrote:
> 

Hi Greg,

I tested your script, but if does not work for me.
- first issue:
  It uses 'F.cu' to find a widgets. However the copper layers names are user 
defined.
  the actual name is board.GetLayerName( pcbnew.F_Cu )
- second issue: it looks for 'Grid'.
  but Kicad is internationalized, so this keyword is not found in non English 
countries (consider
using wxGetTranslation())
- third issue: see attached image.

Thanks.


-- 
Jean-Pierre CHARRAS
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-27 Thread Greg Smith
Tested: kicad-r8452.e3c64f1f0-x86_64.exe 
Great job!
LayerViewSet now works without having to manually change the canvas type.
It has gone back to function similar to 4.0.6 stable, requiring the cursorto 
enter the GLCanvas window to see the layer updates.
In the case of LayerViewSet, pcbnew.UpdateUserInterface() must be called within 
the script after pcbnew.GetBoard().SetVisibleLayers(). And when Ido so, the 
interface flickers (particularly the top tool box "F.Cu (PgUp)"layer 
indicator). Ideally, there'd be a visually cleaner way to do this, but it 
isvery functional at the moment.
When the cursor enters the GLCanvas window, the layers are redrawn. I 
suspectthe issue requires a call to SwapBuffers, but it is a common issue with 
4.0.6 stable.
 

On Sunday, August 27, 2017 1:32 AM, jp charras  
wrote:
 

 Le 23/08/2017 à 16:27, Greg Smith a écrit :
> Better formatting:
> 
> How do you get PCB_EDIT_FRAME functions exposed to python?
> 
> I've been looking around the source code to
> see how to expose them. Specifically, 
> PCB_EDIT_FRAME::syncLayerVisibilities, and other PCB_EDIT_FRAME functions.
> 

In rev a557838c615c9b268830138348c6a8d6a4cc9ba9 I fixed the issue about 
incorrect user interface
update after running a Action Plugin.

When running a Action Plugin, there is no need to update something, the Action 
Plugin manager takes
care of that (manages the undo stack, and updates the GUI and the canvas).



-- 
Jean-Pierre CHARRAS


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-27 Thread jp charras
Le 27/08/2017 à 08:54, Greg Smith a écrit :
> Thank you!!
> 
> Just curious: yesterday's (aug 26) nightly has the number: db3491f3
> 
> 
> 
> Yet the windows nightly has:
> 
> kicad-r8450.db3491f38-x86_64.exe
> 
> 
> 
> Any idea why the windows nightly has the extra "8" after db3491f3?

In fact, every commit is identified by a SHA-1 key.
For this commit (therefore this build), the full key is 
db3491f3821667ee74f5ef5a8127e20086d1e010

It is frequent, to avoid tedious info messages, to restrict the full key to its 
first digits.

> 
> 
> I'll wait for the Aug 27 nightly build and test it out with my python scripts.
> 
> 
> I appreciate it!
> 
> Greg S.
> 
> On Aug 27, 2017, at 1:32 AM, jp charras  > wrote:
> 
>> Le 23/08/2017 à 16:27, Greg Smith a écrit :
>>> Better formatting:
>>>
>>> How do you get PCB_EDIT_FRAME functions exposed to python?
>>>
>>> I've been looking around the source code to
>>> see how to expose them. Specifically, 
>>> PCB_EDIT_FRAME::syncLayerVisibilities, and other PCB_EDIT_FRAME functions.
>>>
>>
>> In rev a557838c615c9b268830138348c6a8d6a4cc9ba9 I fixed the issue about 
>> incorrect user interface
>> update after running a Action Plugin.
>>
>> When running a Action Plugin, there is no need to update something, the 
>> Action Plugin manager takes
>> care of that (manages the undo stack, and updates the GUI and the canvas).
>>
>>
>>
>> -- 
>> Jean-Pierre CHARRAS


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-27 Thread Greg Smith
Thank you!!
Just curious: yesterday's (aug 26) nightly has the number: db3491f3

Yet the windows nightly has:
kicad-r8450.db3491f38-x86_64.exe

Any idea why the windows nightly has the extra "8" after db3491f3?

I'll wait for the Aug 27 nightly build and test it out with my python scripts.

I appreciate it!

Greg S.

> On Aug 27, 2017, at 1:32 AM, jp charras  wrote:
> 
>> Le 23/08/2017 à 16:27, Greg Smith a écrit :
>> Better formatting:
>> 
>> How do you get PCB_EDIT_FRAME functions exposed to python?
>> 
>> I've been looking around the source code to
>> see how to expose them. Specifically, 
>> PCB_EDIT_FRAME::syncLayerVisibilities, and other PCB_EDIT_FRAME functions.
>> 
> 
> In rev a557838c615c9b268830138348c6a8d6a4cc9ba9 I fixed the issue about 
> incorrect user interface
> update after running a Action Plugin.
> 
> When running a Action Plugin, there is no need to update something, the 
> Action Plugin manager takes
> care of that (manages the undo stack, and updates the GUI and the canvas).
> 
> 
> 
> -- 
> Jean-Pierre CHARRAS
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-27 Thread jp charras
Le 23/08/2017 à 16:27, Greg Smith a écrit :
> Better formatting:
> 
> How do you get PCB_EDIT_FRAME functions exposed to python?
> 
> I've been looking around the source code to
> see how to expose them. Specifically, 
> PCB_EDIT_FRAME::syncLayerVisibilities, and other PCB_EDIT_FRAME functions.
> 

In rev a557838c615c9b268830138348c6a8d6a4cc9ba9 I fixed the issue about 
incorrect user interface
update after running a Action Plugin.

When running a Action Plugin, there is no need to update something, the Action 
Plugin manager takes
care of that (manages the undo stack, and updates the GUI and the canvas).



-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-23 Thread Greg Smith
Better formatting:
How do you get PCB_EDIT_FRAME functions exposed to python?
I've been looking around the source code tosee how to expose them. 
Specifically, PCB_EDIT_FRAME::syncLayerVisibilities, and other PCB_EDIT_FRAME 
functions.
It looks like to me the definitions are in
pcbnew/pcbframe.cpp
and the declarations are in
include/wxPcbStruct.h

And the relevant swig files are in
pcbnew/swig/pcbnew.i

Is it correct that modification of pcbnew.i to either
1) (excerpt)
%include 
%include 
%include 

or 2)
%include wxPcbStruct.i
(and have some method for generating wxPcbStruct.i)?

The functions I'm wanting are declared in C++ as "protected:". Does thishave 
any implications for running them from python through SWIG?
Finally, how do you make sure that all argument types are accessible from 
python as well? 

On Tuesday, August 22, 2017 1:02 PM, jp charras  
wrote:
 

 Le 22/08/2017 à 19:33, Greg Smith a écrit :
> Continuing to review, it appears I am wrong. PCB_EDIT_FRAME:sLV does in fact 
> synchronize the
> checkboxes, but also calls PCB_DRAW_PANEL_GAL::SLV to do the background 
> synchronization of the layers.
> 
> Thank you jp, and I apologize for not researching sufficiently your answer 
> before posting.
> 
> So at this point, how do we get PCB_EDIT_FRAME:sLV exposed in python?
> 
> void PCB_EDIT_FRAME::syncLayerVisibilities    (        )    
> 
>     protected
> 

Certainly the Python interface needs a few specific and "easy to call" methods 
to update the GUI and
the canvases, when a board is modified by a python script.

The "legacy" canvas is easy to update, but the GAL canvas has a lot of cached 
data, so it needs a
rebuild method.

I'll try to add this kind of methods. But remember: I have a (very) poor 
knowledge of Python.

Also, I'll not be able to work on Kicad next 3 days.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to    : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help  : https://help.launchpad.net/ListHelp


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-23 Thread Greg Smith
How do you get PCB_EDIT_FRAME functions exposed to python?
I've been looking around the source code tosee how to expose them. 
Specifically, PCB_EDIT_FRAME::syncLayerVisibilities, and other PCB_EDIT_FRAME 
functions.
It looks like to me the definitions are inpcbnew/pcbframe.cppand the 
declarations are ininclude/wxPcbStruct.h
And the relevant swig files are inpcbnew/swig/pcbnew.i
Is it correct that modification of pcbnew.i to either1) (excerpt)%include 
%include %include 
or 2)%include wxPcbStruct.i(and have some method for generating wxPcbStruct.i)?
The functions I'm wanting are declared in C++ as "protected:". Does thishave 
any implications for running them from python through SWIG?
Finally, how do you make sure that all argument types are accessible from 
python as well?
 

On Tuesday, August 22, 2017 1:02 PM, jp charras  
wrote:
 

 Le 22/08/2017 à 19:33, Greg Smith a écrit :
> Continuing to review, it appears I am wrong. PCB_EDIT_FRAME:sLV does in fact 
> synchronize the
> checkboxes, but also calls PCB_DRAW_PANEL_GAL::SLV to do the background 
> synchronization of the layers.
> 
> Thank you jp, and I apologize for not researching sufficiently your answer 
> before posting.
> 
> So at this point, how do we get PCB_EDIT_FRAME:sLV exposed in python?
> 
> void PCB_EDIT_FRAME::syncLayerVisibilities    (        )    
> 
>     protected
> 

Certainly the Python interface needs a few specific and "easy to call" methods 
to update the GUI and
the canvases, when a board is modified by a python script.

The "legacy" canvas is easy to update, but the GAL canvas has a lot of cached 
data, so it needs a
rebuild method.

I'll try to add this kind of methods. But remember: I have a (very) poor 
knowledge of Python.

Also, I'll not be able to work on Kicad next 3 days.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to    : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help  : https://help.launchpad.net/ListHelp


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-22 Thread Greg Smith
That's awesome, jp!
I am able to test the nightly version of Windows, so let me know (perhaps via 
the bug here: https://bugs.launchpad.net/kicad/+bug/1712233) when you'd like me 
to test. I am currently unable to rebuild KiCad, so I rely on the nightly 
builds to test. 

On Tuesday, August 22, 2017 1:02 PM, jp charras  
wrote:
 

 Le 22/08/2017 à 19:33, Greg Smith a écrit :
> Continuing to review, it appears I am wrong. PCB_EDIT_FRAME:sLV does in fact 
> synchronize the
> checkboxes, but also calls PCB_DRAW_PANEL_GAL::SLV to do the background 
> synchronization of the layers.
> 
> Thank you jp, and I apologize for not researching sufficiently your answer 
> before posting.
> 
> So at this point, how do we get PCB_EDIT_FRAME:sLV exposed in python?
> 
> void PCB_EDIT_FRAME::syncLayerVisibilities    (        )    
> 
>     protected
> 

Certainly the Python interface needs a few specific and "easy to call" methods 
to update the GUI and
the canvases, when a board is modified by a python script.

The "legacy" canvas is easy to update, but the GAL canvas has a lot of cached 
data, so it needs a
rebuild method.

I'll try to add this kind of methods. But remember: I have a (very) poor 
knowledge of Python.

Also, I'll not be able to work on Kicad next 3 days.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to    : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help  : https://help.launchpad.net/ListHelp


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-22 Thread jp charras
Le 22/08/2017 à 19:33, Greg Smith a écrit :
> Continuing to review, it appears I am wrong. PCB_EDIT_FRAME:sLV does in fact 
> synchronize the
> checkboxes, but also calls PCB_DRAW_PANEL_GAL::SLV to do the background 
> synchronization of the layers.
> 
> Thank you jp, and I apologize for not researching sufficiently your answer 
> before posting.
> 
> So at this point, how do we get PCB_EDIT_FRAME:sLV exposed in python?
> 
> void PCB_EDIT_FRAME::syncLayerVisibilities(   )   
> 
>   protected
> 

Certainly the Python interface needs a few specific and "easy to call" methods 
to update the GUI and
the canvases, when a board is modified by a python script.

The "legacy" canvas is easy to update, but the GAL canvas has a lot of cached 
data, so it needs a
rebuild method.

I'll try to add this kind of methods. But remember: I have a (very) poor 
knowledge of Python.

Also, I'll not be able to work on Kicad next 3 days.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-22 Thread Greg Smith
Continuing to review, it appears I am wrong. PCB_EDIT_FRAME:sLV does in fact 
synchronize the checkboxes, but also calls PCB_DRAW_PANEL_GAL::SLV to do the 
background synchronization of the layers.
Thank you jp, and I apologize for not researching sufficiently your answer 
before posting.
So at this point, how do we get PCB_EDIT_FRAME:sLV exposed in python?

| 
| void PCB_EDIT_FRAME::syncLayerVisibilities | ( |  | ) |  |

 | protected |

Function syncLayerVisibilities updates each "Layer" checkbox in the layer 
widget according to each layer's current visibility determined by 
IsLayerVisible(), and is helpful immediately after loading a BOARD which may 
have state information in it.Definition at line 913 of file 
pcbframe.cpp.Referenced by OpenProjectFiles(). 914 { 915  
m_Layers->SyncLayerVisibilities(); 916  static_cast( 
GetGalCanvas() )->SyncLayersVisibility( m_Pcb ); 917 } 

On Tuesday, August 22, 2017 12:27 PM, Greg Smith  
wrote:
 

 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  
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
> 
> 
> 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@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help  : https://help.launchpad.net/ListHelp


   

   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-22 Thread Greg Smith
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  
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
> 
> 
> 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@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help  : https://help.launchpad.net/ListHelp


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-22 Thread jp charras
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
> 
> 
> 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@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] Calling PCB_DRAW_PANEL_GAL::SyncLayersVisibility from python?

2017-08-22 Thread Greg Smith

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

Tomasz Wlostowski (twlostow) was kind enough to point out the possible solution 
to getting the layer visibilities updated in OpenGL canvas. Thank you, Tomasz!

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp