From 25f0af11031fd7706fc61a13ebef781a08e1cc2f Mon Sep 17 00:00:00 2001 From: seerge Date: Sat, 15 Apr 2023 16:02:07 +0200 Subject: [PATCH] AdjustAllLevels fixes --- app/ASUSWmi.cs | 12 ++++++------ app/Fans.cs | 19 ++++++++----------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/app/ASUSWmi.cs b/app/ASUSWmi.cs index 760bd166..6bdfa451 100644 --- a/app/ASUSWmi.cs +++ b/app/ASUSWmi.cs @@ -36,17 +36,17 @@ public class ASUSWmi public const int Temp_CPU = 0x00120094; public const int Temp_GPU = 0x00120097; - - public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 and CPU PPT on 2021 + public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 (PPT_LIMIT_SLOW ) and CPU PPT on 2021 public const int PPT_EDCA1 = 0x001200A1; // CPU EDC public const int PPT_TDCA2 = 0x001200A2; // CPU TDC public const int PPT_APUA3 = 0x001200A3; // APU PPT ON 2021, doesn't work on 2022 - public const int PPT_CPUB0 = 0x001200B0; // CPU PPT on 2022 - public const int PPT_CPUB1 = 0x001200B1; // APU PPT on 2022 + public const int PPT_CPUB0 = 0x001200B0; // CPU PPT on 2022 (PPT_LIMIT_APU) + public const int PPT_CPUB1 = 0x001200B1; // Total PPT on 2022 (PPT_LIMIT_SLOW) - public const int PPT_APUC1 = 0x001200C1; - public const int PPT_APUC2 = 0x001200C2; + public const int PPT_APUC0 = 0x001200C0; // does nothing on G14 2022 + public const int PPT_APUC1 = 0x001200C1; // Actual Power Limit (PPT_LIMIT_FAST) AND Sustained Power Limit (STAPM_LIMIT) + public const int PPT_APUC2 = 0x001200C2; // does nothing on G14 2022 public const int TUF_KB = 0x00100056; public const int TUF_KB_STATE = 0x00100057; diff --git a/app/Fans.cs b/app/Fans.cs index dec7d630..e52c1354 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -433,11 +433,8 @@ namespace GHelper curPoint.XValue = dx; curPoint.YValues[0] = dy; - if (hit.Series is not null) { - - AdjustAllLevels(hit.PointIndex, dy, dx, hit.Series); - - } + if (hit.Series is not null) + AdjustAllLevels(hit.PointIndex, dx, dy, hit.Series); tip = true; } @@ -460,7 +457,7 @@ namespace GHelper } - private void AdjustAllLevels(int index, double curYVal, double curXVal, 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,20 +502,20 @@ namespace GHelper if (lowerPoint != null) { - if (curYVal < lowerPoint.YValues[0]) + //Debug.WriteLine(curYVal + " 0; i--) + for (int i = index - 1; i >= 0; i--) { DataPoint curLower = series.Points[i]; if (curLower.YValues[0] <= curYVal) break; - - curLower.YValues[0] = curYVal; + curLower.YValues[0] = Math.Floor(curYVal); } } if (curXVal < lowerPoint.XValue) { - for (int i = index - 1; i > 0; i--) + for (int i = index - 1; i >= 0; i--) { DataPoint curLower = series.Points[i]; if (curLower.XValue <= curXVal) break;