From c7197d750769d2fec7695b3d92dd2637d244d956 Mon Sep 17 00:00:00 2001 From: JamesCJ Date: Sun, 14 Jul 2024 16:17:18 +0100 Subject: [PATCH] Bug fixes --- Framework Hub/Scripts/Windows/Misc/GetSystemInfo.cs | 5 +++++ Framework Hub/Services/PowerModeSettings.cs | 8 ++++---- Framework Hub/ViewModels/MainViewModel.cs | 2 +- Framework Hub/Views/MainView.axaml | 2 +- Framework Hub/Views/MainWindow.axaml.cs | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Framework Hub/Scripts/Windows/Misc/GetSystemInfo.cs b/Framework Hub/Scripts/Windows/Misc/GetSystemInfo.cs index c7cf840..bf06a5d 100644 --- a/Framework Hub/Scripts/Windows/Misc/GetSystemInfo.cs +++ b/Framework Hub/Scripts/Windows/Misc/GetSystemInfo.cs @@ -17,6 +17,11 @@ internal class GetSystemInfo private static ManagementObjectSearcher motherboardSearcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_MotherboardDevice"); private static ManagementObjectSearcher ComputerSsystemInfo = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_ComputerSystemProduct"); + public static bool HasDGPUModule() { + if (IsGPUPresent("RX 7700S")) return true; + else return false; + } + public static bool IsGPUPresent(string gpuName) { // Create a query to search for GPU devices diff --git a/Framework Hub/Services/PowerModeSettings.cs b/Framework Hub/Services/PowerModeSettings.cs index c4cded1..62cb8a5 100644 --- a/Framework Hub/Services/PowerModeSettings.cs +++ b/Framework Hub/Services/PowerModeSettings.cs @@ -40,7 +40,7 @@ internal class PowerModeSettingsManager private readonly string _configDirectory; string _device = GetSystemInfo.Product; - + bool hasDGPUModule = GetSystemInfo.HasDGPUModule(); // set up manager instance public PowerModeSettingsManager(string configDirectory) { @@ -52,9 +52,9 @@ public PowerModeSettingsManager(string configDirectory) // Get data from preset public PowerModePresets GetPreset(int _powerMode) { - if (_settings.ContainsKey($"{_device}_{_powerMode}")) + if (_settings.ContainsKey($"{_device}_{hasDGPUModule}_{_powerMode}")) { - return _settings[$"{_device}_{_powerMode}"]; + return _settings[$"{_device}_{hasDGPUModule}_{_powerMode}"]; } else { @@ -79,7 +79,7 @@ private void LoadPresets() // Save preset to json file public void SaveSettings(PowerModePresets _newPreset, int _powerMode) { - _settings[$"{_device}_{_powerMode}"] = _newPreset; + _settings[$"{_device}_{hasDGPUModule}_{_powerMode}"] = _newPreset; SaveAppSettings(); } diff --git a/Framework Hub/ViewModels/MainViewModel.cs b/Framework Hub/ViewModels/MainViewModel.cs index 59ce3db..ecfda6d 100644 --- a/Framework Hub/ViewModels/MainViewModel.cs +++ b/Framework Hub/ViewModels/MainViewModel.cs @@ -259,7 +259,7 @@ private void SetUpTempPower() else { // Setup temp defaults for each power mode - if (GetSystemInfo.Product.Contains("16") && GetSystemInfo.IsGPUPresent("RX 7700S")) + if (GetSystemInfo.Product.Contains("16")) { if (PowerIndex == 0) { diff --git a/Framework Hub/Views/MainView.axaml b/Framework Hub/Views/MainView.axaml index ce428a5..1bfa547 100644 --- a/Framework Hub/Views/MainView.axaml +++ b/Framework Hub/Views/MainView.axaml @@ -178,7 +178,7 @@ - PBO Scaler + PBO Scalar diff --git a/Framework Hub/Views/MainWindow.axaml.cs b/Framework Hub/Views/MainWindow.axaml.cs index 9a4a868..93372fa 100644 --- a/Framework Hub/Views/MainWindow.axaml.cs +++ b/Framework Hub/Views/MainWindow.axaml.cs @@ -26,8 +26,8 @@ public MainWindow() lbSide.Items.Add(new SideMenu { Icon = "\ue80f", Sub = "Home", Margin = new Thickness(0,-8,0,-8) }); //lbSide.Items.Add(new SideMenu { Icon = "\uea80", Sub = "KBD LED", Margin = new Thickness(0,-8,0,-8) }); - lbSide.Items.Add(new SideMenu { Icon = "\ue8ab", Sub = "Auto", Margin = new Thickness(0,-8,0,-8) }); - lbSide.Items.Add(new SideMenu { Icon = "\ue713", Sub = "Settings", Margin = new Thickness(0, -8, 0, -8) }); + //lbSide.Items.Add(new SideMenu { Icon = "\ue8ab", Sub = "Auto", Margin = new Thickness(0,-8,0,-8) }); + //lbSide.Items.Add(new SideMenu { Icon = "\ue713", Sub = "Settings", Margin = new Thickness(0, -8, 0, -8) }); lbSide.SelectedIndex = 0; this.MinWidth = 1120;