commit 9a6f8e948abe87f31080aeb21b79c4d1cc1551f9 Author: jupfi Date: Tue Jun 27 21:52:59 2023 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c1a36ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.pyc +*$py.class + +# Distribution / packaging +dist/ +build/ +*.egg-info/ + +# IDE-specific files +.idea/ +.vscode/ + +# Logs +*.log + +# Virtual environments +venv/ + +# Other +*.DS_Store \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..94b1433 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Julia Pfitzer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a42d1a2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "Broadband" +version = "0.0.1" +authors = [ + { name="Julia Pfitzer", email="git@jupfi.me" }, +] + +description = "A module for the NQRduck program (a simple python scriptâ„¢) to control different NQR/NMR spectrometers." +readme = "README.md" +license = { file="LICENSE" } +requires-python = ">=3.8" + +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +dependencies = [ + "matplotlib", + "pyqt5", + "NQRduck", +] + diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/resources/spectrometer.ini b/src/resources/spectrometer.ini new file mode 100644 index 0000000..ae45e4e --- /dev/null +++ b/src/resources/spectrometer.ini @@ -0,0 +1,19 @@ +[META] +name = Spectrometer +category = Hardware +tooltip = Application used to control the spectrometer + +[MVC] +model_file = spectrometer.py +model_class = Spectrometer +view_file = spectrometer_view.py +view_class = SpectrometerView +controller_file = spectrometer_controller.py +controller_class = SpectrometerController + +[FILES] +config = resources/spectrometer.ini +widget_file = spectrometer_widget.py +toolbox_logo = resources/toolbox_logo.png + +[DEPENDENCIES] diff --git a/src/resources/spectrometer_widget.ui b/src/resources/spectrometer_widget.ui new file mode 100644 index 0000000..8d23ccc --- /dev/null +++ b/src/resources/spectrometer_widget.ui @@ -0,0 +1,54 @@ + + + Form + + + + 0 + 0 + 800 + 600 + + + + Form + + + + + -1 + -1 + 811 + 611 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Spectrometer tests: + + + + + + + + + diff --git a/src/spectrometer.py b/src/spectrometer.py new file mode 100644 index 0000000..ef7ca35 --- /dev/null +++ b/src/spectrometer.py @@ -0,0 +1,21 @@ +from PyQt5.QtCore import pyqtSignal, QObject +from core.module.module_model import ModuleModel + + +class Spectrometer(ModuleModel): + widget_changed = pyqtSignal(QObject) + spectrometer_changed = pyqtSignal() + + @property + def spectrometer(self): + return self._spectrometer + + @property + def widget(self): + return self._widget + + @widget.setter + def widget(self, value): + self._widget = value + self.widget_changed.emit(value) + diff --git a/src/spectrometer_controller.py b/src/spectrometer_controller.py new file mode 100644 index 0000000..0456cdd --- /dev/null +++ b/src/spectrometer_controller.py @@ -0,0 +1,6 @@ +from core.module.module_controller import ModuleController + + +class SpectrometerController(ModuleController): + def __init__(self, model): + super().__init__(model) \ No newline at end of file diff --git a/src/spectrometer_view.py b/src/spectrometer_view.py new file mode 100644 index 0000000..9556d51 --- /dev/null +++ b/src/spectrometer_view.py @@ -0,0 +1,13 @@ +from PyQt5.QtWidgets import QWidget +from core.module.module_view import ModuleView +from modules.spectrometer.spectrometer_widget import Ui_Form + + +class SpectrometerView(ModuleView): + def __init__(self, model, controller): + super().__init__(model, controller) + + widget = QWidget() + self._ui_form = Ui_Form() + self._ui_form.setupUi(widget) + self._model.widget = widget diff --git a/src/spectrometer_widget.py b/src/spectrometer_widget.py new file mode 100644 index 0000000..beb0370 --- /dev/null +++ b/src/spectrometer_widget.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'modules/spectrometer/resources/spectrometer_widget.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Form(object): + def setupUi(self, Form): + Form.setObjectName("Form") + Form.resize(800, 600) + self.gridLayoutWidget = QtWidgets.QWidget(Form) + self.gridLayoutWidget.setGeometry(QtCore.QRect(-1, -1, 811, 611)) + self.gridLayoutWidget.setObjectName("gridLayoutWidget") + self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget) + self.gridLayout.setContentsMargins(0, 0, 0, 0) + self.gridLayout.setObjectName("gridLayout") + self.lineEdit = QtWidgets.QLineEdit(self.gridLayoutWidget) + self.lineEdit.setObjectName("lineEdit") + self.gridLayout.addWidget(self.lineEdit, 0, 2, 1, 1) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 0, 1, 1, 1) + self.label = QtWidgets.QLabel(self.gridLayoutWidget) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 1) + + self.retranslateUi(Form) + QtCore.QMetaObject.connectSlotsByName(Form) + + def retranslateUi(self, Form): + _translate = QtCore.QCoreApplication.translate + Form.setWindowTitle(_translate("Form", "Form")) + self.label.setText(_translate("Form", "Spectrometer tests:")) diff --git a/src/spectrometers/LimeNQR/limenqr.py b/src/spectrometers/LimeNQR/limenqr.py new file mode 100644 index 0000000..ec4d47f --- /dev/null +++ b/src/spectrometers/LimeNQR/limenqr.py @@ -0,0 +1,8 @@ +from ...spectrometer import Spectrometer + +class LimeNQR(Spectrometer): + def __init__(self, model, controller): + super(LimeNQR, self).__init__(model, controller) + self._model = model + self._controller = controller + \ No newline at end of file diff --git a/src/spectrometers/LimeNQR/limenqr_view.py b/src/spectrometers/LimeNQR/limenqr_view.py new file mode 100644 index 0000000..e69de29 diff --git a/src/spectrometers/Scout/scout.py b/src/spectrometers/Scout/scout.py new file mode 100644 index 0000000..e69de29 diff --git a/src/spectrometers/Scout/scout_view.py b/src/spectrometers/Scout/scout_view.py new file mode 100644 index 0000000..e69de29