66 Commits

Author SHA1 Message Date
Glenn Maynard
681c7adfef Fix up calculating animation frame counts. 2019-01-18 19:46:26 -06:00
Glenn Maynard
a202063287 Truncate the config packet for firmware that doesn't need all of it. 2019-01-18 19:46:26 -06:00
Glenn Maynard
cc07e07649 Fix auto-lighting not reactivating quickly. 2019-01-18 19:46:19 -06:00
Glenn Maynard
331bdc5b56 Fix the checkmark next to the preset buttons not reflecting the current preset. 2019-01-18 19:46:19 -06:00
Glenn Maynard
13bad26fe6 Compare individualPanelFSR in SamePreset, and add placeholder FSR presets. 2019-01-18 19:46:19 -06:00
Glenn Maynard
9167c9e0ed Use GetOverlappedResult instead of GetOverlappedResultEx for Windows 7. 2019-01-18 19:46:19 -06:00
Glenn Maynard
88052ee318 Updates to graphic upload handling. 2019-01-18 19:46:10 -06:00
Glenn Maynard
3d41d8ea15 Fix the application window being created when launched on startup. It should only launch to the tray. 2019-01-18 19:46:10 -06:00
Glenn Maynard
def39becf9 Add labels to the DIP switch display. 2019-01-18 19:46:10 -06:00
Glenn Maynard
f806ad8a00 Scale the diagnostics bars differently for FSRs. 2019-01-18 19:46:10 -06:00
Glenn Maynard
a2eb0c7591 Reorder the diags threshold bars (only cosmetic). 2019-01-07 17:37:41 -06:00
Glenn Maynard
849fd7a975 Simplify overlapped I/O handling, and add a command timeout.
If we don't get a response from a command in a while, resend it.  This doesn't
normally happen (it only happened during firmware development), but it makes
command sending more robust, so let's keep it.  This also uses a single OVERLAPPED
for a whole command, which is simpler.
2019-01-03 18:13:51 -06:00
Glenn Maynard
9ae9a506c6 Add the initial floor lighting button in the UI.
This also refactors the panel button code to rely less on WPF bindings.
They just get in the way for anything nontrivial.  Doing it this way
lets us treat the panel buttons as an interface for setting colors, to
handle the different fields that are set for the panel colors and floor
color.
2019-01-03 18:13:51 -06:00
Glenn Maynard
84c467a485 Cleanup. 2019-01-01 18:00:27 -06:00
Glenn Maynard
48c75ba224 Pass the packet response to completion callbacks. 2019-01-01 18:00:27 -06:00
Glenn Maynard
879df7152c Fix m_bSendingConfig not being reset on close.
This could cause us to stop sending config updates, since we're still
waiting for the previous one to complete.  This is probably the cause
of threshold changes, etc. not being applied.
2018-12-29 22:11:30 -06:00
Glenn Maynard
478a0618fb Fix exception if ThresholdSlider refreshes when no pads are active.
GetFirstActivePadConfig returns a dummy config if nothing is connected, which
didn't have any of its arrays created.  Fill in dummy arrays for enabledSensors,
etc. so refreshes don't throw exceptions if they're updated right when the
last controller disconnects.  (This is a rare race condition and I've only
seen it while stepping in the debugger and disconnecting while stopped.)
2018-12-29 22:10:27 -06:00
Glenn Maynard
aba274603c Set LIGHTS_PER_PANEL to 25.
At 16 the lights data was overflowing, which is probably what was causing the
smxconfig crashes.
2018-12-27 18:26:02 -06:00
Glenn Maynard
6b58194235 Handle FSR thresholds in the threshold sliders. 2018-12-25 17:52:40 -06:00
Glenn Maynard
1c980f24e0 Add config fields for FSR sensitivity and the platform strip color.
This also sets pack:1 so we don't rely on compiler struct alignment.
2018-12-09 16:33:40 -06:00
Glenn Maynard
776baf1aca Set all lights in the UI when previewing light colors. 2018-12-09 16:11:12 -06:00
Glenn Maynard
3d5be3017b Add support for 25 light panels (SDK side). 2018-12-09 16:11:12 -06:00
Glenn Maynard
55443cccb8 Add SMX_SetLights2 to specify the buffer size explicitly. 2018-12-09 16:11:12 -06:00
Glenn Maynard
5e1068d565 Fix config updates when updating quickly.
This fixes the pad flickering when dragging the color slider, because it
could briefly use an out-of-date configuration (only really visible when
going between red and white on the left).
2018-12-09 16:11:12 -06:00
Glenn Maynard
f4e60ef2e0 Clarify comment. 2018-12-09 16:11:12 -06:00
Glenn Maynard
cb7feb626e Separate out scaleLight. 2018-12-09 16:11:12 -06:00
Glenn Maynard
cf02b97fe6 Rename m_aPendingCommands -> m_aPendingLightsCommands.
This only buffers lights commands, not all commands.
2018-12-09 16:11:12 -06:00
Glenn Maynard
39cfc8cee0 Add support for uploading animations to the panel, if it supports it. 2018-12-09 16:11:12 -06:00
Glenn Maynard
0b3202ccff Handle 25-light panel animations in SMXPanelAnimation. 2018-12-09 16:11:12 -06:00
Glenn Maynard
880774f9e4 Make sure we call the callback from SendCommandLocked if the device isn't connected and we're not queueing the command. 2018-12-09 16:11:12 -06:00
Glenn Maynard
159a9a4da2 Add a progress window. 2018-12-09 16:11:12 -06:00
Glenn Maynard
42a99e775b Allow launching on startup.
If this is used to play GIF animations on the pad, being able to have
it launch on startup is useful.

This is disabled by default and there's no UI to enable it yet.
2018-12-09 16:11:12 -06:00
Glenn Maynard
5cf5eddc81 Allow minimizing to the tray.
This allows running GIF animations in the background.
2018-12-09 16:11:12 -06:00
Glenn Maynard
4691ce5ecf If commands are buffered and not sent when the device is disconnected, call any completion callbacks.
This is to guarantee that completion callbacks are always called, so if any
resource collection happens in them it'll always happen.
2018-12-09 16:11:12 -06:00
Glenn Maynard
135e3c5401 Add a UI to set panel animations.
This is driven by the config tool, which needs to stay running.
2018-12-09 16:11:12 -06:00
Glenn Maynard
e5e75e0106 Put the step color widgets in a StackPanel.
Doing this in a separate commit since it changes a lot of indentation but
doesn't really change much code.
2018-12-09 16:11:12 -06:00
Glenn Maynard
2628c078fa Add SMXPanelAnimation. 2018-12-09 16:11:10 -06:00
Glenn Maynard
303283624a Add SMX_SetLights2.
This is the same as SMX_SetLights, but instead of taking one buffer with a
fixed size, it takes a separate buffer for each pad, and explicitly includes
the size of the buffer rather than assuming it's 864 bytes.  SMX_SetLights
and SMX_SetLights2 call into the same underlying update.
2018-12-09 16:10:45 -06:00
Glenn Maynard
d576545266 Split out low-level thread handling into SMXThread, and use it in SMXHelperThread.
This isn't used by the SMXManager thread for now.

This also separates out SMX::Event for thread event handling.
2018-12-09 16:10:45 -06:00
Glenn Maynard
a7cb6ad51d Replace SMXHelperThread::GetThreadId() with SMXHelperThread::IsCurrentThread(). 2018-12-09 16:10:45 -06:00
Glenn Maynard
ad2e7dcb74 Move extern "C" into the SMX_API define. 2018-12-09 16:10:45 -06:00
Glenn Maynard
baa66fc551 Select an enabled panel in the panel color UI by default.
This fixes the default always being up-left (which is usually disabled),
causing the color slider to not do anything until you select a different
panel.
2018-12-09 16:10:45 -06:00
Glenn Maynard
bceca77016 Fix AutoLightsColorRefreshColor calling SetColor with an incomplete array.
This could cause access violations, because it calls the native SMX_SetColor
with a color array that's too small.
2018-12-09 16:10:45 -06:00
Glenn Maynard
4c0da63842 Add debounceDelayMs.
This isn't turned on, this is just to sync up the config packet with the
firmware.
2018-12-09 16:10:44 -06:00
Glenn Maynard
7a4bbc6eab Pad the configuration struct to 250 bytes, so the SDK.DLL ABI doesn't change when fields are added. 2018-12-09 16:10:16 -06:00
Glenn Maynard
6e09b2ea53 Fix the auto-lights preview when dragging the color slider being dimmer than the actual auto-lights. 2018-11-08 19:13:35 -06:00
Glenn Maynard
2c07942478 Move the SMXManager from SMX to SMXManager. 2018-11-08 19:13:35 -06:00
Glenn Maynard
a18df41e49 Fix calls to ActivePads() causing exceptions in design mode. 2018-11-08 19:13:35 -06:00
Glenn Maynard
5f627b1b55 Fix the debug build. 2018-10-19 22:40:02 -05:00
Glenn Maynard
65f4a7102c Check for out of sequence PACKET_FLAG_START_OF_COMMAND.
This improves recovery if a start packet is received when we didn't receive a complete
packet earlier.  This doesn't normally happen, this just matches the error recovery used
in game.
2018-10-19 18:55:50 -05:00