-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jarvis_brain_gui.py
75 lines (56 loc) · 2.12 KB
/
Jarvis_brain_gui.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
from jarvisgui import Ui_MainWindow
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import QTimer, QTime, QDate, Qt
from PyQt5.QtGui import QMovie
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUiType
import main
import sys
import datetime
class MainThread(QThread):
def __init__(self):
super(MainThread,self).__init__()
def run(self):
main.executer()
StartExe = MainThread()
class Gui_start(QMainWindow):
def __init__(self):
super().__init__()
self.gui = Ui_MainWindow()
self.gui.setupUi(self)
self.gui.triggerjarvis.clicked.connect(self.startTask)
self.gui.shutengine.clicked.connect(self.close)
def startTask(self):
self.gui.label1 = QtGui.QMovie("GUI images//system initialising.gif")
self.gui.initialising.setMovie(self.gui.label1)
self.gui.label1.start()
self.gui.label2 = QtGui.QMovie("GUI images//background.gif")
self.gui.backgroud.setMovie(self.gui.label2)
self.gui.label2.start()
self.gui.label3 = QtGui.QMovie("GUI images//tumblr_nrqm32yH3W1r6xm5co1_640.gif")
self.gui.voice.setMovie(self.gui.label3)
self.gui.label3.start()
#timer = QTimer(self)
#timer.timeout.connect(self)
#tmer.start(999)
#crt = QTime.currentTime()
#crdt = QDate.currentDate()
#time = crt.toString('hh:mm:ss')
#date = crdt.toString()
#self.gui.datetime.setText(date+" "+time)
tnow = datetime.datetime.now().strftime('%H:%M:%S') #this shows entry log time
self.gui.datetime.setText(tnow) #this shows entry log time
self.gui.jarvisstatus.setText("ONLINE")
self.gui.databasestatus.setText("OFFLINE")
self.gui.temp.setText("27°C")
if main.database_variable == 1 :
self.gui.databasestatus.setText("ONLINE")
StartExe.start()
def database(self):
self.gui.databasestatus.setText("ONLINE")
Gui_App = QApplication(sys.argv)
Gui_Jarvis = Gui_start()
Gui_Jarvis.show()
exit(Gui_App.exec_())