mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-11-08 20:10:02 +00:00
Changed to new structure.
This commit is contained in:
parent
5d9a08c5e5
commit
4782eec806
5 changed files with 23 additions and 28 deletions
|
@ -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
|
|
@ -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)
|
|
@ -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)
|
10
src/nqrduck_spectrometer/spectrometer_model.py
Normal file
10
src/nqrduck_spectrometer/spectrometer_model.py
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue