Intel E/P Cores UI Tweaks

This commit is contained in:
Serge
2024-02-25 11:39:43 +01:00
parent 4889f0277f
commit a9c6033c35
3 changed files with 39 additions and 21 deletions

View File

@@ -2,7 +2,6 @@
using GHelper.USB; using GHelper.USB;
using System.Management; using System.Management;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using static System.Runtime.InteropServices.JavaScript.JSType;
public enum AsusFan public enum AsusFan
{ {
@@ -145,7 +144,7 @@ public class AsusACPI
public const int DefaultCPU = 80; public const int DefaultCPU = 80;
public const int MinGPUBoost = 5; public const int MinGPUBoost = 5;
public static int MaxGPUBoost = 50; public static int MaxGPUBoost = 25;
public const int MinGPUTemp = 75; public const int MinGPUTemp = 75;
public const int MaxGPUTemp = 87; public const int MaxGPUTemp = 87;
@@ -685,7 +684,7 @@ public class AsusACPI
if (value < 0) return (-1, -1); if (value < 0) return (-1, -1);
Logger.WriteLine("Cores" + (max ? "Max" : "") + ": 0x" + value.ToString("X4")); Logger.WriteLine("Cores" + (max ? "Max" : "") + ": 0x" + value.ToString("X4"));
return ((value >> 8) & 0xFF, (value) & 0xFF); return ((value >> 8) & 0xFF, (value) & 0xFF);
} }
@@ -693,7 +692,7 @@ public class AsusACPI
{ {
if (eCores < 0 || eCores > 16 || pCores < 0 || pCores > 16) return; if (eCores < 0 || eCores > 16 || pCores < 0 || pCores > 16) return;
int value = (eCores << 8) | pCores; int value = (eCores << 8) | pCores;
Program.acpi.DeviceSet(CORES_CPU, value, "Cores (0x" + value.ToString("X4")+")"); Program.acpi.DeviceSet(CORES_CPU, value, "Cores (0x" + value.ToString("X4") + ")");
} }
public string ScanRange() public string ScanRange()

38
app/Extra.Designer.cs generated
View File

@@ -122,6 +122,7 @@ namespace GHelper
pictureAPUMem = new PictureBox(); pictureAPUMem = new PictureBox();
labelAPUMem = new Label(); labelAPUMem = new Label();
panelCores = new Panel(); panelCores = new Panel();
buttonCores = new RButton();
comboCoresP = new RComboBox(); comboCoresP = new RComboBox();
comboCoresE = new RComboBox(); comboCoresE = new RComboBox();
pictureCores = new PictureBox(); pictureCores = new PictureBox();
@@ -162,7 +163,7 @@ namespace GHelper
panelServices.Controls.Add(labelServices); panelServices.Controls.Add(labelServices);
panelServices.Controls.Add(buttonServices); panelServices.Controls.Add(buttonServices);
panelServices.Dock = DockStyle.Top; panelServices.Dock = DockStyle.Top;
panelServices.Location = new Point(15, 1436); panelServices.Location = new Point(15, 1439);
panelServices.Name = "panelServices"; panelServices.Name = "panelServices";
panelServices.Size = new Size(983, 75); panelServices.Size = new Size(983, 75);
panelServices.TabIndex = 5; panelServices.TabIndex = 5;
@@ -1084,7 +1085,7 @@ namespace GHelper
panelSettings.Controls.Add(checkGpuApps); panelSettings.Controls.Add(checkGpuApps);
panelSettings.Controls.Add(checkGPUFix); panelSettings.Controls.Add(checkGPUFix);
panelSettings.Dock = DockStyle.Top; panelSettings.Dock = DockStyle.Top;
panelSettings.Location = new Point(15, 1036); panelSettings.Location = new Point(15, 1039);
panelSettings.Name = "panelSettings"; panelSettings.Name = "panelSettings";
panelSettings.Padding = new Padding(20, 5, 11, 5); panelSettings.Padding = new Padding(20, 5, 11, 5);
panelSettings.Size = new Size(983, 346); panelSettings.Size = new Size(983, 346);
@@ -1199,7 +1200,7 @@ namespace GHelper
panelPower.Controls.Add(labelHibernateAfter); panelPower.Controls.Add(labelHibernateAfter);
panelPower.Controls.Add(pictureHibernate); panelPower.Controls.Add(pictureHibernate);
panelPower.Dock = DockStyle.Top; panelPower.Dock = DockStyle.Top;
panelPower.Location = new Point(15, 1382); panelPower.Location = new Point(15, 1385);
panelPower.Name = "panelPower"; panelPower.Name = "panelPower";
panelPower.Size = new Size(983, 54); panelPower.Size = new Size(983, 54);
panelPower.TabIndex = 4; panelPower.TabIndex = 4;
@@ -1242,7 +1243,7 @@ namespace GHelper
panelAPU.Controls.Add(pictureAPUMem); panelAPU.Controls.Add(pictureAPUMem);
panelAPU.Controls.Add(labelAPUMem); panelAPU.Controls.Add(labelAPUMem);
panelAPU.Dock = DockStyle.Top; panelAPU.Dock = DockStyle.Top;
panelAPU.Location = new Point(15, 979); panelAPU.Location = new Point(15, 982);
panelAPU.Name = "panelAPU"; panelAPU.Name = "panelAPU";
panelAPU.Padding = new Padding(11, 5, 11, 0); panelAPU.Padding = new Padding(11, 5, 11, 0);
panelAPU.Size = new Size(983, 57); panelAPU.Size = new Size(983, 57);
@@ -1260,7 +1261,7 @@ namespace GHelper
comboAPU.FormattingEnabled = true; comboAPU.FormattingEnabled = true;
comboAPU.ItemHeight = 32; comboAPU.ItemHeight = 32;
comboAPU.Items.AddRange(new object[] { "Auto", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G" }); comboAPU.Items.AddRange(new object[] { "Auto", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G" });
comboAPU.Location = new Point(647, 8); comboAPU.Location = new Point(654, 8);
comboAPU.Margin = new Padding(4, 12, 4, 9); comboAPU.Margin = new Padding(4, 12, 4, 9);
comboAPU.Name = "comboAPU"; comboAPU.Name = "comboAPU";
comboAPU.Size = new Size(309, 40); comboAPU.Size = new Size(309, 40);
@@ -1281,7 +1282,7 @@ namespace GHelper
// //
labelAPUMem.AutoSize = true; labelAPUMem.AutoSize = true;
labelAPUMem.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelAPUMem.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelAPUMem.Location = new Point(56, 11); labelAPUMem.Location = new Point(64, 11);
labelAPUMem.Name = "labelAPUMem"; labelAPUMem.Name = "labelAPUMem";
labelAPUMem.Size = new Size(309, 32); labelAPUMem.Size = new Size(309, 32);
labelAPUMem.TabIndex = 0; labelAPUMem.TabIndex = 0;
@@ -1290,6 +1291,7 @@ namespace GHelper
// panelCores // panelCores
// //
panelCores.AutoSize = true; panelCores.AutoSize = true;
panelCores.Controls.Add(buttonCores);
panelCores.Controls.Add(comboCoresP); panelCores.Controls.Add(comboCoresP);
panelCores.Controls.Add(comboCoresE); panelCores.Controls.Add(comboCoresE);
panelCores.Controls.Add(pictureCores); panelCores.Controls.Add(pictureCores);
@@ -1298,10 +1300,27 @@ namespace GHelper
panelCores.Location = new Point(15, 921); panelCores.Location = new Point(15, 921);
panelCores.Name = "panelCores"; panelCores.Name = "panelCores";
panelCores.Padding = new Padding(11, 5, 11, 0); panelCores.Padding = new Padding(11, 5, 11, 0);
panelCores.Size = new Size(983, 58); panelCores.Size = new Size(983, 61);
panelCores.TabIndex = 47; panelCores.TabIndex = 47;
panelCores.Visible = false; panelCores.Visible = false;
// //
// buttonCores
//
buttonCores.Activated = false;
buttonCores.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCores.BackColor = SystemColors.ButtonHighlight;
buttonCores.BorderColor = Color.Transparent;
buttonCores.BorderRadius = 2;
buttonCores.FlatStyle = FlatStyle.Flat;
buttonCores.Location = new Point(856, 7);
buttonCores.Margin = new Padding(4, 3, 4, 3);
buttonCores.Name = "buttonCores";
buttonCores.Secondary = false;
buttonCores.Size = new Size(106, 46);
buttonCores.TabIndex = 20;
buttonCores.Text = "Apply";
buttonCores.UseVisualStyleBackColor = false;
//
// comboCoresP // comboCoresP
// //
comboCoresP.Anchor = AnchorStyles.Top | AnchorStyles.Right; comboCoresP.Anchor = AnchorStyles.Top | AnchorStyles.Right;
@@ -1311,7 +1330,7 @@ namespace GHelper
comboCoresP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); comboCoresP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboCoresP.FormattingEnabled = true; comboCoresP.FormattingEnabled = true;
comboCoresP.ItemHeight = 32; comboCoresP.ItemHeight = 32;
comboCoresP.Location = new Point(805, 9); comboCoresP.Location = new Point(701, 10);
comboCoresP.Margin = new Padding(4, 12, 4, 9); comboCoresP.Margin = new Padding(4, 12, 4, 9);
comboCoresP.Name = "comboCoresP"; comboCoresP.Name = "comboCoresP";
comboCoresP.Size = new Size(150, 40); comboCoresP.Size = new Size(150, 40);
@@ -1327,7 +1346,7 @@ namespace GHelper
comboCoresE.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); comboCoresE.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboCoresE.FormattingEnabled = true; comboCoresE.FormattingEnabled = true;
comboCoresE.ItemHeight = 32; comboCoresE.ItemHeight = 32;
comboCoresE.Location = new Point(647, 9); comboCoresE.Location = new Point(543, 10);
comboCoresE.Margin = new Padding(4, 12, 4, 9); comboCoresE.Margin = new Padding(4, 12, 4, 9);
comboCoresE.Name = "comboCoresE"; comboCoresE.Name = "comboCoresE";
comboCoresE.Size = new Size(150, 40); comboCoresE.Size = new Size(150, 40);
@@ -1522,5 +1541,6 @@ namespace GHelper
private PictureBox pictureCores; private PictureBox pictureCores;
private Label label1; private Label label1;
private RComboBox comboCoresP; private RComboBox comboCoresP;
private RButton buttonCores;
} }
} }

View File

@@ -419,29 +419,28 @@ namespace GHelper
comboCoresE.DropDownStyle = ComboBoxStyle.DropDownList; comboCoresE.DropDownStyle = ComboBoxStyle.DropDownList;
comboCoresP.DropDownStyle = ComboBoxStyle.DropDownList; comboCoresP.DropDownStyle = ComboBoxStyle.DropDownList;
for (int i = 0; i <= eCoresMax; i++) comboCoresE.Items.Add(i.ToString() + "E-cores"); for (int i = 0; i <= eCoresMax; i++) comboCoresE.Items.Add(i.ToString() + " Ecores");
for (int i = 0; i <= pCoresMax; i++) comboCoresP.Items.Add(i.ToString() + "P-cores"); for (int i = 0; i <= pCoresMax; i++) comboCoresP.Items.Add(i.ToString() + " Pcores");
comboCoresE.SelectedIndex = Math.Min(eCores, eCoresMax); comboCoresE.SelectedIndex = Math.Min(eCores, eCoresMax);
comboCoresP.SelectedIndex = Math.Min(pCores, pCoresMax); comboCoresP.SelectedIndex = Math.Min(pCores, pCoresMax);
comboCoresP.SelectedIndexChanged += ComboCores_SelectedIndexChanged; buttonCores.Click += ButtonCores_Click;
comboCoresE.SelectedIndexChanged += ComboCores_SelectedIndexChanged;
} }
private void ComboCores_SelectedIndexChanged(object? sender, EventArgs e) private void ButtonCores_Click(object? sender, EventArgs e)
{ {
Program.acpi.SetCores(comboCoresE.SelectedIndex, comboCoresP.SelectedIndex);
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertAPUMemoryRestart, Properties.Strings.AlertAPUMemoryRestartTitle, MessageBoxButtons.YesNo); DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertAPUMemoryRestart, Properties.Strings.AlertAPUMemoryRestartTitle, MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes) if (dialogResult == DialogResult.Yes)
{ {
Program.acpi.SetCores(comboCoresE.SelectedIndex, comboCoresP.SelectedIndex);
Process.Start("shutdown", "/r /t 1"); Process.Start("shutdown", "/r /t 1");
} }
} }
private void PictureScan_Click(object? sender, EventArgs e) private void PictureScan_Click(object? sender, EventArgs e)
{ {
string logFile = Program.acpi.ScanRange(); string logFile = Program.acpi.ScanRange();