Exemple #1
0
        private static GpsSource GetGpsSource(XmlNode inputNode)
        {
            var gpsSource = new GpsSource();

            gpsSource.SourceType         = GetSourceType(inputNode.GetXmlNodeValue("@I"));
            gpsSource.HorizontalAccuracy = GetAccuracy(inputNode.GetXmlNodeValue("@J"));
            gpsSource.VerticalAccuracy   = GetAccuracy(inputNode.GetXmlNodeValue("@K"));
            return(gpsSource);
        }
Exemple #2
0
        private static string WriteGpsData(XmlWriter writer, GpsSource gpsSource)
        {
            if (gpsSource == null)
            {
                return(null);
            }

            if (_SourceMapping.ContainsKey(gpsSource.SourceType))
            {
                writer.WriteXmlAttribute("I", _SourceMapping[gpsSource.SourceType]);
            }

            writer.WriteXmlAttribute("J", GetAccuracy(gpsSource.HorizontalAccuracy));
            writer.WriteXmlAttribute("K", GetAccuracy(gpsSource.VerticalAccuracy));

            return(null);
        }
Exemple #3
0
        private static GpsSource GetGpsSource(XmlNode inputNode)
        {
            var gpsSource = new GpsSource
            {
                SourceType = GetSourceType(inputNode.GetXmlNodeValue("@D"))
            };

            int satelliteCount;

            if (inputNode.GetXmlNodeValue("@G").ParseValue(out satelliteCount))
            {
                gpsSource.NumberOfSatellites = satelliteCount;
            }

            gpsSource.GpsUtcTime = GetGpsTime(inputNode);

            return(gpsSource);
        }