From 768acba338c60f8c04c6e73a20c32f6e77c37bbb Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Mon, 17 Jun 2024 16:43:09 +0200 Subject: [PATCH] feat:added launch script --- bec_widgets/plugin/plugin_launch.py | 8 ++--- .../selection/motor_selection_launch.py | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 bec_widgets/widgets/motor_control/selection/motor_selection_launch.py diff --git a/bec_widgets/plugin/plugin_launch.py b/bec_widgets/plugin/plugin_launch.py index e356b68e..99aa6f38 100644 --- a/bec_widgets/plugin/plugin_launch.py +++ b/bec_widgets/plugin/plugin_launch.py @@ -8,12 +8,12 @@ import bec_widgets def main(): - os.environ["PYSIDE_DESIGNER_PLUGINS"] = os.path.join( - "/Users/janwyzula/PSI/bec_widgets/bec_widgets/plugin" - ) # os.environ["PYSIDE_DESIGNER_PLUGINS"] = os.path.join( - # os.path.dirname(bec_widgets.__file__), "widgets/motor_control/selection" + # "/Users/janwyzula/PSI/bec_widgets/bec_widgets/plugin" # ) + os.environ["PYSIDE_DESIGNER_PLUGINS"] = os.path.join( + os.path.dirname(bec_widgets.__file__), "widgets/motor_control/selection" + ) # os.environ["PYTHONFRAMEWORKPREFIX"] = os.path.join( # os.path.dirname(bec_widgets.__file__), "widgets/motor_control/selection" # ) diff --git a/bec_widgets/widgets/motor_control/selection/motor_selection_launch.py b/bec_widgets/widgets/motor_control/selection/motor_selection_launch.py new file mode 100644 index 00000000..36c8cb6c --- /dev/null +++ b/bec_widgets/widgets/motor_control/selection/motor_selection_launch.py @@ -0,0 +1,30 @@ +import qdarktheme +from qtpy.QtWidgets import QApplication + +from bec_widgets.utils.bec_dispatcher import BECDispatcher +from bec_widgets.widgets.motor_control.selection.selection import MotorControlSelection + +CONFIG_DEFAULT = { + "motor_control": { + "motor_x": "samx", + "motor_y": "samy", + "step_size_x": 3, + "step_size_y": 5, + "precision": 4, + "step_x_y_same": False, + "move_with_arrows": False, + } +} +if __name__ == "__main__": + bec_dispatcher = BECDispatcher() + # BECclient global variables + client = bec_dispatcher.client + client.start() + + app = QApplication([]) + qdarktheme.setup_theme("auto") + motor_control = MotorControlSelection(client=client, config=CONFIG_DEFAULT) + + window = motor_control + window.show() + app.exec()