diff --git a/installer-inno-config.iss b/installer-inno-config.iss index bc68609..df0529f 100644 --- a/installer-inno-config.iss +++ b/installer-inno-config.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Thermal Control Center" -#define MyAppVersion "1.5.2" +#define MyAppVersion "1.5.3" #define MyAppPublisher "AlexIII" #define MyAppURL "https://github.com/AlexIII/tcc-g15" #define MyAppExeName "tcc-g15.exe" diff --git a/make-release.bat b/make-release.bat index c2a3ba7..f35d600 100644 --- a/make-release.bat +++ b/make-release.bat @@ -1,10 +1,10 @@ @echo off echo Compiling Portable version... -pyinstaller --icon=icons/gaugeIcon.ico --add-data icons/gaugeIcon.png;icons --add-data tcc_g15_task.xml;. -w -F -y src/tcc-g15.py || goto :error +pyinstaller --icon=icons/gaugeIcon.ico --add-data icons/gaugeIcon.png;icons --add-data tcc_g15_task.xml;. --hidden-import PySide6 -w -F -y src/tcc-g15.py || goto :error echo Compiling version for installer... -pyinstaller --icon=icons/gaugeIcon.ico --add-data icons/gaugeIcon.png;icons --add-data tcc_g15_task.xml;. -w -y src/tcc-g15.py || goto :error +pyinstaller --icon=icons/gaugeIcon.ico --add-data icons/gaugeIcon.png;icons --add-data tcc_g15_task.xml;. --hidden-import PySide6 -w -y src/tcc-g15.py || goto :error echo Compiling installer... "C:\Program Files (x86)\Inno Setup 6\iscc.exe" installer-inno-config.iss || goto :error diff --git a/src/GUI/AppGUI.py b/src/GUI/AppGUI.py index faf2fd8..d116022 100644 --- a/src/GUI/AppGUI.py +++ b/src/GUI/AppGUI.py @@ -93,9 +93,10 @@ class TCC_GUI(QtWidgets.QWidget): TEMP_UPD_PERIOD_MS = 1000 FAILSAFE_CPU_TEMP = 95 FAILSAFE_GPU_TEMP = 85 + FAILSAFE_TRIGGER_DELAY_SEC = 8 FAILSAFE_RESET_AFTER_TEMP_IS_OK_FOR_SEC = 60 APP_NAME = "Thermal Control Center for Dell G15" - APP_VERSION = "1.5.2" + APP_VERSION = "1.5.3" APP_DESCRIPTION = "This app is an open-source replacement for Alienware Control Center " APP_URL = "github.com/AlexIII/tcc-g15" @@ -104,8 +105,9 @@ class TCC_GUI(QtWidgets.QWidget): CPU_COLOR_LIMITS = (85, 95) # private - _failsafeTempIsHighTs = 0 - _failsafeTrippedPrevModeStr = None + _failsafeTempIsHighTs = 0 # Last time when the temp was registered to be high + _failsafeTempIsHighStartTs: Optional[int] = None # Time when the temp first registered to be high (without going lower than the threshold) + _failsafeTrippedPrevModeStr: Optional[str] = None # Mode (Custom, Balanced) before fail-safe tripped, as a string _failsafeOn = True def __init__(self, awcc: AWCCThermal): @@ -113,6 +115,7 @@ def __init__(self, awcc: AWCCThermal): self._awcc = awcc self.settings = QtCore.QSettings(self.APP_URL, "AWCC") + print(self.settings.fileName()) # Set main window props self.setFixedSize(600, 0) @@ -262,11 +265,13 @@ def onModeChange(val: str): onModeChange(ThermalMode.Balanced.value) self._modeSwitch.setOnChange(onModeChange) - def updateOutput(): + def updateAppState(): + # Get temps and RPMs gpuTemp = self._awcc.getFanRelatedTemp(self._awcc.GPUFanIdx) gpuRPM = self._awcc.getFanRPM(self._awcc.GPUFanIdx) cpuTemp = self._awcc.getFanRelatedTemp(self._awcc.CPUFanIdx) cpuRPM = self._awcc.getFanRPM(self._awcc.CPUFanIdx) + # Update UI gauges if gpuTemp is not None: self._thermalGPU.setTemp(gpuTemp) if gpuRPM is not None: self._thermalGPU.setFanRPM(gpuRPM) if cpuTemp is not None: self._thermalCPU.setTemp(cpuTemp) @@ -282,9 +287,13 @@ def updateOutput(): if tempIsHigh: self._failsafeTempIsHighTs = time.time() + self._failsafeTempIsHighStartTs = (self._failsafeTempIsHighStartTs or time.time()) if tempIsHigh else None + + # Trip fail-safe if (self._failsafeOn and self._modeSwitch.getChecked() != ThermalMode.G_Mode.value and - tempIsHigh + tempIsHigh and + time.time() - self._failsafeTempIsHighStartTs > self.FAILSAFE_TRIGGER_DELAY_SEC ): self._failsafeTrippedPrevModeStr = self._modeSwitch.getChecked() self._modeSwitch.setChecked(ThermalMode.G_Mode.value) @@ -302,8 +311,8 @@ def updateOutput(): trayIcon.update((gpuTemp, cpuTemp)) tray.setIcon(trayIcon) - self._updateGaugesTask = QPeriodic(self, self.TEMP_UPD_PERIOD_MS, updateOutput) - updateOutput() + self._updateGaugesTask = QPeriodic(self, self.TEMP_UPD_PERIOD_MS, updateAppState) + updateAppState() self._updateGaugesTask.start() self._thermalGPU.speedSliderChanged(updateFanSpeed)