Skip to content

Commit

Permalink
Added ICAO flight settings
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Oct 7, 2024
1 parent 917dfb7 commit 8ec9c87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.7.2

- 🎁 Keeping time intact while importing from `main.mcf` or METAR info
- 🎁 Added ICAO flight settings


## 1.7.1
Expand Down
12 changes: 11 additions & 1 deletion src/WettergeraetDesktop/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,15 @@ void Frame::fromInputToObject()
}
}

/**
* @see https://www.thinkaviation.net/levels-of-vfr-ifr-explained/
* @see https://en.wikipedia.org/wiki/Ceiling_(cloud)
*/
void Frame::updateFlightCategory()
{
std::string flightCategory = "LIFR";
std::string icaoFlightCategory = "IFR";

double visibilityStatuteMiles = this->visbilityInput->GetValue() / 1609.344;
double ceilingFeet = 9999.99;

Expand All @@ -367,7 +373,11 @@ void Frame::updateFlightCategory()
flightCategory = "IFR";
}

SetStatusText("Flight rules: " + flightCategory, 1);
if (this->visbilityInput->GetValue() >= 5000 && (ceilingFeet > 1500)) {
icaoFlightCategory = "VFR";
}

SetStatusText("Flight rules: " + flightCategory + " (ICAO: " + icaoFlightCategory + ")", 1);
}

void Frame::markAsClean()
Expand Down

0 comments on commit 8ec9c87

Please sign in to comment.