-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpca_input.py
More file actions
70 lines (58 loc) · 2.71 KB
/
pca_input.py
File metadata and controls
70 lines (58 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
class Ui_MainWindow(object):
def __init__(self):
self.pca_number = 0
def setupUi(self, MainWindow):
self.MainWindow = MainWindow
self.MainWindow.setObjectName("MainWindow")
self.MainWindow.resize(526, 255)
self.MainWindow.setStyleSheet("background-color: rgb(222, 224, 255);\n"
"color: rgb(0, 0, 0);\n"
"font: 12pt \"Berlin Sans FB\";")
self.centralwidget = QtWidgets.QWidget(self.MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(140, 150, 231, 61))
self.pushButton.setStyleSheet("QPushButton {"
" background-color: rgb(169, 169, 253);"
" color: rgb(0, 0, 0);"
"}"
"QPushButton:hover {"
" background-color: rgb(134, 67, 0);"
" color: rgb(255, 255, 255);"
"}")
self.pushButton.setObjectName("pushButton")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(90, 50, 231, 61))
self.label.setObjectName("label")
self.spinBox = QtWidgets.QSpinBox(self.centralwidget)
self.spinBox.setGeometry(QtCore.QRect(290, 60, 141, 51))
self.spinBox.setStyleSheet("background-color: rgb(110, 65, 97);\n"
"color: rgb(255, 255, 255);")
self.spinBox.setMinimum(7)
self.spinBox.setObjectName("spinBox")
self.MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(self.MainWindow)
self.statusbar.setObjectName("statusbar")
self.MainWindow.setStatusBar(self.statusbar)
self.retranslateUi()
QtCore.QMetaObject.connectSlotsByName(self.MainWindow)
self.pushButton.clicked.connect(self.pca_push)
def retranslateUi(self):
_translate = QtCore.QCoreApplication.translate
self.MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.pushButton.setText(_translate("MainWindow", "Do PCA Analysis"))
self.label.setText(_translate("MainWindow", "Number of PCs:"))
def pca_push(self):
self.pca_number = self.spinBox.value()
self.MainWindow.close()
def get_pca(self):
return self.pca_number
def main(app):
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
app.exec_()
return ui.get_pca()