LayerViewSet (main thread) - a python script for manipulating visible layers

It seems there is a problem with the build systems. (boost lib problems again)
Otherwise 4.0.7 would already have been released. (There where also two major bugs that made it necessary to postpone the release date by more than two weeks.)

https://lists.launchpad.net/kicad-developers/msg30272.html

1 Like

The 4.0.x series is not released from master, it is released from the ā€œ4.0ā€ branch. https://code.launchpad.net/~kicad-product-committers/kicad/+git/product-git/+ref/4.0 The 4.0 branch only has essential bug fixes on top of previous stable releases in the 4.0.x series. I guess when you have been around a bit longer you will get familiar with all this.

The nightly builds from master are effectively 5.0.0 beta versions.

2 Likes

Wow. This is totally opaque to me now. I have tested with the nightly. I hope to learn more about the process. Thanks for the insight!

4.0.7 will be 4.0.6 with bugs fixed and few or zero new features. Especially nothing will change that affects backwards compatibility with any of the 4.0.x releases.
As 4.0.0 is almost two year old, Nightly builds have evolved away a lot.
I call them ā€œofficialā€ Nightlies as they are described on the KiCad website and bugs are managed on Launchpad

2 Likes

They have build dates / sourcecode reference numbers. If you hit ā€˜copy infoā€™ in the about page youā€™ll get this:

Application: kicad
Version: (2017-05-12 revision b823d0b78)-makepkg, release build
Libraries: wxWidgets 3.0.2
libcurl/7.52.1 OpenSSL/1.0.2k zlib/1.2.11 libssh2/1.8.0 nghttp2/1.19.0 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW

  • Build Info -
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    Curl: 7.52.1
    ā€¦

Take note & be careful what of your data you expose to the nightlies, as backwards compatibility WILL GET BROKEN :wink:

Iā€™m experimenting with adjusting the visual components in Layer Manager to integrate the push/pop functionality of Layer Visibility Sets. Itā€™s not perfect yet, but getting close. I am trying to get it so that the LayerManager can dock into its normal place. Still having problems with width adjustment of the windows. And a little resizing issues, too. I went with clickable labels (with explanatory tooltips) so the space overhead is lower. Left to right is push, pop, and dock.

(Click the image to see the full thing).

1 Like

Would it be possible to add some installation and usage information to the Read Me file beyond ā€œLayer View Set.py A gui for saving, loading view sets as well as interacting with a stack of view sets for changing which layers are viewed within KiCad.ā€ Documentation seems to be a dying art :frowning:

1 Like

Only tested with the Nightly version of KiCad.

LayerViewSet is a ActionPlugin and is installed similar to other Action Plugins.
Place the file in 
C:\Program Files\KiCad\share\kicad\scripting\plugins
Or the equivalent in MacOS or Linux
(there may be a user-level directory for such files, but I am not aware of it at the moment.)

Within KiCad pcbnew, select the Tools > External Plugins > Refresh Plugins
LayerViewSet dialog box is shown when the LayerViewSet menu item is selected.
1 Like

Thank you :slight_smile:

Here is some additional text to satisfy the minimum posting requirement.

1 Like

Hereā€™s an update on progress. This is not pushed to GitHub yet, but Iā€™ll do so in the next few days.

Iā€™ve figured out how to integrate with KiCad frame, and I think it looks great! There are still a few tweaks to make, and Iā€™m not super happy with the buttons, but they are functional.

Click on the graphic to see the LayerViewSet control panel on the bottom:

A note on integration: it doesnā€™t integrate with the Layer Manager, but only with the KiCad frame. This means it doesnā€™t float around with the Layer Manager when you decouple the Layer Manager from the KiCad frame. Ideally, LayerViewSet would move around and float with the Layer Manager itself, but I havenā€™t figured that out yet.

And Iā€™m still working on tweaking the title bar. Not sure of the right combination to make it work similarly to ā€œVisiblesā€.

The ā€œClick on any label.ā€ is where message text will go to indicate progress (if any messages are needed, otherwise Iā€™ll remove it)

2 Likes

Hereā€™s a big release. This includes a lot of improvements. Iā€™ve worked around the issue with checkboxes (now I am setting the checkboxes appropriately) but still havenā€™t gotten around the issue of layers not updating in the layout view without switching canvases (and back).

This fully integrates into KiCad: you can dock the tool anywhere. Iā€™ve shown my favorite place. Iā€™ve shortened the label names to one line, and provided the full list of layers and renders in the tooltip to the View Set button.

If a button icon/word isnā€™t clear, just hover over it to get a full description of what it does. Iā€™ve also updated the README.md that should cover most uses.

Let me know what you think!!

4 Likes

Hi, Greg :slight_smile: Itā€™s a really nice feature, but in my opinion the interface is a bit clumsy. Unfortunately, canā€™t try this plugin in business, so my opinion is based only on your pictures. From the first glance itā€™s hard to say what the buttons do (letā€™s forget that you explained it earlier). I can suggest my vision: if you are implementing a stack of view perspectives, you need two buttons - push and restore. A list of perspectives may be maintained by wxListBox. It would be nice if the user could change the name of the perspective (e.g., I can prepare ā€œFront viewā€, ā€œBottom viewā€, ā€œMechanicalā€ etc.). I hope my feedback can be useful)

1 Like

Agreed on all points. I want the ability to ā€œsaveā€ sets to the side and rename them. As to the ease of use of the buttons. I agree that itā€™s difficult to determine what they do. Perhaps a downward arrow on each of the thee push buttons and an up arrow on the pop button (I tried to do that with ASCII ^ (pop) and v (push ā€“ and the dashes in ā€œ-v-ā€ indicates coming from both Layers and Renders and pushing onto the stack)?

Also the tool tips (which you donā€™t get from the picture, but you do get when you hover over each button) are:

ā€œPop stack and assign visible layers and/or rendersā€
ā€œPush visible Layers onto stackā€
ā€œPush visible Layers and Renders onto stackā€
ā€œPush visible Renders onto stackā€

Hovering over the button shows every visible layer in that set.

Another release around the corner, possibly by this weekend.

Integrating saved / named view sets. Youā€™ll be able save any viewset on the stack and name it. It will appear as a selectable viewset on the right, and it will persist between kicad runs in ~/kicad/viewsets

This seems to be reaching and end in development. There are no other features that I plan to add after this. Any ideas or thoughts on what would make this more useful?

1 Like

Hereā€™s where development is at the moment.

I put the stack on the right, and the saved view sets on the left. The stack automatically gets the name [layers]/[renders], without extra labels. This way the label in the stack is small, and any extra room can go to the named set on the left.

Here is a little guide on the stack label format:
3/5 - 3 layers are visible and 5 renders are visible
2/ - 2 layers are visible and renders will be unchanged
/4 - layers will be unchanged and 4 renders are visible
0/3 - 0 layers are visible and 3 renders are visible

Note the subtle distinction between ā€œ/4ā€ and ā€œ0/3ā€.

The ā€œtooltipā€ for the stack buttons list all the visible layers in the set:

2 Likes

Well, I couldnā€™t wait. Iā€™ve updated the files on github with the latest update. Includes naming and saving ViewSets. An updated README.md explains in detail how to use the control.

Please let me know how it works and if you find any bugs. Itā€™s been lightly tested in Windows KiCad nightly.

LayerViewSet github master branch has been updated.

In combination with a fix to KiCad, this LayerViewSet update removes the need to switch canvas and back to update the layout view after pop or load.

This fix works with KiCad nightly a557838c615c9b268830138348c6a8d6a4cc9ba9 or later, referenced by this bug report.

It should still function with older nightlies, but will still require switching views.

LayerViewSet has been updated. There was a bug that prevented loading different viewsets from different buttons. It should work much smoother now.

Because LayerViewSet can load Layers and Renders separately or together, you can do cool things like set buttons for quickly changing the Renders. This, for example, has buttons named ā€œShow All Rendersā€ and ā€œHide All Rendersā€. You can set any combination of layer visibility, render visibility, or both, that you want; name them; and they will persist between KiCad sessions:

3 Likes

Really gotta find some time to play with this. :thumbsup:

2 Likes