Initial commit.

This commit is contained in:
jupfi 2023-07-17 10:18:06 +02:00
commit 896048ab39
12 changed files with 239 additions and 0 deletions

22
.gitignore vendored Normal file
View file

@ -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

21
LICENSE Normal file
View file

@ -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.

0
README.md Normal file
View file

33
pyproject.toml Normal file
View file

@ -0,0 +1,33 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[project]
name = "nqrduck-measurement"
version = "0.0.1"
authors = [
{ name="Julia Pfitzer", email="git@jupfi.me" },
]
description = "A module for the NQRduck program (a simple python script™) to perform single frequency measurements."
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",
"pyqt6",
"NQRduck",
]
[project.entry-points."nqrduck"]
"nqrduck-measurement" = "nqrduck_measurement.measurement:Measurement"

View file

@ -0,0 +1 @@
from .measurement import Measurement as Module

View file

@ -0,0 +1,8 @@
import logging
from nqrduck.module.module_controller import ModuleController
logger = logging.getLogger(__name__)
class MeasurementController(ModuleController):
def __init__(self, module):
super().__init__(module)

View file

@ -0,0 +1,6 @@
from nqrduck.module.module import Module
from .model import MeasurementModel
from .view import MeasurementView
from .controller import MeasurementController
Measurement = Module(MeasurementModel, MeasurementView, MeasurementController)

View file

@ -0,0 +1,8 @@
import logging
from nqrduck.module.module_model import ModuleModel
logger = logging.getLogger(__name__)
class MeasurementModel(ModuleModel):
def __init__(self, module) -> None:
super().__init__(module)

View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="buttonStart">
<property name="text">
<string>Start Measurement</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelSpectrometer">
<property name="text">
<string>Spectrometer:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="MplWidget" name="plotter" native="true"/>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MplWidget</class>
<extends>QWidget</extends>
<header>contrib/mplwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,10 @@
[META]
name = nqrduck-measurement
toolbar_name = Measurement
category = Measurement
tooltip = AModule to perform single frequency measurement
[FILES]
widget_file = measurement_widget.py
toolbox_logo = resources/toolbox_logo.png

View file

@ -0,0 +1,15 @@
import logging
from PyQt6.QtWidgets import QWidget
from .widget import Ui_Form
from nqrduck.module.module_view import ModuleView
logger = logging.getLogger(__name__)
class MeasurementView(ModuleView):
def __init__(self, module):
super().__init__(module)
widget = QWidget()
self._ui_form = Ui_Form()
self._ui_form.setupUi(self)
self.widget = widget

View file

@ -0,0 +1,51 @@
# Form implementation generated from reading ui file '../Modules/nqrduck-measurement/src/nqrduck_measurement/resources/measurement_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(1920, 1080)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout.setObjectName("horizontalLayout")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.buttonStart = QtWidgets.QPushButton(parent=Form)
self.buttonStart.setObjectName("buttonStart")
self.verticalLayout_2.addWidget(self.buttonStart)
self.labelSpectrometer = QtWidgets.QLabel(parent=Form)
self.labelSpectrometer.setObjectName("labelSpectrometer")
self.verticalLayout_2.addWidget(self.labelSpectrometer)
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.plotter = MplWidget(parent=Form)
self.plotter.setObjectName("plotter")
self.verticalLayout.addWidget(self.plotter)
self.horizontalLayout_2.addLayout(self.verticalLayout)
self.horizontalLayout.addLayout(self.horizontalLayout_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.buttonStart.setText(_translate("Form", "Start Measurement"))
self.labelSpectrometer.setText(_translate("Form", "Spectrometer:"))
from nqrduck.contrib.mplwidget import MplWidget