LiquidGUI [1.0.3.0] Release
- Updated PySide package version. - GUI improvements with emoji.
This commit is contained in:
@@ -1,35 +1,45 @@
|
||||
import sys
|
||||
import qdarktheme
|
||||
import win32mica
|
||||
import resources
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton
|
||||
import resources, pkg_resources.extern
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar
|
||||
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
||||
from PySide6.QtGui import QFont, QIcon
|
||||
from LiquidCTL_Helper import LiquidCTL_Helper
|
||||
from MessageHandler import MessageHandler
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, lctl):
|
||||
super(MainWindow, self).__init__()
|
||||
self.setWindowTitle("LiquidGUI (v.1.0.2.0)")
|
||||
self.setFixedSize(450, 350)
|
||||
self.setWindowTitle("LiquidGUI (v.1.0.3.0)")
|
||||
self.setFixedSize(450, 385)
|
||||
|
||||
self.lctl = lctl
|
||||
|
||||
# Widgets Style ####################################
|
||||
lbl_style = QFont("Calibri", 12, weight=QFont.Weight.Bold)
|
||||
lbl_align = Qt.AlignmentFlag.AlignCenter
|
||||
|
||||
# Widgets ##########################################
|
||||
self.lbl_device_name = QLabel(font=QFont("Calibri", 16, weight=QFont.Weight.Bold))
|
||||
self.lbl_temp = QLabel("Liquid Temperature:")
|
||||
self.prg_temp = QProgressBar(format="%v°C",
|
||||
self.lbl_temp = QLabel("💧 Liquid Temperature:",
|
||||
font=lbl_style)
|
||||
self.prg_temp = QProgressBar(textVisible=False,
|
||||
minimum=0,
|
||||
maximum=50)
|
||||
self.lbl_fanSpeed = QLabel("Fan Speed:")
|
||||
self.prg_fanSpeed = QProgressBar(format="%v rpm",
|
||||
self.lbl_prg_temp = QLabel(alignment=lbl_align)
|
||||
self.lbl_fanSpeed = QLabel("🍃 Fan Speed:",
|
||||
font=lbl_style)
|
||||
self.prg_fanSpeed = QProgressBar(textVisible=False,
|
||||
minimum=520,
|
||||
maximum=1700)
|
||||
self.lbl_pumpSpeed = QLabel("Pump Speed:")
|
||||
self.prg_pumpSpeed = QProgressBar(format="%v rpm",
|
||||
self.lbl_prg_fanSpeed = QLabel(alignment=lbl_align)
|
||||
self.lbl_pumpSpeed = QLabel("⛽ Pump Speed:",
|
||||
font=lbl_style)
|
||||
self.prg_pumpSpeed = QProgressBar(textVisible=False,
|
||||
minimum=1900,
|
||||
maximum=2700)
|
||||
self.lbl_prg_pumpSpeed = QLabel(alignment=lbl_align)
|
||||
self.lbl_fwVers = QLabel(alignment=Qt.AlignmentFlag.AlignRight)
|
||||
|
||||
# Layout ##########################################
|
||||
@@ -38,16 +48,19 @@ class MainWindow(QMainWindow):
|
||||
layout.addWidget(self.lbl_device_name)
|
||||
layout.addWidget(self.lbl_temp)
|
||||
layout.addWidget(self.prg_temp)
|
||||
layout.addWidget(self.lbl_prg_temp)
|
||||
layout.addWidget(self.lbl_fanSpeed)
|
||||
layout.addWidget(self.prg_fanSpeed)
|
||||
layout.addWidget(self.lbl_prg_fanSpeed)
|
||||
layout.addWidget(self.lbl_pumpSpeed)
|
||||
layout.addWidget(self.prg_pumpSpeed)
|
||||
layout.addWidget(self.lbl_prg_pumpSpeed)
|
||||
layout.addWidget(self.lbl_fwVers)
|
||||
layout.setSpacing(10)
|
||||
|
||||
self.setLayout(layout)
|
||||
self.setCentralWidget(widget)
|
||||
self.setContentsMargins(40, 20, 40, 20)
|
||||
self.setContentsMargins(20, 20, 20, 20)
|
||||
|
||||
# Threading #######################################
|
||||
self.thread_manager = QThreadPool()
|
||||
@@ -56,16 +69,20 @@ class MainWindow(QMainWindow):
|
||||
self.timer.setInterval(1000)
|
||||
self.timer.timeout.connect(lambda: self.thread_manager.start(self.lctl.Update))
|
||||
self.timer.timeout.connect(self.update_widgets)
|
||||
self.timer.start()
|
||||
self.timer.start()
|
||||
|
||||
def update_widgets(self):
|
||||
self.lbl_device_name.setText(self.lctl.device_name)
|
||||
self.lbl_device_name.setText("- "+self.lctl.device_name+" -")
|
||||
self.prg_temp.setValue(self.lctl.device_temp)
|
||||
self.lbl_prg_temp.setText(str(self.lctl.device_temp)+"°C")
|
||||
self.prg_fanSpeed.setValue(self.lctl.device_fanSpeed)
|
||||
self.lbl_prg_fanSpeed.setText(str(self.lctl.device_fanSpeed)+" rpm")
|
||||
self.prg_pumpSpeed.setValue(self.lctl.device_pumpSpeed)
|
||||
if self.lctl.device_fwVers != None:
|
||||
self.lbl_prg_pumpSpeed.setText(str(self.lctl.device_pumpSpeed)+" rpm")
|
||||
if self.lctl.device_fwVers is not None:
|
||||
self.lbl_fwVers.setText(f"Firmware: v{self.lctl.device_fwVers}")
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||
@@ -80,11 +97,11 @@ def main():
|
||||
MessageHandler().ShowNoDevicesFoundError()
|
||||
sys.exit(1)
|
||||
else:
|
||||
qdarktheme.setup_theme("dark", custom_colors={"background": "#00000000"})
|
||||
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
|
||||
|
||||
window.show()
|
||||
app.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# Resource object code (Python 3)
|
||||
# Created by: object code
|
||||
# Created by: The Resource Compiler for Qt version 6.5.2
|
||||
# Created by: The Resource Compiler for Qt version 6.7.2
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PySide6 import QtCore
|
||||
@@ -2621,7 +2621,7 @@ qt_resource_struct = b"\
|
||||
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
|
||||
\x00\x00\x00\x00\x00\x00\x00\x00\
|
||||
\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
|
||||
\x00\x00\x01\x8e*\x09\xdc\x8c\
|
||||
\x00\x00\x01\x90f\x0b\xfe\xb4\
|
||||
"
|
||||
|
||||
def qInitResources():
|
||||
|
||||
+2633
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user