forked from markwbrown/MAPIR_Camera_Control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MAPIR_Camera_Control.py
48 lines (43 loc) · 1.78 KB
/
MAPIR_Camera_Control.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
import os
from PyQt5.QtCore import QFile, QTextStream
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
from MAPIR_Processing_dockwidget import *
import breeze_resouces
modpath = os.path.dirname(os.path.realpath(__file__))
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
if __name__ == "__main__":
try:
app = QApplication(sys.argv)
# splash_pix = QPixmap(os.path.dirname(os.path.realpath(__file__)) + 'lut_legend_rgb.jpg')
#
# splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
# splash.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
# splash.setEnabled(True)
# progressBar = QProgressBar(splash)
# progressBar.setMaximum(30)
# progressBar.setGeometry(0, splash_pix.height() - 50, splash_pix.width(), 20)
# splash.show()
# for i in range(1, 31):
# progressBar.setValue(i)
# t = time.time()
# while time.time() < t + 0.1:
# app.processEvents()
file = QFile(resource_path("dark.qss"))
file.open(QFile.ReadOnly | QFile.Text)
stream = QTextStream(file)
app.setStyleSheet(stream.readAll())
myapp = MAPIR_ProcessingDockWidget()
myapp.setWindowIcon(QIcon(resource_path("C:\\Users\\Software\\Desktop\\GITHUB\\MAPIR_Camera_Control\\corn_logo_taskbar.png")))
myapp.show()
# splash.finish(myapp)
except Exception as e:
print(e)
sys.exit(app.exec_())