Beispiel #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("G P H V TDOP:");
            sb.Append(" " + Geo.Utils.StringUtil.FillSpaceLeft(GDOP.ToString("0.000000"), 10) + ",");
            sb.Append(" " + Geo.Utils.StringUtil.FillSpaceLeft(PDOP.ToString("0.000000"), 10) + ",");
            sb.Append(" " + Geo.Utils.StringUtil.FillSpaceLeft(HDOP.ToString("0.000000"), 10) + ",");
            sb.Append(" " + Geo.Utils.StringUtil.FillSpaceLeft(VDOP.ToString("0.000000"), 10) + ",");
            //sb.Append(" " + Geo.Utils.StringUtil.FillSpaceLeft(TDOP.ToString("0.000000"), 10) + ",");
            return(sb.ToString());
        }
Beispiel #2
0
        public override XmlWriter WriteXML(XmlWriter xmlBuilder)
        {
            //This write method has additional complexity to support the PTN behavior inside of TimeLogs
            xmlBuilder.WriteStartElement("PTN");

            string north = PositionNorth.HasValue ? PositionNorth.ToString() : HasPositionNorth ? string.Empty : null;

            if (north != null)
            {
                xmlBuilder.WriteAttributeString("A", north);
            }

            string east = PositionEast.HasValue ? PositionEast.ToString() : HasPositionEast ? string.Empty : null;

            if (east != null)
            {
                xmlBuilder.WriteAttributeString("B", east);
            }

            string up = PositionUp.HasValue ? PositionUp.ToString() : HasPositionUp ? string.Empty : null;

            if (up != null)
            {
                xmlBuilder.WriteAttributeString("C", up);
            }

            string status = PositionStatus.HasValue ? ((int)PositionStatus).ToString() : HasPositionStatus ? string.Empty : null;

            if (status != null)
            {
                xmlBuilder.WriteAttributeString("D", status);
            }

            string pdop = PDOP.HasValue ? PDOP.ToString() : HasPDOP ? string.Empty : null;

            if (pdop != null)
            {
                xmlBuilder.WriteAttributeString("E", pdop);
            }

            string hdop = HDOP.HasValue ? HDOP.ToString() : HasHDOP ? string.Empty : null;

            if (hdop != null)
            {
                xmlBuilder.WriteAttributeString("F", hdop);
            }

            string satellites = NumberOfSatellites.HasValue ? NumberOfSatellites.ToString() : HasNumberOfSatellites ? string.Empty : null;

            if (satellites != null)
            {
                xmlBuilder.WriteAttributeString("G", satellites);
            }

            string gpsTime = GpsUtcTime.HasValue ? GpsUtcTime.ToString() : HasGpsUtcTime ? string.Empty : null;

            if (gpsTime != null)
            {
                xmlBuilder.WriteAttributeString("H", gpsTime);
            }

            string gpsDate = GpsUtcDate.HasValue ? GpsUtcDate.ToString() : HasGpsUtcDate ? string.Empty : null;

            if (gpsDate != null)
            {
                xmlBuilder.WriteAttributeString("I", gpsDate);
            }

            xmlBuilder.WriteEndElement();

            return(xmlBuilder);
        }