I have built a complex control system for a scientific instrument. Settings are implemented as Param objects, with one Parameterized class for each component of the instrument. Settings are displayed in a UI using Panel, which serialises and sends settings to the instrument.
Some components now have dozens of settings and I would like to make the UI easier to use by grouping the settings for one component into UI group-boxes, or sections with titles, or into an accordion.
I know I can use precedence to order the settings. I know I could break each componentâs settings into multiple child Parameterized objects, but this would be a huge change and would give me other problems with my custom serialisation.
I found that I could add any Python object to a Parameterized, so I added a dictionary of groups. I then tried to add the settings in each group to the UI, but this didnât work because that subset of settings was not a Parameterized.
I also tried adding all the settings multiple times to the UI, each time setting the precedence to -1 for those that were hidden in each group. But this just showed only the last group, because the precedence was being overwritten each time.
Please does anyone know of a way to group the settings in a Parameterized class in the UI, without breaking it into a hierarchy of settings?
This is not so great. So I believe you are asking how to make this look and feel better. Especially as the number of controls and settings start growing?
Hi @Marc. I have already organised the UI so the different modules have their own pages, selected at the top level of the UI - so this level of detail was perhaps confusing for me to have included. The issue is that each module now has scores of settings so the user just sees a sea of controls with no organisation to them; but the settings often have groups of controls which are logically similar or connected, e.g. âvoltage limitsâ, âtemperature limitsâ, âcalibration settingsâ.
What I would like is to be able to group those settings easily, into groups of controls - each group with a heading (a âgroup boxâ).
There might be only one or two controls in each group; I still want to see all the settings at once on a page, and I definitely donât want to split my settings classes into hundreds of small child classes.
This is a purely visual thing, not a very solid logical separation, just a visual indicator to help the user.
On a previous project, using PyQt and not using Holoviz, when I created my own settings objects I added a âgroupâ parameter to each setting; the page then grouped settings with the same group name into a GroupBox. I tried to build such a system on top of Panel but could not get it to work because I could not find a way to have a widget that showed only some settings within a Parameterized object, while another widget showed a different choice of settings.
Being able to separate my settings into an accordion would be one nice solution, but I canât see how to do it without splitting my settings class. Say I have one Parameterized with 50 parameters within it; how do I persuade panel to show say five settings in one accordion page and another five on another accordion page?
Thatâs the problem.
You might think that to split the view of one parameterized object into several views, such as several accordion pages, in the first page you could set the precedence of all but a few settings to -1; and in the next page, a different selection of settings would be hidden. But this does not work; the settings are shared between all the pages so you cannot make them different for one page from another.
This is such a basic aspect of an industrial-strength professional (as opposed to research or small toy) UI that Iâm amazed it is absent.
But this shows setting2 in both entries of the accordion, because the same settings object is in both views and so changing the precedence affects them both the same. Note that I only want to instantiate one MySettings object, because this object is what will be saved and will be serialised to the instrument.
That may succeed in creating the UI, but now we have several objects of type MySettings, which will have different and conflicting values. To save or serialise the settings, I would then have to combine them using knowledge of which setting was in which accordion.
I could also have some serious complexity when validating changes since some settings need to be considered together, although probably all dependent settings would be in the same accordion page.
I think this may be a possible solution, thank you.
I consider it more of a kludge and work-around, considering the complexity I will have to add on top; but I should be able to create a custom âaccordion Param pageâ to put the split settings back together. Itâs a pity Param doesnât support this very basic requirement.