Warning label when custom fan profile is not supported

This commit is contained in:
seerge
2023-04-16 13:01:34 +02:00
parent 0afee18f20
commit cb15161fc4
4 changed files with 46 additions and 20 deletions

22
app/Fans.Designer.cs generated
View File

@@ -63,6 +63,7 @@ namespace GHelper
trackTotal = new TrackBar();
pictureFine = new PictureBox();
labelInfo = new Label();
labelFansResult = new Label();
panelFans.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
tableFanCharts.SuspendLayout();
@@ -80,6 +81,7 @@ namespace GHelper
//
// panelFans
//
panelFans.Controls.Add(labelFansResult);
panelFans.Controls.Add(labelTip);
panelFans.Controls.Add(labelBoost);
panelFans.Controls.Add(comboBoost);
@@ -117,7 +119,6 @@ namespace GHelper
labelBoost.TabIndex = 39;
labelBoost.Text = Properties.Strings.CPUBoost;
labelBoost.TextAlign = ContentAlignment.MiddleRight;
//
// comboBoost
//
@@ -221,11 +222,11 @@ namespace GHelper
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
checkApplyFans.AutoSize = true;
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.Name = "checkApplyFans";
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
checkApplyFans.Size = new Size(339, 50);
checkApplyFans.Size = new Size(339, 46);
checkApplyFans.TabIndex = 17;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
checkApplyFans.UseVisualStyleBackColor = false;
@@ -292,11 +293,11 @@ namespace GHelper
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
checkApplyPower.AutoSize = true;
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.Name = "checkApplyPower";
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
checkApplyPower.Size = new Size(277, 50);
checkApplyPower.Size = new Size(277, 46);
checkApplyPower.TabIndex = 25;
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
checkApplyPower.UseVisualStyleBackColor = false;
@@ -417,6 +418,16 @@ namespace GHelper
labelInfo.TabIndex = 19;
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
//
AutoScaleDimensions = new SizeF(192F, 192F);
@@ -483,5 +494,6 @@ namespace GHelper
private RComboBox comboBoost;
private Label labelBoost;
private Label labelTip;
private Label labelFansResult;
}
}

View File

@@ -200,9 +200,12 @@ namespace GHelper
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
Program.settingsForm.AutoPower();
}
}
public void LabelFansResult(string text)
{
labelFansResult.Text = text;
}
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
DataPoint upperPoint = null;
@@ -505,12 +509,12 @@ namespace GHelper
if (lowerPoint != null)
{
//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--)
{
DataPoint curLower = series.Points[i];
if (curLower.YValues[0] <= curYVal) break;
if (curLower.YValues[0] < curYVal) break;
curLower.YValues[0] = Math.Floor(curYVal);
}
}

View File

@@ -718,7 +718,6 @@ public class NativeMethods
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
/*
var hrDC = PowerWriteDCValueIndex(
IntPtr.Zero,
activeSchemeGuid,
@@ -727,7 +726,6 @@ public class NativeMethods
boost);
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
*/
Logger.WriteLine("Boost " + boost);
}

View File

@@ -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)
{
customFans = false;
@@ -919,8 +926,13 @@ namespace GHelper
int mode = Program.config.getConfig("performance_mode");
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
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
if ((Program.config.ContainsModel("FX507") || Program.config.ContainsModel("FX517")) && Program.config.getConfigPerf("auto_apply_power") != 1)