diff --git a/app/Fans.Designer.cs b/app/Fans.Designer.cs index 68931a6b..e0930011 100644 --- a/app/Fans.Designer.cs +++ b/app/Fans.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/app/Fans.cs b/app/Fans.cs index 81895ffd..7c552131 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -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) @@ -407,7 +410,7 @@ namespace GHelper { curPoint = hit.Series.Points[hit.PointIndex]; tip = true; - } + } if (curPoint != null) @@ -435,7 +438,7 @@ namespace GHelper curPoint.XValue = dx; curPoint.YValues[0] = dy; - if (hit.Series is not null) + if (hit.Series is not null) AdjustAllLevels(hit.PointIndex, dx, dy, hit.Series); tip = true; @@ -444,7 +447,7 @@ namespace GHelper labelTip.Text = Math.Round(curPoint.XValue) + "C, " + ChartPercToRPM((int)curPoint.YValues[0], " " + Properties.Strings.RPM); labelTip.Top = e.Y + ((Control)sender).Top; labelTip.Left = e.X - 50; - + } catch { @@ -452,20 +455,21 @@ namespace GHelper tip = false; } - } + } labelTip.Visible = tip; } - 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; DataPoint lowerPoint = null; - if (index > 0) + if (index > 0) { lowerPoint = series.Points[index - 1]; } @@ -480,7 +484,7 @@ namespace GHelper { if (curYVal > upperPoint.YValues[0]) { - + for (int i = index + 1; i < series.Points.Count; i++) { DataPoint curUpper = series.Points[i]; @@ -505,12 +509,12 @@ namespace GHelper if (lowerPoint != null) { //Debug.WriteLine(curYVal + " = 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); } } diff --git a/app/NativeMethods.cs b/app/NativeMethods.cs index 6b595ac8..7f23031d 100644 --- a/app/NativeMethods.cs +++ b/app/NativeMethods.cs @@ -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); } diff --git a/app/Settings.cs b/app/Settings.cs index 9a8f2804..bfa9898a 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -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; @@ -914,13 +921,18 @@ namespace GHelper Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2)); // something went wrong, resetting to default profile - if (cpuResult != 1 || gpuResult != 1) + if (cpuResult != 1 || gpuResult != 1) { 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)