mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Warning label when custom fan profile is not supported
This commit is contained in:
22
app/Fans.Designer.cs
generated
22
app/Fans.Designer.cs
generated
@@ -63,6 +63,7 @@ namespace GHelper
|
|||||||
trackTotal = new TrackBar();
|
trackTotal = new TrackBar();
|
||||||
pictureFine = new PictureBox();
|
pictureFine = new PictureBox();
|
||||||
labelInfo = new Label();
|
labelInfo = new Label();
|
||||||
|
labelFansResult = new Label();
|
||||||
panelFans.SuspendLayout();
|
panelFans.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
||||||
tableFanCharts.SuspendLayout();
|
tableFanCharts.SuspendLayout();
|
||||||
@@ -80,6 +81,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// panelFans
|
// panelFans
|
||||||
//
|
//
|
||||||
|
panelFans.Controls.Add(labelFansResult);
|
||||||
panelFans.Controls.Add(labelTip);
|
panelFans.Controls.Add(labelTip);
|
||||||
panelFans.Controls.Add(labelBoost);
|
panelFans.Controls.Add(labelBoost);
|
||||||
panelFans.Controls.Add(comboBoost);
|
panelFans.Controls.Add(comboBoost);
|
||||||
@@ -117,7 +119,6 @@ namespace GHelper
|
|||||||
labelBoost.TabIndex = 39;
|
labelBoost.TabIndex = 39;
|
||||||
labelBoost.Text = Properties.Strings.CPUBoost;
|
labelBoost.Text = Properties.Strings.CPUBoost;
|
||||||
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
||||||
|
|
||||||
//
|
//
|
||||||
// comboBoost
|
// comboBoost
|
||||||
//
|
//
|
||||||
@@ -221,11 +222,11 @@ namespace GHelper
|
|||||||
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
checkApplyFans.AutoSize = true;
|
checkApplyFans.AutoSize = true;
|
||||||
checkApplyFans.BackColor = SystemColors.ControlLight;
|
checkApplyFans.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyFans.Location = new Point(449, 1084);
|
checkApplyFans.Location = new Point(449, 1088);
|
||||||
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
||||||
checkApplyFans.Name = "checkApplyFans";
|
checkApplyFans.Name = "checkApplyFans";
|
||||||
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
||||||
checkApplyFans.Size = new Size(339, 50);
|
checkApplyFans.Size = new Size(339, 46);
|
||||||
checkApplyFans.TabIndex = 17;
|
checkApplyFans.TabIndex = 17;
|
||||||
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
||||||
checkApplyFans.UseVisualStyleBackColor = false;
|
checkApplyFans.UseVisualStyleBackColor = false;
|
||||||
@@ -292,11 +293,11 @@ namespace GHelper
|
|||||||
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
checkApplyPower.AutoSize = true;
|
checkApplyPower.AutoSize = true;
|
||||||
checkApplyPower.BackColor = SystemColors.ControlLight;
|
checkApplyPower.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyPower.Location = new Point(20, 1084);
|
checkApplyPower.Location = new Point(20, 1088);
|
||||||
checkApplyPower.Margin = new Padding(4, 2, 4, 2);
|
checkApplyPower.Margin = new Padding(4, 2, 4, 2);
|
||||||
checkApplyPower.Name = "checkApplyPower";
|
checkApplyPower.Name = "checkApplyPower";
|
||||||
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
||||||
checkApplyPower.Size = new Size(277, 50);
|
checkApplyPower.Size = new Size(277, 46);
|
||||||
checkApplyPower.TabIndex = 25;
|
checkApplyPower.TabIndex = 25;
|
||||||
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
|
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
|
||||||
checkApplyPower.UseVisualStyleBackColor = false;
|
checkApplyPower.UseVisualStyleBackColor = false;
|
||||||
@@ -417,6 +418,16 @@ namespace GHelper
|
|||||||
labelInfo.TabIndex = 19;
|
labelInfo.TabIndex = 19;
|
||||||
labelInfo.Text = "label";
|
labelInfo.Text = "label";
|
||||||
//
|
//
|
||||||
|
// labelFansResult
|
||||||
|
//
|
||||||
|
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
labelFansResult.ForeColor = Color.Red;
|
||||||
|
labelFansResult.Location = new Point(30, 1070);
|
||||||
|
labelFansResult.Name = "labelFansResult";
|
||||||
|
labelFansResult.Size = new Size(760, 32);
|
||||||
|
labelFansResult.TabIndex = 41;
|
||||||
|
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
||||||
|
//
|
||||||
// Fans
|
// Fans
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(192F, 192F);
|
AutoScaleDimensions = new SizeF(192F, 192F);
|
||||||
@@ -483,5 +494,6 @@ namespace GHelper
|
|||||||
private RComboBox comboBoost;
|
private RComboBox comboBoost;
|
||||||
private Label labelBoost;
|
private Label labelBoost;
|
||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
|
private Label labelFansResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12
app/Fans.cs
12
app/Fans.cs
@@ -200,9 +200,12 @@ namespace GHelper
|
|||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoPower();
|
Program.settingsForm.AutoPower();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void LabelFansResult(string text)
|
||||||
|
{
|
||||||
|
labelFansResult.Text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
|
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
|
||||||
@@ -459,7 +462,8 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AdjustAllLevels(int index, double curXVal, double curYVal, Series series) {
|
private void AdjustAllLevels(int index, double curXVal, double curYVal, Series series)
|
||||||
|
{
|
||||||
|
|
||||||
// Get the neighboring DataPoints of the hit point
|
// Get the neighboring DataPoints of the hit point
|
||||||
DataPoint upperPoint = null;
|
DataPoint upperPoint = null;
|
||||||
@@ -505,12 +509,12 @@ namespace GHelper
|
|||||||
if (lowerPoint != null)
|
if (lowerPoint != null)
|
||||||
{
|
{
|
||||||
//Debug.WriteLine(curYVal + " <? " + Math.Floor(lowerPoint.YValues[0]));
|
//Debug.WriteLine(curYVal + " <? " + Math.Floor(lowerPoint.YValues[0]));
|
||||||
if (curYVal < Math.Floor(lowerPoint.YValues[0]))
|
if (curYVal <= Math.Floor(lowerPoint.YValues[0]))
|
||||||
{
|
{
|
||||||
for (int i = index - 1; i >= 0; i--)
|
for (int i = index - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
DataPoint curLower = series.Points[i];
|
DataPoint curLower = series.Points[i];
|
||||||
if (curLower.YValues[0] <= curYVal) break;
|
if (curLower.YValues[0] < curYVal) break;
|
||||||
curLower.YValues[0] = Math.Floor(curYVal);
|
curLower.YValues[0] = Math.Floor(curYVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -718,7 +718,6 @@ public class NativeMethods
|
|||||||
|
|
||||||
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
||||||
|
|
||||||
/*
|
|
||||||
var hrDC = PowerWriteDCValueIndex(
|
var hrDC = PowerWriteDCValueIndex(
|
||||||
IntPtr.Zero,
|
IntPtr.Zero,
|
||||||
activeSchemeGuid,
|
activeSchemeGuid,
|
||||||
@@ -727,7 +726,6 @@ public class NativeMethods
|
|||||||
boost);
|
boost);
|
||||||
|
|
||||||
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
||||||
*/
|
|
||||||
|
|
||||||
Logger.WriteLine("Boost " + boost);
|
Logger.WriteLine("Boost " + boost);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -901,6 +901,13 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void LabelFansResult(string text)
|
||||||
|
{
|
||||||
|
if (fans != null && fans.Text != "")
|
||||||
|
fans.LabelFansResult(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void AutoFans(bool force = false)
|
public void AutoFans(bool force = false)
|
||||||
{
|
{
|
||||||
customFans = false;
|
customFans = false;
|
||||||
@@ -919,8 +926,13 @@ namespace GHelper
|
|||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = Program.config.getConfig("performance_mode");
|
||||||
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
||||||
|
LabelFansResult("ASUS BIOS rejected fan curve");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LabelFansResult("");
|
||||||
|
customFans = true;
|
||||||
}
|
}
|
||||||
else customFans = true;
|
|
||||||
|
|
||||||
// fix for misbehaving bios on intell based TUF 2022
|
// fix for misbehaving bios on intell based TUF 2022
|
||||||
if ((Program.config.ContainsModel("FX507") || Program.config.ContainsModel("FX517")) && Program.config.getConfigPerf("auto_apply_power") != 1)
|
if ((Program.config.ContainsModel("FX507") || Program.config.ContainsModel("FX517")) && Program.config.getConfigPerf("auto_apply_power") != 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user