Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCJ60 committed Jul 14, 2024
1 parent 3ba14c9 commit c7197d7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Framework Hub/Scripts/Windows/Misc/GetSystemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Framework Hub/Services/PowerModeSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
{
Expand All @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion Framework Hub/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Framework Hub/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
</StackPanel>
</Expander.Header>
<StackPanel Margin="0,0,0,-12">
<TextBlock FontSize="15" Margin="0,0,0,8">PBO Scaler</TextBlock>
<TextBlock FontSize="15" Margin="0,0,0,8">PBO Scalar</TextBlock>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
Expand Down
4 changes: 2 additions & 2 deletions Framework Hub/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c7197d7

Please sign in to comment.