This commit is contained in:
Serge
2024-03-18 17:53:13 +01:00
6 changed files with 44 additions and 29 deletions

View File

@@ -19,6 +19,7 @@ namespace GHelper.AnimeMatrix
public SlashDevice? deviceSlash; public SlashDevice? deviceSlash;
public static bool lidClose = false; public static bool lidClose = false;
private static bool _wakeUp = false;
double[]? AudioValues; double[]? AudioValues;
WasapiCapture? AudioDevice; WasapiCapture? AudioDevice;
@@ -91,15 +92,21 @@ namespace GHelper.AnimeMatrix
return; return;
} }
if (wakeUp) deviceSlash.WakeUp(); if (wakeUp) _wakeUp = true;
if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) || (lid && lidClose)) if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) || (lid && lidClose))
{ {
//deviceSlash.Init(); deviceSlash.Init();
deviceSlash.SetOptions(false, 0, 0); deviceSlash.SetOptions(false, 0, 0);
} }
else else
{ {
if (_wakeUp)
{
deviceSlash.WakeUp();
_wakeUp = false;
}
deviceSlash.Init(); deviceSlash.Init();
deviceSlash.SetMode((SlashMode)running); deviceSlash.SetMode((SlashMode)running);
deviceSlash.SetOptions(true, brightness, inteval); deviceSlash.SetOptions(true, brightness, inteval);

View File

@@ -84,18 +84,18 @@ namespace GHelper.AnimeMatrix
public void WakeUp() public void WakeUp()
{ {
Set(Packet<SlashPacket>(Encoding.ASCII.GetBytes("ASUS Tech.Inc."))); Set(Packet<SlashPacket>(Encoding.ASCII.GetBytes("ASUS Tech.Inc.")), "SlashWakeUp");
} }
public void Init() public void Init()
{ {
Set(Packet<SlashPacket>(0xD7, 0x00, 0x00, 0x01, 0xAC)); Set(Packet<SlashPacket>(0xD7, 0x00, 0x00, 0x01, 0xAC), "SlashInit");
Set(Packet<SlashPacket>(0xD2, 0x02, 0x01, 0x08, 0xAB)); Set(Packet<SlashPacket>(0xD2, 0x02, 0x01, 0x08, 0xAB), "SlashInit");
} }
public void Save() public void Save()
{ {
Set(Packet<SlashPacket>(0xD4, 0x00, 0x00, 0x01, 0xAB)); Set(Packet<SlashPacket>(0xD4, 0x00, 0x00, 0x01, 0xAB), "SlashSave");
} }
public void SetMode(SlashMode mode) public void SetMode(SlashMode mode)
@@ -111,20 +111,20 @@ namespace GHelper.AnimeMatrix
modeByte = 0x00; modeByte = 0x00;
} }
Set(Packet<SlashPacket>(0xD2, 0x03, 0x00, 0x0C)); Set(Packet<SlashPacket>(0xD2, 0x03, 0x00, 0x0C), "SlashMode");
Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13)); Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13), "SlashMode");
} }
public void SetOptions(bool status, int brightness = 0, int interval = 0) public void SetOptions(bool status, int brightness = 0, int interval = 0)
{ {
byte brightnessByte = (byte)(brightness * 85.333); byte brightnessByte = (byte)(brightness * 85.333);
Set(Packet<SlashPacket>(0xD3, 0x03, 0x01, 0x08, 0xAB, 0xFF, 0x01, status ? (byte)0x01 : (byte)0x00, 0x06, brightnessByte, 0xFF, (byte)interval)); Set(Packet<SlashPacket>(0xD3, 0x03, 0x01, 0x08, 0xAB, 0xFF, 0x01, status ? (byte)0x01 : (byte)0x00, 0x06, brightnessByte, 0xFF, (byte)interval), "SlashOptions");
} }
public void SetBatterySaver(bool status) public void SetBatterySaver(bool status)
{ {
Set(Packet<SlashPacket>(0xD8, 0x01, 0x00, 0x01, status ? (byte)0x80 : (byte)0x00)); Set(Packet<SlashPacket>(0xD8, 0x01, 0x00, 0x01, status ? (byte)0x80 : (byte)0x00), "SlashBatterySaver");
} }
public void SetLidMode(bool status) public void SetLidMode(bool status)
@@ -132,10 +132,10 @@ namespace GHelper.AnimeMatrix
Set(Packet<SlashPacket>(0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00)); Set(Packet<SlashPacket>(0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00));
} }
public void Set(Packet packet) public void Set(Packet packet, string? log = null)
{ {
_usbProvider?.Set(packet.Data); _usbProvider?.Set(packet.Data);
Logger.WriteLine("Slash:" + BitConverter.ToString(packet.Data)); if (log is not null) Logger.WriteLine("Slash:" + BitConverter.ToString(packet.Data));
} }

View File

@@ -587,6 +587,11 @@ public static class AppConfig
return ContainsModel("G834") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634"); return ContainsModel("G834") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634");
} }
public static bool IsNoFNV()
{
return ContainsModel("FX507") || ContainsModel("FX707");
}
public static bool IsROG() public static bool IsROG()
{ {
return ContainsModel("ROG"); return ContainsModel("ROG");
@@ -601,4 +606,6 @@ public static class AppConfig
return Is("bw_icon"); return Is("bw_icon");
} }
} }

View File

@@ -205,15 +205,16 @@ namespace GHelper
labelFNF4.Visible = comboFNF4.Visible = textFNF4.Visible = false; labelFNF4.Visible = comboFNF4.Visible = textFNF4.Visible = false;
} }
if (AppConfig.IsTUF()) if (!AppConfig.IsTUF())
{
labelFNV.Visible = comboFNV.Visible = textFNV.Visible = false;
}
else
{ {
labelFNE.Visible = comboFNE.Visible = textFNE.Visible = false; labelFNE.Visible = comboFNE.Visible = textFNE.Visible = false;
} }
if (AppConfig.IsNoFNV())
{
labelFNV.Visible = comboFNV.Visible = textFNV.Visible = false;
}
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) < 0) if (Program.acpi.DeviceGet(AsusACPI.GPUEco) < 0)
{ {
checkGpuApps.Visible = false; checkGpuApps.Visible = false;

View File

@@ -250,16 +250,16 @@
<value>Encendida</value> <value>Encendida</value>
</data> </data>
<data name="BacklightLow" xml:space="preserve"> <data name="BacklightLow" xml:space="preserve">
<value>Low</value> <value>Bajo</value>
</data> </data>
<data name="BacklightMax" xml:space="preserve"> <data name="BacklightMax" xml:space="preserve">
<value>Max</value> <value>Máximo</value>
</data> </data>
<data name="BacklightMid" xml:space="preserve"> <data name="BacklightMid" xml:space="preserve">
<value>Mid</value> <value>Medio</value>
</data> </data>
<data name="BacklightOff" xml:space="preserve"> <data name="BacklightOff" xml:space="preserve">
<value>Off</value> <value>Apagado</value>
</data> </data>
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Tiempo de espera conectado / con batería (0 - ON)</value> <value>Tiempo de espera conectado / con batería (0 - ON)</value>
@@ -355,7 +355,7 @@
<value>Descargando</value> <value>Descargando</value>
</data> </data>
<data name="DownloadColorProfiles" xml:space="preserve"> <data name="DownloadColorProfiles" xml:space="preserve">
<value>Download Color Profiles</value> <value>Descargar perfiles de color</value>
</data> </data>
<data name="DownloadUpdate" xml:space="preserve"> <data name="DownloadUpdate" xml:space="preserve">
<value>Descargar</value> <value>Descargar</value>
@@ -585,7 +585,7 @@
<value>Multizona fuerte</value> <value>Multizona fuerte</value>
</data> </data>
<data name="Muted" xml:space="preserve"> <data name="Muted" xml:space="preserve">
<value>Muted</value> <value>Silenciado</value>
</data> </data>
<data name="MuteMic" xml:space="preserve"> <data name="MuteMic" xml:space="preserve">
<value>Silenciar micrófono</value> <value>Silenciar micrófono</value>
@@ -603,10 +603,10 @@
<value>No conectado</value> <value>No conectado</value>
</data> </data>
<data name="Off" xml:space="preserve"> <data name="Off" xml:space="preserve">
<value>Off</value> <value>Apagado</value>
</data> </data>
<data name="On" xml:space="preserve"> <data name="On" xml:space="preserve">
<value>On</value> <value>Encendido</value>
</data> </data>
<data name="OneZone" xml:space="preserve"> <data name="OneZone" xml:space="preserve">
<value>Una zona</value> <value>Una zona</value>
@@ -753,7 +753,7 @@
<value>Undervolting es una característica experimental. Aplicar valores demasiado bajos puede causar inestabilidad en el hardware o corrupción de datos. Si desea probar, empiece con valores pequeños, haga click en Aplicar y pruebe.</value> <value>Undervolting es una característica experimental. Aplicar valores demasiado bajos puede causar inestabilidad en el hardware o corrupción de datos. Si desea probar, empiece con valores pequeños, haga click en Aplicar y pruebe.</value>
</data> </data>
<data name="Unmuted" xml:space="preserve"> <data name="Unmuted" xml:space="preserve">
<value>Unmuted</value> <value>No silenciado</value>
</data> </data>
<data name="Updates" xml:space="preserve"> <data name="Updates" xml:space="preserve">
<value>Actualización</value> <value>Actualización</value>
@@ -765,7 +765,7 @@
<value>Intensidad de vibración</value> <value>Intensidad de vibración</value>
</data> </data>
<data name="VisualMode" xml:space="preserve"> <data name="VisualMode" xml:space="preserve">
<value>Visual Mode</value> <value>Modo visual</value>
</data> </data>
<data name="VolumeDown" xml:space="preserve"> <data name="VolumeDown" xml:space="preserve">
<value>Bajar volumen</value> <value>Bajar volumen</value>

View File

@@ -3,8 +3,8 @@
[![GitHub release](https://img.shields.io/github/release/seerge/g-helper)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub release](https://img.shields.io/github/release/seerge/g-helper)](https://GitHub.com/seerge/g-helper/releases/)
[![Github all releases](https://img.shields.io/github/downloads/seerge/g-helper/total)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub stars](https://img.shields.io/github/stars/seerge/g-helper.svg?style=social)](https://GitHub.com/seerge/g-helper/stargazers/) [![Github all releases](https://img.shields.io/github/downloads/seerge/g-helper/total)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub stars](https://img.shields.io/github/stars/seerge/g-helper.svg?style=social)](https://GitHub.com/seerge/g-helper/stargazers/)
Small and lightweight Armoury Crate alternative for Asus laptops offering almost same functionality without extra bloat and unnecessary services. Small and lightweight Armoury Crate alternative for Asus laptops offering almost same functionality without extra load and unnecessary services.
Works with all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, Flow Z13, TUF Series, Strix / Scar Series, ProArt, VivoBook, Ally and many more! Works with all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, Flow Z13, TUF Series, Strix / Scar Series, ProArt, Vivobook, Zenbook, ROG Ally and many more!
# [:floppy_disk:Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip) # [:floppy_disk:Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)