Compare commits

...

12 Commits

Author SHA1 Message Date
Serge
77d89505b3 Update GHelper.csproj 2024-09-29 11:49:00 +02:00
Serge
4be790dce0 Update tweaks 2024-09-28 17:39:05 +02:00
Serge
c9698a1613 Strix impact DPI correction https://github.com/seerge/g-helper/issues/3146 2024-09-28 17:30:21 +02:00
Serge
819506e7ee UI Tweaks 2024-09-28 09:31:39 +02:00
Serge
489616d255 Option to disable "gpu_mode_force_set" for GA503 https://github.com/seerge/g-helper/issues/3175 2024-09-26 13:22:21 +02:00
Serge
1103ab70f6 Extra delay when setting Ultimate from Eco https://github.com/seerge/g-helper/issues/3170 2024-09-25 19:48:38 +02:00
Serge
dbf0cbc3ac Dependencies update 2024-09-25 17:48:45 +02:00
Serge
a45d693937 Version bump 2024-09-25 08:15:49 +02:00
Serge
0db49af310 Config writing tweaks 2024-09-24 12:24:20 +02:00
Serge
28daaf9a4c Config writing tweaks 2024-09-24 11:56:18 +02:00
Serge
38d02ee7f9 Minimum possible number of E-Cores https://github.com/seerge/g-helper/issues/3160 2024-09-23 21:06:09 +02:00
Serge
c6d1b29a49 Touchscreen toggle toast tweaks https://github.com/seerge/g-helper/issues/3143 2024-09-23 15:24:28 +02:00
9 changed files with 47 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ public static class AppConfig
private static string? _bios; private static string? _bios;
private static Dictionary<string, object> config = new Dictionary<string, object>(); private static Dictionary<string, object> config = new Dictionary<string, object>();
private static System.Timers.Timer timer = new System.Timers.Timer(1000); private static System.Timers.Timer timer = new System.Timers.Timer(2000);
static AppConfig() static AppConfig()
{ {
@@ -92,7 +92,9 @@ public static class AppConfig
Thread.Sleep(500); Thread.Sleep(500);
if (File.ReadAllText(backup).Contains("}")) var backupText = File.ReadAllText(backup);
if (backupText.Contains("{") && backupText.Contains("}"))
{ {
File.Copy(backup, configFile, true); File.Copy(backup, configFile, true);
} }
@@ -219,6 +221,7 @@ public static class AppConfig
private static void Write() private static void Write()
{ {
timer.Stop();
timer.Start(); timer.Start();
} }
@@ -637,7 +640,7 @@ public static class AppConfig
public static bool IsForceSetGPUMode() public static bool IsForceSetGPUMode()
{ {
return Is("gpu_mode_force_set") || ContainsModel("503"); return Is("gpu_mode_force_set") || (ContainsModel("503") && IsNotFalse("gpu_mode_force_set"));
} }
public static bool IsNoGPUModes() public static bool IsNoGPUModes()

View File

@@ -145,7 +145,7 @@ namespace GHelper.AutoUpdate
Logger.WriteLine(ex.Message); Logger.WriteLine(ex.Message);
} }
Environment.Exit(0); Application.Exit();
} }
} }

View File

@@ -505,7 +505,10 @@ namespace GHelper
return; return;
} }
eCoresMax = Math.Max(8, eCoresMax); if (eCoresMax == 0) eCoresMax = 8;
if (pCoresMax == 0) pCoresMax = 6;
eCoresMax = Math.Max(4, eCoresMax);
pCoresMax = Math.Max(6, pCoresMax); pCoresMax = Math.Max(6, pCoresMax);
panelCores.Visible = true; panelCores.Visible = true;

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.192</AssemblyVersion> <AssemblyVersion>0.194</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -63,8 +63,8 @@
<PackageReference Include="NAudio" Version="2.1.0" /> <PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="NvAPIWrapper.Net" Version="0.8.1.101" /> <PackageReference Include="NvAPIWrapper.Net" Version="0.8.1.101" />
<PackageReference Include="System.Management" Version="8.0.0" /> <PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="TaskScheduler" Version="2.10.1" /> <PackageReference Include="TaskScheduler" Version="2.11.0" />
<PackageReference Include="WinForms.DataVisualization" Version="1.8.0" /> <PackageReference Include="WinForms.DataVisualization" Version="1.9.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -92,13 +92,16 @@ namespace GHelper.Gpu
{ {
if (AppConfig.NoAutoUltimate()) if (AppConfig.NoAutoUltimate())
{ {
int standardStatus = Program.acpi.SetGPUEco(0); Program.acpi.SetGPUEco(0);
if (standardStatus == 0) Thread.Sleep(500);
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
Logger.WriteLine("Eco flag : " + eco);
if (eco == 1)
{ {
settings.VisualiseGPUMode(); settings.VisualiseGPUMode();
return; return;
} }
Thread.Sleep(100);
} }
status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux"); status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
restart = true; restart = true;

View File

@@ -2,21 +2,31 @@
public static class TouchscreenHelper public static class TouchscreenHelper
{ {
public static bool? ToggleTouchscreen()
public static bool? GetStatus()
{ {
try try
{ {
ProcessHelper.RunAsAdmin(); ProcessHelper.RunAsAdmin();
return ProcessHelper.RunCMD("powershell", "(Get-PnpDevice -FriendlyName '*touch*screen*').Status").Contains("OK");
}
catch (Exception ex)
{
Logger.WriteLine($"Can't get touchscreen status: {ex.Message}");
return null;
}
}
var status = !ProcessHelper.RunCMD("powershell", "(Get-PnpDevice -FriendlyName '*touch*screen*').Status").Contains("OK"); public static void ToggleTouchscreen(bool status)
{
try
{
ProcessHelper.RunAsAdmin();
ProcessHelper.RunCMD("powershell", (status ? "Enable-PnpDevice" : "Disable-PnpDevice") + " -InstanceId (Get-PnpDevice -FriendlyName '*touch*screen*').InstanceId -Confirm:$false"); ProcessHelper.RunCMD("powershell", (status ? "Enable-PnpDevice" : "Disable-PnpDevice") + " -InstanceId (Get-PnpDevice -FriendlyName '*touch*screen*').InstanceId -Confirm:$false");
return status;
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.WriteLine($"Can't toggle touchscreen: {ex.Message}"); Logger.WriteLine($"Can't toggle touchscreen: {ex.Message}");
return null;
} }
} }

View File

@@ -591,9 +591,13 @@ namespace GHelper.Input
Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey); Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey);
break; break;
case "touchscreen": case "touchscreen":
var touchscreenStatus = TouchscreenHelper.ToggleTouchscreen(); var status = !TouchscreenHelper.GetStatus();
if (touchscreenStatus is not null) Logger.WriteLine("Touchscreen status: " + status);
Program.toast.RunToast(Properties.Strings.Touchscreen + " " + ((bool)touchscreenStatus ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.Touchpad); if (status is not null)
{
Program.toast.RunToast(Properties.Strings.Touchscreen + " " + ((bool)status ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.Touchpad);
TouchscreenHelper.ToggleTouchscreen((bool)status);
}
break; break;
default: default:
break; break;

View File

@@ -86,7 +86,7 @@
public override int DPIIncrements() public override int DPIIncrements()
{ {
return 100; return 50;
} }

View File

@@ -226,13 +226,10 @@ namespace GHelper
public void _VisualiseNewCount(int updatesCount, TableLayoutPanel table) public void _VisualiseNewCount(int updatesCount, TableLayoutPanel table)
{ {
Invoke(delegate labelUpdates.Text = $"{Properties.Strings.NewUpdates}: {updatesCount}";
{ labelUpdates.ForeColor = colorTurbo;
labelUpdates.Text = $"{Properties.Strings.NewUpdates}: {updatesCount}"; labelUpdates.Font = new Font(labelUpdates.Font, FontStyle.Bold);
labelUpdates.ForeColor = colorTurbo; panelBios.AccessibleName = labelUpdates.Text;
labelUpdates.Font = new Font(labelUpdates.Font, FontStyle.Bold);
panelBios.AccessibleName = labelUpdates.Text;
});
} }
static string CleanupDeviceId(string input) static string CleanupDeviceId(string input)