Compare commits

..

22 Commits

Author SHA1 Message Date
Serge
58b5221b3c Version bump 2024-08-31 11:56:57 +02:00
Serge
0192d59524 UI Tweaks 2024-08-31 11:06:42 +02:00
Serge
01cede58b5 UI Tweaks 2024-08-31 10:42:43 +02:00
Serge
3dbbddfa58 Startup counter 2024-08-31 10:03:16 +02:00
Serge
1b898b44d2 Cleanup 2024-08-31 09:52:48 +02:00
Serge
dc7362dab1 Added AsusPTPService to the stop/start list https://github.com/seerge/g-helper/issues/3031 2024-08-30 19:45:47 +02:00
Serge
cbd4a5e27c Exception handling https://github.com/seerge/g-helper/issues/3029 2024-08-29 23:12:34 +02:00
Serge
5e9b002013 Version bump 2024-08-26 10:03:42 +02:00
Serge
5077c30704 Power limits tweak for GA605 https://github.com/seerge/g-helper/issues/3017 2024-08-26 09:51:04 +02:00
Serge
d6363dee85 Shasl Battery timer refresh interval 2024-08-26 09:48:41 +02:00
Serge
359575d00d Log cleanup 2024-08-26 09:44:41 +02:00
Serge
9dc444fd33 Added ProArt P16 and X13 to OLED List 2024-08-24 20:09:28 +02:00
Serge
a5b8885ff6 Removed unsuppored backlight modes for ProArt X13 https://github.com/seerge/g-helper/issues/2912 2024-08-24 20:07:44 +02:00
Serge
56676005a5 Added Vivobook M550 to OLED list https://github.com/seerge/g-helper/issues/3015 2024-08-24 15:53:18 +02:00
Serge
0e59f9318e Invert FN-Lock for ProArt https://github.com/seerge/g-helper/issues/3012 2024-08-23 22:26:37 +02:00
Serge
21a2dca271 Hardware FN-Lock for ProArt https://github.com/seerge/g-helper/issues/2973 https://github.com/seerge/g-helper/issues/3012 2024-08-23 13:20:58 +02:00
Serge
e265a78b4f ProArt backlight init #2973 2024-08-22 23:31:22 +02:00
Serge
18b6dd794f Merge branch 'main' of https://github.com/seerge/g-helper 2024-08-22 14:18:05 +02:00
Serge
9fd9506177 Ryzen AI 9 undervolting https://github.com/seerge/g-helper/issues/3005 2024-08-22 14:18:02 +02:00
Serge
a30b202022 ProArt backlight init https://github.com/seerge/g-helper/issues/2973 2024-08-22 12:20:32 +02:00
Serge
b9534fdfe5 New translations strings.resx (Chinese Simplified) (#2998) 2024-08-22 12:20:11 +02:00
Serge
cb3bf3ea90 Swap brightness hotkeys for FA706IH https://github.com/seerge/g-helper/issues/3009 2024-08-22 11:30:38 +02:00
14 changed files with 89 additions and 26 deletions

View File

@@ -114,6 +114,7 @@ namespace GHelper.AnimeMatrix
switch ((SlashMode)running) switch ((SlashMode)running)
{ {
case SlashMode.Static: case SlashMode.Static:
Logger.WriteLine("Slash: Static");
var custom = AppConfig.GetString("slash_custom"); var custom = AppConfig.GetString("slash_custom");
if (custom is not null && custom.Length > 0) if (custom is not null && custom.Length > 0)
{ {
@@ -126,6 +127,7 @@ namespace GHelper.AnimeMatrix
break; break;
case SlashMode.BatteryLevel: case SlashMode.BatteryLevel:
// call tick to immediately update the pattern // call tick to immediately update the pattern
Logger.WriteLine("Slash: Battery Level");
SlashTimer_start(); SlashTimer_start();
SlashTimer_tick(); SlashTimer_tick();
break; break;
@@ -278,7 +280,7 @@ namespace GHelper.AnimeMatrix
} }
private void SlashTimer_start(int interval = 60000) private void SlashTimer_start(int interval = 180000)
{ {
// 100% to 0% in 1hr = 1% every 36 seconds // 100% to 0% in 1hr = 1% every 36 seconds
// 1 bracket every 14.2857 * 36s = 514s ~ 8m 30s // 1 bracket every 14.2857 * 36s = 514s ~ 8m 30s

View File

@@ -182,17 +182,17 @@ namespace GHelper.AnimeMatrix
public void SetBatteryPattern(int brightness) public void SetBatteryPattern(int brightness)
{ {
SetCustom(GetBatteryPattern(brightness, 100 * (GetBatteryChargePercentage() / AppConfig.Get("charge_limit", 100)))); SetCustom(GetBatteryPattern(brightness, 100 * (GetBatteryChargePercentage() / AppConfig.Get("charge_limit", 100))), null);
} }
public void SetCustom(byte[] data) public void SetCustom(byte[] data, string? log = "Static Data")
{ {
Set(CreatePacket([0xD2, 0x02, 0x01, 0x08, 0xAC]), "Static"); Set(CreatePacket([0xD2, 0x02, 0x01, 0x08, 0xAC]), null);
Set(CreatePacket([0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF]), "StaticSettings"); Set(CreatePacket([0xD3, 0x03, 0x01, 0x08, 0xAC, 0xFF, 0xFF, 0x01, 0x05, 0xFF, 0xFF]), null);
Set(CreatePacket([0xD4, 0x00, 0x00, 0x01, 0xAC]), "StaticSave"); Set(CreatePacket([0xD4, 0x00, 0x00, 0x01, 0xAC]), null);
byte[] payload = new byte[] { 0xD3, 0x00, 0x00, 0x07 }; byte[] payload = new byte[] { 0xD3, 0x00, 0x00, 0x07 };
Set(CreatePacket(payload.Concat(data.Take(7)).ToArray()), "Static Data"); Set(CreatePacket(payload.Concat(data.Take(7)).ToArray()), log);
} }
public void SetOptions(bool status, int brightness = 0, int interval = 0) public void SetOptions(bool status, int brightness = 0, int interval = 0)

View File

@@ -391,10 +391,15 @@ public static class AppConfig
return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt"); return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt");
} }
public static bool IsHardwareFnLock()
{
return IsVivoZenPro();
}
// Devices with bugged bios command to change brightness // Devices with bugged bios command to change brightness
public static bool SwappedBrightness() public static bool SwappedBrightness()
{ {
return ContainsModel("FA506IH") || ContainsModel("FA506IC") || ContainsModel("FX506LU") || ContainsModel("FX506IC") || ContainsModel("FX506LH") || ContainsModel("FA506IV") || ContainsModel("FA706IC"); return ContainsModel("FA506IH") || ContainsModel("FA506IC") || ContainsModel("FX506LU") || ContainsModel("FX506IC") || ContainsModel("FX506LH") || ContainsModel("FA506IV") || ContainsModel("FA706IC") || ContainsModel("FA706IH");
} }
@@ -406,17 +411,17 @@ public static class AppConfig
// G14 2020 has no aura, but media keys instead // G14 2020 has no aura, but media keys instead
public static bool NoAura() public static bool NoAura()
{ {
return ContainsModel("GA401I") && !ContainsModel("GA401IHR"); return (ContainsModel("GA401I") && !ContainsModel("GA401IHR")) || ContainsModel("HN7306");
} }
public static bool MediaKeys() public static bool MediaKeys()
{ {
return NoAura() || ContainsModel("G712L"); return (ContainsModel("GA401I") && !ContainsModel("GA401IHR")) || ContainsModel("G712L");
} }
public static bool IsSingleColor() public static bool IsSingleColor()
{ {
return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("GA502IU") || ContainsModel("FA617N") || ContainsModel("FA617X"); return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("GA502IU") || ContainsModel("FA617N") || ContainsModel("FA617X") || NoAura();
} }
public static bool IsSlash() public static bool IsSlash()
@@ -441,7 +446,7 @@ public static class AppConfig
public static bool IsOLED() public static bool IsOLED()
{ {
return ContainsModel("OLED") || IsSlash() || ContainsModel("M7600") || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M350") || ContainsModel("K650") || ContainsModel("UM53") || ContainsModel("K660") || ContainsModel("UX84") || ContainsModel("M650") || ContainsModel("K340") || ContainsModel("K350") || ContainsModel("M140") || ContainsModel("UM340") || ContainsModel("S540") || ContainsModel("M7400") || ContainsModel("N650"); return ContainsModel("OLED") || IsSlash() || ContainsModel("M7600") || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M350") || ContainsModel("K650") || ContainsModel("UM53") || ContainsModel("K660") || ContainsModel("UX84") || ContainsModel("M650") || ContainsModel("M550") || ContainsModel("K340") || ContainsModel("K350") || ContainsModel("M140") || ContainsModel("UM340") || ContainsModel("S540") || ContainsModel("M7400") || ContainsModel("N650") || ContainsModel("HN7306") || ContainsModel("H7606");
} }
public static bool IsNoOverdrive() public static bool IsNoOverdrive()
@@ -607,12 +612,12 @@ public static class AppConfig
public static bool IsFanRequired() public static bool IsFanRequired()
{ {
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P") || ContainsModel("GU605") || ContainsModel("GA403") || ContainsModel("G634J") || ContainsModel("G834J") || ContainsModel("G614J") || ContainsModel("G814J") || ContainsModel("FX507V"); return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P") || ContainsModel("GU605") || ContainsModel("GA605") || ContainsModel("GA403") || ContainsModel("G634J") || ContainsModel("G834J") || ContainsModel("G614J") || ContainsModel("G814J") || ContainsModel("FX507V");
} }
public static bool IsAMDLight() public static bool IsAMDLight()
{ {
return ContainsModel("GA402X") || ContainsModel("GA403") || ContainsModel("FA507N") || ContainsModel("FA507X") || ContainsModel("FA707N") || ContainsModel("FA707X"); return ContainsModel("GA402X") || ContainsModel("GA605") || ContainsModel("GA403") || ContainsModel("FA507N") || ContainsModel("FA507X") || ContainsModel("FA707N") || ContainsModel("FA707X");
} }
public static bool IsPowerRequired() public static bool IsPowerRequired()

View File

@@ -16,7 +16,10 @@ namespace GHelper.Display
var modes = new DISPLAYCONFIG_MODE_INFO[modeCount]; var modes = new DISPLAYCONFIG_MODE_INFO[modeCount];
err = QueryDisplayConfig(QDC.QDC_ONLY_ACTIVE_PATHS, ref pathCount, paths, ref modeCount, modes, IntPtr.Zero); err = QueryDisplayConfig(QDC.QDC_ONLY_ACTIVE_PATHS, ref pathCount, paths, ref modeCount, modes, IntPtr.Zero);
if (err != 0) if (err != 0)
throw new Win32Exception(err); {
Logger.WriteLine("HDR Detection Error: " + new Win32Exception(err).Message);
return false;
}
string internalName = AppConfig.GetString("internal_display"); string internalName = AppConfig.GetString("internal_display");

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.185</AssemblyVersion> <AssemblyVersion>0.187</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -20,6 +20,8 @@ namespace GHelper.Helpers
"AsusCertService" "AsusCertService"
}; };
//"AsusPTPService",
static List<string> processesAC = new() { static List<string> processesAC = new() {
"ArmouryCrateSE.Service", "ArmouryCrateSE.Service",
"ArmouryCrate.Service", "ArmouryCrate.Service",

View File

@@ -85,8 +85,7 @@ namespace GHelper.Input
InitBacklightTimer(); InitBacklightTimer();
if (AppConfig.IsVivoZenbook()) if (AppConfig.IsHardwareFnLock()) HardwareFnLock(AppConfig.Is("fn_lock"));
Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
} }
@@ -155,7 +154,7 @@ namespace GHelper.Input
// FN-Lock group // FN-Lock group
if (AppConfig.Is("fn_lock") && !AppConfig.IsVivoZenbook()) if (AppConfig.Is("fn_lock") && !AppConfig.IsHardwareFnLock())
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i); for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
// Arrow-lock group // Arrow-lock group
@@ -629,13 +628,19 @@ namespace GHelper.Input
Program.toast.RunToast("Arrow-Lock " + (arLock == 1 ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.FnLock); Program.toast.RunToast("Arrow-Lock " + (arLock == 1 ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.FnLock);
} }
public static void HardwareFnLock(bool fnLock)
{
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E, fnLock ? (byte)0x00 : (byte)0x01], "USB FnLock");
}
public static void ToggleFnLock() public static void ToggleFnLock()
{ {
bool fnLock = !AppConfig.Is("fn_lock"); bool fnLock = !AppConfig.Is("fn_lock");
AppConfig.Set("fn_lock", fnLock ? 1 : 0); AppConfig.Set("fn_lock", fnLock ? 1 : 0);
if (AppConfig.IsVivoZenbook()) if (AppConfig.IsHardwareFnLock())
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock"); HardwareFnLock(fnLock);
else else
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys); Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);

View File

@@ -69,6 +69,10 @@ namespace GHelper
Logger.WriteLine("------------"); Logger.WriteLine("------------");
Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (ProcessHelper.IsUserAdministrator() ? "." : "")); Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (ProcessHelper.IsUserAdministrator() ? "." : ""));
var startCount = AppConfig.Get("start_count") + 1;
AppConfig.Set("start_count", startCount);
Logger.WriteLine("Start Count: " + startCount);
acpi = new AsusACPI(); acpi = new AsusACPI();
if (!acpi.IsConnected() && AppConfig.IsASUS()) if (!acpi.IsConnected() && AppConfig.IsASUS())

View File

@@ -741,7 +741,7 @@
<value>关闭屏幕</value> <value>关闭屏幕</value>
</data> </data>
<data name="ToggleTouchscreen" xml:space="preserve"> <data name="ToggleTouchscreen" xml:space="preserve">
<value>Toggle Touchscreen</value> <value>切换触摸屏</value>
</data> </data>
<data name="Touchscreen" xml:space="preserve"> <data name="Touchscreen" xml:space="preserve">
<value/> <value/>

View File

@@ -40,7 +40,7 @@ namespace Ryzen
//PHEONIX - 9 //PHEONIX - 9
//RAPHAEL/DRAGON RANGE - 10 //RAPHAEL/DRAGON RANGE - 10
//MENDOCINO - 11 //MENDOCINO - 11
//HAWKPOINT - 12 //HAWKPOINT/STRIXPOINT - 12
public static void Init() public static void Init()
{ {
@@ -77,7 +77,7 @@ namespace Ryzen
FAMID = 1; //PICASSO FAMID = 1; //PICASSO
} }
if (CPUModel.Contains("Model " + Convert.ToString(32))) if (CPUModel.Contains("Family " + Convert.ToString(23)) && CPUModel.Contains("Model " + Convert.ToString(32)))
{ {
FAMID = 2; //DALI FAMID = 2; //DALI
} }
@@ -127,6 +127,11 @@ namespace Ryzen
FAMID = 12; //HAWKPOINT FAMID = 12; //HAWKPOINT
} }
if (CPUModel.Contains("Family " + Convert.ToString(26)) && CPUModel.Contains("Model " + Convert.ToString(36)))
{
FAMID = 12; //STRIXPOINT
}
Logger.WriteLine($"CPU: {FAMID} - {CPUName} - {CPUModel}"); Logger.WriteLine($"CPU: {FAMID} - {CPUName} - {CPUModel}");
SetAddresses(); SetAddresses();
@@ -141,7 +146,7 @@ namespace Ryzen
public static bool IsSupportedUV() public static bool IsSupportedUV()
{ {
if (CPUName.Length == 0) Init(); if (CPUName.Length == 0) Init();
return CPUName.Contains("Ryzen 9") || CPUName.Contains("4900H") || CPUName.Contains("4800H") || CPUName.Contains("4600H"); return CPUName.Contains("Ryzen AI 9") || CPUName.Contains("Ryzen 9") || CPUName.Contains("4900H") || CPUName.Contains("4800H") || CPUName.Contains("4600H");
} }
public static bool IsSupportedUViGPU() public static bool IsSupportedUViGPU()

View File

@@ -21,7 +21,7 @@ namespace Ryzen
//PHEONIX - 9 //PHEONIX - 9
//RAPHAEL/DRAGON RANGE - 10 //RAPHAEL/DRAGON RANGE - 10
//MENDOCINO - 11 //MENDOCINO - 11
//HAWKPOINT - 12 //HAWKPOINT/STRIXPOINT - 12
public static Smu RyzenAccess = new Smu(false); public static Smu RyzenAccess = new Smu(false);
public static int FAMID = RyzenControl.FAMID; public static int FAMID = RyzenControl.FAMID;

View File

@@ -270,6 +270,12 @@ namespace GHelper
labelCharge.Click += LabelCharge_Click; labelCharge.Click += LabelCharge_Click;
buttonDonate.Click += ButtonDonate_Click; buttonDonate.Click += ButtonDonate_Click;
if (AppConfig.Get("start_count") > 10 && !AppConfig.Is("donate_click"))
{
buttonDonate.BorderColor = colorTurbo;
buttonDonate.Badge = true;
}
labelDynamicLighting.Click += LabelDynamicLighting_Click; labelDynamicLighting.Click += LabelDynamicLighting_Click;
@@ -279,6 +285,8 @@ namespace GHelper
private void ButtonDonate_Click(object? sender, EventArgs e) private void ButtonDonate_Click(object? sender, EventArgs e)
{ {
AppConfig.Set("donate_click", 1);
buttonDonate.Badge = false;
Process.Start(new ProcessStartInfo("https://github.com/seerge/g-helper/wiki/Support-Project") { UseShellExecute = true }); Process.Start(new ProcessStartInfo("https://github.com/seerge/g-helper/wiki/Support-Project") { UseShellExecute = true });
} }

View File

@@ -52,6 +52,16 @@ namespace GHelper.UI
} }
} }
private bool badge = false;
public bool Badge
{
get { return badge; }
set
{
badge = value;
}
}
public RButton() public RButton()
{ {
DoubleBuffered = true; DoubleBuffered = true;
@@ -99,6 +109,15 @@ namespace GHelper.UI
pevent.Graphics.DrawPath(penBorder, pathBorder); pevent.Graphics.DrawPath(penBorder, pathBorder);
} }
if (badge)
{
using (Brush brush = new SolidBrush(borderColor))
{
var radius = ratio * 10;
pevent.Graphics.FillEllipse(brush, rectSurface.Width - rectSurface.Height / 2 - radius, rectSurface.Height / 2 - radius, radius + radius, radius + radius);
}
}
if (!Enabled && ForeColor != SystemColors.ControlText) if (!Enabled && ForeColor != SystemColors.ControlText)
{ {
var rect = pevent.ClipRectangle; var rect = pevent.ClipRectangle;

View File

@@ -268,6 +268,16 @@ namespace GHelper.USB
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."), Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1A }, new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1A },
}, "Init"); }, "Init");
if (AppConfig.IsProArt())
{
AsusHid.WriteInput([AsusHid.INPUT_ID, 0x05, 0x20, 0x31, 0x00, 0x08], "ProArt Init");
//AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E], "ProArt Init");
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xBA, 0xC5, 0xC4], "ProArt Init");
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x8F, 0x01], "ProArt Init");
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x85, 0xFF], "ProArt Init");
//AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E], "ProArt Init");
}
} }