mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-12-30 12:18:09 +00:00
Initial commit
This commit is contained in:
commit
9a6f8e948a
15 changed files with 231 additions and 0 deletions
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal 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
21
LICENSE
Normal 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
0
README.md
Normal file
28
pyproject.toml
Normal file
28
pyproject.toml
Normal file
|
@ -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",
|
||||
]
|
||||
|
0
src/__init__.py
Normal file
0
src/__init__.py
Normal file
19
src/resources/spectrometer.ini
Normal file
19
src/resources/spectrometer.ini
Normal file
|
@ -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]
|
54
src/resources/spectrometer_widget.ui
Normal file
54
src/resources/spectrometer_widget.ui
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?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>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
<width>811</width>
|
||||
<height>611</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Spectrometer tests:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
21
src/spectrometer.py
Normal file
21
src/spectrometer.py
Normal file
|
@ -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)
|
||||
|
6
src/spectrometer_controller.py
Normal file
6
src/spectrometer_controller.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from core.module.module_controller import ModuleController
|
||||
|
||||
|
||||
class SpectrometerController(ModuleController):
|
||||
def __init__(self, model):
|
||||
super().__init__(model)
|
13
src/spectrometer_view.py
Normal file
13
src/spectrometer_view.py
Normal file
|
@ -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
|
39
src/spectrometer_widget.py
Normal file
39
src/spectrometer_widget.py
Normal file
|
@ -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:"))
|
8
src/spectrometers/LimeNQR/limenqr.py
Normal file
8
src/spectrometers/LimeNQR/limenqr.py
Normal file
|
@ -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
|
||||
|
0
src/spectrometers/LimeNQR/limenqr_view.py
Normal file
0
src/spectrometers/LimeNQR/limenqr_view.py
Normal file
0
src/spectrometers/Scout/scout.py
Normal file
0
src/spectrometers/Scout/scout.py
Normal file
0
src/spectrometers/Scout/scout_view.py
Normal file
0
src/spectrometers/Scout/scout_view.py
Normal file
Loading…
Reference in a new issue