fix: обновляет до PySide2

This commit is contained in:
Maxim Slipenko 2023-09-27 13:16:29 +03:00
parent 62d689eff3
commit 3824a098a9
5 changed files with 15 additions and 33 deletions

View File

@ -1,6 +1,5 @@
from PySide6.QtCore import Slot
from PySide6.QtGui import QIntValidator
from PySide6.QtWidgets import QDialog
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

View File

@ -8,6 +8,7 @@ from statapp.generate_window import GenerateWindow
from statapp.about_window import AboutWindow
from statapp.ui.ui_main_window import Ui_MainWindow
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
@ -22,36 +23,27 @@ class MainWindow(QMainWindow):
gw = GenerateWindow()
if gw.exec():
y = np.random.normal(gw.mat, gw.deviation, size=(gw.count, 1))
# self.model._data = y
self.model.updateAllData(y)
@Slot()
def on_generateXaction_triggered(self):
gfw = GenerateFactorWindow()
# dd = np.array([])
if gfw.exec():
y = self.model.getY()
yMat = np.mean(y)
x_arr = np.array([])
# y - 5 x1 - прямая 4 -> 6
# 7
#
#
dd = np.array([])
for cur_y in y:
k = np.abs(cur_y / yMat)
if k > 1:
k = 2 - 1 / k
if gfw.typeConnection == INDIRECT_LINK:
k = 1 / k
# def f(x):
# x = np.abs(x)
# return 2.01375 - (1 / np.exp(x - 0.7))
# k = f(k)
x = np.random.normal(gfw.mat * (k ** 3), gfw.deviation * k, size=1)
x_arr = np.append(x_arr, x)
# if (x > gfw.mat and cur_y > yMat) or (x < gfw.mat and cur_y < yMat):
@ -61,7 +53,6 @@ class MainWindow(QMainWindow):
data = self.model.getData()
# self.model._data = y
x_arr = x_arr.reshape(len(x_arr), 1)
# dd = dd.reshape(len(dd), 1)
data = np.concatenate((data, x_arr), axis=1)

View File

@ -1,4 +1,4 @@
from PySide6.QtCore import QAbstractListModel, Qt
from PySide2.QtCore import QAbstractListModel, Qt
class ComboBoxModel(QAbstractListModel):

View File

@ -3,21 +3,15 @@
################################################################################
## Form generated from reading UI file 'generate_factor_window.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QComboBox, QDialog, QDoubleSpinBox,
QGridLayout, QLabel, QPushButton, QSizePolicy,
QWidget)
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
class Ui_GenerateFactorWindow(object):
def setupUi(self, GenerateFactorWindow):
@ -93,4 +87,3 @@ class Ui_GenerateFactorWindow(object):
self.typeComboBox.setCurrentText("")
self.typeComboBox.setPlaceholderText("")
# retranslateUi

View File

@ -17,7 +17,7 @@ class Ui_GenerateWindow(object):
def setupUi(self, GenerateWindow):
if not GenerateWindow.objectName():
GenerateWindow.setObjectName(u"GenerateWindow")
GenerateWindow.resize(503, 381)
GenerateWindow.resize(503, 182)
font = QFont()
font.setPointSize(12)
GenerateWindow.setFont(font)
@ -83,4 +83,3 @@ class Ui_GenerateWindow(object):
self.label_3.setText(QCoreApplication.translate("GenerateWindow", u"\u0421\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435", None))
self.label.setText(QCoreApplication.translate("GenerateWindow", u"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439", None))
# retranslateUi