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_controller import SpectrometerController as Controller
from .spectrometer_view import SpectrometerView as View
from .spectrometer import Spectrometer as Module

View file

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

View file

@ -2,5 +2,5 @@ from nqrduck.module.module_controller import ModuleController
class SpectrometerController(ModuleController):
def __init__(self, model):
super().__init__(model)
def __init__(self, module):
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):
def __init__(self, model, controller):
super().__init__(model, controller)
def __init__(self, module):
super().__init__(module)
widget = QWidget()
self._ui_form = Ui_Form()
self._ui_form.setupUi(widget)
self._model.widget = widget
self._ui_form.setupUi(self)
self.widget = widget