Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03ff5f1f66 |
Vendored
-1
@@ -3,4 +3,3 @@ dist
|
|||||||
build
|
build
|
||||||
.venv
|
.venv
|
||||||
LiquidGUI.spec
|
LiquidGUI.spec
|
||||||
.idea
|
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
from liquidctl import find_liquidctl_devices, cli
|
|
||||||
|
|
||||||
class LiquidCTL_Helper():
|
|
||||||
device_name = None
|
|
||||||
device_temp = 0
|
|
||||||
device_fanSpeed = 0
|
|
||||||
device_pumpSpeed = 0
|
|
||||||
device_fwVers = None
|
|
||||||
|
|
||||||
devices = find_liquidctl_devices()
|
|
||||||
try:
|
|
||||||
for dev in devices:
|
|
||||||
with dev.connect():
|
|
||||||
#print(f'{dev.description}')
|
|
||||||
device_name = dev.description
|
|
||||||
device_fwVers = ''.join(map(str, dev.firmware_version))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def ForceInit(self):
|
|
||||||
init_status = self.dev.initialize()
|
|
||||||
if init_status:
|
|
||||||
for key, value, unit in init_status:
|
|
||||||
#print(f'- {key}: {value} {unit}')
|
|
||||||
device_fwVers = value
|
|
||||||
|
|
||||||
def TestConnectionState(self):
|
|
||||||
if self.device_name != None:
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
|
|
||||||
def Update(self):
|
|
||||||
with self.dev.connect():
|
|
||||||
status = self.dev.get_status()
|
|
||||||
for key, value, unit in status:
|
|
||||||
#print(f'- {key}: {value} {unit}')
|
|
||||||
if key == "Liquid temperature":
|
|
||||||
self.device_temp = value
|
|
||||||
elif key == "Fan speed":
|
|
||||||
self.device_fanSpeed = value
|
|
||||||
elif key == "Pump speed":
|
|
||||||
self.device_pumpSpeed = value
|
|
||||||
|
|
||||||
def SetFanSpeed(self, speed):
|
|
||||||
with self.dev.connect():
|
|
||||||
cli._device_set_speed(self.dev, args={"<temperature>": [],
|
|
||||||
"<channel>": "fan",
|
|
||||||
"<percentage>": [str(speed)]})
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 36 KiB |
@@ -1,11 +0,0 @@
|
|||||||
from PySide6.QtWidgets import QMessageBox
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
class MessageHandler():
|
|
||||||
def ShowNoDevicesFoundError(self):
|
|
||||||
msg = QMessageBox()
|
|
||||||
msg.setWindowTitle("LiquidGUI Error")
|
|
||||||
msg.setText("No suitable devices could be detected. Please ensure you have a cooler \
|
|
||||||
both compatible with LiquidCTL, and connected to the system.")
|
|
||||||
msg.setIcon(QMessageBox.Icon.Warning)
|
|
||||||
msg.exec()
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
call .venv\Scripts\activate.bat
|
call .venv\Scripts\activate.bat
|
||||||
pyside6-rcc.exe resources.qrc -o resources.py
|
pyside6-rcc.exe resources.qrc -o resources.py
|
||||||
pyinstaller.exe main.pyw --onefile --paths .venv\Lib\site-packages --icon resources\LiquidGUI.ico --name LiquidGUI --version-file file_version_info.txt
|
pyinstaller.exe main.pyw --onefile --paths .venv\Lib\site-packages --icon resources\LiquidGUI.ico --name LiquidGUI
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
class MinMaxCurrent:
|
|
||||||
def __init__(self):
|
|
||||||
self.min = 0
|
|
||||||
self.max = 0
|
|
||||||
self.cur = 0
|
|
||||||
|
|
||||||
def builder(self, _cur: int, _unit: str):
|
|
||||||
self.cur = _cur
|
|
||||||
|
|
||||||
if 0 in [self.max, self.min]:
|
|
||||||
self.max = _cur
|
|
||||||
self.min = _cur
|
|
||||||
|
|
||||||
if self.cur > self.max:
|
|
||||||
self.max = _cur
|
|
||||||
|
|
||||||
if self.cur < self.min:
|
|
||||||
self.min = _cur
|
|
||||||
|
|
||||||
return f"Current: {self.cur}{_unit}\n(Min: {self.min}{_unit} / Max: {self.max}{_unit})"
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# UTF-8
|
|
||||||
#
|
|
||||||
# For more details about fixed file info 'ffi' see:
|
|
||||||
# http://msdn.microsoft.com/en-us/library/ms646997.aspx
|
|
||||||
|
|
||||||
VSVersionInfo(
|
|
||||||
ffi=FixedFileInfo(
|
|
||||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
|
||||||
# Set not needed items to zero 0. Must always contain 4 elements.
|
|
||||||
filevers=(1,1,1,0),
|
|
||||||
prodvers=(1,1,1,0),
|
|
||||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
|
||||||
mask=0x3f,
|
|
||||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
|
||||||
flags=0x0,
|
|
||||||
# The operating system for which this file was designed.
|
|
||||||
# 0x4 - NT and there is no need to change it.
|
|
||||||
OS=0x40004,
|
|
||||||
# The general type of file.
|
|
||||||
# 0x1 - the file is an application.
|
|
||||||
fileType=0x1,
|
|
||||||
# The function of the file.
|
|
||||||
# 0x0 - the function is not defined for this fileType
|
|
||||||
subtype=0x0,
|
|
||||||
# Creation date and time stamp.
|
|
||||||
date=(0, 0)
|
|
||||||
),
|
|
||||||
kids=[
|
|
||||||
StringFileInfo(
|
|
||||||
[
|
|
||||||
StringTable(
|
|
||||||
u'040904B0',
|
|
||||||
[StringStruct(u'CompanyName', u'Fil Sapia'),
|
|
||||||
StringStruct(u'FileDescription', u'LiquidGUI'),
|
|
||||||
StringStruct(u'FileVersion', u'1.1.1.0'),
|
|
||||||
StringStruct(u'InternalName', u'LiquidGUI'),
|
|
||||||
StringStruct(u'LegalCopyright', u'© Fil Sapia. All rights reserved.'),
|
|
||||||
StringStruct(u'OriginalFilename', u'LiquidGUI.exe'),
|
|
||||||
StringStruct(u'ProductName', u'LiquidGUI'),
|
|
||||||
StringStruct(u'ProductVersion', u'1.1.1.0')])
|
|
||||||
]),
|
|
||||||
VarFileInfo([VarStruct(u'Translation', [0, 1200, 1033, 1252])])
|
|
||||||
]
|
|
||||||
)
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
from liquidctl import find_liquidctl_devices
|
||||||
|
|
||||||
|
class LiquidCTL_Init():
|
||||||
|
device_name = None
|
||||||
|
device_temp = 0
|
||||||
|
device_fanSpeed = 0
|
||||||
|
device_pumpSpeed = 0
|
||||||
|
device_fwVers = 0
|
||||||
|
|
||||||
|
devices = find_liquidctl_devices()
|
||||||
|
for dev in devices:
|
||||||
|
with dev.connect():
|
||||||
|
#print(f'{dev.description}')
|
||||||
|
device_name = dev.description
|
||||||
|
init_status = dev.initialize()
|
||||||
|
|
||||||
|
if init_status:
|
||||||
|
for key, value, unit in init_status:
|
||||||
|
#print(f'- {key}: {value} {unit}')
|
||||||
|
device_fwVers = value
|
||||||
|
|
||||||
|
def Update(self):
|
||||||
|
with self.dev.connect():
|
||||||
|
status = self.dev.get_status()
|
||||||
|
for key, value, unit in status:
|
||||||
|
#print(f'- {key}: {value} {unit}')
|
||||||
|
if key == "Liquid temperature":
|
||||||
|
self.device_temp = value
|
||||||
|
elif key == "Fan speed":
|
||||||
|
self.device_fanSpeed = value
|
||||||
|
elif key == "Pump speed":
|
||||||
|
self.device_pumpSpeed = value
|
||||||
@@ -1,137 +1,83 @@
|
|||||||
# External Dependencies
|
|
||||||
import sys
|
import sys
|
||||||
|
import qdarktheme
|
||||||
import win32mica
|
import win32mica
|
||||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton
|
import liquidctl_worker
|
||||||
|
import resources
|
||||||
|
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QGroupBox
|
||||||
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
||||||
from PySide6.QtGui import QFont, QIcon
|
from PySide6.QtGui import QFont, QIcon
|
||||||
# Internal Imports
|
|
||||||
from LiquidCTL_Helper import LiquidCTL_Helper
|
|
||||||
from MessageHandler import MessageHandler
|
|
||||||
from styles.SubLabel import SubLabel
|
|
||||||
from styles.SubLabelValue import SubLabelValue
|
|
||||||
import common
|
|
||||||
import resources, pkg_resources.extern
|
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
""" Main application window. """
|
def __init__(self):
|
||||||
|
|
||||||
def __init__(self, lctl):
|
|
||||||
super(MainWindow, self).__init__()
|
super(MainWindow, self).__init__()
|
||||||
self.setWindowTitle("LiquidGUI (v.1.1.1.0)")
|
self.setWindowTitle("LiquidGUI (v.1.0.0.1)")
|
||||||
self.setFixedSize(450, 450)
|
self.setFixedSize(450, 300)
|
||||||
|
self.setWindowFlags(Qt.WindowType.Dialog)
|
||||||
|
widget = QWidget(self)
|
||||||
|
|
||||||
self.lctl = lctl
|
font_style = QFont("Calibri", 16, weight=QFont.Weight.Bold)
|
||||||
|
|
||||||
# Widgets ##########################################
|
self.lbl_device_name = QLabel()
|
||||||
self.lbl_device_name = QLabel(font=QFont("Calibri",
|
self.lbl_device_name.setFont(font_style)
|
||||||
18,
|
self.lbl_temp = QLabel("Liquid Temperature:")
|
||||||
weight=QFont.Weight.Bold),
|
self.prg_temp = QProgressBar(format="%v°C",
|
||||||
alignment=Qt.AlignmentFlag.AlignCenter)
|
|
||||||
|
|
||||||
self.lbl_temp = SubLabel(value="💧 Liquid Temperature:")
|
|
||||||
self.min_max_cur_temp = common.MinMaxCurrent()
|
|
||||||
self.prg_temp = QProgressBar(textVisible=False,
|
|
||||||
minimum=0,
|
minimum=0,
|
||||||
maximum=50)
|
maximum=50)
|
||||||
self.lbl_value_prg_temp = SubLabelValue()
|
self.lbl_fanSpeed = QLabel("Fan Speed:")
|
||||||
|
self.prg_fanSpeed = QProgressBar(format="%v rpm",
|
||||||
self.lbl_fanspeed = SubLabel(value="🍃 Fan Speed:")
|
|
||||||
self.min_max_cur_fanspeed = common.MinMaxCurrent()
|
|
||||||
self.prg_fanspeed = QProgressBar(textVisible=False,
|
|
||||||
minimum=520,
|
minimum=520,
|
||||||
maximum=1700)
|
maximum=1700)
|
||||||
self.lbl_value_prg_fanspeed = SubLabelValue()
|
self.lbl_pumpSpeed = QLabel("Pump Speed:")
|
||||||
|
self.prg_pumpSpeed = QProgressBar(format="%v rpm",
|
||||||
self.lbl_pumpspeed = SubLabel(value="⛽ Pump Speed:")
|
|
||||||
self.min_max_cur_pumpspeed = common.MinMaxCurrent()
|
|
||||||
self.prg_pumpspeed = QProgressBar(textVisible=False,
|
|
||||||
minimum=1900,
|
minimum=1900,
|
||||||
maximum=2700)
|
maximum=2700)
|
||||||
self.lbl_value_prg_pumpspeed = SubLabelValue()
|
self.lbl_fwVers = QLabel()
|
||||||
self.btn_reset_min_max = QPushButton("Reset Min/Max")
|
|
||||||
self.btn_reset_min_max.clicked.connect(self.on_reset_min_max)
|
|
||||||
|
|
||||||
self.lbl_fwvers = SubLabelValue()
|
|
||||||
|
|
||||||
# Layout ##########################################
|
|
||||||
widget = QWidget(self)
|
|
||||||
layout = QVBoxLayout(widget)
|
layout = QVBoxLayout(widget)
|
||||||
layout.addWidget(self.lbl_device_name)
|
layout.addWidget(self.lbl_device_name)
|
||||||
layout.addWidget(self.lbl_temp)
|
layout.addWidget(self.lbl_temp)
|
||||||
layout.addWidget(self.prg_temp)
|
layout.addWidget(self.prg_temp)
|
||||||
layout.addWidget(self.lbl_value_prg_temp)
|
layout.addWidget(self.lbl_fanSpeed)
|
||||||
layout.addWidget(self.lbl_fanspeed)
|
layout.addWidget(self.prg_fanSpeed)
|
||||||
layout.addWidget(self.prg_fanspeed)
|
layout.addWidget(self.lbl_pumpSpeed)
|
||||||
layout.addWidget(self.lbl_value_prg_fanspeed)
|
layout.addWidget(self.prg_pumpSpeed)
|
||||||
layout.addWidget(self.lbl_pumpspeed)
|
layout.addWidget(self.lbl_fwVers)
|
||||||
layout.addWidget(self.prg_pumpspeed)
|
|
||||||
layout.addWidget(self.lbl_value_prg_pumpspeed)
|
|
||||||
layout.addWidget(self.lbl_fwvers)
|
|
||||||
layout.addWidget(self.btn_reset_min_max)
|
|
||||||
|
|
||||||
layout.setSpacing(10)
|
layout.setSpacing(10)
|
||||||
|
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
self.setCentralWidget(widget)
|
self.setCentralWidget(widget)
|
||||||
self.setContentsMargins(20, 20, 20, 20)
|
self.setContentsMargins(40, 20, 40, 20)
|
||||||
|
|
||||||
# Threading #######################################
|
|
||||||
self.thread_manager = QThreadPool()
|
self.thread_manager = QThreadPool()
|
||||||
|
|
||||||
self.timer = QTimer()
|
self.timer = QTimer()
|
||||||
self.timer.setInterval(1000)
|
self.timer.setInterval(1000)
|
||||||
self.timer.timeout.connect(lambda: self.thread_manager.start(self.lctl.Update))
|
self.timer.timeout.connect(lambda: self.thread_manager.start(lctl_worker.Update))
|
||||||
self.timer.timeout.connect(self.update_widgets)
|
self.timer.timeout.connect(self.update_widgets)
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
|
||||||
def on_reset_min_max(self):
|
|
||||||
""" Pauses the timer and creates new instances of MinMaxCurrent """
|
|
||||||
self.timer.stop()
|
|
||||||
self.min_max_cur_temp = common.MinMaxCurrent()
|
|
||||||
self.min_max_cur_fanspeed = common.MinMaxCurrent()
|
|
||||||
self.min_max_cur_pumpspeed = common.MinMaxCurrent()
|
|
||||||
self.timer.start()
|
|
||||||
|
|
||||||
def update_widgets(self):
|
def update_widgets(self):
|
||||||
""" Update widgets using LiquidCTL library."""
|
self.lbl_device_name.setText(lctl_worker.device_name)
|
||||||
self.lbl_device_name.setText(self.lctl.device_name)
|
self.prg_temp.setValue(lctl_worker.device_temp)
|
||||||
self.prg_temp.setValue(self.lctl.device_temp)
|
self.prg_fanSpeed.setValue(lctl_worker.device_fanSpeed)
|
||||||
self.lbl_value_prg_temp.setText(
|
self.prg_pumpSpeed.setValue(lctl_worker.device_pumpSpeed)
|
||||||
self.min_max_cur_temp.builder(
|
if lctl_worker.device_fwVers != 0 or None:
|
||||||
self.lctl.device_temp, "°C"))
|
self.lbl_fwVers.setText(f"Firmware: v{lctl_worker.device_fwVers}")
|
||||||
self.prg_fanspeed.setValue(self.lctl.device_fanSpeed)
|
|
||||||
self.lbl_value_prg_fanspeed.setText(
|
app = QApplication(sys.argv)
|
||||||
self.min_max_cur_fanspeed.builder(
|
|
||||||
self.lctl.device_fanSpeed, " rpm"))
|
|
||||||
self.prg_pumpspeed.setValue(self.lctl.device_pumpSpeed)
|
|
||||||
self.lbl_value_prg_pumpspeed.setText(
|
|
||||||
self.min_max_cur_pumpspeed.builder(
|
|
||||||
self.lctl.device_pumpSpeed, " rpm"))
|
|
||||||
if self.lctl.device_fwVers is not None:
|
|
||||||
self.lbl_fwvers.setText(f"Firmware: v{self.lctl.device_fwVers}")
|
|
||||||
|
|
||||||
|
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||||
|
app.setWindowIcon(icon)
|
||||||
|
|
||||||
def main():
|
lctl_worker = liquidctl_worker.LiquidCTL_Init()
|
||||||
""" Initialize application and setup window parameters. """
|
|
||||||
app = QApplication(sys.argv)
|
|
||||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
|
||||||
app.setWindowIcon(icon)
|
|
||||||
|
|
||||||
window = MainWindow(LiquidCTL_Helper())
|
window = MainWindow()
|
||||||
window.setWindowIcon(icon)
|
window.setWindowIcon(icon)
|
||||||
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||||
|
|
||||||
# Show error and quit app if no devices are found
|
qdarktheme.setup_theme("dark", custom_colors={"background": "#00000000"})
|
||||||
if window.lctl.TestConnectionState():
|
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
|
||||||
MessageHandler().ShowNoDevicesFoundError()
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
|
|
||||||
|
|
||||||
window.show()
|
window.show()
|
||||||
app.exec()
|
app.exec()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
Version: 1.1.0.1
|
|
||||||
CompanyName: Fil Sapia
|
|
||||||
FileDescription: LiquidGUI
|
|
||||||
InternalName: LiquidGUI
|
|
||||||
LegalCopyright: © Fil Sapia. All rights reserved.
|
|
||||||
OriginalFilename: LiquidGUI.exe
|
|
||||||
ProductName: LiquidGUI
|
|
||||||
Translation:
|
|
||||||
- langID: 0
|
|
||||||
charsetID: 1200
|
|
||||||
- langID: 1033
|
|
||||||
charsetID: 1252
|
|
||||||
Binary file not shown.
+2290
-2594
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
-2633
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
|||||||
from PySide6.QtWidgets import QLabel
|
|
||||||
from PySide6.QtGui import QFont
|
|
||||||
|
|
||||||
|
|
||||||
class SubLabel(QLabel):
|
|
||||||
""" Formatting for sub-labels. """
|
|
||||||
|
|
||||||
def __init__(self, value):
|
|
||||||
super().__init__()
|
|
||||||
self.setFont(QFont("Calibri", 12, weight=QFont.Weight.Bold))
|
|
||||||
self.setText(value)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
from PySide6.QtWidgets import QLabel
|
|
||||||
from PySide6.QtGui import QFont
|
|
||||||
from PySide6.QtCore import Qt
|
|
||||||
|
|
||||||
class SubLabelValue(QLabel):
|
|
||||||
""" Formatting for values. """
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
self.setAlignment(Qt.AlignmentFlag.AlignRight)
|
|
||||||
self.setFont(QFont("Cascadia Code", 8))
|
|
||||||
Reference in New Issue
Block a user