private double GetAzimuthAsDegrees()
        {
            if (LineAzimuthType == AzimuthTypes.Mils)
            {
                return(Azimuth.GetValueOrDefault() * 0.05625);
            }

            return(Azimuth.GetValueOrDefault());
        }
示例#2
0
        private double GetAzimuthAsDegrees()
        {
            if (LineAzimuthType == AzimuthTypes.Mils)
            {
                return(Azimuth.GetValueOrDefault() * ValueConverterConstant.MilsToDegree);
            }
            else if (LineAzimuthType == AzimuthTypes.Gradians)
            {
                return(Azimuth.GetValueOrDefault() * ValueConverterConstant.GradianToDegree);
            }

            return(Azimuth.GetValueOrDefault());
        }
        private void UpdateAzimuthFromTo(AzimuthTypes fromType, AzimuthTypes toType)
        {
            try
            {
                double angle = Azimuth.GetValueOrDefault();

                if (fromType == AzimuthTypes.Degrees && toType == AzimuthTypes.Mils)
                {
                    angle *= 17.777777778;
                }
                else if (fromType == AzimuthTypes.Mils && toType == AzimuthTypes.Degrees)
                {
                    angle *= 0.05625;
                }

                Azimuth = angle;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
示例#4
0
        private void UpdateAzimuthFromTo(AzimuthTypes fromType, AzimuthTypes toType)
        {
            try
            {
                double angle = Azimuth.GetValueOrDefault();

                if (fromType == AzimuthTypes.Degrees && toType == AzimuthTypes.Mils)
                {
                    angle *= ValueConverterConstant.DegreeToMils;
                }
                else if (fromType == AzimuthTypes.Degrees && toType == AzimuthTypes.Gradians)
                {
                    angle *= ValueConverterConstant.DegreeToGradian;
                }
                else if (fromType == AzimuthTypes.Mils && toType == AzimuthTypes.Degrees)
                {
                    angle *= ValueConverterConstant.MilsToDegree;
                }
                else if (fromType == AzimuthTypes.Mils && toType == AzimuthTypes.Gradians)
                {
                    angle *= ValueConverterConstant.MilsToGradian;
                }
                else if (fromType == AzimuthTypes.Gradians && toType == AzimuthTypes.Degrees)
                {
                    angle *= ValueConverterConstant.GradianToDegree;
                }
                else if (fromType == AzimuthTypes.Gradians && toType == AzimuthTypes.Mils)
                {
                    angle *= ValueConverterConstant.GradianToMils;
                }

                Azimuth = angle;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        }