Exemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            PointF text = new PointF(CMB_coordsystem.Right + 3, 3);

            //Enum.GetValues(typeof(CoordsSystems), CMB_coordsystem.Text);

            if (System == CoordsSystems.GEO.ToString())
            {
                e.Graphics.DrawString(Lat.ToString("0.000000") + " " + Lng.ToString("0.000000") + "   " + Alt.ToString("0.00"), this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
            }
            else if (System == CoordsSystems.UTM.ToString())
            {
                UTM utm = (UTM)point;
                //utm.East.ToString("0.00") + " " + utm.North.ToString("0.00")
                e.Graphics.DrawString(utm.ToString() + "   " + Alt.ToString("0.00"), this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
            }
            else if (System == CoordsSystems.MGRS.ToString())
            {
                MGRS mgrs = (MGRS)point;
                mgrs.Precision = 5;
                e.Graphics.DrawString(mgrs.ToString() + "   " + Alt.ToString("0.00"), this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
            }
        }
 public override string ToString()
 {
     return("{Lat=" + Lat.ToString(CultureInfo.CurrentCulture) + ",Lng=" +
            Lng.ToString(CultureInfo.CurrentCulture) + ",WidthLng=" +
            WidthLng.ToString(CultureInfo.CurrentCulture) + ",HeightLat=" +
            HeightLat.ToString(CultureInfo.CurrentCulture) + "}");
 }
        public virtual void SaveToXml(System.Xml.XmlTextWriter xmlWriter)
        {
            xmlWriter.WriteStartElement("ReferenceFrame");
            xmlWriter.WriteAttributeString("Name", Name);
            xmlWriter.WriteAttributeString("Parent", Parent);
            xmlWriter.WriteAttributeString("ReferenceFrameType", ReferenceFrameType.ToString());
            xmlWriter.WriteAttributeString("Reference", Reference.ToString());
            xmlWriter.WriteAttributeString("ParentsRoationalBase", ParentsRoationalBase.ToString());
            xmlWriter.WriteAttributeString("MeanRadius", MeanRadius.ToString());
            xmlWriter.WriteAttributeString("Oblateness", Oblateness.ToString());
            xmlWriter.WriteAttributeString("Heading", Heading.ToString());
            xmlWriter.WriteAttributeString("Pitch", Pitch.ToString());
            xmlWriter.WriteAttributeString("Roll", Roll.ToString());
            xmlWriter.WriteAttributeString("Scale", Scale.ToString());
            xmlWriter.WriteAttributeString("Tilt", Tilt.ToString());
            xmlWriter.WriteAttributeString("Translation", Translation.ToString());
            if (ReferenceFrameType == ReferenceFrameTypes.FixedSherical)
            {
                xmlWriter.WriteAttributeString("Lat", Lat.ToString());
                xmlWriter.WriteAttributeString("Lng", Lng.ToString());
                xmlWriter.WriteAttributeString("Altitude", Altitude.ToString());
            }
            xmlWriter.WriteAttributeString("RotationalPeriod", RotationalPeriod.ToString());
            xmlWriter.WriteAttributeString("ZeroRotationDate", ZeroRotationDate.ToString());
            xmlWriter.WriteAttributeString("RepresentativeColor", SavedColor.Save(RepresentativeColor));
            xmlWriter.WriteAttributeString("ShowAsPoint", ShowAsPoint.ToString());
            xmlWriter.WriteAttributeString("ShowOrbitPath", ShowOrbitPath.ToString());

            xmlWriter.WriteAttributeString("StationKeeping", StationKeeping.ToString());

            if (ReferenceFrameType == ReferenceFrameTypes.Orbital)
            {
                xmlWriter.WriteAttributeString("SemiMajorAxis", SemiMajorAxis.ToString());
                xmlWriter.WriteAttributeString("SemiMajorAxisScale", this.SemiMajorAxisUnits.ToString());
                xmlWriter.WriteAttributeString("Eccentricity", Eccentricity.ToString());
                xmlWriter.WriteAttributeString("Inclination", Inclination.ToString());
                xmlWriter.WriteAttributeString("ArgumentOfPeriapsis", ArgumentOfPeriapsis.ToString());
                xmlWriter.WriteAttributeString("LongitudeOfAscendingNode", LongitudeOfAscendingNode.ToString());
                xmlWriter.WriteAttributeString("MeanAnomolyAtEpoch", MeanAnomolyAtEpoch.ToString());
                xmlWriter.WriteAttributeString("MeanDailyMotion", MeanDailyMotion.ToString());
                xmlWriter.WriteAttributeString("Epoch", Epoch.ToString());
            }

            if (ReferenceFrameType == ReferenceFrameTypes.Trajectory)
            {
                xmlWriter.WriteStartElement("Trajectory");

                foreach (TrajectorySample sample in Trajectory)
                {
                    string data = sample.ToString();
                    xmlWriter.WriteElementString("Sample", data);
                }
                xmlWriter.WriteEndElement();
            }

            xmlWriter.WriteEndElement();
        }
Exemplo n.º 4
0
        internal void SaveToXml(XmlTextWriter xmlWriter, string elementName)
        {
            xmlWriter.WriteStartElement(elementName);
            xmlWriter.WriteAttributeString("Name", name);
            xmlWriter.WriteAttributeString("DataSetType", Enums.ToXml("ImageSetType", (int)type));
            if (this.Type == ImageSetType.Sky)
            {
                xmlWriter.WriteAttributeString("RA", camParams.RA.ToString());
                xmlWriter.WriteAttributeString("Dec", camParams.Dec.ToString());
            }
            else
            {
                xmlWriter.WriteAttributeString("Lat", Lat.ToString());
                xmlWriter.WriteAttributeString("Lng", Lng.ToString());
            }

            xmlWriter.WriteAttributeString("Constellation", constellation);
            xmlWriter.WriteAttributeString("Classification", Enums.ToXml("Classification", (int)classification));
            xmlWriter.WriteAttributeString("Magnitude", magnitude.ToString());
            xmlWriter.WriteAttributeString("Distance", distnace.ToString());
            xmlWriter.WriteAttributeString("AngularSize", AngularSize.ToString());
            xmlWriter.WriteAttributeString("ZoomLevel", ZoomLevel.ToString());
            xmlWriter.WriteAttributeString("Rotation", camParams.Rotation.ToString());
            xmlWriter.WriteAttributeString("Angle", camParams.Angle.ToString());
            xmlWriter.WriteAttributeString("Opacity", camParams.Opacity.ToString());
            xmlWriter.WriteAttributeString("Target", Enums.ToXml("SolarSystemObjects", (int)Target));
            xmlWriter.WriteAttributeString("ViewTarget", camParams.ViewTarget.ToString());
            xmlWriter.WriteAttributeString("TargetReferenceFrame", camParams.TargetReferenceFrame);
            //todo what do we do with full dome?
            // xmlWriter.WriteAttributeString("DomeAlt", camParams.DomeAlt.ToString());
            // xmlWriter.WriteAttributeString("DomeAz", camParams.DomeAz.ToString());
            xmlWriter.WriteStartElement("Description");
            xmlWriter.WriteCData(HtmlDescription);
            xmlWriter.WriteEndElement();


            if (backgroundImageSet != null)
            {
                xmlWriter.WriteStartElement("BackgroundImageSet");
                Imageset.SaveToXml(xmlWriter, backgroundImageSet, "");

                xmlWriter.WriteEndElement();
            }

            if (studyImageset != null)
            {
                Imageset.SaveToXml(xmlWriter, studyImageset, "");
            }
            xmlWriter.WriteEndElement();
        }
        public string APacket()
        {
            string str = "ADATA@";

            str += StatId + '#';
            str += StatNm + '#';
            str += Adddoro + '#';
            str += Lat.ToString() + '#';
            str += Lng.ToString() + '#';
            str += Usetime;


            return(str);
        }
Exemplo n.º 6
0
        private void Load1(int pCode)
        {
            JStation Auto = new JStation();

            Auto.GetData(pCode);
            txtName.Text = Auto.Name;
            try { Lat = Convert.ToDouble(Auto.Lat); }
            catch { Lat = 0; }
            try { Lng = Convert.ToDouble(Auto.Lng); }
            catch { Lng = 0; }
            txtLat.Text                  = Lat.ToString();
            txtLng.Text                  = Lng.ToString();
            jComZone.SelectedValue       = Auto.ZoneCode;
            cboStationType.SelectedValue = Auto.StationTypeCode;
        }
        public string APakcet()
        {
            string str = "ADATA@";

            str += StatId + '#';
            str += StatNm + '#';
            str += AddrDoro + '#';
            str += Lat.ToString() + '#';
            str += Lng.ToString() + '#';
            str += UseTime + '#';
            str += ChgerId.ToString() + '#';
            str += ChgerType.ToString() + '#';
            str += Stat.ToString() + '#';
            str += StatTime;

            return(str);
        }
Exemplo n.º 8
0
        private void AddMarker(PointLatLng point)
        {
            gMapControl1.Overlays.Clear();
            GMapOverlay markersOverlay = new GMapOverlay("S1");

            Lat = point.Lat;
            Lng = point.Lng;
            GMarkerGoogle marker = new GMarkerGoogle(point, GMarkerGoogleType.arrow);

            marker.ToolTipText = "ایستگاه";
            markersOverlay.Markers.Add(marker);
            gMapControl1.Overlays.Add(markersOverlay);
            txtLat.Text           = Lat.ToString();
            txtLongs.Text         = Lng.ToString();
            gMapControl1.Position = point;
            gMapControl1.Update();
        }
Exemplo n.º 9
0
        /// <summary>
        /// 转换WebApi概略位置实体为dal层概略位置基础信息
        /// </summary>
        /// <returns>dal层概略位置</returns>
        public GGAHistory ToGGAHistory()
        {
            GGAHistory ggaHistory = new GGAHistory()
            {
                ID          = ID,
                Account     = Account,
                AccountType = AccountType,
                AccountSYS  = AccountSYS,
                FixedTime   = FixedTime,
                Lng         = decimal.Parse(Lng.ToString()),
                Lat         = decimal.Parse(Lat.ToString()),
                Status      = Status,
                GGAInfo     = GGAInfo
            };

            return(ggaHistory);
        }
Exemplo n.º 10
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            PointF text = new PointF(CMB_coordsystem.Right + 3, 3);

            if (System == CoordsSystems.GEO.ToString())
            {
                if (Vertical)
                {
                    e.Graphics.DrawString(Lat.ToString("0.000000") + "\n" + Lng.ToString("0.000000") + "\n" + Alt.ToString("0.00") + AltUnit, this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
                    e.Graphics.DrawString(AltSource, this.Font, new SolidBrush(this.ForeColor),
                                          new PointF(CMB_coordsystem.Left, CMB_coordsystem.Bottom + 4), StringFormat.GenericDefault);
                }
                else
                {
                    e.Graphics.DrawString(Lat.ToString("0.000000") + " " + Lng.ToString("0.000000") + "   " + Alt.ToString("0.00") + AltUnit, this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
                }
            }
            else if (System == CoordsSystems.UTM.ToString())
            {
                try
                {
                    if (point.Latitude > 84 || point.Latitude < -80 || point.Longitude >= 180 || point.Longitude <= -180)
                    {
                        return;
                    }

                    UTM utm = (UTM)point;
                    //utm.East.ToString("0.00") + " " + utm.North.ToString("0.00")
                    string[] parts = utm.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                    if (Vertical)
                    {
                        e.Graphics.DrawString(parts[0] + "\n" + parts[1] + "\n" + parts[2] + "\n" + Alt.ToString("0.00") + AltUnit, this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
                        e.Graphics.DrawString(AltSource, this.Font, new SolidBrush(this.ForeColor),
                                              new PointF(CMB_coordsystem.Left, CMB_coordsystem.Bottom + 4), StringFormat.GenericDefault);
                    }
                    else
                    {
                        e.Graphics.DrawString(utm.ToString() + "   " + Alt.ToString("0.00") + AltUnit, this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
                    }
                }
                catch { }
            }
            else if (System == CoordsSystems.MGRS.ToString())
            {
                try
                {
                    if (point.Latitude > 84 || point.Latitude < -80 || point.Longitude >= 180 || point.Longitude <= -180)
                    {
                        return;
                    }

                    MGRS mgrs = (MGRS)point;
                    mgrs.Precision = 5;

                    if (Vertical)
                    {
                        e.Graphics.DrawString(mgrs.ToString() + "\n" + Alt.ToString("0.00") + AltUnit, this.Font, new SolidBrush(this.ForeColor), new Point(5, CMB_coordsystem.Bottom + 2), StringFormat.GenericDefault);
                        e.Graphics.DrawString(AltSource, this.Font, new SolidBrush(this.ForeColor),
                                              new PointF(CMB_coordsystem.Right + 4, CMB_coordsystem.Top), StringFormat.GenericDefault);
                    }
                    else
                    {
                        e.Graphics.DrawString(mgrs.ToString() + "   " + Alt.ToString("0.00") + AltUnit, this.Font, new SolidBrush(this.ForeColor), text, StringFormat.GenericDefault);
                    }
                }
                catch { }
            }
        }
Exemplo n.º 11
0
 public override string ToString()
 {
     return(Lng.ToString() + "," + Lat.ToString());
 }
Exemplo n.º 12
0
 public string Serialize()
 {
     if (IsZero)
     {
         return("null");
     }
     else
     {
         return(string.Format("{0},{1}", Lat.ToString(CultureInfo.InvariantCulture), Lng.ToString(CultureInfo.InvariantCulture)));
     }
 }
Exemplo n.º 13
0
 public override string ToString() => $"0,\"{Name}\",{Lat.ToString(System.Globalization.CultureInfo.InvariantCulture)},{Lng.ToString(System.Globalization.CultureInfo.InvariantCulture)},1";