mirror of
https://github.com/shizand/statapp.git
synced 2025-04-07 01:53:45 +03:00
Closes #2 --------- Co-authored-by: MisterMLiL <99662459+MisterMLiL@users.noreply.github.com>
35 lines
978 B
Python
35 lines
978 B
Python
from PySide2.QtCore import Slot
|
|
from PySide2.QtWidgets import QDialog
|
|
|
|
from statapp.ui.ui_generate_factor_window import Ui_GenerateFactorWindow
|
|
from statapp.models.combobox_model import ComboBoxModel
|
|
|
|
|
|
DIRECT_LINK = 0
|
|
INDIRECT_LINK = 1
|
|
|
|
|
|
class GenerateFactorWindow(QDialog):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.deviation = None
|
|
self.mat = None
|
|
self.typeConnection = None
|
|
self._typeComboBox = ComboBoxModel([
|
|
[DIRECT_LINK, "прямая"],
|
|
[INDIRECT_LINK, "обратная"]
|
|
])
|
|
|
|
self.ui = Ui_GenerateFactorWindow()
|
|
self.ui.setupUi(self)
|
|
self.ui.typeComboBox.setModel(self._typeComboBox)
|
|
|
|
@Slot()
|
|
def on_generatePushButton_clicked(self):
|
|
self.typeConnection = self._typeComboBox.rawData(self.ui.typeComboBox.currentIndex())[0]
|
|
|
|
self.mat = self.ui.matSpinBox.value()
|
|
self.deviation = self.ui.deviationSpinBox.value()
|
|
|
|
self.accept()
|