-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI2.py
79 lines (62 loc) · 2.06 KB
/
GUI2.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from J import Ui_MainWindow
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import QMovie
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt, QTimer, QTime, QDate
from PyQt5.uic import loadUi
import sys
import time
from Jarvis_old import JARVIS
from Task import wishMe
from Listen import Suno
from Speak import Bol
class MainThread(QThread):
def __init__(self):
super(MainThread, self).__init__()
# def run(self):
# j = JARVIS()
# j.PROCESS_()
startExe = MainThread()
class GUI_MOVIE(QMainWindow):
def __init__(self):
super().__init__()
self.gui = Ui_MainWindow()
self.gui.setupUi(self)
# self.gui.btn_start.clicked(self.startTask)
self.gui.btn_start.clicked.connect(self.startTask)
self.gui.btn_stop.clicked.connect(self.close)
def startTask(self):
self.gui.label1 = QtGui.QMovie("public//initial.gif")
self.gui.gif_1.setMovie(self.gui.label1)
self.gui.label1.start()
self.gui.label2 = QtGui.QMovie("public//live.gif")
self.gui.gif_2.setMovie(self.gui.label2)
self.gui.label2.start()
self.gui.label4 = QtGui.QMovie("public//ring.gif")
self.gui.gif_4.setMovie(self.gui.label4)
self.gui.label4.start()
# wishMe()
timer = QTimer(self)
timer.timeout.connect(self.showTime)
timer.start(10)
startExe.start()
while True:
sentence = Suno()
# result = str(sentence)
if sentence == "bye":
exit()
else:
self.gui.txt_final.setText(sentence)
def showTime(self):
current_time = QTime.currentTime()
current_date = QDate.currentDate()
label_time = current_time.toString("hh:mm:ss")
label_date = current_date.toString(Qt.ISODate)
self.gui.ojb_t1.setText(label_date)
self.gui.obj_t2.setText(label_time)
GUIApp = QApplication(sys.argv)
jarvis_GUI = GUI_MOVIE()
jarvis_GUI.show()
exit(GUIApp.exec_())