Ability to override all assemblies in debug panel

This commit is contained in:
PS 2021-04-08 16:06:58 -10:00
parent 1d3d7f5f86
commit 7a95861bf8
5 changed files with 28 additions and 12 deletions

View File

@ -6,7 +6,7 @@ SET MyPath=%MyPath:~0,-1%
call %MyPath%\_prebuild_win32.bat app debug msvc call %MyPath%\_prebuild_win32.bat app debug msvc
call %MyPath%\setup_cl.bat call %MyPath%\setup_cl.bat
SET CommonCompilerFlags=-nologo -DDEBUG=0 -DPLATFORM_WINDOWS -FC -WX -W4 -Z7 -Oi -GR- -EHsc -EHa- -MTd -fp:fast -fp:except- -IC:\programs-dev\gs_libs\src SET CommonCompilerFlags=-nologo -DDEBUG=1 -DPLATFORM_WINDOWS -FC -WX -W4 -Z7 -Oi -GR- -EHsc -EHa- -MTd -fp:fast -fp:except- -IC:\programs-dev\gs_libs\src
SET CommonCompilerFlags=-wd4127 -wd4702 -wd4101 -wd4505 -wd4100 -wd4189 -wd4244 -wd4201 -wd4996 -I%CommonLibs% -O2 %CommonCompilerFlags% SET CommonCompilerFlags=-wd4127 -wd4702 -wd4101 -wd4505 -wd4100 -wd4189 -wd4244 -wd4201 -wd4996 -I%CommonLibs% -O2 %CommonCompilerFlags%

View File

@ -66,6 +66,8 @@ AssemblyDebug_Render(panel* Panel, rect2 PanelBounds, render_command_buffer* Ren
{ {
InterfaceAssert(Interface->PerFrameMemory); InterfaceAssert(Interface->PerFrameMemory);
State->AssemblyDebugState.AllAssemblies = ui_ToggleText(Interface, MakeString("All Assemblies"), State->AssemblyDebugState.AllAssemblies);
gs_string OverrideStr = MakeString(OverrideTypeStrings[State->AssemblyDebugState.Override]); gs_string OverrideStr = MakeString(OverrideTypeStrings[State->AssemblyDebugState.Override]);
if (ui_BeginLabeledDropdown(Interface, MakeString("Override"), OverrideStr)) if (ui_BeginLabeledDropdown(Interface, MakeString("Override"), OverrideStr))
{ {

View File

@ -42,6 +42,7 @@ struct assembly_debug_state
{ {
override_type Override; override_type Override;
bool AllAssemblies;
u32 TargetAssembly; u32 TargetAssembly;
u32 TargetStrip; u32 TargetStrip;
@ -101,12 +102,9 @@ AssemblyDebug_OverrideTagValueWithColor(assembly Assembly, led_buffer LedBuffer,
} }
internal void internal void
AssemblyDebug_OverrideOutput(assembly_debug_state State, assembly_array Assemblies, led_system LedSystem) AssemblyDebug_OverrideOutputForAssembly(assembly_debug_state State, led_system LedSystem,
assembly Assembly)
{ {
if (State.Override == ADS_Override_None) return;
State.TargetColor = pixel{255,255,255};
assembly Assembly = Assemblies.Values[State.TargetAssembly];
led_buffer LedBuffer = LedSystem.Buffers[Assembly.LedBufferIndex]; led_buffer LedBuffer = LedSystem.Buffers[Assembly.LedBufferIndex];
u8 V = State.Brightness; u8 V = State.Brightness;
@ -203,6 +201,27 @@ AssemblyDebug_OverrideOutput(assembly_debug_state State, assembly_array Assembli
} }
} }
internal void
AssemblyDebug_OverrideOutput(assembly_debug_state State, assembly_array Assemblies, led_system LedSystem)
{
if (State.Override == ADS_Override_None) return;
State.TargetColor = pixel{255,255,255};
if (State.AllAssemblies)
{
for (u32 i = 0; i < Assemblies.Count; i++)
{
assembly Assembly = Assemblies.Values[i];
AssemblyDebug_OverrideOutputForAssembly(State, LedSystem, Assembly);
}
}
else
{
assembly Assembly = Assemblies.Values[State.TargetAssembly];
AssemblyDebug_OverrideOutputForAssembly(State, LedSystem, Assembly);
}
}
#define FOLDHAUS_ASSEMBLY_DEBUG_H #define FOLDHAUS_ASSEMBLY_DEBUG_H
#endif // FOLDHAUS_ASSEMBLY_DEBUG_H #endif // FOLDHAUS_ASSEMBLY_DEBUG_H

View File

@ -43,11 +43,6 @@ typedef struct motor_packet
typedef struct motor_status_packet typedef struct motor_status_packet
{ {
motor_packet Pos; motor_packet Pos;
/*
u8 Motor1Pos;
u8 Motor2Pos;
u8 Motor3Pos;
*/
u8 MotorStatus[3]; u8 MotorStatus[3];
u16 Temperature; u16 Temperature;

View File

@ -67,7 +67,7 @@ r64 VoiceCommandSustainDuration = 30.0; // in seconds
// NOTE: This is not a symmetric operation. When we send a 'motor open' // NOTE: This is not a symmetric operation. When we send a 'motor open'
// command, we want to immediately turn the upper leds on so they appear // command, we want to immediately turn the upper leds on so they appear
// to have been on the whole time. // to have been on the whole time.
r64 TurnUpperLedsOffAfterMotorCloseCommandDelay = 5.0; // in seconds r64 TurnUpperLedsOffAfterMotorCloseCommandDelay = 30.0; // in seconds
// NOTE: Temperature & Time of Day Based Led Brightness Settings // NOTE: Temperature & Time of Day Based Led Brightness Settings