Changed to new structure.

This commit is contained in:
jupfi 2023-07-01 16:19:52 +02:00
parent 5d9a08c5e5
commit 4782eec806
5 changed files with 23 additions and 28 deletions

View file

@ -1,3 +1 @@
from .spectrometer import Spectrometer as Model from .spectrometer import Spectrometer as Module
from .spectrometer_controller import SpectrometerController as Controller
from .spectrometer_view import SpectrometerView as View

View file

@ -1,21 +1,8 @@
from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtCore import pyqtSignal, QObject
from nqrduck.module.module_model import ModuleModel from nqrduck.module.module import Module
from nqrduck_spectrometer.spectrometer_model import SpectrometerModel
from nqrduck_spectrometer.spectrometer_view import SpectrometerView
class Spectrometer(ModuleModel): from nqrduck_spectrometer.spectrometer_controller import SpectrometerController
widget_changed = pyqtSignal(QObject) from nqrduck_spectrometer.spectrometer_widget import Ui_Form
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)
Spectrometer = Module(SpectrometerModel, SpectrometerController, SpectrometerView)

View file

@ -2,5 +2,5 @@ from nqrduck.module.module_controller import ModuleController
class SpectrometerController(ModuleController): class SpectrometerController(ModuleController):
def __init__(self, model): def __init__(self, module):
super().__init__(model) super().__init__(module)

View file

@ -0,0 +1,10 @@
from PyQt5.QtCore import pyqtSignal, QObject
from nqrduck.module.module_model import ModuleModel
class SpectrometerModel(ModuleModel):
spectrometer_changed = pyqtSignal()
@property
def spectrometer(self):
return self._spectrometer

View file

@ -4,10 +4,10 @@ from .spectrometer_widget import Ui_Form
class SpectrometerView(ModuleView): class SpectrometerView(ModuleView):
def __init__(self, model, controller): def __init__(self, module):
super().__init__(model, controller) super().__init__(module)
widget = QWidget() widget = QWidget()
self._ui_form = Ui_Form() self._ui_form = Ui_Form()
self._ui_form.setupUi(widget) self._ui_form.setupUi(self)
self._model.widget = widget self.widget = widget