Beispiel #1
0
 public HorizonDesignator(string model, double lat, double lon, double height, double clearance, Horizon horizon, DateTime lastupdated)
 {
     if (!Constants.ElevationModel.IsAnyOf(model))
     {
         throw (new ArgumentException("Unknown elevation model: " + model));
     }
     if ((lat > 90) || (lat < -90))
     {
         throw (new ArgumentOutOfRangeException("Latitude out of range: " + lat.ToString("F8")));
     }
     if ((lon > 180) || (lat < -180))
     {
         throw (new ArgumentOutOfRangeException("Longitude out of range: " + lon.ToString("F8")));
     }
     if (height < 0)
     {
         throw (new ArgumentOutOfRangeException("Height out of range: " + height.ToString("F8")));
     }
     if (clearance < 0)
     {
         throw (new ArgumentOutOfRangeException("Clearance out of range: " + clearance.ToString("F8")));
     }
     Model       = model;
     Lat         = lat;
     Lon         = lon;
     Height      = height;
     Clearance   = clearance;
     Horizon     = horizon;
     LastUpdated = lastupdated;
 }
Beispiel #2
0
 public HorizonDesignator(string model, double lat, double lon, double height, double clearance, Horizon horizon)
     : this(model, lat, lon, height, clearance, horizon, DateTime.UtcNow)
 {
 }