diff --git a/pyproject.toml b/pyproject.toml index bc2e0f8..58bd29f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,10 @@ classifiers = [ dependencies = [ "matplotlib", - "pyqt5", + "pyqt6", "NQRduck", ] +[project.entry-points."nqrduck"] +"nqrduck-autotm" = "nqrduck_autotm.autotm:AutoTM" + diff --git a/src/nqrduck_autotm/AutoTM_controller.py b/src/nqrduck_autotm/AutoTM_controller.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/nqrduck_autotm/AutoTM_view.py b/src/nqrduck_autotm/AutoTM_view.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/nqrduck_autotm/__init__.py b/src/nqrduck_autotm/__init__.py index e69de29..ee58352 100644 --- a/src/nqrduck_autotm/__init__.py +++ b/src/nqrduck_autotm/__init__.py @@ -0,0 +1 @@ +from .autotm import AutoTM as Module \ No newline at end of file diff --git a/src/nqrduck_autotm/autotm.py b/src/nqrduck_autotm/autotm.py new file mode 100644 index 0000000..9f4781b --- /dev/null +++ b/src/nqrduck_autotm/autotm.py @@ -0,0 +1,6 @@ +from nqrduck.module.module import Module +from .model import AutoTMModel +from .view import AutoTMView +from .controller import AutoTMController + +AutoTM = Module(AutoTMModel, AutoTMView, AutoTMController) \ No newline at end of file diff --git a/src/nqrduck_autotm/controller.py b/src/nqrduck_autotm/controller.py new file mode 100644 index 0000000..d16d5e5 --- /dev/null +++ b/src/nqrduck_autotm/controller.py @@ -0,0 +1,4 @@ +from nqrduck.module.module_controller import ModuleController + +class AutoTMController(ModuleController): + pass \ No newline at end of file diff --git a/src/nqrduck_autotm/AutoTM.py b/src/nqrduck_autotm/model.py similarity index 56% rename from src/nqrduck_autotm/AutoTM.py rename to src/nqrduck_autotm/model.py index e0ebd9b..04c195e 100644 --- a/src/nqrduck_autotm/AutoTM.py +++ b/src/nqrduck_autotm/model.py @@ -1,5 +1,4 @@ from nqrduck.module.module_model import ModuleModel -class AutoTM(ModuleModel): - - \ No newline at end of file +class AutoTMModel(ModuleModel): + pass \ No newline at end of file diff --git a/src/nqrduck_autotm/resources/AutoTM.ini b/src/nqrduck_autotm/resources/AutoTM.ini index aa1ed43..b44c797 100644 --- a/src/nqrduck_autotm/resources/AutoTM.ini +++ b/src/nqrduck_autotm/resources/AutoTM.ini @@ -1,12 +1,6 @@ [META] name = nqrduck-autotm category = Measurement +toolbar_name = Tuning and Matching tooltip = Application used for tuning and matching of the probe -[FILES] -config = resources/AutoTM.ini -widget_file = autotm_widget -toolbox_logo = resources/toolbox_logo.png - -[DEPENDECIES] -Spectrometer \ No newline at end of file diff --git a/src/nqrduck_autotm/resources/AutoTM_widget.ui b/src/nqrduck_autotm/resources/AutoTM_widget.ui deleted file mode 100644 index 730ba13..0000000 --- a/src/nqrduck_autotm/resources/AutoTM_widget.ui +++ /dev/null @@ -1,280 +0,0 @@ - - - Form - - - - 0 - 0 - 1280 - 645 - - - - Form - - - - - 310 - 0 - 831 - 651 - - - - - - - - - - - - 0 - 0 - 311 - 651 - - - - - - - - - - 12 - 50 - false - false - - - - Tuning and Matching Settings: - - - Qt::AlignCenter - - - - - - - - - Minimum Return Loss - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::LeftToRight - - - 15 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - dB - - - - - - - - - - - Frequency - - - - - - - Qt::Horizontal - - - - 80 - 20 - - - - - - - - 100 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - - 75 - 20 - - - - - - - - MHz - - - - - - - - - Start Tuning and Matching - - - - - - - - - - - - 12 - 50 - false - false - - - - Actions: - - - Qt::AlignCenter - - - - - - - Homing - - - - - - - Measure Return Loss - - - - - - - - - - - - - - - - - 12 - - - - Info Box: - - - Qt::AlignCenter - - - - - - - 0 - - - - - - - true - - - - - 0 - 0 - 301 - 296 - - - - - - - - - - - - - - - MplWidget - QWidget -
contrib/mplwidget.h
- 1 -
-
- - -
diff --git a/src/nqrduck_autotm/resources/autotm_widget.ui b/src/nqrduck_autotm/resources/autotm_widget.ui new file mode 100644 index 0000000..56feca3 --- /dev/null +++ b/src/nqrduck_autotm/resources/autotm_widget.ui @@ -0,0 +1,198 @@ + + + Form + + + + 0 + 0 + 1280 + 645 + + + + + 0 + 0 + + + + Form + + + + + + + + + 75 + true + + + + Connection Settings: + + + + + + + + + Port: + + + + + + + + + + Connect + + + + + + + + + + 75 + true + + + + T&M Type: + + + + + + + + + + + 75 + true + + + + Frequency Sweep: + + + + + + + + + + + + MHz + + + + + + + + + + MHz + + + + + + + Stop Frequency: + + + + + + + Start Frequency: + + + + + + + Start Sweep + + + + + + + + + T&M Settings + + + + + + + + 75 + true + + + + Info Box: + + + + + + + true + + + + + 0 + 0 + 273 + 255 + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + MplWidget + QWidget +
nqrduck/contrib/mplwidget.h
+ 1 +
+
+ + +
diff --git a/src/nqrduck_autotm/view.py b/src/nqrduck_autotm/view.py new file mode 100644 index 0000000..5a3971b --- /dev/null +++ b/src/nqrduck_autotm/view.py @@ -0,0 +1,16 @@ +import logging +from PyQt6.QtWidgets import QWidget +from nqrduck.module.module_view import ModuleView +from .widget import Ui_Form + +logger = logging.getLogger(__name__) + +class AutoTMView(ModuleView): + + def __init__(self, module): + super().__init__(module) + + widget = QWidget() + self._ui_form = Ui_Form() + self._ui_form.setupUi(self) + self.widget = widget \ No newline at end of file diff --git a/src/nqrduck_autotm/widget.py b/src/nqrduck_autotm/widget.py new file mode 100644 index 0000000..92c66b7 --- /dev/null +++ b/src/nqrduck_autotm/widget.py @@ -0,0 +1,135 @@ +# Form implementation generated from reading ui file '../Modules/nqrduck-autotm/src/nqrduck_autotm/resources/autotm_widget.ui' +# +# Created by: PyQt6 UI code generator 6.5.1 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_Form(object): + def setupUi(self, Form): + Form.setObjectName("Form") + Form.resize(1280, 645) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth()) + Form.setSizePolicy(sizePolicy) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.label_2 = QtWidgets.QLabel(parent=Form) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_2.setFont(font) + self.label_2.setObjectName("label_2") + self.verticalLayout_2.addWidget(self.label_2) + self.gridLayout_2 = QtWidgets.QGridLayout() + self.gridLayout_2.setObjectName("gridLayout_2") + self.label = QtWidgets.QLabel(parent=Form) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.portBox = QtWidgets.QComboBox(parent=Form) + self.portBox.setObjectName("portBox") + self.gridLayout_2.addWidget(self.portBox, 0, 1, 1, 1) + self.pushButton = QtWidgets.QPushButton(parent=Form) + self.pushButton.setObjectName("pushButton") + self.gridLayout_2.addWidget(self.pushButton, 1, 1, 1, 1) + self.verticalLayout_2.addLayout(self.gridLayout_2) + self.label_3 = QtWidgets.QLabel(parent=Form) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_3.setFont(font) + self.label_3.setObjectName("label_3") + self.verticalLayout_2.addWidget(self.label_3) + self.comboBox = QtWidgets.QComboBox(parent=Form) + self.comboBox.setObjectName("comboBox") + self.verticalLayout_2.addWidget(self.comboBox) + self.label_4 = QtWidgets.QLabel(parent=Form) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_4.setFont(font) + self.label_4.setObjectName("label_4") + self.verticalLayout_2.addWidget(self.label_4) + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.startEdit = QtWidgets.QLineEdit(parent=Form) + self.startEdit.setObjectName("startEdit") + self.gridLayout.addWidget(self.startEdit, 0, 1, 1, 1) + self.label_8 = QtWidgets.QLabel(parent=Form) + self.label_8.setObjectName("label_8") + self.gridLayout.addWidget(self.label_8, 1, 2, 1, 1) + self.stopEdit = QtWidgets.QLineEdit(parent=Form) + self.stopEdit.setObjectName("stopEdit") + self.gridLayout.addWidget(self.stopEdit, 1, 1, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=Form) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 0, 2, 1, 1) + self.label_7 = QtWidgets.QLabel(parent=Form) + self.label_7.setObjectName("label_7") + self.gridLayout.addWidget(self.label_7, 1, 0, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=Form) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) + self.pushButton_2 = QtWidgets.QPushButton(parent=Form) + self.pushButton_2.setObjectName("pushButton_2") + self.gridLayout.addWidget(self.pushButton_2, 2, 1, 1, 1) + self.verticalLayout_2.addLayout(self.gridLayout) + self.pushButton_3 = QtWidgets.QPushButton(parent=Form) + self.pushButton_3.setObjectName("pushButton_3") + self.verticalLayout_2.addWidget(self.pushButton_3) + self.label_9 = QtWidgets.QLabel(parent=Form) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_9.setFont(font) + self.label_9.setObjectName("label_9") + self.verticalLayout_2.addWidget(self.label_9) + self.scrollArea = QtWidgets.QScrollArea(parent=Form) + self.scrollArea.setWidgetResizable(True) + self.scrollArea.setObjectName("scrollArea") + self.scrollAreaWidgetContents = QtWidgets.QWidget() + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 273, 255)) + self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") + self.scrollArea.setWidget(self.scrollAreaWidgetContents) + self.verticalLayout_2.addWidget(self.scrollArea) + self.horizontalLayout_2.addLayout(self.verticalLayout_2) + self.verticalLayout_5 = QtWidgets.QVBoxLayout() + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.S11 = MplWidget(parent=Form) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.S11.sizePolicy().hasHeightForWidth()) + self.S11.setSizePolicy(sizePolicy) + self.S11.setObjectName("S11") + self.verticalLayout_5.addWidget(self.S11) + self.horizontalLayout_2.addLayout(self.verticalLayout_5) + self.horizontalLayout_2.setStretch(1, 1) + + self.retranslateUi(Form) + QtCore.QMetaObject.connectSlotsByName(Form) + + def retranslateUi(self, Form): + _translate = QtCore.QCoreApplication.translate + Form.setWindowTitle(_translate("Form", "Form")) + self.label_2.setText(_translate("Form", "Connection Settings:")) + self.label.setText(_translate("Form", "Port:")) + self.pushButton.setText(_translate("Form", "Connect")) + self.label_3.setText(_translate("Form", "T&M Type:")) + self.label_4.setText(_translate("Form", "Frequency Sweep:")) + self.label_8.setText(_translate("Form", "MHz")) + self.label_6.setText(_translate("Form", "MHz")) + self.label_7.setText(_translate("Form", "Stop Frequency:")) + self.label_5.setText(_translate("Form", "Start Frequency:")) + self.pushButton_2.setText(_translate("Form", "Start Sweep")) + self.pushButton_3.setText(_translate("Form", "T&M Settings")) + self.label_9.setText(_translate("Form", "Info Box:")) +from nqrduck.contrib.mplwidget import MplWidget