Selection field usable as Combo box for further use with Form module

Hi.

To continue the discussion that originated in a topic about the Control Widget:

So currently any predefined selection available in the configuration of a device cannot be used to accept a variable generated by the Forms module. This is because a Selection field does not allow for user string input but solely presents values predefined in the source of the driver class.

@Axel proposed to discuss the possibility of offering a Combo Box feature that offers predefined values as well as accpeting a user input string. The downside would be that the driver code has to check the input versus all valid options.

Since one of my earliest drivers, @Franz proposed to use a dictionary to group all entries for Selection fields, which has been implemented by me since then whenever possible. At least for all those drivers, I have the feeling it should be relatively easy to compare the user input string whether it is an item of the dictionary or not as compare functions are quite powerful in python. Bonus if the Combo Box object hosts a property that provides information whether an item of its list was selected or a string entered.

Of specific interest currently is the averaging Selection box of the Keysight EXR Oscilloscope, but as an example based on a smaller and less complex driver, any DMM like the HP 3456A that makes heavy use of the dictionary would suffice.

I understand that following each customer input is a rabbit hole that quickly leads to an overly complex code with lots of exceptions to the rule being constructed. But I think this feature would be important to fully embrace the possibilities given by the Form module.

Best wishes,
Christian

1 Like

Hi Christian,

thanks for opening the topic here.

As you describe, the check should be easy to implement as you can use the same list or dictionary to fill the GUI but also for checking whether the user input is in this list or dictionary.

Coming back to your original request regarding the Scope driver, it would be relatively easy to make the following user input fields of the Scope module editable:

Would this be something that helps you to proceed?

In general, we would like to make more input fields “variable” (i.e. supporting parameter syntax) but have not revised all modules right now. We do it on demand or when it is needed in our customer projects. So, it would be not a problem to change it now as it goes in the right direction.

In future, all input fields should become editable, i.e. also check boxes, but here more work on the UI and a good concept is required to make a check box editable.

Thanks and best,
Axel

1 Like

Morning Axel.

This would solve my problem I currently have at hand, yes. Looking forward to the updated OSC module, thanks for your quick support!

Best wishes,
Christian

1 Like

Hi Christian,
great, that should be a quick win. Will come back to you when a module update is available.
Best, Axel

1 Like

New Scope module version 2025-03-04 is available as testing version.
As described above all relevant dropdown boxes are now editable.

@Christian If everything works for you, we will switch the version to live making it available to everyone. Please log in to download the version in the SweepMe! version manager and let me know if it works.

Best, Axel

2 Likes

The changes are now publically available as live version. If something does not work as expected, please let us know.