mcstasscript.jb_interface.simulation_interface.ParameterWidget#
- class mcstasscript.jb_interface.simulation_interface.ParameterWidget(parameter, parameters)#
Widget for parameter object from McStasScript instrument
- __init__(parameter, parameters)#
Describes a widget for a parameter object given all parameters
When no options are given in ParameterVariable object, the widget will be a textfield where the user can input the value. If the options attribute is used, the widget will be a dropdown menu with available options. The make_widget method returns the widget, and the update function is called whenever the user interacts with the widget.
The widget shows parameter name, the interactive widget and a comment
- Parameters:
parameter (McStasScript ParameterVariable object) – The parameter this widget should represent
parameters (dict of McStasScript ParameterVariable objects) – Dict with all parameter objects of the instrument
Methods
__init__(parameter, parameters)Describes a widget for a parameter object given all parameters
Returns widget with parameter name, interactive widget and comment
update(change)Update function called whenever the user updates the widget
- make_widget()#
Returns widget with parameter name, interactive widget and comment
- update(change)#
Update function called whenever the user updates the widget
When strings parameters are used, this function adds the necessary quotation marks if none are provided.