Skip to content

Commit

Permalink
Limit variable wind bearing impact relative to wind force
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Jul 8, 2019
1 parent 13bbbb6 commit 0bc8bc6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change log
==========

1.2.10
------

* 💊 Limit variable wind bearing impact relative to wind force

1.2.9
-----

Expand Down
10 changes: 8 additions & 2 deletions src/WettergeraetLib/AeroflyWeather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ double AeroflyWeather::makeGust(double windSpeed, char const conditions[4][6])
auto gustSpeed = windSpeed;

// Get gusts from weather
for (unsigned int i = 0; i <= sizeof(conditions) / sizeof(conditions[0]); i++) {
auto sizeOfConditions = 6;
for (unsigned int i = 0; i <= sizeOfConditions; i++) {
if (strcmp(conditions[i], "WS") == 0) {
// Wind Shear
gustSpeed = std::max(windSpeed + 10.0, 45.0);
Expand Down Expand Up @@ -68,7 +69,12 @@ void AeroflyWeather::setWind(double kts, unsigned int degrees)

void AeroflyWeather::setTurbulence(double windSpeed, double gustSpeed, unsigned int degreesFrom, unsigned int degreesTo, char const conditions[4][6])
{
const double degreesRange = std::abs((degreesTo - degreesFrom) / 360.0);
double degreesRange = std::abs((degreesTo - degreesFrom) / 360.0);

// Limit variable wind bearing impact relative to wind force
if (windSpeed / 10 < degreesRange) {
degreesRange = windSpeed / 10;
}

if (gustSpeed == windSpeed) {
// Spice up gust winds
Expand Down
2 changes: 1 addition & 1 deletion src/WettergeraetLib/Argumentor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <sstream>
#include <iterator>

const char* Argumentor::APP_VERSION = "1.2.9";
const char* Argumentor::APP_VERSION = "1.2.10";
#if _WIN64
const char* Argumentor::APP_TARGET = "64-bit";
#else
Expand Down

0 comments on commit 0bc8bc6

Please sign in to comment.