Swap order in update_simulation() to check maneuvers before physics update.
This ensures triggers fire at the correct position instead of after the
spacecraft has moved past the trigger point.
Also fix test config to avoid interference between time-based and true
anomaly triggers.
Documents a bug where true anomaly triggers set to 0 (periapsis) don't
execute because the spacecraft moves past periapsis before the trigger
check happens. The trigger check occurs after physics propagation in the
simulation update order.
- test_periapsis_burn.cpp: Three test cases demonstrating expected behavior
1. Verify periapsis distance is preserved after prograde burn (fails - shows bug)
2. Verify apoapsis raises and periapsis stays same (skipped - depends on fix)
3. Verify burn location equals new periapsis (skipped - depends on fix)
- test_periapsis_burn.toml: Test configuration with elliptical orbit satellite
starting at periapsis with a true anomaly trigger at 0
Added user experience improvements:
- Keyboard shortcuts: ESC to cancel, ENTER to confirm
- Enhanced error messages with detailed descriptions
- Hohmann tab input validation
- Error message display in Hohmann tab
- Edge case handling for all input scenarios
- Clear error messages when tab switches
Keyboard shortcuts work for all dialog tabs and delete confirmation.
Added complete Hohmann transfer calculation and UI:
- Spacecraft, Transfer Parent, Current Body, Target Body selectors
- Calculate Transfer button with real-time calculation
- Results panel showing dv1, dv2, transfer time, semi-major axis
- Create Both Burns / Create Burn 1 Only buttons
- Auto-generated maneuver names with format 'Hohmann Burn N (Source→Target)'
- Proper field initialization and validation
Fixed body selector logic with separate current_body_index field.
Wrapped GuiDropdownBox calls in render_maneuver_create_tab() with validity checks:
- Direction dropdown: Only renders when craft_index is valid
- Trigger dropdown: Only renders when craft_index is valid
- Prevents accessing invalid array indices
- Makes UI more robust
Dropdowns now only appear when spacecraft is properly selected.
Added automatic name generation for new maneuvers:
- generate_maneuver_name() creates sensible names (e.g., 'Prograde #1', 'Retrograde @ ν=3.14 #2')
- Names based on burn direction, trigger type, and burn number
- User can still manually edit names if desired
- Validation now allows empty names (for auto-generation)
- Integrates with existing create_maneuver_from_dialog() workflow
Users can create maneuvers faster with auto-generated names, or override with custom names.
Fixed segfault at ui_renderer.cpp:503 by adding proper initialization:
- All ManeuverDialogState fields initialized in main()
- Dialog opening resets fields to safe defaults
- trigger_type_active, direction_active, delta_v now initialized to valid values
- name, error_message initialized to empty strings
- Preview and error flags initialized to false
Dialog now opens and runs without crashing.
Implemented complete Create tab workflow for maneuver management dialog:
- render_maneuver_create_tab() with all input widgets
- update_orbital_preview() using preview_burn_result()
- render_orbital_preview() for displaying burn results
- validate_maneuver_inputs() for input validation
- create_maneuver_from_dialog() using add_maneuver_to_simulation()
- update_maneuver_from_dialog() for editing existing maneuvers
- Dialog opens/closes from maneuver list button
- Real-time orbital preview with color-coded validation
All tests pass. Phase 1 (Foundation) and Phase 2 (Create Tab) complete.
Comprehensive design for modal maneuver management dialog including:
- Three-tab interface (Create, Hohmann, Edit)
- Real-time orbital preview using preview_burn_result()
- Hohmann transfer calculator
- Enhanced maneuver list with quick actions
- Complete UIState extension with ManeuverDialogState
- Detailed implementation plan with 6 phases
- Edge case handling and visual design guidelines
Implement first 7 priority functions for maneuver UI controls:
- add_maneuver_to_simulation(): Add maneuvers dynamically
- remove_maneuver_by_index(): Remove maneuvers from simulation
- create_maneuver(): Helper to construct maneuver structs
- get_burn_direction_name(): Get descriptive strings for directions
- preview_burn_result(): Preview orbital elements after burn
- calculate_hohmann_transfer(): Calculate optimal two-burn transfer
- validate_burn_parameters(): Validate burn parameters
See docs/planning/maneuver_ui_controls.md for full implementation plan.
- Function was never called anywhere in the codebase
- Functionality now handled by propagate_orbital_elements() with proper Newton-Raphson iteration
- Removes dead code and simplifies the API
- Switch spacecraft and bodies from RK4 to analytical propagation using propagate_orbital_elements()
- Fixed three bugs in hyperbolic orbit propagation (formula errors and insufficient Newton-Raphson iterations)
- Add orbital element reconstruction after burns and SOI transitions
- Zero energy drift for circular, elliptical, parabolic, and hyperbolic orbits
- All 132 tests passing (240,294 assertions)
Moved configs to flatten directory structure:
- test_extreme_orientation_mixed.toml
- test_extreme_timescales.toml
- test_hybrid_burns.toml
- test_hybrid_energy_conservation.toml
Updated corresponding test files to use new paths:
- test_extreme_orientation_mixed.cpp
- test_extreme_timescales.cpp
- test_hybrid_burns.cpp
- test_hybrid_energy_conservation.cpp
All 240,294 assertions passing in 132 test cases
- Combined test_cartesian_to_elements_extreme.cpp (263 lines) and
test_cartesian_to_elements_quadrature.cpp (264 lines) into
test_cartesian_to_elements_advanced.cpp (508 lines, -19 lines saved)
- All 30 test cases preserved (16 from extreme + 14 from quadrature)
- No config files to merge (tests use hardcoded values)
- Added helper functions: find_maneuver_by_name() and execute_maneuver_by_name()
- Modified Hohmann transfer test to use maneuver system via execute_maneuver()
- Modified large burns test to use maneuver system
- Modified energy conservation test to use maneuver system (prograde burn)
- Modified round-trip conversion test to use maneuver system
- Modified multiple burn sequences to use maneuver system for Hohmann transfer
- Tests now properly validate maneuver trigger and execution workflow
- All tests pass (96 assertions in 7 test cases)
- Tests energy comparison between analytical and numerical propagation
- Validates analytical propagation maintains zero energy drift
- Verifies numerical propagation has controlled, expected energy drift
- Tests energy comparison for circular, elliptical, high eccentricity, inclined, fast, and slow orbits
- Tests pre/post burn energy validation (ΔE = v·Δv + 0.5Δv²)
- Tests long-term energy drift comparison (10 orbits)
- Tests energy accuracy across all orbit types
- Validates analytical propagation is more energy-stable than numerical
- Tests fast orbits (LEO, Mercury-like) for numerical precision
- Tests slow orbits (Jupiter-like) for mean anomaly accumulation
- Tests low altitude and super-synchronous orbits
- Validates geosynchronous orbit period accuracy
- Tests period consistency across different true anomalies
- Validates energy conservation across all timescales