-
Notifications
You must be signed in to change notification settings - Fork 2
/
gui_launcher.py
57 lines (40 loc) · 1.35 KB
/
gui_launcher.py
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
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import sys
from PySide2.QtCore import QFile, QObject, Signal, QTimer
from PySide2.QtWidgets import QApplication
import pynomalous
from pynomalous.gui.widgets import PlotWidget, AllData, MainWindow, FileSelectorWindow
import math
import numpy as np
import matplotlib.style as mplstyle
mplstyle.use('fast')
class DSL(QObject):
dataChanged = Signal(list)
def __init__(self, parent=None):
# LOAD HMI
super().__init__(parent)
self.data = []
self.offset = 0
def mainLoop(self):
self.offset += 0.1
self.data = [math.sin(i) for i in np.arange(self.offset, self.offset+10, 0.1)]
# Send data to graph
self.dataChanged.emit(self.data)
# LOOP repeater
QTimer.singleShot(1000, self.mainLoop)
if __name__ == "__main__":
app = QApplication(sys.argv)
dsl = DSL()
dsl.mainLoop()
main_window = MainWindow()
file_selector_window = FileSelectorWindow()
file_selector_window.show()
def main_window_launcher():
file_selector_window.close()
file_name = file_selector_window.file_input.text()
age = file_selector_window.age_input.text()
pyn = pynomalous.Pynomalous()
main_window.show()
file_selector_window.button.clicked.connect(main_window_launcher)
sys.exit(app.exec_())