From 190c060f22bd4465f17482a5fb5a3bf289a86c54 Mon Sep 17 00:00:00 2001 From: Sean McLeod Date: Fri, 17 May 2024 21:40:30 +0200 Subject: [PATCH] Add support for setting ic/vw-mag-fps --- src/initialization/FGInitialCondition.cpp | 8 +++++++- src/initialization/FGInitialCondition.h | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/initialization/FGInitialCondition.cpp b/src/initialization/FGInitialCondition.cpp index e9f9094468..1ba8c353fd 100644 --- a/src/initialization/FGInitialCondition.cpp +++ b/src/initialization/FGInitialCondition.cpp @@ -590,6 +590,11 @@ void FGInitialCondition::SetWindDownKtsIC(double wD) calcAeroAngles(_vt_NED); } +void FGInitialCondition::SetWindMagFpsIC(double mag) +{ + SetWindMagKtsIC(mag*fpstokts); +} + //****************************************************************************** // Modifies the wind velocity (in knots) while keeping its direction unchanged. // The vertical component (in local NED frame) is unmodified. The aircraft @@ -1519,7 +1524,8 @@ void FGInitialCondition::bind(FGPropertyManager* PropertyManager) PropertyManager->Tie("ic/vw-down-fps", this, &FGInitialCondition::GetWindDFpsIC); PropertyManager->Tie("ic/vw-mag-fps", this, - &FGInitialCondition::GetWindFpsIC); + &FGInitialCondition::GetWindFpsIC, + &FGInitialCondition::SetWindMagFpsIC); PropertyManager->Tie("ic/vw-dir-deg", this, &FGInitialCondition::GetWindDirDegIC, &FGInitialCondition::SetWindDirDegIC); diff --git a/src/initialization/FGInitialCondition.h b/src/initialization/FGInitialCondition.h index 36065f7a7a..792f4eead8 100644 --- a/src/initialization/FGInitialCondition.h +++ b/src/initialization/FGInitialCondition.h @@ -443,6 +443,10 @@ class JSBSIM_API FGInitialCondition : public FGJSBBase @param wD Initial wind velocity in local down direction, feet/second */ void SetWindNEDFpsIC(double wN, double wE, double wD); + /** Sets the initial total wind speed. + @param mag Initial wind velocity magnitude in feet/second */ + void SetWindMagFpsIC(double mag); + /** Sets the initial total wind speed. @param mag Initial wind velocity magnitude in knots */ void SetWindMagKtsIC(double mag);