Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Jun 4, 2024
1 parent f3723e9 commit 211d8d3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 95 deletions.
76 changes: 7 additions & 69 deletions app/Fans.Designer.cs

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

13 changes: 0 additions & 13 deletions app/Fans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ public Fans()
trackTemp.Minimum = RyzenControl.MinTemp;
trackTemp.Maximum = RyzenControl.MaxTemp;

trackSkin.Minimum = RyzenControl.MinSkin;
trackSkin.Maximum = RyzenControl.MaxSkin;

comboPowerMode.DropDownStyle = ComboBoxStyle.DropDownList;
comboPowerMode.DataSource = new BindingSource(PowerNative.powerModes, null);
comboPowerMode.DisplayMember = "Value";
Expand Down Expand Up @@ -214,7 +211,6 @@ public Fans()
trackUV.Scroll += TrackUV_Scroll;
trackUViGPU.Scroll += TrackUV_Scroll;
trackTemp.Scroll += TrackUV_Scroll;
trackSkin.Scroll += TrackUV_Scroll;

buttonApplyAdvanced.Click += ButtonApplyAdvanced_Click;

Expand Down Expand Up @@ -252,7 +248,6 @@ private void ButtonDownload_Click(object? sender, EventArgs e)
panelUV.Visible = true;
panelTitleAdvanced.Visible = true;
panelTemperature.Visible = true;
panelSkin.Visible = true;
panelTitleTemp.Visible = true;

VisualiseAdvanced();
Expand Down Expand Up @@ -386,15 +381,11 @@ public void InitUV()
int temp = AppConfig.GetMode("cpu_temp");
if (temp < RyzenControl.MinTemp || temp > RyzenControl.MaxTemp) temp = RyzenControl.MaxTemp;

int skin = AppConfig.GetMode("skin_temp");
if (skin < RyzenControl.MinSkin || skin > RyzenControl.MaxSkin) skin = RyzenControl.MaxSkin;

checkApplyUV.Enabled = checkApplyUV.Checked = AppConfig.IsMode("auto_uv");

trackUV.Value = cpuUV;
trackUViGPU.Value = igpuUV;
trackTemp.Value = temp;
trackSkin.Value = skin;

VisualiseAdvanced();

Expand All @@ -413,7 +404,6 @@ private void VisualiseAdvanced()
panelUViGPU.Visible = false;
panelTitleTemp.Visible = false;
panelTemperature.Visible = false;
panelSkin.Visible = false;
panelAdvancedAlways.Visible = false;
panelAdvancedApply.Visible = false;
panelDownload.Visible = true;
Expand All @@ -440,7 +430,6 @@ private void VisualiseAdvanced()
labelUViGPU.Text = trackUViGPU.Value.ToString();

labelTemp.Text = (trackTemp.Value < RyzenControl.MaxTemp) ? trackTemp.Value.ToString() + "°C" : "Default";
labelSkin.Text = (trackSkin.Value < RyzenControl.MaxSkin) ? trackSkin.Value.ToString() + "°C" : "Default";
}

private void AdvancedScroll()
Expand All @@ -450,7 +439,6 @@ private void AdvancedScroll()

VisualiseAdvanced();

AppConfig.SetMode("skin_temp", trackSkin.Value);
AppConfig.SetMode("cpu_temp", trackTemp.Value);
AppConfig.SetMode("cpu_uv", trackUV.Value);
AppConfig.SetMode("igpu_uv", trackUViGPU.Value);
Expand Down Expand Up @@ -1153,7 +1141,6 @@ private void ButtonReset_Click(object? sender, EventArgs e)
trackUV.Value = RyzenControl.MaxCPUUV;
trackUViGPU.Value = RyzenControl.MaxIGPUUV;
trackTemp.Value = RyzenControl.MaxTemp;
trackSkin.Value = RyzenControl.MaxSkin;

AdvancedScroll();
AppConfig.RemoveMode("cpu_temp");
Expand Down
11 changes: 0 additions & 11 deletions app/Mode/ModeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public ModeControl()
private void ReapplyTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
SetCPUTemp(AppConfig.GetMode("cpu_temp"));
SetSkinTemp(AppConfig.GetMode("skin_temp"));
SetRyzenPower();
}

Expand Down Expand Up @@ -410,15 +409,6 @@ public void SetCPUTemp(int? cpuTemp, bool init = false)
}
}

public void SetSkinTemp(int? skinTemp, bool init = false)
{
if (skinTemp >= RyzenControl.MinSkin && skinTemp < RyzenControl.MaxSkin)
{
var restultAPU = SendCommand.set_apu_skin_temp_limit((uint)skinTemp);
if (init) Logger.WriteLine($"APU Skin Temp: {skinTemp} {restultAPU}");
}
}

public void SetUV(int cpuUV)
{
if (!RyzenControl.IsSupportedUV()) return;
Expand Down Expand Up @@ -459,7 +449,6 @@ public void SetRyzen(bool launchAsAdmin = false)
SetUV(AppConfig.GetMode("cpu_uv", 0));
SetUViGPU(AppConfig.GetMode("igpu_uv", 0));
SetCPUTemp(AppConfig.GetMode("cpu_temp"), true);
SetSkinTemp(AppConfig.GetMode("skin_temp"), true);
}
catch (Exception ex)
{
Expand Down
2 changes: 0 additions & 2 deletions app/Ryzen/RyzenControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ internal class RyzenControl

public static int MinTemp => AppConfig.Get("min_temp", 75);
public const int MaxTemp = 98;
public static int MinSkin => 25;
public const int MaxSkin = 46;

public static int FAMID { get; protected set; }

Expand Down

0 comments on commit 211d8d3

Please sign in to comment.