From 26c7382b1e8a32fcd0600425d4100bd13d74cbf4 Mon Sep 17 00:00:00 2001 From: atse Date: Wed, 10 Jul 2024 14:52:09 +0800 Subject: [PATCH] Move GUI components and examples into folder For better organisation --- pytec/MANIFEST.in | 7 +++-- pytec/{ => examples}/aioexample.py | 0 pytec/{ => examples}/example.py | 0 pytec/{ => pytec/gui}/model/pid_autotuner.py | 0 pytec/{ => pytec/gui}/model/property.py | 0 pytec/{ => pytec/gui}/model/thermostat.py | 2 +- pytec/{ => pytec/gui}/resources/artiq.ico | Bin pytec/{ => pytec/gui}/view/conn_menu.py | 0 pytec/{ => pytec/gui}/view/ctrl_panel.py | 0 pytec/{ => pytec/gui}/view/info_box.py | 0 pytec/{ => pytec/gui}/view/live_plot_view.py | 0 .../gui}/view/net_settings_input_diag.py | 0 pytec/{ => pytec/gui}/view/param_tree.json | 0 .../{ => pytec/gui}/view/plot_options_menu.py | 0 pytec/{ => pytec/gui}/view/tec_qt.ui | 2 +- .../gui}/view/thermostat_ctrl_menu.py | 0 .../gui}/view/waitingspinnerwidget.py | 0 .../gui}/view/zero_limits_warning.py | 0 pytec/tec_qt.py | 26 +++++++++--------- 19 files changed, 19 insertions(+), 18 deletions(-) rename pytec/{ => examples}/aioexample.py (100%) rename pytec/{ => examples}/example.py (100%) rename pytec/{ => pytec/gui}/model/pid_autotuner.py (100%) rename pytec/{ => pytec/gui}/model/property.py (100%) rename pytec/{ => pytec/gui}/model/thermostat.py (98%) rename pytec/{ => pytec/gui}/resources/artiq.ico (100%) rename pytec/{ => pytec/gui}/view/conn_menu.py (100%) rename pytec/{ => pytec/gui}/view/ctrl_panel.py (100%) rename pytec/{ => pytec/gui}/view/info_box.py (100%) rename pytec/{ => pytec/gui}/view/live_plot_view.py (100%) rename pytec/{ => pytec/gui}/view/net_settings_input_diag.py (100%) rename pytec/{ => pytec/gui}/view/param_tree.json (100%) rename pytec/{ => pytec/gui}/view/plot_options_menu.py (100%) rename pytec/{ => pytec/gui}/view/tec_qt.ui (99%) rename pytec/{ => pytec/gui}/view/thermostat_ctrl_menu.py (100%) rename pytec/{ => pytec/gui}/view/waitingspinnerwidget.py (100%) rename pytec/{ => pytec/gui}/view/zero_limits_warning.py (100%) diff --git a/pytec/MANIFEST.in b/pytec/MANIFEST.in index 2148229..5be0b39 100644 --- a/pytec/MANIFEST.in +++ b/pytec/MANIFEST.in @@ -1,3 +1,4 @@ -include resources/*.ico -include view/param_tree.json -include view/tec_qt.ui +graft examples +include pytec/gui/resources/artiq.ico +include pytec/gui/view/param_tree.json +include pytec/gui/view/tec_qt.ui diff --git a/pytec/aioexample.py b/pytec/examples/aioexample.py similarity index 100% rename from pytec/aioexample.py rename to pytec/examples/aioexample.py diff --git a/pytec/example.py b/pytec/examples/example.py similarity index 100% rename from pytec/example.py rename to pytec/examples/example.py diff --git a/pytec/model/pid_autotuner.py b/pytec/pytec/gui/model/pid_autotuner.py similarity index 100% rename from pytec/model/pid_autotuner.py rename to pytec/pytec/gui/model/pid_autotuner.py diff --git a/pytec/model/property.py b/pytec/pytec/gui/model/property.py similarity index 100% rename from pytec/model/property.py rename to pytec/pytec/gui/model/property.py diff --git a/pytec/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py similarity index 98% rename from pytec/model/thermostat.py rename to pytec/pytec/gui/model/thermostat.py index d1a47aa..25246d5 100644 --- a/pytec/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -1,7 +1,7 @@ from pytec.aioclient import Client from PyQt6.QtCore import pyqtSignal, QObject, pyqtSlot from qasync import asyncSlot -from model.property import Property, PropertyMeta +from pytec.gui.model.property import Property, PropertyMeta import asyncio import logging diff --git a/pytec/resources/artiq.ico b/pytec/pytec/gui/resources/artiq.ico similarity index 100% rename from pytec/resources/artiq.ico rename to pytec/pytec/gui/resources/artiq.ico diff --git a/pytec/view/conn_menu.py b/pytec/pytec/gui/view/conn_menu.py similarity index 100% rename from pytec/view/conn_menu.py rename to pytec/pytec/gui/view/conn_menu.py diff --git a/pytec/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py similarity index 100% rename from pytec/view/ctrl_panel.py rename to pytec/pytec/gui/view/ctrl_panel.py diff --git a/pytec/view/info_box.py b/pytec/pytec/gui/view/info_box.py similarity index 100% rename from pytec/view/info_box.py rename to pytec/pytec/gui/view/info_box.py diff --git a/pytec/view/live_plot_view.py b/pytec/pytec/gui/view/live_plot_view.py similarity index 100% rename from pytec/view/live_plot_view.py rename to pytec/pytec/gui/view/live_plot_view.py diff --git a/pytec/view/net_settings_input_diag.py b/pytec/pytec/gui/view/net_settings_input_diag.py similarity index 100% rename from pytec/view/net_settings_input_diag.py rename to pytec/pytec/gui/view/net_settings_input_diag.py diff --git a/pytec/view/param_tree.json b/pytec/pytec/gui/view/param_tree.json similarity index 100% rename from pytec/view/param_tree.json rename to pytec/pytec/gui/view/param_tree.json diff --git a/pytec/view/plot_options_menu.py b/pytec/pytec/gui/view/plot_options_menu.py similarity index 100% rename from pytec/view/plot_options_menu.py rename to pytec/pytec/gui/view/plot_options_menu.py diff --git a/pytec/view/tec_qt.ui b/pytec/pytec/gui/view/tec_qt.ui similarity index 99% rename from pytec/view/tec_qt.ui rename to pytec/pytec/gui/view/tec_qt.ui index c7d8b35..8b20fd9 100644 --- a/pytec/view/tec_qt.ui +++ b/pytec/pytec/gui/view/tec_qt.ui @@ -588,7 +588,7 @@ QtWaitingSpinner QWidget -
view.waitingspinnerwidget
+
pytec.gui.view.waitingspinnerwidget
1
diff --git a/pytec/view/thermostat_ctrl_menu.py b/pytec/pytec/gui/view/thermostat_ctrl_menu.py similarity index 100% rename from pytec/view/thermostat_ctrl_menu.py rename to pytec/pytec/gui/view/thermostat_ctrl_menu.py diff --git a/pytec/view/waitingspinnerwidget.py b/pytec/pytec/gui/view/waitingspinnerwidget.py similarity index 100% rename from pytec/view/waitingspinnerwidget.py rename to pytec/pytec/gui/view/waitingspinnerwidget.py diff --git a/pytec/view/zero_limits_warning.py b/pytec/pytec/gui/view/zero_limits_warning.py similarity index 100% rename from pytec/view/zero_limits_warning.py rename to pytec/pytec/gui/view/zero_limits_warning.py diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 427ffc8..dbc967c 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -1,13 +1,13 @@ -from view.zero_limits_warning import ZeroLimitsWarningView -from view.net_settings_input_diag import NetSettingsInputDiag -from view.thermostat_ctrl_menu import ThermostatCtrlMenu -from view.conn_menu import ConnMenu -from view.plot_options_menu import PlotOptionsMenu -from view.live_plot_view import LiveDataPlotter -from view.ctrl_panel import CtrlPanel -from view.info_box import InfoBox -from model.pid_autotuner import PIDAutoTuner -from model.thermostat import WrappedClient, Thermostat +from pytec.gui.view.zero_limits_warning import ZeroLimitsWarningView +from pytec.gui.view.net_settings_input_diag import NetSettingsInputDiag +from pytec.gui.view.thermostat_ctrl_menu import ThermostatCtrlMenu +from pytec.gui.view.conn_menu import ConnMenu +from pytec.gui.view.plot_options_menu import PlotOptionsMenu +from pytec.gui.view.live_plot_view import LiveDataPlotter +from pytec.gui.view.ctrl_panel import CtrlPanel +from pytec.gui.view.info_box import InfoBox +from pytec.gui.model.pid_autotuner import PIDAutoTuner +from pytec.gui.model.thermostat import WrappedClient, Thermostat import json from autotune import PIDAutotuneState from qasync import asyncSlot, asyncClose @@ -47,7 +47,7 @@ def get_argparser(): parser.add_argument( "-p", "--param_tree", - default=importlib.resources.files("view").joinpath("param_tree.json"), + default=importlib.resources.files("pytec.gui.view").joinpath("param_tree.json"), help="Param Tree Description JSON File", ) @@ -60,7 +60,7 @@ class MainWindow(QtWidgets.QMainWindow): def __init__(self, args): super(MainWindow, self).__init__() - ui_file_path = importlib.resources.files("view").joinpath("tec_qt.ui") + ui_file_path = importlib.resources.files("pytec.gui.view").joinpath("tec_qt.ui") uic.loadUi(ui_file_path, self) self.show() @@ -419,7 +419,7 @@ async def coro_main(): app = QtWidgets.QApplication.instance() app.aboutToQuit.connect(app_quit_event.set) app.setWindowIcon( - QtGui.QIcon(str(importlib.resources.files("resources").joinpath("artiq.ico"))) + QtGui.QIcon(str(importlib.resources.files("pytec.gui.resources").joinpath("artiq.ico"))) ) main_window = MainWindow(args)