.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\itom\ui\demo_paramEditorWidget.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_itom_ui_demo_paramEditorWidget.py: Parameter editor widget ========================== This example shows the usage of the generic ParamEditorWidget. The widget can be used in various ways. Some of them are shown in this example. In the first tab, we have a DummyGrabber live image with two ParamEditorWidgets on the right side. The left one is a default one with an information text field below. If a parameter is clicked, its description is shown there. The right one is configured such that changes are not directly applied to the camera. Instead the Apply button must be clicked to apply all recent changes. In the second tab, we have a DummyMotor with 3 axes. There is one read-only ParamEditorWidget and one standard one, that only shows a subset of parameters (depending on their category). The category of a parameter is an optional meta information and is part of the plugin. .. GENERATED FROM PYTHON SOURCE LINES 22-72 .. code-block:: Python from itom import dataIO from itom import actuator from itom import ui cam = dataIO("DummyGrabber", 1280, 1024, 8) cam.setParam("frame_time", 0.100) # limit to 10 Hz mot = actuator("DummyMotor", 3) gui = ui("paramEditorWidget.ui", ui.TYPEWINDOW) def onApply(): """Call 'setParam' of the DummyGrabber device for all changed parameters in the right ParamEditorWidget of the camera tab.""" gui.pewGrabber2.call("applyChangedParameters") # configure the DummyGrabber camera tab gui.plot["camera"] = cam # assign the camera to the plot gui.pewGrabber["plugin"] = cam # assign the camera to the left ParamEditorWidget # if a parameter is changed in this ParamEditorWidget, directly call # setParam of the camera gui.pewGrabber["immediatelyModifyPluginParamsAfterChange"] = True gui.pewGrabber2["plugin"] = cam # assign the camera to the right ParamEditorWidget # do not directly change the parameters in the camera, instead click # the Apply button... gui.pewGrabber2["immediatelyModifyPluginParamsAfterChange"] = False # connect the click signal of the Apply button to the method ``onApply``. gui.btnApplyChangesGrabber.connect("clicked()", onApply) # configure the DummyMotor tab gui.motorController["actuator"] = mot gui.pewMotor1["plugin"] = mot # do only show parameters that belong to these two categories gui.pewMotor1["filteredCategories"] = ("General", "Motion") # make the left ParamEditorWidget readonly gui.pewMotor1["readonly"] = True gui.pewMotor2["plugin"] = mot gui.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.169 seconds) .. _sphx_glr_download_11_demos_itom_ui_demo_paramEditorWidget.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_paramEditorWidget.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_paramEditorWidget.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_paramEditorWidget.zip `