mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Slash Lighting support for GA605
This commit is contained in:
@@ -40,9 +40,16 @@ namespace GHelper.AnimeMatrix
|
||||
try
|
||||
{
|
||||
if (AppConfig.IsSlash())
|
||||
deviceSlash = new SlashDevice();
|
||||
{
|
||||
if (AppConfig.IsSlashAura())
|
||||
deviceSlash = new SlashDeviceAura();
|
||||
else
|
||||
deviceSlash = new SlashDevice();
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceMatrix = new AnimeMatrixDevice();
|
||||
}
|
||||
|
||||
matrixTimer = new System.Timers.Timer(100);
|
||||
matrixTimer.Elapsed += MatrixTimer_Elapsed;
|
||||
@@ -111,7 +118,8 @@ namespace GHelper.AnimeMatrix
|
||||
if (custom is not null && custom.Length > 0)
|
||||
{
|
||||
deviceSlash.SetCustom(AppConfig.StringToBytes(custom));
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceSlash.SetStatic(brightness);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using GHelper.AnimeMatrix.Communication;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
|
||||
namespace GHelper.AnimeMatrix
|
||||
{
|
||||
@@ -26,6 +25,9 @@ namespace GHelper.AnimeMatrix
|
||||
BatteryLevel,
|
||||
}
|
||||
|
||||
public class SlashDevice : Device
|
||||
{
|
||||
|
||||
internal class SlashPacket : Packet
|
||||
{
|
||||
public SlashPacket(byte[] command) : base(0x5E, 128, command)
|
||||
@@ -33,9 +35,6 @@ namespace GHelper.AnimeMatrix
|
||||
}
|
||||
}
|
||||
|
||||
public class SlashDevice : Device
|
||||
{
|
||||
|
||||
public static Dictionary<SlashMode, string> Modes = new Dictionary<SlashMode, string>
|
||||
{
|
||||
{ SlashMode.Bounce, "Bounce"},
|
||||
@@ -85,7 +84,7 @@ namespace GHelper.AnimeMatrix
|
||||
{ SlashMode.Buzzer, 0x44},
|
||||
};
|
||||
|
||||
public SlashDevice() : base(0x0B05, 0x193B, 128)
|
||||
public SlashDevice(ushort productId = 0x193B) : base(0x0B05, productId, 128)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -216,7 +215,20 @@ namespace GHelper.AnimeMatrix
|
||||
_usbProvider?.Set(packet.Data);
|
||||
if (log is not null) Logger.WriteLine($"{log}:" + BitConverter.ToString(packet.Data).Substring(0, 48));
|
||||
}
|
||||
}
|
||||
|
||||
public class SlashDeviceAura : SlashDevice
|
||||
{
|
||||
public SlashDeviceAura(): base(0x193B)
|
||||
{
|
||||
}
|
||||
|
||||
internal new class SlashPacket : Packet
|
||||
{
|
||||
public SlashPacket(byte[] command) : base(0x5D, 128, command)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -405,6 +405,11 @@ public static class AppConfig
|
||||
return ContainsModel("GA403") || ContainsModel("GU605") || ContainsModel("GA605");
|
||||
}
|
||||
|
||||
public static bool IsSlashAura()
|
||||
{
|
||||
return ContainsModel("GA605");
|
||||
}
|
||||
|
||||
public static bool IsInputBacklight()
|
||||
{
|
||||
return ContainsModel("GA503") || IsSlash();
|
||||
@@ -583,7 +588,7 @@ public static class AppConfig
|
||||
|
||||
public static bool IsFanRequired()
|
||||
{
|
||||
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");
|
||||
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P") || ContainsModel("GU605") || ContainsModel("GA403") || ContainsModel("G634J") || ContainsModel("G834J") || ContainsModel("G614J") || ContainsModel("G814J") || ContainsModel("FX507V");
|
||||
}
|
||||
|
||||
public static bool IsAMDLight()
|
||||
|
||||
Reference in New Issue
Block a user