mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-11-09 12:30:01 +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 import Spectrometer as Module
|
||||||
from .spectrometer_controller import SpectrometerController as Controller
|
|
||||||
from .spectrometer_view import SpectrometerView as View
|
|
|
@ -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)
|
|
@ -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)
|
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):
|
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
|
||||||
|
|
Loading…
Reference in a new issue