.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\itom\ui\demo_MotorAxisController.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_MotorAxisController.py: Motor axis controller ======================== .. GENERATED FROM PYTHON SOURCE LINES 5-37 .. code-block:: Python from itom import ui from itom import actuator from itom import version as itomVersion gui = ui("demoMotorAxisController.ui", ui.TYPEWINDOW) # please notice, that some signals/slots are already connected via Designer! c = gui.controller motor = actuator("DummyMotor", 4) c["actuator"] = motor c["numAxis"] = 4 # the first 4 axes from the motor are considered in this case. c["defaultAxisUnit"] = ( "UnitMum" # available: UnitNm (0), UnitMum (1), UnitMm (2), UnitCm (3), UnitM (4) or UnitDeg (5) ) c["defaultAxisType"] = "TypeLinear" # available: TypeRotational (0), TypeLinear (1) c["defaultRelativeStepSize"] = 0.010 # always in mm or deg c["axisNames"] = ("x", "y", "z", "alpha") c["defaultDecimals"] = 2 qtVersion = itomVersion(1)["itom"]["QT_Version"] # the fourth axis is a rotational axis: if qtVersion >= "5.5.0": c.call("setAxisType", 3, "TypeRotational") c.call("setAxisUnit", 3, "UnitDeg") else: # before Qt 5.5.0, slots with enumeration data types can only be called with their integer value c.call("setAxisType", 3, 0) # TypeRotational c.call("setAxisUnit", 3, 5) # UnitDeg gui.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.041 seconds) .. _sphx_glr_download_11_demos_itom_ui_demo_MotorAxisController.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_MotorAxisController.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_MotorAxisController.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_MotorAxisController.zip `