mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Debug button
This commit is contained in:
@@ -665,22 +665,32 @@ public class AsusACPI
|
||||
}
|
||||
}
|
||||
|
||||
public void ScanRange()
|
||||
public string ScanRange()
|
||||
{
|
||||
int value;
|
||||
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
||||
string logFile = appPath + "\\scan.txt";
|
||||
for (uint i = 0x00000000; i <= 0x00160000; i++)
|
||||
using (StreamWriter w = File.AppendText(logFile))
|
||||
{
|
||||
value = DeviceGet(i);
|
||||
if (value >= 0)
|
||||
using (StreamWriter w = File.AppendText(logFile))
|
||||
w.WriteLine($"Scan started {DateTime.Now}");
|
||||
for (uint i = 0x00000000; i <= 0x00160000; i += 0x10000)
|
||||
{
|
||||
for (uint j = 0x00; j <= 0xFF; j++)
|
||||
{
|
||||
w.WriteLine(i.ToString("X8") + ": " + value.ToString("X4") + " (" + value + ")");
|
||||
w.Close();
|
||||
uint id = i + j;
|
||||
value = DeviceGet(id);
|
||||
if (value >= 0)
|
||||
{
|
||||
w.WriteLine(id.ToString("X8") + ": " + value.ToString("X4") + " (" + value + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
w.WriteLine($"---------------------");
|
||||
w.Close();
|
||||
}
|
||||
|
||||
return logFile;
|
||||
|
||||
}
|
||||
|
||||
public void TUFKeyboardBrightness(int brightness)
|
||||
|
||||
19
app/Extra.Designer.cs
generated
19
app/Extra.Designer.cs
generated
@@ -120,6 +120,7 @@ namespace GHelper
|
||||
comboAPU = new RComboBox();
|
||||
pictureAPUMem = new PictureBox();
|
||||
labelAPUMem = new Label();
|
||||
pictureScan = new PictureBox();
|
||||
panelServices.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureService).BeginInit();
|
||||
panelBindingsHeader.SuspendLayout();
|
||||
@@ -144,6 +145,7 @@ namespace GHelper
|
||||
((System.ComponentModel.ISupportInitialize)pictureHibernate).BeginInit();
|
||||
panelAPU.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureAPUMem).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)pictureScan).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panelServices
|
||||
@@ -1003,6 +1005,7 @@ namespace GHelper
|
||||
//
|
||||
panelSettingsHeader.AutoSize = true;
|
||||
panelSettingsHeader.BackColor = SystemColors.ControlLight;
|
||||
panelSettingsHeader.Controls.Add(pictureScan);
|
||||
panelSettingsHeader.Controls.Add(pictureLog);
|
||||
panelSettingsHeader.Controls.Add(pictureSettings);
|
||||
panelSettingsHeader.Controls.Add(labelSettings);
|
||||
@@ -1263,6 +1266,20 @@ namespace GHelper
|
||||
labelAPUMem.TabIndex = 0;
|
||||
labelAPUMem.Text = "Memory Assigned to GPU";
|
||||
//
|
||||
// pictureScan
|
||||
//
|
||||
pictureScan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
pictureScan.BackgroundImage = Resources.icons8_heartbeat_32;
|
||||
pictureScan.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
pictureScan.Cursor = Cursors.Hand;
|
||||
pictureScan.Location = new Point(891, 11);
|
||||
pictureScan.Margin = new Padding(4, 3, 4, 3);
|
||||
pictureScan.Name = "pictureScan";
|
||||
pictureScan.Size = new Size(32, 32);
|
||||
pictureScan.TabIndex = 13;
|
||||
pictureScan.TabStop = false;
|
||||
pictureScan.Visible = false;
|
||||
//
|
||||
// Extra
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(192F, 192F);
|
||||
@@ -1326,6 +1343,7 @@ namespace GHelper
|
||||
panelAPU.ResumeLayout(false);
|
||||
panelAPU.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureAPUMem).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)pictureScan).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@@ -1420,5 +1438,6 @@ namespace GHelper
|
||||
private PictureBox pictureAPUMem;
|
||||
private Label labelAPUMem;
|
||||
private RComboBox comboAPU;
|
||||
private PictureBox pictureScan;
|
||||
}
|
||||
}
|
||||
13
app/Extra.cs
13
app/Extra.cs
@@ -386,6 +386,7 @@ namespace GHelper
|
||||
buttonServices.Click += ButtonServices_Click;
|
||||
|
||||
pictureLog.Click += PictureLog_Click;
|
||||
pictureScan.Click += PictureScan_Click;
|
||||
|
||||
checkGPUFix.Visible = Program.acpi.IsNVidiaGPU();
|
||||
checkGPUFix.Checked = AppConfig.IsGPUFix();
|
||||
@@ -398,6 +399,18 @@ namespace GHelper
|
||||
InitHibernate();
|
||||
}
|
||||
|
||||
private void PictureScan_Click(object? sender, EventArgs e)
|
||||
{
|
||||
string logFile = Program.acpi.ScanRange();
|
||||
new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo(logFile)
|
||||
{
|
||||
UseShellExecute = true
|
||||
}
|
||||
}.Start();
|
||||
}
|
||||
|
||||
private void ComboAPU_SelectedIndexChanged(object? sender, EventArgs e)
|
||||
{
|
||||
int mem = comboAPU.SelectedIndex;
|
||||
|
||||
Reference in New Issue
Block a user