Set all lights in the UI when previewing light colors.

master
Glenn Maynard 6 years ago
parent 3d5be3017b
commit 776baf1aca
  1. 4
      smx-config/Helpers.cs
  2. 8
      smx-config/SMX.cs

@ -518,7 +518,7 @@ namespace smx_config
color = config.stepColor;
for( int iPanel = 0; iPanel < 9; ++iPanel )
{
for( int i = 0; i < 16; ++i )
for( int i = 0; i < 25; ++i )
{
// Auto-lights colors in the config packet are scaled so the firmware
// doesn't have to do it, but here we're setting the panel color to
@ -531,7 +531,7 @@ namespace smx_config
}
}
SMX.SMX.SetLights(cmd.Get());
SMX.SMX.SetLights2(cmd.Get());
}
};

@ -273,7 +273,7 @@ namespace SMX
[DllImport("SMX.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool SMX_GetTestData(int pad, out SMXSensorTestModeData data);
[DllImport("SMX.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool SMX_SetLights(byte[] buf);
private static extern bool SMX_SetLights2(byte[] buf, int lightDataSize);
[DllImport("SMX.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern IntPtr SMX_Version();
@ -441,13 +441,11 @@ namespace SMX
SMX_ForceRecalibration(pad);
}
public static void SetLights(byte[] buf)
public static void SetLights2(byte[] buf)
{
if(!DLLAvailable()) return;
if(buf.Length != 9*16*3*2)
throw new Exception("SetLights buffer has an invalid length: " + buf.Length);
SMX_SetLights(buf);
SMX_SetLights2(buf, buf.Length);
}
// SMXPanelAnimation

Loading…
Cancel
Save