public bool Equals(AircraftConfigItem other, double deltaWt, double deltaFuelBias) { return (other.AC == AC && other.Registration == Registration && other.FuelProfile == FuelProfile && other.TOProfile == TOProfile && other.LdgProfile == LdgProfile && Abs(other.OewKg - OewKg) <= deltaWt && Abs(other.MaxTOWtKg - MaxTOWtKg) <= deltaWt && Abs(other.MaxLdgWtKg - MaxLdgWtKg) <= deltaWt && Abs(other.MaxZfwKg - MaxZfwKg) <= deltaWt && Abs(other.MaxFuelKg - MaxFuelKg) <= deltaWt && Abs(other.FuelBias - FuelBias) <= deltaFuelBias && other.WtUnit == WtUnit); }
private static string GetError(AircraftConfigItem item, bool fuelFound, bool toFound, bool ldgFound) { var msgs = new List <string>(); if (!fuelFound) { msgs.Add("fuel"); } if (!toFound) { msgs.Add("takeoff"); } if (!ldgFound) { msgs.Add("landing"); } return((msgs.Count > 0) ? ErrorMessage(item, msgs) : null); }
public AircraftConfig(AircraftConfigItem Config, string FilePath) { this.Config = Config; this.FilePath = FilePath; }
private static string ErrorMessage(AircraftConfigItem c, List <string> parts) { return($"Cannot find {parts.Combined()} profile(s) for {c.Registration} ({c.AC})."); }