mirror of
https://github.com/nqrduck/nqrduck-module.git
synced 2024-11-04 09:20:03 +00:00
Initial commit.
This commit is contained in:
commit
b605781082
12 changed files with 207 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.
|
2
README.md
Normal file
2
README.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Introduction
|
||||
This is a template for a nqrduck module.
|
30
pyproject.toml
Normal file
30
pyproject.toml
Normal file
|
@ -0,0 +1,30 @@
|
|||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "nqrduck-module"
|
||||
version = "0.0.1"
|
||||
authors = [
|
||||
{ name="Julia Pfitzer", email="git@jupfi.me" },
|
||||
]
|
||||
|
||||
description = "A template for nqrduck modules."
|
||||
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-module" = "nqrduck_module.module:module"
|
4
src/nqrduck_module/__init__.py
Normal file
4
src/nqrduck_module/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
# If the module is called "duck" the following line would be:
|
||||
# from .duck import Duck as Module
|
||||
|
||||
from .module import Module as Module
|
13
src/nqrduck_module/controller.py
Normal file
13
src/nqrduck_module/controller.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from nqrduck.module.module_controller import ModuleController
|
||||
|
||||
# If the module is called "duck" the class would be called "DuckController"
|
||||
|
||||
class ModuleController(ModuleController):
|
||||
|
||||
def __init__(self, module):
|
||||
"""Initialize the controller."""
|
||||
super().__init__(module)
|
||||
|
||||
def on_loading(self):
|
||||
"""This method is called when the module is loaded."""
|
||||
pass
|
9
src/nqrduck_module/model.py
Normal file
9
src/nqrduck_module/model.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from nqrduck.module.module_model import ModuleModel
|
||||
|
||||
# If the module is called "duck" the class would be called "DuckModel"
|
||||
|
||||
class ModuleModel(ModuleModel):
|
||||
|
||||
def __init__(self, module):
|
||||
"""Initialize the model."""
|
||||
super().__init__(module)
|
14
src/nqrduck_module/module.py
Normal file
14
src/nqrduck_module/module.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from nqrduck.module.module import Module
|
||||
# If the module is called "duck" the following line would be:
|
||||
# from .model import DuckModel
|
||||
from .model import ModuleModel
|
||||
# If the module is called "duck" the following line would be:
|
||||
# from .view import DuckView
|
||||
from .view import ModuleView
|
||||
# If the module is called "duck" the following line would be:
|
||||
# from .controller import DuckController
|
||||
from .controller import ModuleController
|
||||
|
||||
# If the module is called "duck" the following line would be:
|
||||
# Duck = Module(DuckModel, DuckView, DuckController)
|
||||
module = Module(ModuleModel, ModuleView, ModuleController)
|
6
src/nqrduck_module/resources/module.ini
Normal file
6
src/nqrduck_module/resources/module.ini
Normal file
|
@ -0,0 +1,6 @@
|
|||
[META]
|
||||
name = nqrduck-module
|
||||
category = Measurement
|
||||
toolbar_name = MODULETOOLBARNAME
|
||||
tooltip = Template for a new module
|
||||
|
34
src/nqrduck_module/resources/module_widget.ui
Normal file
34
src/nqrduck_module/resources/module_widget.ui
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?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="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Test</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
19
src/nqrduck_module/view.py
Normal file
19
src/nqrduck_module/view.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from nqrduck.module.module_view import ModuleView
|
||||
|
||||
# This is the widget that is loaded into the module view.
|
||||
# It is generated from the .ui file in the same directory using the pyuic6 command.
|
||||
from .widget import Ui_Form
|
||||
|
||||
from PyQt6.QtWidgets import QWidget
|
||||
|
||||
# If the module is called "duck" the class would be called "DuckView"
|
||||
|
||||
class ModuleView(ModuleView):
|
||||
|
||||
def __init__(self, module):
|
||||
super().__init__(module)
|
||||
|
||||
widget = QWidget()
|
||||
self._ui_form = Ui_Form()
|
||||
self._ui_form.setupUi(self)
|
||||
self.widget = widget
|
33
src/nqrduck_module/widget.py
Normal file
33
src/nqrduck_module/widget.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Form implementation generated from reading ui file '../Modules/nqrduck-module/src/nqrduck_module/resources/module_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.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
|
||||
Form.setSizePolicy(sizePolicy)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.pushButton = QtWidgets.QPushButton(parent=Form)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.pushButton.setText(_translate("Form", "Test"))
|
Loading…
Reference in a new issue