mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Added PPT fix for M16, G17 (2023) and F15 (2022)
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.79</AssemblyVersion>
|
<AssemblyVersion>0.80</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -1191,19 +1191,30 @@ namespace GHelper
|
|||||||
public void AutoPower(int delay = 0)
|
public void AutoPower(int delay = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
// fix for misbehaving bios PPTs on G513
|
|
||||||
if (AppConfig.ContainsModel("G513") && AppConfig.getConfigPerf("auto_apply") != 1)
|
|
||||||
{
|
|
||||||
AutoFans(true);
|
|
||||||
delay = 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
customPower = 0;
|
customPower = 0;
|
||||||
|
|
||||||
bool applyPower = AppConfig.getConfigPerf("auto_apply_power") == 1;
|
bool applyPower = (AppConfig.getConfigPerf("auto_apply_power") == 1);
|
||||||
bool applyGPU = true;
|
//bool applyGPU = true;
|
||||||
|
|
||||||
|
if (applyPower)
|
||||||
|
{
|
||||||
|
// fix for misbehaving bios PPTs on G513
|
||||||
|
if (AppConfig.ContainsModel("G513") && AppConfig.getConfigPerf("auto_apply") != 1)
|
||||||
|
{
|
||||||
|
AutoFans(true);
|
||||||
|
delay = 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix for models that don't support PPT settings in all modes
|
||||||
|
if (AppConfig.ContainsModel("GU603") || AppConfig.ContainsModel("GU604") || AppConfig.ContainsModel("FX517") || AppConfig.ContainsModel("G733"))
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceManual, "CustomMode");
|
||||||
|
if (AppConfig.getConfigPerf("auto_apply") != 1) AutoFans(true);
|
||||||
|
delay = 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//if (applyPower) Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceManual, "CustomMode");
|
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace WinFormsSliderBar
|
|||||||
private void RecalculateParameters()
|
private void RecalculateParameters()
|
||||||
{
|
{
|
||||||
_radius = 0.4F * ClientSize.Height;
|
_radius = 0.4F * ClientSize.Height;
|
||||||
_barSize = new SizeF(ClientSize.Width - 4 * _radius, ClientSize.Height * 0.15F);
|
_barSize = new SizeF(ClientSize.Width - 2 * _radius, ClientSize.Height * 0.15F);
|
||||||
_barPos = new PointF(_radius, (ClientSize.Height - _barSize.Height) / 2);
|
_barPos = new PointF(_radius, (ClientSize.Height - _barSize.Height) / 2);
|
||||||
_thumbPos = new PointF(
|
_thumbPos = new PointF(
|
||||||
_barSize.Width / (Max - Min) * (Value - Min) + _barPos.X,
|
_barSize.Width / (Max - Min) * (Value - Min) + _barPos.X,
|
||||||
|
|||||||
@@ -44,34 +44,41 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
private Dictionary<string, string> GetDeviceVersions()
|
private Dictionary<string, string> GetDeviceVersions()
|
||||||
{
|
{
|
||||||
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("Select * from Win32_PnPSignedDriver");
|
using (ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("Select * from Win32_PnPSignedDriver"))
|
||||||
ManagementObjectCollection objCollection = objSearcher.Get();
|
|
||||||
Dictionary<string, string> list = new();
|
|
||||||
|
|
||||||
foreach (ManagementObject obj in objCollection)
|
|
||||||
{
|
{
|
||||||
if (obj["DeviceID"] is not null && obj["DriverVersion"] is not null)
|
using (ManagementObjectCollection objCollection = objSearcher.Get())
|
||||||
list[obj["DeviceID"].ToString()] = obj["DriverVersion"].ToString();
|
{
|
||||||
}
|
Dictionary<string, string> list = new();
|
||||||
|
|
||||||
return list;
|
foreach (ManagementObject obj in objCollection)
|
||||||
|
{
|
||||||
|
if (obj["DeviceID"] is not null && obj["DriverVersion"] is not null)
|
||||||
|
list[obj["DeviceID"].ToString()] = obj["DriverVersion"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetBiosVersion()
|
private string GetBiosVersion()
|
||||||
{
|
{
|
||||||
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");
|
using (ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS"))
|
||||||
ManagementObjectCollection objCollection = objSearcher.Get();
|
{
|
||||||
|
using (ManagementObjectCollection objCollection = objSearcher.Get())
|
||||||
foreach (ManagementObject obj in objCollection)
|
|
||||||
if (obj["SMBIOSBIOSVersion"] is not null)
|
|
||||||
{
|
{
|
||||||
var bios = obj["SMBIOSBIOSVersion"].ToString();
|
foreach (ManagementObject obj in objCollection)
|
||||||
int trim = bios.LastIndexOf(".");
|
if (obj["SMBIOSBIOSVersion"] is not null)
|
||||||
if (trim > 0) return bios.Substring(trim + 1);
|
{
|
||||||
else return bios;
|
var bios = obj["SMBIOSBIOSVersion"].ToString();
|
||||||
}
|
int trim = bios.LastIndexOf(".");
|
||||||
|
if (trim > 0) return bios.Substring(trim + 1);
|
||||||
|
else return bios;
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void DriversAsync(string url, int type, TableLayoutPanel table)
|
public async void DriversAsync(string url, int type, TableLayoutPanel table)
|
||||||
|
|||||||
Reference in New Issue
Block a user