diff --git a/src/initialization/FGInitialCondition.cpp b/src/initialization/FGInitialCondition.cpp index 1ba8c353fd..a0826ebdb8 100644 --- a/src/initialization/FGInitialCondition.cpp +++ b/src/initialization/FGInitialCondition.cpp @@ -590,11 +590,6 @@ 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 @@ -941,7 +936,7 @@ FGColumnVector3 FGInitialCondition::GetWindNEDFpsIC(void) const { //****************************************************************************** -double FGInitialCondition::GetWindFpsIC(void) const +double FGInitialCondition::GetWindMagFpsIC(void) const { const FGMatrix33& Tb2l = orientation.GetTInv(); FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.); @@ -1524,7 +1519,7 @@ void FGInitialCondition::bind(FGPropertyManager* PropertyManager) PropertyManager->Tie("ic/vw-down-fps", this, &FGInitialCondition::GetWindDFpsIC); PropertyManager->Tie("ic/vw-mag-fps", this, - &FGInitialCondition::GetWindFpsIC, + &FGInitialCondition::GetWindMagFpsIC, &FGInitialCondition::SetWindMagFpsIC); PropertyManager->Tie("ic/vw-dir-deg", this, &FGInitialCondition::GetWindDirDegIC, diff --git a/src/initialization/FGInitialCondition.h b/src/initialization/FGInitialCondition.h index 792f4eead8..3b133428eb 100644 --- a/src/initialization/FGInitialCondition.h +++ b/src/initialization/FGInitialCondition.h @@ -445,7 +445,7 @@ class JSBSIM_API FGInitialCondition : public FGJSBBase /** Sets the initial total wind speed. @param mag Initial wind velocity magnitude in feet/second */ - void SetWindMagFpsIC(double mag); + void SetWindMagFpsIC(double mag) { SetWindMagKtsIC(mag * fpstokts); } /** Sets the initial total wind speed. @param mag Initial wind velocity magnitude in knots */ @@ -509,7 +509,7 @@ class JSBSIM_API FGInitialCondition : public FGJSBBase /** Gets the initial total wind velocity in feet/sec. @return Initial wind velocity in feet/second */ - double GetWindFpsIC(void) const; + double GetWindMagFpsIC(void) const; /** Gets the initial wind direction. @return Initial wind direction in feet/second */ diff --git a/tests/unit_tests/FGInitialConditionTest.h b/tests/unit_tests/FGInitialConditionTest.h index e38830868f..71c8033a6d 100644 --- a/tests/unit_tests/FGInitialConditionTest.h +++ b/tests/unit_tests/FGInitialConditionTest.h @@ -369,5 +369,10 @@ class FGInitialConditionTest : public CxxTest::TestSuite TS_ASSERT_DELTA(ic.GetWindNFpsIC(), 3.5*sqrt(3.0)*ktstofps, epsilon); TS_ASSERT_DELTA(ic.GetWindEFpsIC(), 3.5*ktstofps, epsilon); TS_ASSERT_DELTA(ic.GetWindDFpsIC(), 3.0, epsilon); + + ic.SetWindMagFpsIC(7.0); + TS_ASSERT_DELTA(ic.GetWindNFpsIC(), 3.5 * sqrt(3.0), epsilon); + TS_ASSERT_DELTA(ic.GetWindEFpsIC(), 3.5, epsilon); + TS_ASSERT_DELTA(ic.GetWindDFpsIC(), 3.0, epsilon); } };