Skip to content

Commit

Permalink
Allow no_factor_wind to be configurable per airport
Browse files Browse the repository at this point in the history
  • Loading branch information
laxentis committed Nov 18, 2024
1 parent 52fa711 commit 03f9fc0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct Airport {
preferred_arr: Option<Vec<String>>,
selected_dep_rwy: Option<String>,
selected_arr_rwy: Option<String>,
no_factor_wind: Option<u32>,
}

impl Runway {
Expand All @@ -54,12 +55,18 @@ impl Airport {

async fn select_rwy(
&self,
calm_wind: Option<u32>,
calm_wind_prop: Option<u32>,
pref_wind: Option<u32>,
assumed_dir: Option<u32>,
) -> Result<(String, String), ExitFailure> {
let icao: String;
let calm_wind = calm_wind.unwrap_or(5);
let calm_wind: u32;
if self.no_factor_wind.is_some()
{
calm_wind = self.no_factor_wind.unwrap();
} else {
calm_wind = calm_wind_prop.unwrap_or(5);
}
let pref_calm_wind = pref_wind.unwrap_or(15);
let assumed_dir = assumed_dir.unwrap_or(270);
match &self.use_metar_from {
Expand Down

0 comments on commit 03f9fc0

Please sign in to comment.