Beispiel #1
0
        public StationLocation(SmallDecimal absoluteLatitude, SmallDecimal absoluteLongitude, GlobeQuadrant quadrant) : this()
        {
            if (absoluteLatitude < 0 || absoluteLatitude > 90)
            {
                throw new ArgumentOutOfRangeException(nameof(absoluteLatitude));
            }
            if (absoluteLongitude < 0 || absoluteLongitude > 180)
            {
                throw new ArgumentOutOfRangeException(nameof(absoluteLongitude));
            }
            if (quadrant == default || !quadrant.IsDefined())
            {
                throw new ArgumentOutOfRangeException(nameof(quadrant));
            }

            AbsoluteLatitude  = absoluteLatitude;
            AbsoluteLongitude = absoluteLongitude;
            Quadrant          = quadrant;
        }
Beispiel #2
0
        public StationLocation(SmallDecimal absoluteLatitude, SmallDecimal absoluteLongitude, GlobeQuadrant quadrant,
                               short marsdenSquareNumber, SmallDecimal elevation, ElevationUnitAndAccuracy elevationUnitAndAccuracy) : this(absoluteLatitude, absoluteLongitude, quadrant)
        {
            if (marsdenSquareNumber < 0 || marsdenSquareNumber > 999)
            {
                throw new ArgumentOutOfRangeException(nameof(marsdenSquareNumber));
            }

            switch (elevationUnitAndAccuracy)
            {
            case ElevationUnitAndAccuracy.MeterExcellent:
                Elevation         = (elevation, LengthUnit.Meter);
                ElevationAccuracy = Codes.ElevationAccuracy.Excellent;
                break;

            case ElevationUnitAndAccuracy.MeterGood:
                Elevation         = (elevation, LengthUnit.Meter);
                ElevationAccuracy = Codes.ElevationAccuracy.Good;
                break;

            case ElevationUnitAndAccuracy.MeterFair:
                Elevation         = (elevation, LengthUnit.Meter);
                ElevationAccuracy = Codes.ElevationAccuracy.Fair;
                break;

            case ElevationUnitAndAccuracy.MeterPoor:
                Elevation         = (elevation, LengthUnit.Meter);
                ElevationAccuracy = Codes.ElevationAccuracy.Poor;
                break;

            case ElevationUnitAndAccuracy.FootExcellent:
                Elevation         = (elevation, LengthUnit.Foot);
                ElevationAccuracy = Codes.ElevationAccuracy.Excellent;
                break;

            case ElevationUnitAndAccuracy.FootGood:
                Elevation         = (elevation, LengthUnit.Foot);
                ElevationAccuracy = Codes.ElevationAccuracy.Good;
                break;

            case ElevationUnitAndAccuracy.FootFair:
                Elevation         = (elevation, LengthUnit.Foot);
                ElevationAccuracy = Codes.ElevationAccuracy.Fair;
                break;

            case ElevationUnitAndAccuracy.FootPoor:
                Elevation         = (elevation, LengthUnit.Foot);
                ElevationAccuracy = Codes.ElevationAccuracy.Poor;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(elevationUnitAndAccuracy), elevationUnitAndAccuracy, null);
            }
        }