github untoldwind/KontrolSystem2 v0.5.7.3

latest releases: v0.5.9.2, v0.5.9.1, v0.5.9.0...
one month ago

Result<T, E> overhaul.

Background:

  • The main use-case of Result<T, E> is to serve as return of a function that can either have a successful result of
    type T or an error of type E.
  • In pretty much all cases the error is just a string, i.e. the common use is Result<T, string>

Changes:

  • For simplification the type parameter for the error case is dropped, i.e. a result is just Result<T>
    • The old notation Result<T, E> (or rather Result<T, string>) will still work, but the second parameter is ignored
  • The result.error field is now a newly introduced core::error::Error
    • For compatibility core::error::Error will be automatically converted to a string
    • Just like before an error Result can be created using the builtin Err function with an error message
  • In addition to the error message the core::error::Error additional contains a stack_trace to help locating
    where the Error was created
  • As an additional helper there this a core::error::current_stack() function to obtain the current stack trace for
    debugging purposes.

Support for script based logs:

  • Add MAIN_LOG and open_log_file(string) to ksp::debug
    • Log files will be cared ein logs sub-folder of to2Local

General improvements:

  • Add vessel.has_launched, vessel.launch_time and vessel.time_since_launch (the latter should be the mission time)
  • Fix issue in std::control::sterring not working for "poorly" oriented command modules
  • Basic support for aerodynamic drag and lift-forces:
    • Add part.lifting_surface and part.dard
    • Add drag, lift and body lift properties to ModuleLiftingSurface, ModuleDrag and ModuleControlSurface

Don't miss a new KontrolSystem2 release

NewReleases is sending notifications on new releases.