mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
PPT UI tweaks
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Management;
|
using GHelper;
|
||||||
|
using System.Management;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public enum AsusFan
|
public enum AsusFan
|
||||||
@@ -65,16 +66,16 @@ public class AsusACPI
|
|||||||
public const int Temp_CPU = 0x00120094;
|
public const int Temp_CPU = 0x00120094;
|
||||||
public const int Temp_GPU = 0x00120097;
|
public const int Temp_GPU = 0x00120097;
|
||||||
|
|
||||||
public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 (PPT_LIMIT_SLOW ) and CPU PPT on 2021
|
public const int PPT_TotalA0 = 0x001200A0; // SPL (Total limit for all-AMD models)
|
||||||
public const int PPT_EDCA1 = 0x001200A1; // CPU EDC
|
public const int PPT_EDCA1 = 0x001200A1; // CPU EDC
|
||||||
public const int PPT_TDCA2 = 0x001200A2; // CPU TDC
|
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_APUA3 = 0x001200A3; // sPPT (long boost limit)
|
||||||
|
|
||||||
public const int PPT_CPUB0 = 0x001200B0; // CPU PPT on 2022 (PPT_LIMIT_APU)
|
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_CPUB1 = 0x001200B1; // Total PPT on 2022 (PPT_LIMIT_SLOW)
|
||||||
|
|
||||||
public const int PPT_GPUC0 = 0x001200C0; // NVIDIA GPU Boost
|
public const int PPT_GPUC0 = 0x001200C0; // NVIDIA GPU Boost
|
||||||
public const int PPT_APUC1 = 0x001200C1; // Actual Power Limit (PPT_LIMIT_FAST) AND Sustained Power Limit (STAPM_LIMIT)
|
public const int PPT_APUC1 = 0x001200C1; // fPPT (fast boost limit)
|
||||||
public const int PPT_GPUC2 = 0x001200C2; // NVIDIA GPU Temp Target (75.. 87 C)
|
public const int PPT_GPUC2 = 0x001200C2; // NVIDIA GPU Temp Target (75.. 87 C)
|
||||||
|
|
||||||
public const int TUF_KB_BRIGHTNESS = 0x00050021;
|
public const int TUF_KB_BRIGHTNESS = 0x00050021;
|
||||||
@@ -413,6 +414,11 @@ public class AsusACPI
|
|||||||
return DeviceGet(GPUXGConnected) == 1;
|
return DeviceGet(GPUXGConnected) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsAllAmdPPT()
|
||||||
|
{
|
||||||
|
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
public void TUFKeyboardBrightness(int brightness)
|
public void TUFKeyboardBrightness(int brightness)
|
||||||
{
|
{
|
||||||
int param = 0x80 | (brightness & 0x7F);
|
int param = 0x80 | (brightness & 0x7F);
|
||||||
|
|||||||
384
app/Fans.Designer.cs
generated
384
app/Fans.Designer.cs
generated
@@ -31,14 +31,14 @@ namespace GHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
ChartArea chartArea9 = new ChartArea();
|
ChartArea chartArea5 = new ChartArea();
|
||||||
Title title9 = new Title();
|
Title title5 = new Title();
|
||||||
ChartArea chartArea10 = new ChartArea();
|
ChartArea chartArea6 = new ChartArea();
|
||||||
Title title10 = new Title();
|
Title title6 = new Title();
|
||||||
ChartArea chartArea11 = new ChartArea();
|
ChartArea chartArea7 = new ChartArea();
|
||||||
Title title11 = new Title();
|
Title title7 = new Title();
|
||||||
ChartArea chartArea12 = new ChartArea();
|
ChartArea chartArea8 = new ChartArea();
|
||||||
Title title12 = new Title();
|
Title title8 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
tableFanCharts = new TableLayoutPanel();
|
tableFanCharts = new TableLayoutPanel();
|
||||||
@@ -60,18 +60,18 @@ namespace GHelper
|
|||||||
panelApplyPower = new Panel();
|
panelApplyPower = new Panel();
|
||||||
checkApplyPower = new RCheckBox();
|
checkApplyPower = new RCheckBox();
|
||||||
labelInfo = new Label();
|
labelInfo = new Label();
|
||||||
panelAPU = new Panel();
|
panelB0 = new Panel();
|
||||||
labelAPU = new Label();
|
labelB0 = new Label();
|
||||||
labelLeftAPU = new Label();
|
labelLeftB0 = new Label();
|
||||||
trackAPU = new TrackBar();
|
trackB0 = new TrackBar();
|
||||||
panelCPU = new Panel();
|
panelC1 = new Panel();
|
||||||
labelCPU = new Label();
|
labelC1 = new Label();
|
||||||
labelLeftCPU = new Label();
|
labelLeftC1 = new Label();
|
||||||
trackCPU = new TrackBar();
|
trackC1 = new TrackBar();
|
||||||
panelTotal = new Panel();
|
panelA0 = new Panel();
|
||||||
labelTotal = new Label();
|
labelA0 = new Label();
|
||||||
labelLeftPlatform = new Label();
|
labelLeftA0 = new Label();
|
||||||
trackTotal = new TrackBar();
|
trackA0 = new TrackBar();
|
||||||
panelTitleCPU = new Panel();
|
panelTitleCPU = new Panel();
|
||||||
pictureBox1 = new PictureBox();
|
pictureBox1 = new PictureBox();
|
||||||
labelPowerLimits = new Label();
|
labelPowerLimits = new Label();
|
||||||
@@ -107,12 +107,12 @@ namespace GHelper
|
|||||||
panelSliders.SuspendLayout();
|
panelSliders.SuspendLayout();
|
||||||
panelPower.SuspendLayout();
|
panelPower.SuspendLayout();
|
||||||
panelApplyPower.SuspendLayout();
|
panelApplyPower.SuspendLayout();
|
||||||
panelAPU.SuspendLayout();
|
panelB0.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackAPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackB0).BeginInit();
|
||||||
panelCPU.SuspendLayout();
|
panelC1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackCPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackC1).BeginInit();
|
||||||
panelTotal.SuspendLayout();
|
panelA0.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackTotal).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackA0).BeginInit();
|
||||||
panelTitleCPU.SuspendLayout();
|
panelTitleCPU.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
||||||
panelGPU.SuspendLayout();
|
panelGPU.SuspendLayout();
|
||||||
@@ -181,8 +181,8 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// chartGPU
|
// chartGPU
|
||||||
//
|
//
|
||||||
chartArea9.Name = "ChartArea1";
|
chartArea5.Name = "ChartArea1";
|
||||||
chartGPU.ChartAreas.Add(chartArea9);
|
chartGPU.ChartAreas.Add(chartArea5);
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
chartGPU.Location = new Point(12, 289);
|
chartGPU.Location = new Point(12, 289);
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -190,13 +190,13 @@ namespace GHelper
|
|||||||
chartGPU.Size = new Size(781, 259);
|
chartGPU.Size = new Size(781, 259);
|
||||||
chartGPU.TabIndex = 17;
|
chartGPU.TabIndex = 17;
|
||||||
chartGPU.Text = "chartGPU";
|
chartGPU.Text = "chartGPU";
|
||||||
title9.Name = "Title1";
|
title5.Name = "Title1";
|
||||||
chartGPU.Titles.Add(title9);
|
chartGPU.Titles.Add(title5);
|
||||||
//
|
//
|
||||||
// chartCPU
|
// chartCPU
|
||||||
//
|
//
|
||||||
chartArea10.Name = "ChartArea1";
|
chartArea6.Name = "ChartArea1";
|
||||||
chartCPU.ChartAreas.Add(chartArea10);
|
chartCPU.ChartAreas.Add(chartArea6);
|
||||||
chartCPU.Dock = DockStyle.Fill;
|
chartCPU.Dock = DockStyle.Fill;
|
||||||
chartCPU.Location = new Point(12, 10);
|
chartCPU.Location = new Point(12, 10);
|
||||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -204,13 +204,13 @@ namespace GHelper
|
|||||||
chartCPU.Size = new Size(781, 259);
|
chartCPU.Size = new Size(781, 259);
|
||||||
chartCPU.TabIndex = 14;
|
chartCPU.TabIndex = 14;
|
||||||
chartCPU.Text = "chartCPU";
|
chartCPU.Text = "chartCPU";
|
||||||
title10.Name = "Title1";
|
title6.Name = "Title1";
|
||||||
chartCPU.Titles.Add(title10);
|
chartCPU.Titles.Add(title6);
|
||||||
//
|
//
|
||||||
// chartXGM
|
// chartXGM
|
||||||
//
|
//
|
||||||
chartArea11.Name = "ChartAreaXGM";
|
chartArea7.Name = "ChartAreaXGM";
|
||||||
chartXGM.ChartAreas.Add(chartArea11);
|
chartXGM.ChartAreas.Add(chartArea7);
|
||||||
chartXGM.Dock = DockStyle.Fill;
|
chartXGM.Dock = DockStyle.Fill;
|
||||||
chartXGM.Location = new Point(12, 847);
|
chartXGM.Location = new Point(12, 847);
|
||||||
chartXGM.Margin = new Padding(2, 10, 2, 10);
|
chartXGM.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -218,14 +218,14 @@ namespace GHelper
|
|||||||
chartXGM.Size = new Size(781, 261);
|
chartXGM.Size = new Size(781, 261);
|
||||||
chartXGM.TabIndex = 14;
|
chartXGM.TabIndex = 14;
|
||||||
chartXGM.Text = "chartXGM";
|
chartXGM.Text = "chartXGM";
|
||||||
title11.Name = "Title4";
|
title7.Name = "Title4";
|
||||||
chartXGM.Titles.Add(title11);
|
chartXGM.Titles.Add(title7);
|
||||||
chartXGM.Visible = false;
|
chartXGM.Visible = false;
|
||||||
//
|
//
|
||||||
// chartMid
|
// chartMid
|
||||||
//
|
//
|
||||||
chartArea12.Name = "ChartArea3";
|
chartArea8.Name = "ChartArea3";
|
||||||
chartMid.ChartAreas.Add(chartArea12);
|
chartMid.ChartAreas.Add(chartArea8);
|
||||||
chartMid.Dock = DockStyle.Fill;
|
chartMid.Dock = DockStyle.Fill;
|
||||||
chartMid.Location = new Point(12, 568);
|
chartMid.Location = new Point(12, 568);
|
||||||
chartMid.Margin = new Padding(2, 10, 2, 10);
|
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -233,8 +233,8 @@ namespace GHelper
|
|||||||
chartMid.Size = new Size(781, 259);
|
chartMid.Size = new Size(781, 259);
|
||||||
chartMid.TabIndex = 14;
|
chartMid.TabIndex = 14;
|
||||||
chartMid.Text = "chartMid";
|
chartMid.Text = "chartMid";
|
||||||
title12.Name = "Title3";
|
title8.Name = "Title3";
|
||||||
chartMid.Titles.Add(title12);
|
chartMid.Titles.Add(title8);
|
||||||
chartMid.Visible = false;
|
chartMid.Visible = false;
|
||||||
//
|
//
|
||||||
// panelTitleFans
|
// panelTitleFans
|
||||||
@@ -366,9 +366,9 @@ namespace GHelper
|
|||||||
panelPower.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
panelPower.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelPower.Controls.Add(panelApplyPower);
|
panelPower.Controls.Add(panelApplyPower);
|
||||||
panelPower.Controls.Add(labelInfo);
|
panelPower.Controls.Add(labelInfo);
|
||||||
panelPower.Controls.Add(panelCPU);
|
panelPower.Controls.Add(panelB0);
|
||||||
panelPower.Controls.Add(panelAPU);
|
panelPower.Controls.Add(panelC1);
|
||||||
panelPower.Controls.Add(panelTotal);
|
panelPower.Controls.Add(panelA0);
|
||||||
panelPower.Controls.Add(panelTitleCPU);
|
panelPower.Controls.Add(panelTitleCPU);
|
||||||
panelPower.Dock = DockStyle.Fill;
|
panelPower.Dock = DockStyle.Fill;
|
||||||
panelPower.Location = new Point(10, 652);
|
panelPower.Location = new Point(10, 652);
|
||||||
@@ -411,155 +411,155 @@ namespace GHelper
|
|||||||
labelInfo.TabIndex = 43;
|
labelInfo.TabIndex = 43;
|
||||||
labelInfo.Text = "Experimental Feature";
|
labelInfo.Text = "Experimental Feature";
|
||||||
//
|
//
|
||||||
// panelAPU
|
// panelB0
|
||||||
//
|
//
|
||||||
panelAPU.AutoSize = true;
|
panelB0.AutoSize = true;
|
||||||
panelAPU.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
panelB0.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelAPU.Controls.Add(labelAPU);
|
panelB0.Controls.Add(labelB0);
|
||||||
panelAPU.Controls.Add(labelLeftAPU);
|
panelB0.Controls.Add(labelLeftB0);
|
||||||
panelAPU.Controls.Add(trackAPU);
|
panelB0.Controls.Add(trackB0);
|
||||||
panelAPU.Dock = DockStyle.Top;
|
panelB0.Dock = DockStyle.Top;
|
||||||
panelAPU.Location = new Point(0, 206);
|
panelB0.Location = new Point(0, 346);
|
||||||
panelAPU.Margin = new Padding(4);
|
panelB0.Margin = new Padding(4);
|
||||||
panelAPU.Name = "panelAPU";
|
panelB0.Name = "panelB0";
|
||||||
panelAPU.Size = new Size(523, 140);
|
panelB0.Size = new Size(523, 136);
|
||||||
panelAPU.TabIndex = 45;
|
panelB0.TabIndex = 41;
|
||||||
//
|
//
|
||||||
// labelAPU
|
// labelB0
|
||||||
//
|
//
|
||||||
labelAPU.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelB0.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelAPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelB0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelAPU.Location = new Point(396, 8);
|
labelB0.Location = new Point(398, 8);
|
||||||
labelAPU.Margin = new Padding(4, 0, 4, 0);
|
labelB0.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelAPU.Name = "labelAPU";
|
labelB0.Name = "labelB0";
|
||||||
labelAPU.Size = new Size(119, 32);
|
labelB0.Size = new Size(120, 32);
|
||||||
labelAPU.TabIndex = 13;
|
labelB0.TabIndex = 13;
|
||||||
labelAPU.Text = "APU";
|
labelB0.Text = "CPU";
|
||||||
labelAPU.TextAlign = ContentAlignment.TopRight;
|
labelB0.TextAlign = ContentAlignment.TopRight;
|
||||||
//
|
//
|
||||||
// labelLeftAPU
|
// labelLeftB0
|
||||||
//
|
//
|
||||||
labelLeftAPU.AutoSize = true;
|
labelLeftB0.AutoSize = true;
|
||||||
labelLeftAPU.Location = new Point(10, 8);
|
labelLeftB0.Location = new Point(10, 8);
|
||||||
labelLeftAPU.Margin = new Padding(4, 0, 4, 0);
|
labelLeftB0.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelLeftAPU.Name = "labelLeftAPU";
|
labelLeftB0.Name = "labelLeftB0";
|
||||||
labelLeftAPU.Size = new Size(58, 32);
|
labelLeftB0.Size = new Size(58, 32);
|
||||||
labelLeftAPU.TabIndex = 12;
|
labelLeftB0.TabIndex = 12;
|
||||||
labelLeftAPU.Text = "APU";
|
labelLeftB0.Text = "CPU";
|
||||||
//
|
//
|
||||||
// trackAPU
|
// trackB0
|
||||||
//
|
//
|
||||||
trackAPU.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
trackB0.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
trackAPU.Location = new Point(6, 48);
|
trackB0.Location = new Point(6, 44);
|
||||||
trackAPU.Margin = new Padding(4, 2, 4, 2);
|
trackB0.Margin = new Padding(4, 2, 4, 2);
|
||||||
trackAPU.Maximum = 85;
|
trackB0.Maximum = 85;
|
||||||
trackAPU.Minimum = 5;
|
trackB0.Minimum = 5;
|
||||||
trackAPU.Name = "trackAPU";
|
trackB0.Name = "trackB0";
|
||||||
trackAPU.Size = new Size(513, 90);
|
trackB0.Size = new Size(513, 90);
|
||||||
trackAPU.TabIndex = 11;
|
trackB0.TabIndex = 11;
|
||||||
trackAPU.TickFrequency = 5;
|
trackB0.TickFrequency = 5;
|
||||||
trackAPU.TickStyle = TickStyle.TopLeft;
|
trackB0.TickStyle = TickStyle.TopLeft;
|
||||||
trackAPU.Value = 80;
|
trackB0.Value = 80;
|
||||||
//
|
//
|
||||||
// panelCPU
|
// panelC1
|
||||||
//
|
//
|
||||||
panelCPU.AutoSize = true;
|
panelC1.AutoSize = true;
|
||||||
panelCPU.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
panelC1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelCPU.Controls.Add(labelCPU);
|
panelC1.Controls.Add(labelC1);
|
||||||
panelCPU.Controls.Add(labelLeftCPU);
|
panelC1.Controls.Add(labelLeftC1);
|
||||||
panelCPU.Controls.Add(trackCPU);
|
panelC1.Controls.Add(trackC1);
|
||||||
panelCPU.Dock = DockStyle.Top;
|
panelC1.Dock = DockStyle.Top;
|
||||||
panelCPU.Location = new Point(0, 346);
|
panelC1.Location = new Point(0, 206);
|
||||||
panelCPU.Margin = new Padding(4);
|
panelC1.Margin = new Padding(4);
|
||||||
panelCPU.Name = "panelCPU";
|
panelC1.Name = "panelC1";
|
||||||
panelCPU.Size = new Size(523, 136);
|
panelC1.Size = new Size(523, 140);
|
||||||
panelCPU.TabIndex = 41;
|
panelC1.TabIndex = 45;
|
||||||
//
|
//
|
||||||
// labelCPU
|
// labelC1
|
||||||
//
|
//
|
||||||
labelCPU.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelC1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelC1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelCPU.Location = new Point(398, 8);
|
labelC1.Location = new Point(396, 8);
|
||||||
labelCPU.Margin = new Padding(4, 0, 4, 0);
|
labelC1.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelCPU.Name = "labelCPU";
|
labelC1.Name = "labelC1";
|
||||||
labelCPU.Size = new Size(120, 32);
|
labelC1.Size = new Size(119, 32);
|
||||||
labelCPU.TabIndex = 13;
|
labelC1.TabIndex = 13;
|
||||||
labelCPU.Text = "CPU";
|
labelC1.Text = "APU";
|
||||||
labelCPU.TextAlign = ContentAlignment.TopRight;
|
labelC1.TextAlign = ContentAlignment.TopRight;
|
||||||
//
|
//
|
||||||
// labelLeftCPU
|
// labelLeftC1
|
||||||
//
|
//
|
||||||
labelLeftCPU.AutoSize = true;
|
labelLeftC1.AutoSize = true;
|
||||||
labelLeftCPU.Location = new Point(10, 8);
|
labelLeftC1.Location = new Point(10, 8);
|
||||||
labelLeftCPU.Margin = new Padding(4, 0, 4, 0);
|
labelLeftC1.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelLeftCPU.Name = "labelLeftCPU";
|
labelLeftC1.Name = "labelLeftC1";
|
||||||
labelLeftCPU.Size = new Size(58, 32);
|
labelLeftC1.Size = new Size(58, 32);
|
||||||
labelLeftCPU.TabIndex = 12;
|
labelLeftC1.TabIndex = 12;
|
||||||
labelLeftCPU.Text = "CPU";
|
labelLeftC1.Text = "APU";
|
||||||
//
|
//
|
||||||
// trackCPU
|
// trackC1
|
||||||
//
|
//
|
||||||
trackCPU.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
trackC1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
trackCPU.Location = new Point(6, 44);
|
trackC1.Location = new Point(6, 48);
|
||||||
trackCPU.Margin = new Padding(4, 2, 4, 2);
|
trackC1.Margin = new Padding(4, 2, 4, 2);
|
||||||
trackCPU.Maximum = 85;
|
trackC1.Maximum = 85;
|
||||||
trackCPU.Minimum = 5;
|
trackC1.Minimum = 5;
|
||||||
trackCPU.Name = "trackCPU";
|
trackC1.Name = "trackC1";
|
||||||
trackCPU.Size = new Size(513, 90);
|
trackC1.Size = new Size(513, 90);
|
||||||
trackCPU.TabIndex = 11;
|
trackC1.TabIndex = 11;
|
||||||
trackCPU.TickFrequency = 5;
|
trackC1.TickFrequency = 5;
|
||||||
trackCPU.TickStyle = TickStyle.TopLeft;
|
trackC1.TickStyle = TickStyle.TopLeft;
|
||||||
trackCPU.Value = 80;
|
trackC1.Value = 80;
|
||||||
//
|
//
|
||||||
// panelTotal
|
// panelA0
|
||||||
//
|
//
|
||||||
panelTotal.AutoSize = true;
|
panelA0.AutoSize = true;
|
||||||
panelTotal.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
panelA0.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelTotal.Controls.Add(labelTotal);
|
panelA0.Controls.Add(labelA0);
|
||||||
panelTotal.Controls.Add(labelLeftPlatform);
|
panelA0.Controls.Add(labelLeftA0);
|
||||||
panelTotal.Controls.Add(trackTotal);
|
panelA0.Controls.Add(trackA0);
|
||||||
panelTotal.Dock = DockStyle.Top;
|
panelA0.Dock = DockStyle.Top;
|
||||||
panelTotal.Location = new Point(0, 66);
|
panelA0.Location = new Point(0, 66);
|
||||||
panelTotal.Margin = new Padding(4);
|
panelA0.Margin = new Padding(4);
|
||||||
panelTotal.Name = "panelTotal";
|
panelA0.Name = "panelA0";
|
||||||
panelTotal.Size = new Size(523, 140);
|
panelA0.Size = new Size(523, 140);
|
||||||
panelTotal.TabIndex = 40;
|
panelA0.TabIndex = 40;
|
||||||
//
|
//
|
||||||
// labelTotal
|
// labelA0
|
||||||
//
|
//
|
||||||
labelTotal.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelA0.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelA0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelTotal.Location = new Point(396, 10);
|
labelA0.Location = new Point(396, 10);
|
||||||
labelTotal.Margin = new Padding(4, 0, 4, 0);
|
labelA0.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelTotal.Name = "labelTotal";
|
labelA0.Name = "labelA0";
|
||||||
labelTotal.Size = new Size(122, 32);
|
labelA0.Size = new Size(122, 32);
|
||||||
labelTotal.TabIndex = 12;
|
labelA0.TabIndex = 12;
|
||||||
labelTotal.Text = "Platform";
|
labelA0.Text = "Platform";
|
||||||
labelTotal.TextAlign = ContentAlignment.TopRight;
|
labelA0.TextAlign = ContentAlignment.TopRight;
|
||||||
//
|
//
|
||||||
// labelLeftPlatform
|
// labelLeftA0
|
||||||
//
|
//
|
||||||
labelLeftPlatform.AutoSize = true;
|
labelLeftA0.AutoSize = true;
|
||||||
labelLeftPlatform.Location = new Point(10, 10);
|
labelLeftA0.Location = new Point(10, 10);
|
||||||
labelLeftPlatform.Margin = new Padding(4, 0, 4, 0);
|
labelLeftA0.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelLeftPlatform.Name = "labelLeftPlatform";
|
labelLeftA0.Name = "labelLeftA0";
|
||||||
labelLeftPlatform.Size = new Size(104, 32);
|
labelLeftA0.Size = new Size(104, 32);
|
||||||
labelLeftPlatform.TabIndex = 11;
|
labelLeftA0.TabIndex = 11;
|
||||||
labelLeftPlatform.Text = "Platform";
|
labelLeftA0.Text = "Platform";
|
||||||
//
|
//
|
||||||
// trackTotal
|
// trackA0
|
||||||
//
|
//
|
||||||
trackTotal.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
trackA0.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
trackTotal.Location = new Point(6, 48);
|
trackA0.Location = new Point(6, 48);
|
||||||
trackTotal.Margin = new Padding(4, 2, 4, 2);
|
trackA0.Margin = new Padding(4, 2, 4, 2);
|
||||||
trackTotal.Maximum = 180;
|
trackA0.Maximum = 180;
|
||||||
trackTotal.Minimum = 10;
|
trackA0.Minimum = 10;
|
||||||
trackTotal.Name = "trackTotal";
|
trackA0.Name = "trackA0";
|
||||||
trackTotal.Size = new Size(513, 90);
|
trackA0.Size = new Size(513, 90);
|
||||||
trackTotal.TabIndex = 10;
|
trackA0.TabIndex = 10;
|
||||||
trackTotal.TickFrequency = 5;
|
trackA0.TickFrequency = 5;
|
||||||
trackTotal.TickStyle = TickStyle.TopLeft;
|
trackA0.TickStyle = TickStyle.TopLeft;
|
||||||
trackTotal.Value = 125;
|
trackA0.Value = 125;
|
||||||
//
|
//
|
||||||
// panelTitleCPU
|
// panelTitleCPU
|
||||||
//
|
//
|
||||||
@@ -873,15 +873,15 @@ namespace GHelper
|
|||||||
panelPower.PerformLayout();
|
panelPower.PerformLayout();
|
||||||
panelApplyPower.ResumeLayout(false);
|
panelApplyPower.ResumeLayout(false);
|
||||||
panelApplyPower.PerformLayout();
|
panelApplyPower.PerformLayout();
|
||||||
panelAPU.ResumeLayout(false);
|
panelB0.ResumeLayout(false);
|
||||||
panelAPU.PerformLayout();
|
panelB0.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackAPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackB0).EndInit();
|
||||||
panelCPU.ResumeLayout(false);
|
panelC1.ResumeLayout(false);
|
||||||
panelCPU.PerformLayout();
|
panelC1.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackCPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackC1).EndInit();
|
||||||
panelTotal.ResumeLayout(false);
|
panelA0.ResumeLayout(false);
|
||||||
panelTotal.PerformLayout();
|
panelA0.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackTotal).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackA0).EndInit();
|
||||||
panelTitleCPU.ResumeLayout(false);
|
panelTitleCPU.ResumeLayout(false);
|
||||||
panelTitleCPU.PerformLayout();
|
panelTitleCPU.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||||
@@ -917,14 +917,14 @@ namespace GHelper
|
|||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
private Panel panelPower;
|
private Panel panelPower;
|
||||||
private Label labelInfo;
|
private Label labelInfo;
|
||||||
private Panel panelCPU;
|
private Panel panelB0;
|
||||||
private Label labelCPU;
|
private Label labelB0;
|
||||||
private Label labelLeftCPU;
|
private Label labelLeftB0;
|
||||||
private TrackBar trackCPU;
|
private TrackBar trackB0;
|
||||||
private Panel panelTotal;
|
private Panel panelA0;
|
||||||
private Label labelTotal;
|
private Label labelA0;
|
||||||
private Label labelLeftPlatform;
|
private Label labelLeftA0;
|
||||||
private TrackBar trackTotal;
|
private TrackBar trackA0;
|
||||||
private Panel panelTitleCPU;
|
private Panel panelTitleCPU;
|
||||||
private PictureBox pictureBox1;
|
private PictureBox pictureBox1;
|
||||||
private Label labelPowerLimits;
|
private Label labelPowerLimits;
|
||||||
@@ -959,9 +959,9 @@ namespace GHelper
|
|||||||
private RComboBox comboBoost;
|
private RComboBox comboBoost;
|
||||||
private PictureBox picturePerf;
|
private PictureBox picturePerf;
|
||||||
private Label labelFans;
|
private Label labelFans;
|
||||||
private Panel panelAPU;
|
private Panel panelC1;
|
||||||
private Label labelAPU;
|
private Label labelC1;
|
||||||
private Label labelLeftAPU;
|
private Label labelLeftC1;
|
||||||
private TrackBar trackAPU;
|
private TrackBar trackC1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
84
app/Fans.cs
84
app/Fans.cs
@@ -77,22 +77,22 @@ namespace GHelper
|
|||||||
|
|
||||||
buttonReset.Click += ButtonReset_Click;
|
buttonReset.Click += ButtonReset_Click;
|
||||||
|
|
||||||
trackTotal.Maximum = AsusACPI.MaxTotal;
|
trackA0.Maximum = AsusACPI.MaxTotal;
|
||||||
trackTotal.Minimum = AsusACPI.MinTotal;
|
trackA0.Minimum = AsusACPI.MinTotal;
|
||||||
|
|
||||||
trackCPU.Maximum = AsusACPI.MaxCPU;
|
trackB0.Maximum = AsusACPI.MaxCPU;
|
||||||
trackCPU.Minimum = AsusACPI.MinCPU;
|
trackB0.Minimum = AsusACPI.MinCPU;
|
||||||
|
|
||||||
trackAPU.Maximum = AsusACPI.MaxTotal;
|
trackC1.Maximum = AsusACPI.MaxTotal;
|
||||||
trackAPU.Minimum = AsusACPI.MinTotal;
|
trackC1.Minimum = AsusACPI.MinTotal;
|
||||||
|
|
||||||
trackAPU.Scroll += TrackPower_Scroll;
|
trackC1.Scroll += TrackPower_Scroll;
|
||||||
trackCPU.Scroll += TrackPower_Scroll;
|
trackB0.Scroll += TrackPower_Scroll;
|
||||||
trackTotal.Scroll += TrackPower_Scroll;
|
trackA0.Scroll += TrackPower_Scroll;
|
||||||
|
|
||||||
trackAPU.MouseUp += TrackPower_MouseUp;
|
trackC1.MouseUp += TrackPower_MouseUp;
|
||||||
trackCPU.MouseUp += TrackPower_MouseUp;
|
trackB0.MouseUp += TrackPower_MouseUp;
|
||||||
trackTotal.MouseUp += TrackPower_MouseUp;
|
trackA0.MouseUp += TrackPower_MouseUp;
|
||||||
|
|
||||||
checkApplyFans.Click += CheckApplyFans_Click;
|
checkApplyFans.Click += CheckApplyFans_Click;
|
||||||
checkApplyPower.Click += CheckApplyPower_Click;
|
checkApplyPower.Click += CheckApplyPower_Click;
|
||||||
@@ -411,49 +411,45 @@ namespace GHelper
|
|||||||
public void InitPower(bool changed = false)
|
public void InitPower(bool changed = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0);
|
bool modeA0 = Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0;
|
||||||
bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB1) >= 0);
|
bool modeB0 = Program.acpi.IsAllAmdPPT();
|
||||||
bool apuMode = (Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0);
|
bool modeC1 = Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0;
|
||||||
|
|
||||||
bool gpuMode = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0);
|
|
||||||
|
|
||||||
bool allAMD = cpuBmode && !gpuMode;
|
powerVisible = panelPower.Visible = modeA0;
|
||||||
|
panelB0.Visible = modeB0;
|
||||||
powerVisible = panelPower.Visible = cpuAmode;
|
panelC1.Visible = modeC1;
|
||||||
panelCPU.Visible = allAMD;
|
|
||||||
panelAPU.Visible = apuMode;
|
|
||||||
|
|
||||||
|
|
||||||
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
// All AMD version has B0 but doesn't have C0 (Nvidia GPU) settings
|
||||||
if (allAMD)
|
if (modeB0)
|
||||||
{
|
{
|
||||||
labelLeftPlatform.Text = "Platform Slow (CPU + GPU)";
|
labelLeftA0.Text = "Platform (CPU + GPU)";
|
||||||
labelLeftAPU.Text = "Platform Fast (CPU + GPU)";
|
labelLeftB0.Text = "CPU";
|
||||||
labelLeftCPU.Text = "CPU";
|
panelC1.Visible = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
labelLeftPlatform.Text = "CPU Slow";
|
labelLeftA0.Text = "CPU Slow";
|
||||||
labelLeftAPU.Text = "CPU Fast";
|
labelLeftC1.Text = "CPU Fast";
|
||||||
}
|
}
|
||||||
|
|
||||||
int limit_total;
|
int limit_total;
|
||||||
int limit_cpu;
|
int limit_cpu;
|
||||||
int limit_apu;
|
int limit_fast;
|
||||||
|
|
||||||
bool apply = AppConfig.getConfigPerf("auto_apply_power") == 1;
|
bool apply = AppConfig.getConfigPerf("auto_apply_power") == 1;
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
limit_total = trackTotal.Value;
|
limit_total = trackA0.Value;
|
||||||
limit_cpu = trackCPU.Value;
|
limit_cpu = trackB0.Value;
|
||||||
limit_apu = trackAPU.Value;
|
limit_fast = trackC1.Value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
limit_total = AppConfig.getConfigPerf("limit_total");
|
limit_total = AppConfig.getConfigPerf("limit_total");
|
||||||
limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
||||||
limit_apu = AppConfig.getConfigPerf("limit_apu");
|
limit_fast = AppConfig.getConfigPerf("limit_fast");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
|
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
|
||||||
@@ -465,23 +461,23 @@ namespace GHelper
|
|||||||
if (limit_cpu < AsusACPI.MinCPU) limit_cpu = AsusACPI.MinCPU;
|
if (limit_cpu < AsusACPI.MinCPU) limit_cpu = AsusACPI.MinCPU;
|
||||||
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
||||||
|
|
||||||
if (limit_apu < 0) limit_apu = AsusACPI.DefaultTotal;
|
if (limit_fast < 0) limit_fast = AsusACPI.DefaultTotal;
|
||||||
if (limit_apu > AsusACPI.MaxTotal) limit_apu = AsusACPI.MaxTotal;
|
if (limit_fast > AsusACPI.MaxTotal) limit_fast = AsusACPI.MaxTotal;
|
||||||
if (limit_apu < AsusACPI.MinTotal) limit_apu = AsusACPI.MinTotal;
|
if (limit_fast < AsusACPI.MinTotal) limit_fast = AsusACPI.MinTotal;
|
||||||
|
|
||||||
trackTotal.Value = limit_total;
|
trackA0.Value = limit_total;
|
||||||
trackCPU.Value = limit_cpu;
|
trackB0.Value = limit_cpu;
|
||||||
trackAPU.Value = limit_apu;
|
trackC1.Value = limit_fast;
|
||||||
|
|
||||||
checkApplyPower.Checked = apply;
|
checkApplyPower.Checked = apply;
|
||||||
|
|
||||||
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
labelA0.Text = trackA0.Value.ToString() + "W";
|
||||||
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
labelB0.Text = trackB0.Value.ToString() + "W";
|
||||||
labelAPU.Text = trackAPU.Value.ToString() + "W";
|
labelC1.Text = trackC1.Value.ToString() + "W";
|
||||||
|
|
||||||
AppConfig.setConfigPerf("limit_total", limit_total);
|
AppConfig.setConfigPerf("limit_total", limit_total);
|
||||||
AppConfig.setConfigPerf("limit_cpu", limit_cpu);
|
AppConfig.setConfigPerf("limit_cpu", limit_cpu);
|
||||||
AppConfig.setConfigPerf("limit_apu", limit_apu);
|
AppConfig.setConfigPerf("limit_fast", limit_fast);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1013,7 +1013,7 @@ namespace GHelper
|
|||||||
|
|
||||||
int limit_total = AppConfig.getConfigPerf("limit_total");
|
int limit_total = AppConfig.getConfigPerf("limit_total");
|
||||||
int limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
int limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
||||||
int limit_apu = AppConfig.getConfigPerf("limit_apu");
|
int limit_fast = AppConfig.getConfigPerf("limit_fast");
|
||||||
|
|
||||||
if (limit_total > AsusACPI.MaxTotal) return;
|
if (limit_total > AsusACPI.MaxTotal) return;
|
||||||
if (limit_total < AsusACPI.MinTotal) return;
|
if (limit_total < AsusACPI.MinTotal) return;
|
||||||
@@ -1021,9 +1021,10 @@ namespace GHelper
|
|||||||
if (limit_cpu > AsusACPI.MaxCPU) return;
|
if (limit_cpu > AsusACPI.MaxCPU) return;
|
||||||
if (limit_cpu < AsusACPI.MinCPU) return;
|
if (limit_cpu < AsusACPI.MinCPU) return;
|
||||||
|
|
||||||
if (limit_apu > AsusACPI.MaxTotal) return;
|
if (limit_fast > AsusACPI.MaxTotal) return;
|
||||||
if (limit_apu < AsusACPI.MinTotal) return;
|
if (limit_fast < AsusACPI.MinTotal) return;
|
||||||
|
|
||||||
|
// SPL + SPPT togeher in one slider
|
||||||
if (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0)
|
||||||
{
|
{
|
||||||
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0");
|
||||||
@@ -1031,17 +1032,18 @@ namespace GHelper
|
|||||||
customPower = limit_total;
|
customPower = limit_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0)
|
if (Program.acpi.IsAllAmdPPT()) // CPU limit all amd models
|
||||||
{
|
{
|
||||||
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, limit_cpu, "PowerLimit B0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, limit_cpu, "PowerLimit B0");
|
||||||
customPower = limit_cpu;
|
customPower = limit_cpu;
|
||||||
}
|
}
|
||||||
|
else if (Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0) // FPPT boost for non all-amd models
|
||||||
if (Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0)
|
|
||||||
{
|
{
|
||||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUC1, limit_apu, "PowerLimit C1");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUC1, limit_fast, "PowerLimit C1");
|
||||||
|
customPower = limit_fast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Program.settingsForm.BeginInvoke(SetPerformanceLabel);
|
Program.settingsForm.BeginInvoke(SetPerformanceLabel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user