Skip to content

Commit

Permalink
Removed duplicate god mode option
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed Nov 5, 2023
1 parent 5c4c0f3 commit 28abc93
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public Task SetStateAsync(GodModeState state)
CPUPL1Tau = preset.CPUPL1Tau,
APUsPPTPowerLimit = preset.APUsPPTPowerLimit,
CPUTemperatureLimit = preset.CPUTemperatureLimit,
CPUToGPUDynamicBoost = preset.CPUToGPUDynamicBoost,
GPUPowerBoost = preset.GPUPowerBoost,
GPUConfigurableTGP = preset.GPUConfigurableTGP,
GPUTemperatureLimit = preset.GPUTemperatureLimit,
Expand Down Expand Up @@ -174,7 +173,6 @@ private async Task<GodModeState> LoadStateFromStoreAsync(GodModeSettings.GodMode
CPUPL1Tau = CreateStepperValue(defaultState.CPUPL1Tau, preset.CPUPL1Tau, preset.MinValueOffset, preset.MaxValueOffset),
APUsPPTPowerLimit = CreateStepperValue(defaultState.APUsPPTPowerLimit, preset.APUsPPTPowerLimit, preset.MinValueOffset, preset.MaxValueOffset),
CPUTemperatureLimit = CreateStepperValue(defaultState.CPUTemperatureLimit, preset.CPUTemperatureLimit, preset.MinValueOffset, preset.MaxValueOffset),
CPUToGPUDynamicBoost = CreateStepperValue(defaultState.CPUToGPUDynamicBoost, preset.CPUToGPUDynamicBoost),
GPUPowerBoost = CreateStepperValue(defaultState.GPUPowerBoost, preset.GPUPowerBoost, preset.MinValueOffset, preset.MaxValueOffset),
GPUConfigurableTGP = CreateStepperValue(defaultState.GPUConfigurableTGP, preset.GPUConfigurableTGP, preset.MinValueOffset, preset.MaxValueOffset),
GPUTemperatureLimit = CreateStepperValue(defaultState.GPUTemperatureLimit, preset.GPUTemperatureLimit, preset.MinValueOffset, preset.MaxValueOffset),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public override async Task ApplyStateAsync()
{ CapabilityID.CPUPL1Tau, preset.CPUPL1Tau },
{ CapabilityID.APUsPPTPowerLimit, preset.APUsPPTPowerLimit },
{ CapabilityID.CPUTemperatureLimit, preset.CPUTemperatureLimit },
{ CapabilityID.CPUToGPUDynamicBoost, preset.CPUToGPUDynamicBoost },
{ CapabilityID.GPUPowerBoost, preset.GPUPowerBoost },
{ CapabilityID.GPUConfigurableTGP, preset.GPUConfigurableTGP },
{ CapabilityID.GPUTemperatureLimit, preset.GPUTemperatureLimit },
Expand Down Expand Up @@ -168,7 +167,6 @@ public override async Task<Dictionary<PowerModeState, GodModeDefaults>> GetDefau
CPUPL1Tau = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.CPUPL1Tau, powerMode),
APUsPPTPowerLimit = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.APUsPPTPowerLimit, powerMode),
CPUTemperatureLimit = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.CPUTemperatureLimit, powerMode),
CPUToGPUDynamicBoost = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.CPUToGPUDynamicBoost, powerMode),
GPUPowerBoost = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.GPUPowerBoost, powerMode),
GPUConfigurableTGP = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.GPUConfigurableTGP, powerMode),
GPUTemperatureLimit = GetDefaultCapabilityIdValueInPowerMode(allCapabilityData, CapabilityID.GPUTemperatureLimit, powerMode),
Expand Down Expand Up @@ -247,7 +245,6 @@ protected override async Task<GodModePreset> GetDefaultStateAsync()
CPUPL1Tau = stepperValues.GetValueOrNull(CapabilityID.CPUPL1Tau),
APUsPPTPowerLimit = stepperValues.GetValueOrNull(CapabilityID.APUsPPTPowerLimit),
CPUTemperatureLimit = stepperValues.GetValueOrNull(CapabilityID.CPUTemperatureLimit),
CPUToGPUDynamicBoost = stepperValues.GetValueOrNull(CapabilityID.CPUToGPUDynamicBoost),
GPUPowerBoost = stepperValues.GetValueOrNull(CapabilityID.GPUPowerBoost),
GPUConfigurableTGP = stepperValues.GetValueOrNull(CapabilityID.GPUConfigurableTGP),
GPUTemperatureLimit = stepperValues.GetValueOrNull(CapabilityID.GPUTemperatureLimit),
Expand Down
1 change: 0 additions & 1 deletion LenovoLegionToolkit.Lib/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public enum CapabilityID
APUsPPTPowerLimit = 0x0105FF00,
CPUCrossLoadingPowerLimit = 0x0106FF00,
CPUPL1Tau = 0x0107FF00,
CPUToGPUDynamicBoost = 0x0201FF00,
GPUPowerBoost = 0x0201FF00,
GPUConfigurableTGP = 0x0202FF00,
GPUTemperatureLimit = 0x0203FF00,
Expand Down
1 change: 0 additions & 1 deletion LenovoLegionToolkit.Lib/Settings/GodModeSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class Preset
public StepperValue? CPUPL1Tau { get; init; }
public StepperValue? APUsPPTPowerLimit { get; init; }
public StepperValue? CPUTemperatureLimit { get; init; }
public StepperValue? CPUToGPUDynamicBoost { get; init; }
public StepperValue? GPUPowerBoost { get; init; }
public StepperValue? GPUConfigurableTGP { get; init; }
public StepperValue? GPUTemperatureLimit { get; init; }
Expand Down
4 changes: 0 additions & 4 deletions LenovoLegionToolkit.Lib/Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ public readonly struct GodModeDefaults
public int? CPUPL1Tau { get; init; }
public int? APUsPPTPowerLimit { get; init; }
public int? CPUTemperatureLimit { get; init; }
public int? CPUToGPUDynamicBoost { get; init; }
public int? GPUPowerBoost { get; init; }
public int? GPUConfigurableTGP { get; init; }
public int? GPUTemperatureLimit { get; init; }
Expand All @@ -281,7 +280,6 @@ public override string ToString() =>
$" {nameof(CPUPL1Tau)}: {CPUPL1Tau}," +
$" {nameof(APUsPPTPowerLimit)}: {APUsPPTPowerLimit}," +
$" {nameof(CPUTemperatureLimit)}: {CPUTemperatureLimit}," +
$" {nameof(CPUToGPUDynamicBoost)}: {CPUToGPUDynamicBoost}," +
$" {nameof(GPUPowerBoost)}: {GPUPowerBoost}," +
$" {nameof(GPUConfigurableTGP)}: {GPUConfigurableTGP}," +
$" {nameof(GPUTemperatureLimit)}: {GPUTemperatureLimit}," +
Expand All @@ -307,7 +305,6 @@ public readonly struct GodModePreset
public StepperValue? CPUPL1Tau { get; init; }
public StepperValue? APUsPPTPowerLimit { get; init; }
public StepperValue? CPUTemperatureLimit { get; init; }
public StepperValue? CPUToGPUDynamicBoost { get; init; }
public StepperValue? GPUPowerBoost { get; init; }
public StepperValue? GPUConfigurableTGP { get; init; }
public StepperValue? GPUTemperatureLimit { get; init; }
Expand All @@ -327,7 +324,6 @@ public override string ToString() =>
$" {nameof(CPUPL1Tau)}: {CPUPL1Tau}," +
$" {nameof(APUsPPTPowerLimit)}: {APUsPPTPowerLimit}," +
$" {nameof(CPUTemperatureLimit)}: {CPUTemperatureLimit}," +
$" {nameof(CPUToGPUDynamicBoost)}: {CPUToGPUDynamicBoost}," +
$" {nameof(GPUPowerBoost)}: {GPUPowerBoost}," +
$" {nameof(GPUConfigurableTGP)}: {GPUConfigurableTGP}," +
$" {nameof(GPUTemperatureLimit)}: {GPUTemperatureLimit}," +
Expand Down
18 changes: 0 additions & 18 deletions LenovoLegionToolkit.WPF/Resources/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions LenovoLegionToolkit.WPF/Resources/Resource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1895,12 +1895,6 @@ Requires restart.</value>
<data name="NotificationsSettingsWindow_Updates_Title" xml:space="preserve">
<value>Updates</value>
</data>
<data name="GodModeSettingsWindow_CPU_ToGpuDynamicBoostControl" xml:space="preserve">
<value>CPU to GPU Dynamic Boost</value>
</data>
<data name="GodModeSettingsWindow_CPU_ToGpuDynamicBoostControl_Description" xml:space="preserve">
<value>This is the maximum additional power that can be allocated to the GPU from the CPU based on CPU usage. The higher the value, the better the performance of applications that use the GPU.</value>
</data>
<data name="GodModeSettingsWindow_GPU_ToCpuDynamicBoostControl" xml:space="preserve">
<value>GPU to CPU Dynamic Boost</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@
Description="{x:Static resources:Resource.GodModeSettingsWindow_CPU_TempLimit_Description}"
Unit="°C" />

<godMode:GodModeValueControl
x:Name="_cpuToGpuDynamicBoostControl"
Title="{x:Static resources:Resource.GodModeSettingsWindow_CPU_ToGpuDynamicBoostControl}"
Margin="0,0,0,8"
Description="{x:Static resources:Resource.GodModeSettingsWindow_CPU_ToGpuDynamicBoostControl_Description}"
Unit="W" />

<TextBlock
x:Name="_gpuSectionTitle"
Margin="0,16,0,24"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ private async Task<bool> ApplyAsync()
CPUPL1Tau = preset.CPUPL1Tau?.WithValue(_cpuPL1TauControl.Value),
APUsPPTPowerLimit = preset.APUsPPTPowerLimit?.WithValue(_apuSPPTPowerLimitControl.Value),
CPUTemperatureLimit = preset.CPUTemperatureLimit?.WithValue(_cpuTemperatureLimitControl.Value),
CPUToGPUDynamicBoost = preset.CPUToGPUDynamicBoost?.WithValue(_cpuToGpuDynamicBoostControl.Value),
GPUPowerBoost = preset.GPUPowerBoost?.WithValue(_gpuPowerBoostControl.Value),
GPUConfigurableTGP = preset.GPUConfigurableTGP?.WithValue(_gpuConfigurableTGPControl.Value),
GPUTemperatureLimit = preset.GPUTemperatureLimit?.WithValue(_gpuTemperatureLimitControl.Value),
Expand Down Expand Up @@ -169,7 +168,6 @@ private async Task SetStateAsync(GodModeState state)
_cpuPL1TauControl.Set(preset.CPUPL1Tau);
_apuSPPTPowerLimitControl.Set(preset.APUsPPTPowerLimit);
_cpuTemperatureLimitControl.Set(preset.CPUTemperatureLimit);
_cpuToGpuDynamicBoostControl.Set(preset.CPUToGPUDynamicBoost);
_gpuPowerBoostControl.Set(preset.GPUPowerBoost);
_gpuConfigurableTGPControl.Set(preset.GPUConfigurableTGP);
_gpuTemperatureLimitControl.Set(preset.GPUTemperatureLimit);
Expand Down Expand Up @@ -219,8 +217,7 @@ private async Task SetStateAsync(GodModeState state)
_cpuCrossLoadingLimitControl,
_cpuPL1TauControl,
_apuSPPTPowerLimitControl,
_cpuTemperatureLimitControl,
_cpuToGpuDynamicBoostControl
_cpuTemperatureLimitControl
}.Any(v => v.Visibility == Visibility.Visible);

var gpuSectionVisible = new[]
Expand Down Expand Up @@ -274,9 +271,6 @@ private async void SetDefaults(GodModeDefaults defaults)
if (_cpuTemperatureLimitControl.Visibility == Visibility.Visible && defaults.CPUTemperatureLimit is { } cpuTemperatureLimit)
_cpuTemperatureLimitControl.Value = cpuTemperatureLimit;

if (_cpuToGpuDynamicBoostControl.Visibility == Visibility.Visible && defaults.CPUToGPUDynamicBoost is { } cpuToGPUDynamicBoost)
_cpuToGpuDynamicBoostControl.Value = cpuToGPUDynamicBoost;

if (_gpuPowerBoostControl.Visibility == Visibility.Visible && defaults.GPUPowerBoost is { } gpuPowerBoost)
_gpuPowerBoostControl.Value = gpuPowerBoost;

Expand Down

0 comments on commit 28abc93

Please sign in to comment.