Compare commits

...

7 Commits
v0.22 ... v0.23

Author SHA1 Message Date
seerge
5334d1e4ed Screenshot 2023-03-11 12:47:17 +01:00
seerge
9f339806d4 UI Fixes 2023-03-11 12:41:34 +01:00
seerge
54a4668e2a Under the hood changes 2023-03-10 23:32:12 +01:00
seerge
71d2a6ce05 Merge branch 'main' of https://github.com/seerge/g14-helper 2023-03-10 21:50:22 +01:00
seerge
92d1b97b95 Fix for UI lag on GPU switch 2023-03-10 21:50:20 +01:00
seerge
4b9a53cef8 Update README.md 2023-03-10 15:51:20 +01:00
seerge
068694d7d1 Update README.md 2023-03-10 13:45:49 +01:00
13 changed files with 186 additions and 810 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics; using GHelper;
using System.Diagnostics;
using System.Management; using System.Management;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@@ -3,4 +3,8 @@
<System.Windows.Forms.ApplicationConfigurationSection> <System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" /> <add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection> </System.Windows.Forms.ApplicationConfigurationSection>
</configuration> </configuration>
<appSettings>
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>

163
Fans.Designer.cs generated
View File

@@ -28,16 +28,17 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
panelFans = new Panel(); panelFans = new Panel();
tableFanCharts = new TableLayoutPanel();
chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
chartCPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
checkBoost = new CheckBox(); checkBoost = new CheckBox();
labelFans = new Label(); labelFans = new Label();
checkAuto = new CheckBox(); checkAuto = new CheckBox();
chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
buttonReset = new Button(); buttonReset = new Button();
buttonApply = new Button(); buttonApply = new Button();
chartCPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
panelPower = new Panel(); panelPower = new Panel();
labelPowerLimits = new Label(); labelPowerLimits = new Label();
checkApplyPower = new CheckBox(); checkApplyPower = new CheckBox();
@@ -54,6 +55,7 @@
pictureFine = new PictureBox(); pictureFine = new PictureBox();
labelInfo = new Label(); labelInfo = new Label();
panelFans.SuspendLayout(); panelFans.SuspendLayout();
tableFanCharts.SuspendLayout();
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit(); ((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit(); ((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
panelPower.SuspendLayout(); panelPower.SuspendLayout();
@@ -66,28 +68,68 @@
// //
// panelFans // panelFans
// //
panelFans.AutoSize = true; panelFans.Controls.Add(tableFanCharts);
panelFans.Controls.Add(checkBoost); panelFans.Controls.Add(checkBoost);
panelFans.Controls.Add(labelFans); panelFans.Controls.Add(labelFans);
panelFans.Controls.Add(checkAuto); panelFans.Controls.Add(checkAuto);
panelFans.Controls.Add(chartGPU);
panelFans.Controls.Add(buttonReset); panelFans.Controls.Add(buttonReset);
panelFans.Controls.Add(buttonApply); panelFans.Controls.Add(buttonApply);
panelFans.Controls.Add(chartCPU);
panelFans.Dock = DockStyle.Left; panelFans.Dock = DockStyle.Left;
panelFans.Location = new Point(363, 0); panelFans.Location = new Point(364, 0);
panelFans.Margin = new Padding(10); panelFans.Margin = new Padding(0);
panelFans.MinimumSize = new Size(872, 1089); panelFans.MinimumSize = new Size(824, 1098);
panelFans.Name = "panelFans"; panelFans.Name = "panelFans";
panelFans.Padding = new Padding(10); panelFans.Padding = new Padding(20);
panelFans.Size = new Size(872, 1089); panelFans.Size = new Size(824, 1159);
panelFans.TabIndex = 12; panelFans.TabIndex = 12;
// //
// tableFanCharts
//
tableFanCharts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
tableFanCharts.ColumnCount = 1;
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
tableFanCharts.Controls.Add(chartGPU, 0, 1);
tableFanCharts.Controls.Add(chartCPU, 0, 0);
tableFanCharts.Location = new Point(28, 68);
tableFanCharts.Margin = new Padding(6);
tableFanCharts.Name = "tableFanCharts";
tableFanCharts.RowCount = 2;
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
tableFanCharts.Size = new Size(764, 988);
tableFanCharts.TabIndex = 36;
//
// chartGPU
//
chartArea3.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea3);
chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(2, 504);
chartGPU.Margin = new Padding(2, 10, 2, 10);
chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(760, 474);
chartGPU.TabIndex = 17;
chartGPU.Text = "chart1";
//
// chartCPU
//
chartArea4.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea4);
chartCPU.Dock = DockStyle.Fill;
chartCPU.Location = new Point(2, 10);
chartCPU.Margin = new Padding(2, 10, 2, 10);
chartCPU.Name = "chartCPU";
chartCPU.Size = new Size(760, 474);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
//
// checkBoost // checkBoost
// //
checkBoost.AutoSize = true; checkBoost.AutoSize = true;
checkBoost.ForeColor = SystemColors.ControlText; checkBoost.ForeColor = SystemColors.ControlText;
checkBoost.Location = new Point(512, 15); checkBoost.Location = new Point(475, 18);
checkBoost.Margin = new Padding(4, 2, 4, 2); checkBoost.Margin = new Padding(4, 2, 4, 2);
checkBoost.Name = "checkBoost"; checkBoost.Name = "checkBoost";
checkBoost.Size = new Size(320, 36); checkBoost.Size = new Size(320, 36);
@@ -99,7 +141,8 @@
// //
labelFans.AutoSize = true; labelFans.AutoSize = true;
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelFans.Location = new Point(24, 15); labelFans.Location = new Point(28, 20);
labelFans.Margin = new Padding(4, 0, 4, 0);
labelFans.Name = "labelFans"; labelFans.Name = "labelFans";
labelFans.Size = new Size(138, 32); labelFans.Size = new Size(138, 32);
labelFans.TabIndex = 28; labelFans.TabIndex = 28;
@@ -109,7 +152,7 @@
// //
checkAuto.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; checkAuto.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
checkAuto.AutoSize = true; checkAuto.AutoSize = true;
checkAuto.Location = new Point(411, 1030); checkAuto.Location = new Point(377, 1086);
checkAuto.Margin = new Padding(4, 2, 4, 2); checkAuto.Margin = new Padding(4, 2, 4, 2);
checkAuto.Name = "checkAuto"; checkAuto.Name = "checkAuto";
checkAuto.Size = new Size(165, 36); checkAuto.Size = new Size(165, 36);
@@ -117,25 +160,13 @@
checkAuto.Text = "Auto Apply"; checkAuto.Text = "Auto Apply";
checkAuto.UseVisualStyleBackColor = true; checkAuto.UseVisualStyleBackColor = true;
// //
// chartGPU
//
chartGPU.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Location = new Point(22, 547);
chartGPU.Margin = new Padding(4, 2, 4, 2);
chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(810, 460);
chartGPU.TabIndex = 16;
chartGPU.Text = "chart1";
//
// buttonReset // buttonReset
// //
buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonReset.Location = new Point(22, 1025); buttonReset.Location = new Point(30, 1081);
buttonReset.Margin = new Padding(4, 2, 4, 2); buttonReset.Margin = new Padding(4, 2, 4, 2);
buttonReset.Name = "buttonReset"; buttonReset.Name = "buttonReset";
buttonReset.Size = new Size(231, 44); buttonReset.Size = new Size(232, 44);
buttonReset.TabIndex = 15; buttonReset.TabIndex = 15;
buttonReset.Text = "Factory Defaults"; buttonReset.Text = "Factory Defaults";
buttonReset.UseVisualStyleBackColor = true; buttonReset.UseVisualStyleBackColor = true;
@@ -143,7 +174,7 @@
// buttonApply // buttonApply
// //
buttonApply.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonApply.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonApply.Location = new Point(584, 1025); buttonApply.Location = new Point(542, 1081);
buttonApply.Margin = new Padding(4, 2, 4, 2); buttonApply.Margin = new Padding(4, 2, 4, 2);
buttonApply.Name = "buttonApply"; buttonApply.Name = "buttonApply";
buttonApply.Size = new Size(248, 44); buttonApply.Size = new Size(248, 44);
@@ -151,18 +182,6 @@
buttonApply.Text = "Apply Fan Curve"; buttonApply.Text = "Apply Fan Curve";
buttonApply.UseVisualStyleBackColor = true; buttonApply.UseVisualStyleBackColor = true;
// //
// chartCPU
//
chartCPU.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
chartCPU.Location = new Point(22, 66);
chartCPU.Margin = new Padding(10);
chartCPU.Name = "chartCPU";
chartCPU.Size = new Size(810, 460);
chartCPU.TabIndex = 13;
chartCPU.Text = "chartCPU";
//
// panelPower // panelPower
// //
panelPower.Controls.Add(labelPowerLimits); panelPower.Controls.Add(labelPowerLimits);
@@ -175,15 +194,18 @@
panelPower.Controls.Add(labelInfo); panelPower.Controls.Add(labelInfo);
panelPower.Dock = DockStyle.Left; panelPower.Dock = DockStyle.Left;
panelPower.Location = new Point(0, 0); panelPower.Location = new Point(0, 0);
panelPower.Margin = new Padding(10);
panelPower.Name = "panelPower"; panelPower.Name = "panelPower";
panelPower.Size = new Size(363, 1089); panelPower.Padding = new Padding(10);
panelPower.Size = new Size(364, 1159);
panelPower.TabIndex = 13; panelPower.TabIndex = 13;
// //
// labelPowerLimits // labelPowerLimits
// //
labelPowerLimits.AutoSize = true; labelPowerLimits.AutoSize = true;
labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelPowerLimits.Location = new Point(23, 15); labelPowerLimits.Location = new Point(24, 20);
labelPowerLimits.Margin = new Padding(4, 0, 4, 0);
labelPowerLimits.Name = "labelPowerLimits"; labelPowerLimits.Name = "labelPowerLimits";
labelPowerLimits.Size = new Size(229, 32); labelPowerLimits.Size = new Size(229, 32);
labelPowerLimits.TabIndex = 26; labelPowerLimits.TabIndex = 26;
@@ -191,9 +213,9 @@
// //
// checkApplyPower // checkApplyPower
// //
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
checkApplyPower.AutoSize = true; checkApplyPower.AutoSize = true;
checkApplyPower.Location = new Point(21, 982); checkApplyPower.Location = new Point(27, 1039);
checkApplyPower.Margin = new Padding(4, 2, 4, 2); checkApplyPower.Margin = new Padding(4, 2, 4, 2);
checkApplyPower.Name = "checkApplyPower"; checkApplyPower.Name = "checkApplyPower";
checkApplyPower.Size = new Size(165, 36); checkApplyPower.Size = new Size(165, 36);
@@ -204,10 +226,10 @@
// buttonApplyPower // buttonApplyPower
// //
buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
buttonApplyPower.Location = new Point(17, 1025); buttonApplyPower.Location = new Point(20, 1081);
buttonApplyPower.Margin = new Padding(4, 2, 4, 2); buttonApplyPower.Margin = new Padding(4, 2, 4, 2);
buttonApplyPower.Name = "buttonApplyPower"; buttonApplyPower.Name = "buttonApplyPower";
buttonApplyPower.Size = new Size(321, 44); buttonApplyPower.Size = new Size(324, 44);
buttonApplyPower.TabIndex = 24; buttonApplyPower.TabIndex = 24;
buttonApplyPower.Text = "Apply Power Limits"; buttonApplyPower.Text = "Apply Power Limits";
buttonApplyPower.UseVisualStyleBackColor = true; buttonApplyPower.UseVisualStyleBackColor = true;
@@ -217,7 +239,8 @@
panelCPU.Controls.Add(labelCPU); panelCPU.Controls.Add(labelCPU);
panelCPU.Controls.Add(label2); panelCPU.Controls.Add(label2);
panelCPU.Controls.Add(trackCPU); panelCPU.Controls.Add(trackCPU);
panelCPU.Location = new Point(184, 89); panelCPU.Location = new Point(184, 90);
panelCPU.Margin = new Padding(4);
panelCPU.Name = "panelCPU"; panelCPU.Name = "panelCPU";
panelCPU.Size = new Size(160, 510); panelCPU.Size = new Size(160, 510);
panelCPU.TabIndex = 23; panelCPU.TabIndex = 23;
@@ -226,7 +249,7 @@
// //
labelCPU.AutoSize = true; labelCPU.AutoSize = true;
labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelCPU.Location = new Point(43, 41); labelCPU.Location = new Point(44, 40);
labelCPU.Margin = new Padding(4, 0, 4, 0); labelCPU.Margin = new Padding(4, 0, 4, 0);
labelCPU.Name = "labelCPU"; labelCPU.Name = "labelCPU";
labelCPU.Size = new Size(61, 32); labelCPU.Size = new Size(61, 32);
@@ -237,7 +260,7 @@
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(45, 7); label2.Location = new Point(44, 8);
label2.Margin = new Padding(4, 0, 4, 0); label2.Margin = new Padding(4, 0, 4, 0);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(58, 32); label2.Size = new Size(58, 32);
@@ -247,7 +270,7 @@
// //
// trackCPU // trackCPU
// //
trackCPU.Location = new Point(47, 89); trackCPU.Location = new Point(48, 88);
trackCPU.Margin = new Padding(4, 2, 4, 2); trackCPU.Margin = new Padding(4, 2, 4, 2);
trackCPU.Maximum = 85; trackCPU.Maximum = 85;
trackCPU.Minimum = 15; trackCPU.Minimum = 15;
@@ -263,16 +286,17 @@
panelTotal.Controls.Add(labelTotal); panelTotal.Controls.Add(labelTotal);
panelTotal.Controls.Add(label1); panelTotal.Controls.Add(label1);
panelTotal.Controls.Add(trackTotal); panelTotal.Controls.Add(trackTotal);
panelTotal.Location = new Point(17, 89); panelTotal.Location = new Point(16, 90);
panelTotal.Margin = new Padding(4);
panelTotal.Name = "panelTotal"; panelTotal.Name = "panelTotal";
panelTotal.Size = new Size(160, 511); panelTotal.Size = new Size(160, 512);
panelTotal.TabIndex = 22; panelTotal.TabIndex = 22;
// //
// labelTotal // labelTotal
// //
labelTotal.AutoSize = true; labelTotal.AutoSize = true;
labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelTotal.Location = new Point(46, 41); labelTotal.Location = new Point(46, 40);
labelTotal.Margin = new Padding(4, 0, 4, 0); labelTotal.Margin = new Padding(4, 0, 4, 0);
labelTotal.Name = "labelTotal"; labelTotal.Name = "labelTotal";
labelTotal.Size = new Size(70, 32); labelTotal.Size = new Size(70, 32);
@@ -283,7 +307,7 @@
// label1 // label1
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new Point(48, 7); label1.Location = new Point(48, 8);
label1.Margin = new Padding(4, 0, 4, 0); label1.Margin = new Padding(4, 0, 4, 0);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(65, 32); label1.Size = new Size(65, 32);
@@ -293,7 +317,7 @@
// //
// trackTotal // trackTotal
// //
trackTotal.Location = new Point(44, 89); trackTotal.Location = new Point(44, 88);
trackTotal.Margin = new Padding(4, 2, 4, 2); trackTotal.Margin = new Padding(4, 2, 4, 2);
trackTotal.Maximum = 150; trackTotal.Maximum = 150;
trackTotal.Minimum = 15; trackTotal.Minimum = 15;
@@ -309,7 +333,7 @@
// //
labelApplied.AutoSize = true; labelApplied.AutoSize = true;
labelApplied.ForeColor = Color.Tomato; labelApplied.ForeColor = Color.Tomato;
labelApplied.Location = new Point(23, 51); labelApplied.Location = new Point(24, 54);
labelApplied.Margin = new Padding(4, 0, 4, 0); labelApplied.Margin = new Padding(4, 0, 4, 0);
labelApplied.Name = "labelApplied"; labelApplied.Name = "labelApplied";
labelApplied.Size = new Size(143, 32); labelApplied.Size = new Size(143, 32);
@@ -318,13 +342,13 @@
// //
// pictureFine // pictureFine
// //
pictureFine.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; pictureFine.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
pictureFine.BackgroundImageLayout = ImageLayout.Zoom; pictureFine.BackgroundImageLayout = ImageLayout.Zoom;
pictureFine.Image = Properties.Resources.everything_is_fine_itsfine; pictureFine.Image = Properties.Resources.everything_is_fine_itsfine;
pictureFine.Location = new Point(17, 671); pictureFine.Location = new Point(20, 682);
pictureFine.Margin = new Padding(4, 2, 4, 2); pictureFine.Margin = new Padding(4, 2, 4, 2);
pictureFine.Name = "pictureFine"; pictureFine.Name = "pictureFine";
pictureFine.Size = new Size(327, 254); pictureFine.Size = new Size(324, 268);
pictureFine.SizeMode = PictureBoxSizeMode.Zoom; pictureFine.SizeMode = PictureBoxSizeMode.Zoom;
pictureFine.TabIndex = 20; pictureFine.TabIndex = 20;
pictureFine.TabStop = false; pictureFine.TabStop = false;
@@ -332,10 +356,10 @@
// //
// labelInfo // labelInfo
// //
labelInfo.Location = new Point(17, 603); labelInfo.Location = new Point(24, 618);
labelInfo.Margin = new Padding(4, 0, 4, 0); labelInfo.Margin = new Padding(4, 0, 4, 0);
labelInfo.Name = "labelInfo"; labelInfo.Name = "labelInfo";
labelInfo.Size = new Size(327, 330); labelInfo.Size = new Size(320, 330);
labelInfo.TabIndex = 19; labelInfo.TabIndex = 19;
labelInfo.Text = "label"; labelInfo.Text = "label";
// //
@@ -345,14 +369,14 @@
AutoScaleMode = AutoScaleMode.Dpi; AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true; AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink; AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(1220, 1089); ClientSize = new Size(1188, 1159);
Controls.Add(panelFans); Controls.Add(panelFans);
Controls.Add(panelPower); Controls.Add(panelPower);
Margin = new Padding(4, 2, 4, 2); Margin = new Padding(4, 2, 4, 2);
MaximizeBox = false; MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false; MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false; MinimizeBox = false;
MinimumSize = new Size(0, 1160); MinimumSize = new Size(26, 1230);
Name = "Fans"; Name = "Fans";
ShowIcon = false; ShowIcon = false;
ShowInTaskbar = false; ShowInTaskbar = false;
@@ -360,6 +384,7 @@
Text = "Fans and Power"; Text = "Fans and Power";
panelFans.ResumeLayout(false); panelFans.ResumeLayout(false);
panelFans.PerformLayout(); panelFans.PerformLayout();
tableFanCharts.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit(); ((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit(); ((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
panelPower.ResumeLayout(false); panelPower.ResumeLayout(false);
@@ -372,16 +397,13 @@
((System.ComponentModel.ISupportInitialize)trackTotal).EndInit(); ((System.ComponentModel.ISupportInitialize)trackTotal).EndInit();
((System.ComponentModel.ISupportInitialize)pictureFine).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureFine).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion
private Panel panelFans; private Panel panelFans;
private CheckBox checkAuto; private CheckBox checkAuto;
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
private Button buttonReset; private Button buttonReset;
private Button buttonApply; private Button buttonApply;
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
private Panel panelPower; private Panel panelPower;
private CheckBox checkApplyPower; private CheckBox checkApplyPower;
private Button buttonApplyPower; private Button buttonApplyPower;
@@ -397,7 +419,10 @@
private PictureBox pictureFine; private PictureBox pictureFine;
private Label labelInfo; private Label labelInfo;
private Label labelPowerLimits; private Label labelPowerLimits;
private Label labelFans; private TableLayoutPanel tableFanCharts;
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
private CheckBox checkBoost; private CheckBox checkBoost;
private Label labelFans;
} }
} }

13
Fans.cs
View File

@@ -57,7 +57,18 @@ namespace GHelper
private void Fans_Shown(object? sender, EventArgs e) private void Fans_Shown(object? sender, EventArgs e)
{ {
Top = Program.settingsForm.Top; if (Height > Program.settingsForm.Height)
{
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
}
else
{
MinimumSize = new Size(0, Program.settingsForm.Height);
Height = Program.settingsForm.Height;
Top = Program.settingsForm.Top;
}
Left = Program.settingsForm.Left - Width - 5; Left = Program.settingsForm.Left - Width - 5;
} }

View File

@@ -15,8 +15,8 @@
<AssemblyName>GHelper</AssemblyName> <AssemblyName>GHelper</AssemblyName>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AssemblyVersion>0.21</AssemblyVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.23</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -99,6 +99,7 @@ namespace GHelper
} }
Application.EnableVisualStyles();
trayIcon.MouseClick += TrayIcon_MouseClick; ; trayIcon.MouseClick += TrayIcon_MouseClick; ;
@@ -143,10 +144,6 @@ namespace GHelper
case PBT_APMRESUMEAUTOMATIC: case PBT_APMRESUMEAUTOMATIC:
settingsForm.BeginInvoke(delegate settingsForm.BeginInvoke(delegate
{ {
// Setting "other" mode to prevent bios bugging with PPTs after wake up from sleep
wmi.DeviceSet(ASUSWmi.PerformanceMode, config.getConfig("performance_mode"));
Thread.Sleep(1000);
SetAutoModes(); SetAutoModes();
}); });
break; break;
@@ -159,7 +156,8 @@ namespace GHelper
static async void CheckForUpdates() static async void CheckForUpdates()
{ {
settingsForm.SetVersionLabel("Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString()); var assembly = Assembly.GetExecutingAssembly().GetName().Version.ToString();
settingsForm.SetVersionLabel("Version: " + assembly);
try try
{ {
@@ -170,12 +168,11 @@ namespace GHelper
var config = JsonSerializer.Deserialize<JsonElement>(json); var config = JsonSerializer.Deserialize<JsonElement>(json);
var tag = config.GetProperty("tag_name").ToString().Replace("v", ""); var tag = config.GetProperty("tag_name").ToString().Replace("v", "");
var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString(); var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString();
var assembly = Assembly.GetExecutingAssembly().GetName().Version.ToString();
var gitVersion = new Version(tag); var gitVersion = new Version(tag);
var appVersion = new Version(); var appVersion = new Version(assembly);
var result = appVersion.CompareTo(gitVersion); var result = gitVersion.CompareTo(appVersion);
if (result > 0) if (result > 0)
{ {
settingsForm.SetVersionLabel("Download Update: " + tag, url); settingsForm.SetVersionLabel("Download Update: " + tag, url);
@@ -196,9 +193,8 @@ namespace GHelper
Debug.WriteLine(isPlugged.ToString()); Debug.WriteLine(isPlugged.ToString());
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit")); settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
settingsForm.AutoPerformance(isPlugged);
settingsForm.AutoScreen(isPlugged);
settingsForm.AutoPerformance(isPlugged);
settingsForm.AutoGPUMode(isPlugged); settingsForm.AutoGPUMode(isPlugged);
settingsForm.SetMatrix(isPlugged); settingsForm.SetMatrix(isPlugged);

View File

@@ -2,6 +2,10 @@
A small utility that allows you do almost everyting you could do with Armory Crate but without extra bloat and unnecessary services. A small utility that allows you do almost everyting you could do with Armory Crate but without extra bloat and unnecessary services.
### [Download latest release](https://github.com/seerge/g-helper/releases)
![Screenshot](https://raw.githubusercontent.com/seerge/g-helper/main/screenshot.png)
## NEW (and experimental) features ## NEW (and experimental) features
1. Set Power limits (PPT) for Total (APU + dGPU) and CPU. 1. Set Power limits (PPT) for Total (APU + dGPU) and CPU.
@@ -27,10 +31,6 @@ To keep autoswitching and hotkeys work app needs to stay in running in tray. It
I recommend to keep "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working. If you have (or had) MyASUS app installed, that service is most probably still up an running even after MyASUS uninstall. It's part of [Asus System Controll Interface](https://www.asus.com/support/FAQ/1047338/). You can install it, and later disable / remove unnecesarily services by running [this bat file](https://raw.githubusercontent.com/seerge/g-helper/main/stop-asus-sv.bat ) as admin. I recommend to keep "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working. If you have (or had) MyASUS app installed, that service is most probably still up an running even after MyASUS uninstall. It's part of [Asus System Controll Interface](https://www.asus.com/support/FAQ/1047338/). You can install it, and later disable / remove unnecesarily services by running [this bat file](https://raw.githubusercontent.com/seerge/g-helper/main/stop-asus-sv.bat ) as admin.
### [Download latest release](https://github.com/seerge/g-helper/releases)
![Screenshot](https://github.com/seerge/g-helper/blob/main/screenshot.png)
## Performance Profile switching ## Performance Profile switching
Profiles are **same** as in Armory Crate (as they are stored in bios), including default fan curves Profiles are **same** as in Armory Crate (as they are stored in bios), including default fan curves

View File

@@ -60,6 +60,7 @@ namespace GHelper
buttonQuit.Click += ButtonQuit_Click; buttonQuit.Click += ButtonQuit_Click;
checkGPU.CheckedChanged += CheckGPU_CheckedChanged;
checkScreen.CheckedChanged += checkScreen_CheckedChanged; checkScreen.CheckedChanged += checkScreen_CheckedChanged;
@@ -96,6 +97,13 @@ namespace GHelper
} }
private void CheckGPU_CheckedChanged(object? sender, EventArgs e)
{
if (sender is null) return;
CheckBox check = (CheckBox)sender;
Program.config.setConfig("gpu_auto", check.Checked ? 1 : 0);
}
public void SetVersionLabel(string label, string url = null) public void SetVersionLabel(string label, string url = null)
{ {
labelVersion.Text = label; labelVersion.Text = label;
@@ -510,21 +518,15 @@ namespace GHelper
frequency = 120; frequency = 120;
} }
if (frequency > 0) if (frequency <= 0) return;
NativeMethods.SetRefreshRate(frequency);
try
{
if (overdrive > 0)
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
}
catch
{
Debug.WriteLine("Screen Overdrive not supported");
}
NativeMethods.SetRefreshRate(frequency);
if (overdrive > 0)
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
InitScreen(); InitScreen();
Debug.WriteLine(frequency);
} }
public void InitScreen() public void InitScreen()
@@ -717,8 +719,16 @@ namespace GHelper
if (Program.config.getConfigPerf("auto_apply_power") == 1) if (Program.config.getConfigPerf("auto_apply_power") == 1)
{ {
SetPower(); var timer = new System.Timers.Timer(500);
timer.Elapsed += delegate
{
timer.Stop();
timer.Dispose();
SetPower();
};
timer.Start();
} }
} }
public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced, bool notify = false) public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced, bool notify = false)
@@ -802,7 +812,6 @@ namespace GHelper
else else
SetScreen(60, 0); SetScreen(60, 0);
InitScreen();
} }
@@ -815,20 +824,17 @@ namespace GHelper
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco); int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux); int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
if (mux == 0) // GPU in Ultimate, ignore if (mux == 0) // GPU in Ultimate, ignore
return; return;
else else
{ {
if (eco == 1 && Plugged == PowerLineStatus.Online) // Eco going Standard on plugged if (eco == 1 && Plugged == PowerLineStatus.Online) // Eco going Standard on plugged
{ {
Program.wmi.DeviceSet(ASUSWmi.GPUEco, 0); SetEcoGPU(0);
InitGPUMode();
} }
else if (eco == 0 && Plugged != PowerLineStatus.Online) // Standard going Eco on plugged else if (eco == 0 && Plugged != PowerLineStatus.Online) // Standard going Eco on plugged
{ {
Program.wmi.DeviceSet(ASUSWmi.GPUEco, 1); SetEcoGPU(1);
InitGPUMode();
} }
} }
@@ -851,10 +857,13 @@ namespace GHelper
else else
GpuMode = ASUSWmi.GPUModeStandard; GpuMode = ASUSWmi.GPUModeStandard;
if (mux != 1) buttonUltimate.Visible = (mux == 1);
Disable_Ultimate();
} }
ButtonEnabled(buttonEco, true);
ButtonEnabled(buttonStandard, true);
ButtonEnabled(buttonUltimate, true);
Program.config.setConfig("gpu_mode", GpuMode); Program.config.setConfig("gpu_mode", GpuMode);
VisualiseGPUMode(GpuMode); VisualiseGPUMode(GpuMode);
@@ -862,7 +871,30 @@ namespace GHelper
} }
public void SetGPUMode(int GPUMode = ASUSWmi.GPUModeStandard)
public void SetEcoGPU(int eco)
{
ButtonEnabled(buttonEco, false);
ButtonEnabled(buttonStandard, false);
ButtonEnabled(buttonUltimate, false);
labelGPU.Text = "GPU Mode: Changing ...";
new Thread(() =>
{
Thread.CurrentThread.IsBackground = true;
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco);
Program.settingsForm.BeginInvoke(delegate
{
InitGPUMode();
AutoScreen(SystemInformation.PowerStatus.PowerLineStatus);
});
}).Start();
}
public void SetGPUMode(int GPUMode)
{ {
int CurrentGPU = Program.config.getConfig("gpu_mode"); int CurrentGPU = Program.config.getConfig("gpu_mode");
@@ -897,13 +929,13 @@ namespace GHelper
else if (GPUMode == ASUSWmi.GPUModeEco) else if (GPUMode == ASUSWmi.GPUModeEco)
{ {
VisualiseGPUMode(GPUMode); VisualiseGPUMode(GPUMode);
Program.wmi.DeviceSet(ASUSWmi.GPUEco, 1); SetEcoGPU(1);
changed = true; changed = true;
} }
else if (GPUMode == ASUSWmi.GPUModeStandard) else if (GPUMode == ASUSWmi.GPUModeStandard)
{ {
VisualiseGPUMode(GPUMode); VisualiseGPUMode(GPUMode);
Program.wmi.DeviceSet(ASUSWmi.GPUEco, 0); SetEcoGPU(0);
changed = true; changed = true;
} }
@@ -959,6 +991,7 @@ namespace GHelper
Program.trayIcon.Icon = GHelper.Properties.Resources.standard; Program.trayIcon.Icon = GHelper.Properties.Resources.standard;
break; break;
} }
} }
@@ -982,10 +1015,10 @@ namespace GHelper
} }
public void Disable_Ultimate() public void ButtonEnabled(Button but, bool enabled)
{ {
buttonUltimate.Enabled = false; but.Enabled = enabled;
buttonUltimate.BackColor = SystemColors.ControlLight; but.BackColor = enabled ? SystemColors.ControlLightLight : SystemColors.ControlLight;
} }
public void SetStartupCheck(bool status) public void SetStartupCheck(bool status)
@@ -1013,13 +1046,6 @@ namespace GHelper
SetBatteryChargeLimit(bar.Value); SetBatteryChargeLimit(bar.Value);
} }
private void checkGPU_CheckedChanged(object? sender, EventArgs e)
{
if (sender is null) return;
CheckBox check = (CheckBox)sender;
Program.config.setConfig("gpu_auto", check.Checked ? 1 : 0);
}
private void checkScreen_CheckedChanged(object? sender, EventArgs e) private void checkScreen_CheckedChanged(object? sender, EventArgs e)
{ {

View File

@@ -54,6 +54,7 @@
<application xmlns="urn:schemas-microsoft-com:asm.v3"> <application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings> <windowsSettings>
<!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor/dpiAwareness>--> <!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor/dpiAwareness>-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness>
</windowsSettings> </windowsSettings>
</application> </application>

View File

@@ -1 +0,0 @@
ps2exe .\ghelper.ps1 g14-helper.exe -title 'G14 Helper' -DPIAware -winFormsDPIAware -requireAdmin -iconFile 'standard.ico' -noConsole -copyright 'G14 Helper Tool' -noOutput

File diff suppressed because one or more lines are too long

BIN
old-ps1-script/ghelper.zip Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB