mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce9ec1b6df | ||
|
|
e68282050b | ||
|
|
6b8f61fab4 | ||
|
|
f59070cb96 | ||
|
|
f47a00fde2 | ||
|
|
b15c15974e |
@@ -26,7 +26,11 @@ public class ASUSWmi
|
|||||||
public const uint DevsGPUFanCurve = 0x00110025;
|
public const uint DevsGPUFanCurve = 0x00110025;
|
||||||
|
|
||||||
public const int PPT_Total = 0x001200A0;
|
public const int PPT_Total = 0x001200A0;
|
||||||
|
public const int PPT_Total1 = 0x001200A1;
|
||||||
|
public const int PPT_Total2 = 0x001200A2;
|
||||||
|
|
||||||
public const int PPT_CPU = 0x001200B0;
|
public const int PPT_CPU = 0x001200B0;
|
||||||
|
public const int PPT_CPU1 = 0x001200B1;
|
||||||
|
|
||||||
public const int PerformanceBalanced = 0;
|
public const int PerformanceBalanced = 0;
|
||||||
public const int PerformanceTurbo = 1;
|
public const int PerformanceTurbo = 1;
|
||||||
@@ -165,6 +169,11 @@ public class ASUSWmi
|
|||||||
public void SetFanCurve(int device, byte[] curve)
|
public void SetFanCurve(int device, byte[] curve)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (curve.Length != 16) return;
|
||||||
|
if (curve.All(singleByte => singleByte == 0)) return;
|
||||||
|
|
||||||
|
Debug.WriteLine(BitConverter.ToString(curve));
|
||||||
|
|
||||||
if (device == 1)
|
if (device == 1)
|
||||||
DeviceSet(DevsGPUFanCurve, curve);
|
DeviceSet(DevsGPUFanCurve, curve);
|
||||||
else
|
else
|
||||||
|
|||||||
16
Aura.cs
16
Aura.cs
@@ -10,7 +10,7 @@ public class Aura
|
|||||||
public const int Breathe = 1;
|
public const int Breathe = 1;
|
||||||
public const int Strobe = 2;
|
public const int Strobe = 2;
|
||||||
public const int Rainbow = 3;
|
public const int Rainbow = 3;
|
||||||
public const int Dingding = 10;
|
public const int Dingding = 4;
|
||||||
|
|
||||||
public const int SpeedSlow = 0xe1;
|
public const int SpeedSlow = 0xe1;
|
||||||
public const int SpeedMedium = 0xeb;
|
public const int SpeedMedium = 0xeb;
|
||||||
@@ -47,6 +47,20 @@ public class Aura
|
|||||||
|
|
||||||
HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||||
|
|
||||||
|
if (Mode == Dingding)
|
||||||
|
{
|
||||||
|
Mode = 10;
|
||||||
|
Speed = SpeedMedium;
|
||||||
|
}
|
||||||
|
else if (Mode == Rainbow)
|
||||||
|
{
|
||||||
|
Speed = SpeedMedium;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Speed = SpeedSlow;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (HidDevice device in HidDeviceList)
|
foreach (HidDevice device in HidDeviceList)
|
||||||
{
|
{
|
||||||
if (device.IsConnected)
|
if (device.IsConnected)
|
||||||
|
|||||||
54
Fans.Designer.cs
generated
54
Fans.Designer.cs
generated
@@ -35,6 +35,7 @@
|
|||||||
buttonReset = new Button();
|
buttonReset = new Button();
|
||||||
chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||||
groupBox1 = new GroupBox();
|
groupBox1 = new GroupBox();
|
||||||
|
labelApplied = new Label();
|
||||||
pictureFine = new PictureBox();
|
pictureFine = new PictureBox();
|
||||||
labelInfo = new Label();
|
labelInfo = new Label();
|
||||||
labelCPU = new Label();
|
labelCPU = new Label();
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
trackCPU = new TrackBar();
|
trackCPU = new TrackBar();
|
||||||
trackTotal = new TrackBar();
|
trackTotal = new TrackBar();
|
||||||
buttonApplyPower = new Button();
|
buttonApplyPower = new Button();
|
||||||
|
checkAuto = new CheckBox();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
||||||
groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
@@ -73,7 +75,7 @@
|
|||||||
//
|
//
|
||||||
// buttonReset
|
// buttonReset
|
||||||
//
|
//
|
||||||
buttonReset.Location = new Point(619, 1016);
|
buttonReset.Location = new Point(362, 1016);
|
||||||
buttonReset.Name = "buttonReset";
|
buttonReset.Name = "buttonReset";
|
||||||
buttonReset.Size = new Size(254, 46);
|
buttonReset.Size = new Size(254, 46);
|
||||||
buttonReset.TabIndex = 2;
|
buttonReset.TabIndex = 2;
|
||||||
@@ -92,6 +94,7 @@
|
|||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
|
groupBox1.Controls.Add(labelApplied);
|
||||||
groupBox1.Controls.Add(pictureFine);
|
groupBox1.Controls.Add(pictureFine);
|
||||||
groupBox1.Controls.Add(labelInfo);
|
groupBox1.Controls.Add(labelInfo);
|
||||||
groupBox1.Controls.Add(labelCPU);
|
groupBox1.Controls.Add(labelCPU);
|
||||||
@@ -102,18 +105,30 @@
|
|||||||
groupBox1.Controls.Add(trackTotal);
|
groupBox1.Controls.Add(trackTotal);
|
||||||
groupBox1.Location = new Point(12, 12);
|
groupBox1.Location = new Point(12, 12);
|
||||||
groupBox1.Name = "groupBox1";
|
groupBox1.Name = "groupBox1";
|
||||||
|
groupBox1.Padding = new Padding(5);
|
||||||
groupBox1.Size = new Size(330, 979);
|
groupBox1.Size = new Size(330, 979);
|
||||||
groupBox1.TabIndex = 4;
|
groupBox1.TabIndex = 4;
|
||||||
groupBox1.TabStop = false;
|
groupBox1.TabStop = false;
|
||||||
groupBox1.Text = "Power Limits (PPT)";
|
groupBox1.Text = "Power Limits (PPT)";
|
||||||
//
|
//
|
||||||
|
// labelApplied
|
||||||
|
//
|
||||||
|
labelApplied.AutoSize = true;
|
||||||
|
labelApplied.ForeColor = Color.Tomato;
|
||||||
|
labelApplied.Location = new Point(14, 39);
|
||||||
|
labelApplied.Name = "labelApplied";
|
||||||
|
labelApplied.Size = new Size(143, 32);
|
||||||
|
labelApplied.TabIndex = 13;
|
||||||
|
labelApplied.Text = "Not Applied";
|
||||||
|
//
|
||||||
// pictureFine
|
// pictureFine
|
||||||
//
|
//
|
||||||
|
pictureFine.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
pictureFine.BackgroundImage = Properties.Resources.everything_is_fine_itsfine;
|
pictureFine.BackgroundImage = Properties.Resources.everything_is_fine_itsfine;
|
||||||
pictureFine.BackgroundImageLayout = ImageLayout.Zoom;
|
pictureFine.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
pictureFine.Location = new Point(12, 725);
|
pictureFine.Location = new Point(9, 730);
|
||||||
pictureFine.Name = "pictureFine";
|
pictureFine.Name = "pictureFine";
|
||||||
pictureFine.Size = new Size(304, 240);
|
pictureFine.Size = new Size(311, 240);
|
||||||
pictureFine.TabIndex = 12;
|
pictureFine.TabIndex = 12;
|
||||||
pictureFine.TabStop = false;
|
pictureFine.TabStop = false;
|
||||||
pictureFine.Visible = false;
|
pictureFine.Visible = false;
|
||||||
@@ -121,7 +136,8 @@
|
|||||||
// labelInfo
|
// labelInfo
|
||||||
//
|
//
|
||||||
labelInfo.AutoSize = true;
|
labelInfo.AutoSize = true;
|
||||||
labelInfo.Location = new Point(22, 644);
|
labelInfo.Dock = DockStyle.Bottom;
|
||||||
|
labelInfo.Location = new Point(5, 942);
|
||||||
labelInfo.Name = "labelInfo";
|
labelInfo.Name = "labelInfo";
|
||||||
labelInfo.Size = new Size(65, 32);
|
labelInfo.Size = new Size(65, 32);
|
||||||
labelInfo.TabIndex = 11;
|
labelInfo.TabIndex = 11;
|
||||||
@@ -131,7 +147,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(195, 99);
|
labelCPU.Location = new Point(197, 125);
|
||||||
labelCPU.Name = "labelCPU";
|
labelCPU.Name = "labelCPU";
|
||||||
labelCPU.Size = new Size(61, 32);
|
labelCPU.Size = new Size(61, 32);
|
||||||
labelCPU.TabIndex = 10;
|
labelCPU.TabIndex = 10;
|
||||||
@@ -142,7 +158,7 @@
|
|||||||
//
|
//
|
||||||
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(37, 99);
|
labelTotal.Location = new Point(39, 125);
|
||||||
labelTotal.Name = "labelTotal";
|
labelTotal.Name = "labelTotal";
|
||||||
labelTotal.Size = new Size(70, 32);
|
labelTotal.Size = new Size(70, 32);
|
||||||
labelTotal.TabIndex = 9;
|
labelTotal.TabIndex = 9;
|
||||||
@@ -152,7 +168,7 @@
|
|||||||
// label2
|
// label2
|
||||||
//
|
//
|
||||||
label2.AutoSize = true;
|
label2.AutoSize = true;
|
||||||
label2.Location = new Point(198, 57);
|
label2.Location = new Point(200, 91);
|
||||||
label2.Name = "label2";
|
label2.Name = "label2";
|
||||||
label2.Size = new Size(58, 32);
|
label2.Size = new Size(58, 32);
|
||||||
label2.TabIndex = 8;
|
label2.TabIndex = 8;
|
||||||
@@ -162,7 +178,7 @@
|
|||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
label1.AutoSize = true;
|
label1.AutoSize = true;
|
||||||
label1.Location = new Point(39, 57);
|
label1.Location = new Point(41, 91);
|
||||||
label1.Name = "label1";
|
label1.Name = "label1";
|
||||||
label1.Size = new Size(65, 32);
|
label1.Size = new Size(65, 32);
|
||||||
label1.TabIndex = 7;
|
label1.TabIndex = 7;
|
||||||
@@ -171,24 +187,24 @@
|
|||||||
//
|
//
|
||||||
// trackCPU
|
// trackCPU
|
||||||
//
|
//
|
||||||
trackCPU.Location = new Point(203, 154);
|
trackCPU.Location = new Point(203, 178);
|
||||||
trackCPU.Maximum = 85;
|
trackCPU.Maximum = 85;
|
||||||
trackCPU.Minimum = 15;
|
trackCPU.Minimum = 15;
|
||||||
trackCPU.Name = "trackCPU";
|
trackCPU.Name = "trackCPU";
|
||||||
trackCPU.Orientation = Orientation.Vertical;
|
trackCPU.Orientation = Orientation.Vertical;
|
||||||
trackCPU.Size = new Size(90, 470);
|
trackCPU.Size = new Size(90, 444);
|
||||||
trackCPU.TabIndex = 6;
|
trackCPU.TabIndex = 6;
|
||||||
trackCPU.TickFrequency = 5;
|
trackCPU.TickFrequency = 5;
|
||||||
trackCPU.Value = 80;
|
trackCPU.Value = 80;
|
||||||
//
|
//
|
||||||
// trackTotal
|
// trackTotal
|
||||||
//
|
//
|
||||||
trackTotal.Location = new Point(45, 154);
|
trackTotal.Location = new Point(42, 178);
|
||||||
trackTotal.Maximum = 150;
|
trackTotal.Maximum = 150;
|
||||||
trackTotal.Minimum = 15;
|
trackTotal.Minimum = 15;
|
||||||
trackTotal.Name = "trackTotal";
|
trackTotal.Name = "trackTotal";
|
||||||
trackTotal.Orientation = Orientation.Vertical;
|
trackTotal.Orientation = Orientation.Vertical;
|
||||||
trackTotal.Size = new Size(90, 470);
|
trackTotal.Size = new Size(90, 444);
|
||||||
trackTotal.TabIndex = 5;
|
trackTotal.TabIndex = 5;
|
||||||
trackTotal.TickFrequency = 5;
|
trackTotal.TickFrequency = 5;
|
||||||
trackTotal.TickStyle = TickStyle.TopLeft;
|
trackTotal.TickStyle = TickStyle.TopLeft;
|
||||||
@@ -203,11 +219,22 @@
|
|||||||
buttonApplyPower.Text = "Apply Power Limits";
|
buttonApplyPower.Text = "Apply Power Limits";
|
||||||
buttonApplyPower.UseVisualStyleBackColor = true;
|
buttonApplyPower.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// checkAuto
|
||||||
|
//
|
||||||
|
checkAuto.AutoSize = true;
|
||||||
|
checkAuto.Location = new Point(708, 1022);
|
||||||
|
checkAuto.Name = "checkAuto";
|
||||||
|
checkAuto.Size = new Size(165, 36);
|
||||||
|
checkAuto.TabIndex = 12;
|
||||||
|
checkAuto.Text = "Auto Apply";
|
||||||
|
checkAuto.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// Fans
|
// Fans
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(13F, 32F);
|
AutoScaleDimensions = new SizeF(13F, 32F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1154, 1089);
|
ClientSize = new Size(1154, 1089);
|
||||||
|
Controls.Add(checkAuto);
|
||||||
Controls.Add(buttonApplyPower);
|
Controls.Add(buttonApplyPower);
|
||||||
Controls.Add(groupBox1);
|
Controls.Add(groupBox1);
|
||||||
Controls.Add(chartGPU);
|
Controls.Add(chartGPU);
|
||||||
@@ -231,6 +258,7 @@
|
|||||||
((System.ComponentModel.ISupportInitialize)trackCPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackCPU).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)trackTotal).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackTotal).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -249,5 +277,7 @@
|
|||||||
private Button buttonApplyPower;
|
private Button buttonApplyPower;
|
||||||
private Label labelInfo;
|
private Label labelInfo;
|
||||||
private PictureBox pictureFine;
|
private PictureBox pictureFine;
|
||||||
|
private Label labelApplied;
|
||||||
|
private CheckBox checkAuto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
107
Fans.cs
107
Fans.cs
@@ -65,14 +65,14 @@ namespace GHelper
|
|||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
FormClosing += Fans_FormClosing;
|
||||||
|
|
||||||
seriesCPU = chartCPU.Series.Add("CPU");
|
seriesCPU = chartCPU.Series.Add("CPU");
|
||||||
seriesGPU = chartGPU.Series.Add("GPU");
|
seriesGPU = chartGPU.Series.Add("GPU");
|
||||||
|
|
||||||
seriesCPU.Color = Color.Blue;
|
seriesCPU.Color = Color.Blue;
|
||||||
seriesGPU.Color = Color.Red;
|
seriesGPU.Color = Color.Red;
|
||||||
|
|
||||||
LoadFans();
|
|
||||||
|
|
||||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
@@ -93,15 +93,37 @@ namespace GHelper
|
|||||||
|
|
||||||
buttonApplyPower.Click += ButtonApplyPower_Click;
|
buttonApplyPower.Click += ButtonApplyPower_Click;
|
||||||
|
|
||||||
|
checkAuto.Click += CheckAuto_Click;
|
||||||
|
|
||||||
labelInfo.MaximumSize = new Size(300, 0);
|
labelInfo.MaximumSize = new Size(300, 0);
|
||||||
labelInfo.Text = "Power Limits (PPT) is experimental feature.\n\nValues will be applied only after you click 'Apply' and reset after performance mode change.\n\nUse carefully and on your own risk!";
|
labelInfo.Text = "Power Limits (PPT) is experimental feature.\n\nValues will be applied only after you click 'Apply' and reset after performance mode change.\n\nUse carefully and on your own risk!";
|
||||||
|
|
||||||
|
LoadFans();
|
||||||
VisualisePower(true);
|
VisualisePower(true);
|
||||||
|
|
||||||
Shown += Fans_Shown;
|
Shown += Fans_Shown;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckAuto_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CheckBox chk = (CheckBox)sender;
|
||||||
|
|
||||||
|
Program.config.setConfig("auto_apply_" + Program.config.getConfig("performance_mode"), chk.Checked ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.CloseReason == CloseReason.UserClosing)
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ButtonApplyPower_Click(object? sender, EventArgs e)
|
private void ButtonApplyPower_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
int limit_total = trackTotal.Value;
|
int limit_total = trackTotal.Value;
|
||||||
@@ -111,7 +133,14 @@ namespace GHelper
|
|||||||
Program.config.setConfig("limit_cpu", limit_cpu);
|
Program.config.setConfig("limit_cpu", limit_cpu);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_Total, limit_total);
|
Program.wmi.DeviceSet(ASUSWmi.PPT_Total, limit_total);
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PPT_Total1, limit_total);
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PPT_Total2, limit_total);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPU, limit_cpu);
|
Program.wmi.DeviceSet(ASUSWmi.PPT_CPU, limit_cpu);
|
||||||
|
//Program.wmi.DeviceSet(ASUSWmi.PPT_CPU1, limit_cpu);
|
||||||
|
|
||||||
|
labelApplied.ForeColor = Color.Blue;
|
||||||
|
labelApplied.Text = "Applied";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +190,12 @@ namespace GHelper
|
|||||||
VisualisePower();
|
VisualisePower();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetApplyLabel()
|
||||||
|
{
|
||||||
|
labelApplied.ForeColor = Color.Red;
|
||||||
|
labelApplied.Text = "Not Applied";
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadFans()
|
public void LoadFans()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -170,28 +205,12 @@ namespace GHelper
|
|||||||
LoadProfile(seriesCPU, 0);
|
LoadProfile(seriesCPU, 0);
|
||||||
LoadProfile(seriesGPU, 1);
|
LoadProfile(seriesGPU, 1);
|
||||||
|
|
||||||
|
int auto_apply = Program.config.getConfig("auto_apply_" + Program.config.getConfig("performance_mode"));
|
||||||
|
|
||||||
|
checkAuto.Checked = (auto_apply == 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] StringToBytes(string str)
|
|
||||||
{
|
|
||||||
String[] arr = str.Split('-');
|
|
||||||
byte[] array = new byte[arr.Length];
|
|
||||||
for (int i = 0; i < arr.Length; i++) array[i] = Convert.ToByte(arr[i], 16);
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
string GetFanName(int device)
|
|
||||||
{
|
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
|
||||||
string name;
|
|
||||||
|
|
||||||
if (device == 1)
|
|
||||||
name = "gpu";
|
|
||||||
else
|
|
||||||
name = "cpu";
|
|
||||||
|
|
||||||
return "fan_profile_" + name + "_" + mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoadProfile(Series series, int device, int def = 0)
|
void LoadProfile(Series series, int device, int def = 0)
|
||||||
{
|
{
|
||||||
@@ -203,42 +222,13 @@ namespace GHelper
|
|||||||
series.Points.Clear();
|
series.Points.Clear();
|
||||||
|
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = Program.config.getConfig("performance_mode");
|
||||||
string curveString = Program.config.getConfigString(GetFanName(device));
|
byte[] curve = Program.config.getFanConfig(device);
|
||||||
byte[] curve = { };
|
|
||||||
|
|
||||||
if (curveString is not null)
|
|
||||||
curve = StringToBytes(curveString);
|
|
||||||
|
|
||||||
if (def == 1 || curve.Length != 16)
|
if (def == 1 || curve.Length != 16)
|
||||||
curve = Program.wmi.GetFanCurve(device, mode);
|
curve = Program.wmi.GetFanCurve(device, mode);
|
||||||
|
|
||||||
if (curve.All(singleByte => singleByte == 0))
|
if (curve.All(singleByte => singleByte == 0))
|
||||||
{
|
Program.config.getDefaultCurve(device);
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
if (device == 1)
|
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
|
||||||
else
|
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (device == 1)
|
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
|
||||||
else
|
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (device == 1)
|
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
|
||||||
else
|
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Debug.WriteLine(BitConverter.ToString(curve));
|
//Debug.WriteLine(BitConverter.ToString(curve));
|
||||||
|
|
||||||
@@ -263,10 +253,7 @@ namespace GHelper
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
string bitCurve = BitConverter.ToString(curve);
|
Program.config.setFanConfig(device, curve);
|
||||||
Debug.WriteLine(bitCurve);
|
|
||||||
Program.config.setConfig(GetFanName(device), bitCurve);
|
|
||||||
|
|
||||||
Program.wmi.SetFanCurve(device, curve);
|
Program.wmi.SetFanCurve(device, curve);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -282,7 +269,13 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
LoadProfile(seriesCPU, 0, 1);
|
LoadProfile(seriesCPU, 0, 1);
|
||||||
LoadProfile(seriesGPU, 1, 1);
|
LoadProfile(seriesGPU, 1, 1);
|
||||||
|
|
||||||
|
checkAuto.Checked = false;
|
||||||
|
Program.config.setConfig("auto_apply_" + Program.config.getConfig("performance_mode"), 0);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"));
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"));
|
||||||
|
|
||||||
|
ResetApplyLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<AssemblyName>GHelper</AssemblyName>
|
<AssemblyName>GHelper</AssemblyName>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AssemblyVersion>0.10.0</AssemblyVersion>
|
<AssemblyVersion>0.11.0</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
74
Program.cs
74
Program.cs
@@ -75,6 +75,74 @@ public class AppConfig
|
|||||||
File.WriteAllText(configFile, jsonString);
|
File.WriteAllText(configFile, jsonString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string getFanName(int device)
|
||||||
|
{
|
||||||
|
int mode = getConfig("performance_mode");
|
||||||
|
string name;
|
||||||
|
|
||||||
|
if (device == 1)
|
||||||
|
name = "gpu";
|
||||||
|
else
|
||||||
|
name = "cpu";
|
||||||
|
|
||||||
|
return "fan_profile_" + name + "_" + mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getFanConfig(int device)
|
||||||
|
{
|
||||||
|
string curveString = getConfigString(getFanName(device));
|
||||||
|
byte[] curve = { };
|
||||||
|
|
||||||
|
if (curveString is not null)
|
||||||
|
curve = StringToBytes(curveString);
|
||||||
|
|
||||||
|
return curve;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFanConfig(int device, byte[] curve)
|
||||||
|
{
|
||||||
|
string bitCurve = BitConverter.ToString(curve);
|
||||||
|
setConfig(getFanName(device), bitCurve);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static byte[] StringToBytes(string str)
|
||||||
|
{
|
||||||
|
String[] arr = str.Split('-');
|
||||||
|
byte[] array = new byte[arr.Length];
|
||||||
|
for (int i = 0; i < arr.Length; i++) array[i] = Convert.ToByte(arr[i], 16);
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getDefaultCurve(int device)
|
||||||
|
{
|
||||||
|
int mode = getConfig("performance_mode");
|
||||||
|
byte[] curve;
|
||||||
|
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
if (device == 1)
|
||||||
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
||||||
|
else
|
||||||
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (device == 1)
|
||||||
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
||||||
|
else
|
||||||
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (device == 1)
|
||||||
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
||||||
|
else
|
||||||
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return curve;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +244,8 @@ namespace GHelper
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Process proc = Process.Start(start);
|
Process proc = Process.Start(start);
|
||||||
} catch
|
}
|
||||||
|
catch
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Failed to run " + fileName);
|
Debug.WriteLine("Failed to run " + fileName);
|
||||||
}
|
}
|
||||||
@@ -269,6 +338,9 @@ namespace GHelper
|
|||||||
settingsForm.Show();
|
settingsForm.Show();
|
||||||
settingsForm.Activate();
|
settingsForm.Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settingsForm.VisualiseGPUMode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
|
static void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
### NEW! Experimental feature: **Set Power limits (PPT) - Total and CPU**.
|
||||||
|
|
||||||
1. Switch between default **Performance modes** - Silent / Balanced / Turbo and apply default fan curves
|
1. Switch between default **Performance modes** - Silent / Balanced / Turbo and apply default fan curves
|
||||||
2. Switch between Eco / Standard or Ultimate **GPU modes**
|
2. Switch between Eco / Standard or Ultimate **GPU modes**
|
||||||
3. Change laptop screen refresh rate - 60hz or your maximum (120hz, 144hz, etc depending on the model) with display overdrive (OD)
|
3. Change laptop screen refresh rate - 60hz or your maximum (120hz, 144hz, etc depending on the model) with display overdrive (OD)
|
||||||
@@ -11,10 +13,10 @@ A small utility that allows you do almost everyting you could do with Armory Cra
|
|||||||
7. Monitor CPU temperature, fan speeds and battery discharge rate
|
7. Monitor CPU temperature, fan speeds and battery discharge rate
|
||||||
8. **Automatically switch to Eco(iGPU)/60hz on battery** and back to Standard(GPU)/120hz modes when plugged
|
8. **Automatically switch to Eco(iGPU)/60hz on battery** and back to Standard(GPU)/120hz modes when plugged
|
||||||
9. Support for M4 key / FN+F5 to cycle through performance modes (with OSD notification) and FN+F4 to cycle through keeyboard animation modes
|
9. Support for M4 key / FN+F5 to cycle through performance modes (with OSD notification) and FN+F4 to cycle through keeyboard animation modes
|
||||||
10. Basic keybindings for M3 amd M4 keys
|
10. Basic keybindings for M3 and M4 keys
|
||||||
11. Turn cpu turbo boost on/off with one checkbox to keep temps cooler
|
11. Turn cpu turbo boost on/off with one checkbox to keep temps cooler
|
||||||
|
|
||||||
Designed and developer for Asus Zephyrus G14 2022 (with AMD Radeon iGPU and dGPU). But could and should potentially work for G14 of 2021 and 2020, G15, X FLOW, and other ROG models for relevant and supported features.
|
Designed and developed for Asus Zephyrus G14 2022 (with AMD Radeon iGPU and dGPU). But could and should potentially work for G14 of 2021 and 2020, G15, X FLOW, and other ROG models for relevant and supported features.
|
||||||
|
|
||||||
To keep autoswitching and hotkeys work app needs to stay in running in tray. It doesn't consume any resources.
|
To keep autoswitching and hotkeys work app needs to stay in running in tray. It doesn't consume any resources.
|
||||||
|
|
||||||
|
|||||||
2
Settings.Designer.cs
generated
2
Settings.Designer.cs
generated
@@ -468,7 +468,7 @@
|
|||||||
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
comboKeyboard.FormattingEnabled = true;
|
comboKeyboard.FormattingEnabled = true;
|
||||||
comboKeyboard.ItemHeight = 32;
|
comboKeyboard.ItemHeight = 32;
|
||||||
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Strobe", "Rainbow" });
|
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Strobe", "Rainbow", "Dingding" });
|
||||||
comboKeyboard.Location = new Point(32, 778);
|
comboKeyboard.Location = new Point(32, 778);
|
||||||
comboKeyboard.Margin = new Padding(0);
|
comboKeyboard.Margin = new Padding(0);
|
||||||
comboKeyboard.Name = "comboKeyboard";
|
comboKeyboard.Name = "comboKeyboard";
|
||||||
|
|||||||
42
Settings.cs
42
Settings.cs
@@ -1,7 +1,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Security.Cryptography;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using System.Windows.Forms.DataVisualization.Charting;
|
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
@@ -122,12 +122,17 @@ namespace GHelper
|
|||||||
if (fans == null || fans.Text == "")
|
if (fans == null || fans.Text == "")
|
||||||
{
|
{
|
||||||
fans = new Fans();
|
fans = new Fans();
|
||||||
|
Debug.WriteLine("Starting fans");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fans.Visible)
|
||||||
|
{
|
||||||
|
fans.Hide();
|
||||||
|
} else
|
||||||
|
{
|
||||||
fans.Show();
|
fans.Show();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
fans.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,14 +210,14 @@ namespace GHelper
|
|||||||
|
|
||||||
//Debug.WriteLine(mode);
|
//Debug.WriteLine(mode);
|
||||||
|
|
||||||
if (mode > 3) mode = 0;
|
if (mode > 4) mode = 0;
|
||||||
|
|
||||||
pictureColor2.Visible = (mode == Aura.Breathe);
|
pictureColor2.Visible = (mode == Aura.Breathe);
|
||||||
|
|
||||||
if (Aura.Mode == mode) return; // same mode
|
if (Aura.Mode == mode) return; // same mode
|
||||||
|
|
||||||
|
|
||||||
Aura.Mode = mode;
|
Aura.Mode = mode;
|
||||||
|
|
||||||
Program.config.setConfig("aura_mode", mode);
|
Program.config.setConfig("aura_mode", mode);
|
||||||
|
|
||||||
comboKeyboard.SelectedValueChanged -= ComboKeyboard_SelectedValueChanged;
|
comboKeyboard.SelectedValueChanged -= ComboKeyboard_SelectedValueChanged;
|
||||||
@@ -425,7 +430,7 @@ namespace GHelper
|
|||||||
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
||||||
{
|
{
|
||||||
RefreshSensors();
|
RefreshSensors();
|
||||||
aTimer.Interval = 2000;
|
aTimer.Interval = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
||||||
@@ -474,17 +479,19 @@ namespace GHelper
|
|||||||
|
|
||||||
|
|
||||||
Program.config.setConfig("performance_mode", PerformanceMode);
|
Program.config.setConfig("performance_mode", PerformanceMode);
|
||||||
try
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode);
|
||||||
|
|
||||||
|
if (Program.config.getConfig("auto_apply_" + PerformanceMode) == 1)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode);
|
Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
||||||
}
|
Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
||||||
catch
|
|
||||||
{
|
|
||||||
labelPerf.Text = "Performance Mode: not supported";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fans != null && fans.Text != "")
|
if (fans != null && fans.Text != "")
|
||||||
|
{
|
||||||
fans.LoadFans();
|
fans.LoadFans();
|
||||||
|
fans.ResetApplyLabel();
|
||||||
|
}
|
||||||
|
|
||||||
if (notify)
|
if (notify)
|
||||||
{
|
{
|
||||||
@@ -643,9 +650,14 @@ namespace GHelper
|
|||||||
checkScreen.Checked = (ScreenAuto == 1);
|
checkScreen.Checked = (ScreenAuto == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void VisualiseGPUMode(int GPUMode)
|
public void VisualiseGPUMode(int GPUMode = -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (GPUMode == -1)
|
||||||
|
{
|
||||||
|
GPUMode = Program.config.getConfig("gpu_mode");
|
||||||
|
}
|
||||||
|
|
||||||
buttonEco.FlatAppearance.BorderSize = buttonInactive;
|
buttonEco.FlatAppearance.BorderSize = buttonInactive;
|
||||||
buttonStandard.FlatAppearance.BorderSize = buttonInactive;
|
buttonStandard.FlatAppearance.BorderSize = buttonInactive;
|
||||||
buttonUltimate.FlatAppearance.BorderSize = buttonInactive;
|
buttonUltimate.FlatAppearance.BorderSize = buttonInactive;
|
||||||
|
|||||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
Reference in New Issue
Block a user