当前位置: 首页>>代码示例>>C#>>正文


C# Distance.toStringU方法代码示例

本文整理汇总了C#中Distance.toStringU方法的典型用法代码示例。如果您正苦于以下问题:C# Distance.toStringU方法的具体用法?C# Distance.toStringU怎么用?C# Distance.toStringU使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Distance的用法示例。


在下文中一共展示了Distance.toStringU方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: validateCoord

        protected bool validateCoord(out double lng, out double lat, out double elev)
        {
            bool allcool = true;

            lng = 0.0d;
            lat = 0.0d;
            elev = 0.0d;

            if(Project.coordStyle == 3)		// UTM?
            {
                // something like "11S 0432345E 3712345N" in the latitudeTextBox
                allcool = Project.mainCommand.fromUtmString(latitudeTextBox.Text, out lng, out lat);
                if(allcool)
                {
                    latLabel.ForeColor = Color.Black;
                }
                else
                {
                    latLabel.ForeColor = Color.Red;
                }
            }
            else
            {
                try
                {
                    lng = GeoCoord.stringLngToDouble(longitudeTextBox.Text);
                    lngLabel.ForeColor = Color.Black;
                }
                catch
                {
                    lngLabel.ForeColor = Color.Red;
                    allcool = false;
                }

                try
                {
                    lat = GeoCoord.stringLatToDouble(latitudeTextBox.Text);
                    latLabel.ForeColor = Color.Black;
                }
                catch
                {
                    latLabel.ForeColor = Color.Red;
                    allcool = false;
                }
            }

            try
            {
                Distance elevDist = new Distance(0.0d);
                int unitsCompl = elevDist.UnitsCompl;

                double nuElev = Convert.ToDouble(elevationTextBox.Text.Replace(",",""));
                elevDist.byUnits(nuElev, unitsCompl);

                elev = elevDist.Meters;

                elevationUnitsLabel.Text = elevDist.toStringU(unitsCompl);

                elevLabel.ForeColor = Color.Black;
            }
            catch
            {
                elevLabel.ForeColor = Color.Red;
                allcool = false;
            }
            return allcool;
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:67,代码来源:DlgMakeWaypoint.cs

示例2: setCoordFields

        protected void setCoordFields(GeoCoord location)
        {
            speedLabel.Visible = false;
            speedTextBox.Visible = false;
            speedUnitsLabel.Visible = false;

            m_cameraManager.MarkLocation(location, 0);

            if(Project.coordStyle == 3)		// UTM?
            {
                coordFormatLabel.Text = "type like\r\n11S 432345E 3712345N";
                latLabel.Text = "* UTM:";
                lngLabel.Visible = false;
                longitudeTextBox.Visible = false;

                latitudeTextBox.Text = m_latText = location.ToString();
                m_lngText = longitudeTextBox.Text;	// will be a part of comparison later
            }
            else
            {
                coordFormatLabel.Text = "type like 117,33.355 -\r\nfirst comma, then dot";
                latLabel.Text = "* Latitude:";
                lngLabel.Visible = true;
                longitudeTextBox.Visible = true;

                latitudeTextBox.Text = m_latText = "" + GeoCoord.latToString(location.Lat, Project.coordStyle, true, true);
                longitudeTextBox.Text = m_lngText = "" + GeoCoord.lngToString(location.Lng, Project.coordStyle, true, true);
            }
            Distance elevDist = new Distance(location.Elev);
            int unitsCompl = elevDist.UnitsCompl;
            elevationTextBox.Text = m_elevText = elevDist.toStringN(unitsCompl);
            elevationUnitsLabel.Text = elevDist.toStringU(unitsCompl);
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:33,代码来源:DlgMakeWaypoint.cs

示例3: setCoordTextBoxes

 private void setCoordTextBoxes()
 {
     m_cameraManager.MarkLocation(m_cameraManager.Location, 0);
     if(Project.coordStyle == 3)		// UTM?
     {
         coordFormatLabel.Text = "type like 11S 432345E 3712345N";
         latLabel.Text = "UTM:";
         lngLabel.Visible = false;
         longitudeTextBox.Visible = false;
         latitudeTextBox.Text = m_cameraManager.Location.ToString();
     }
     else
     {
         coordFormatLabel.Text = (Project.coordStyle == 0) ?
                                             "type like 117,33'35 - first comma, then quote"
                                         :	"type like 117,33.355 - first comma, then dot";
         latLabel.Text = "Latitude:";
         lngLabel.Visible = true;
         longitudeTextBox.Visible = true;
         latitudeTextBox.Text = "" + GeoCoord.latToString(m_cameraManager.Location.Lat, Project.coordStyle, true, true);
         longitudeTextBox.Text = "" + GeoCoord.lngToString(m_cameraManager.Location.Lng, Project.coordStyle, true, true);
     }
     Distance elevDist = new Distance(m_cameraManager.Location.Elev);
     int unitsCompl = elevDist.UnitsCompl;
     elevationTextBox.Text = elevDist.toStringN(unitsCompl);
     elevationUnitsLabel.Text = elevDist.toStringU(unitsCompl);
 }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:27,代码来源:GotoForm.cs

示例4: act

        private void act()
        {
            double lng = 0.0d;
            double lat = 0.0d;
            double elev = 0.0d;

            bool allcool = true;

            if(Project.coordStyle == 3)		// UTM?
            {
                // something like "11S 0432345E 3712345N" in the latitudeTextBox
                allcool = Project.mainCommand.fromUtmString(latitudeTextBox.Text, out lng, out lat);
                if(allcool)
                {
                    latLabel.ForeColor = Color.Black;
                }
                else
                {
                    latLabel.ForeColor = Color.Red;
                }
            }
            else
            {
                try
                {
                    lng = GeoCoord.stringLngToDouble(longitudeTextBox.Text);
                    lngLabel.ForeColor = Color.Black;
                }
                catch
                {
                    lngLabel.ForeColor = Color.Red;
                    allcool = false;
                }

                try
                {
                    lat = GeoCoord.stringLatToDouble(latitudeTextBox.Text);
                    latLabel.ForeColor = Color.Black;
                }
                catch
                {
                    latLabel.ForeColor = Color.Red;
                    allcool = false;
                }
            }

            try
            {
                Distance elevDist = new Distance(0.0d);
                int unitsCompl = elevDist.UnitsCompl;

                double nuElev = Convert.ToDouble(elevationTextBox.Text.Replace(",",""));
                elevDist.byUnits(nuElev, unitsCompl);

                elev = elevDist.Meters;

                if(elev < Project.cameraHeightMin*1000.0d)
                {
                    elevDist.byUnits(Project.cameraHeightMin*1000.0d, Distance.UNITS_DISTANCE_M);
                    elev = elevDist.Meters;
                }
                else if(elev > Project.CAMERA_HEIGHT_MAX*1000.0d)
                {
                    elevDist.byUnits(Project.CAMERA_HEIGHT_MAX*1000.0d, Distance.UNITS_DISTANCE_M);
                    elev = elevDist.Meters;
                }

                elevationUnitsLabel.Text = elevDist.toStringU(unitsCompl);

                elevLabel.ForeColor = Color.Black;
            }
            catch
            {
                elevLabel.ForeColor = Color.Red;
                allcool = false;
            }

            if(makeWaypointCheckBox.Checked && waypointNameTextBox.Text.Length == 0)
            {
                waypointNameLabel.ForeColor = Color.Red;
                allcool = false;
            }
            else
            {
                waypointNameLabel.ForeColor = Color.Black;
            }

            if(allcool)
            {
                try
                {
                    GeoCoord location = new GeoCoord(lng, lat, elev);
                    location.Normalize();
                    m_cameraManager.MarkLocation(location, 0);
                    if(makeWaypointCheckBox.Checked)
                    {
                        LiveObjectTypes type = LiveObjectTypes.LiveObjectTypeWaypoint;
                        bool isFound = false;
                        switch(waypointTypeComboBox.SelectedIndex)
                        {
//.........这里部分代码省略.........
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:101,代码来源:GotoForm.cs

示例5: goButton_Click

        private void goButton_Click(object sender, System.EventArgs e)
        {
            bool allcool = true;

            try
            {
                Distance elevDist = new Distance(0.0d);
                int unitsCompl = elevDist.UnitsCompl;

                double nuElev = Convert.ToDouble(elevationTextBox.Text.Replace(",",""));
                elevDist.byUnits(nuElev, unitsCompl);

                altitude = elevDist.Meters;

                elevationUnitsLabel.Text = elevDist.toStringU(unitsCompl);

                elevLabel.ForeColor = Color.Black;
            }
            catch
            {
                elevLabel.ForeColor = Color.Red;
                allcool = false;
            }

            try
            {
                Speed speedDist = new Speed(0.0d);
                int units = speedDist.Units;

                double nuSpeed = Convert.ToDouble(speedTextBox.Text.Replace(",",""));
                speedDist.byUnits(nuSpeed, units);

                speed = speedDist.Meters;

                speedUnitsLabel.Text = speedDist.toStringU(units);

                elevLabel.ForeColor = Color.Black;
            }
            catch
            {
                elevLabel.ForeColor = Color.Red;
                allcool = false;
            }

            try
            {
                startTime = timePicker.isDateTimeValid ? timePicker.dateTime : DateTime.MinValue; //new DateTime(7000, 1, 1);
            }
            catch
            {
                allcool = false;
            }

            if(allcool)
            {
                result = true;
                this.Close();
            }
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:59,代码来源:DlgNewRouteParameters.cs

示例6: setFields

        protected void setFields()
        {
            Distance elevDist = new Distance(altitude);
            int elevUnitsCompl = elevDist.UnitsCompl;
            elevationTextBox.Text = elevDist.toStringN(elevUnitsCompl);
            elevationUnitsLabel.Text = elevDist.toStringU(elevUnitsCompl);

            Speed speedDist = new Speed(speed);
            int speedUnits = speedDist.Units;
            speedTextBox.Text = speedDist.toStringN(speedUnits);
            speedUnitsLabel.Text = speedDist.toStringU(speedUnits);
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:12,代码来源:DlgNewRouteParameters.cs


注:本文中的Distance.toStringU方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。