mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Static mode for Slash Lighting https://github.com/seerge/g-helper/issues/2448
This commit is contained in:
@@ -98,9 +98,18 @@ namespace GHelper.AnimeMatrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
deviceSlash.Init();
|
deviceSlash.Init();
|
||||||
|
|
||||||
|
switch ((SlashMode)running)
|
||||||
|
{
|
||||||
|
case SlashMode.Static:
|
||||||
|
deviceSlash.SetStatic();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
deviceSlash.SetMode((SlashMode)running);
|
deviceSlash.SetMode((SlashMode)running);
|
||||||
deviceSlash.SetOptions(true, brightness, inteval);
|
deviceSlash.SetOptions(true, brightness, inteval);
|
||||||
deviceSlash.Save();
|
deviceSlash.Save();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ namespace GHelper.AnimeMatrix
|
|||||||
Ramp,
|
Ramp,
|
||||||
GameOver,
|
GameOver,
|
||||||
Start,
|
Start,
|
||||||
Buzzer
|
Buzzer,
|
||||||
|
Static
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class SlashPacket : Packet
|
internal class SlashPacket : Packet
|
||||||
@@ -53,6 +54,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
{ SlashMode.GameOver, "Game Over"},
|
{ SlashMode.GameOver, "Game Over"},
|
||||||
{ SlashMode.Start, "Start"},
|
{ SlashMode.Start, "Start"},
|
||||||
{ SlashMode.Buzzer, "Buzzer"},
|
{ SlashMode.Buzzer, "Buzzer"},
|
||||||
|
{ SlashMode.Static, "Static"},
|
||||||
};
|
};
|
||||||
|
|
||||||
private static Dictionary<SlashMode, byte> modeCodes = new Dictionary<SlashMode, byte>
|
private static Dictionary<SlashMode, byte> modeCodes = new Dictionary<SlashMode, byte>
|
||||||
@@ -115,6 +117,13 @@ namespace GHelper.AnimeMatrix
|
|||||||
Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13), "SlashMode");
|
Set(Packet<SlashPacket>(0xD3, 0x04, 0x00, 0x0C, 0x01, modeByte, 0x02, 0x19, 0x03, 0x13, 0x04, 0x11, 0x05, 0x12, 0x06, 0x13), "SlashMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetStatic()
|
||||||
|
{
|
||||||
|
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x07), "Static");
|
||||||
|
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x01, 0xAC), "Static");
|
||||||
|
Set(Packet<SlashPacket>(0xD3, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), "StaticWhite");
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user