Ejemplo n.º 1
0
        /// <summary>
        /// 解析
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static RtcmFileNamer Parse(string name)
        {
            RtcmFileNamer namer        = new RtcmFileNamer();
            var           nameendIndex = name.IndexOf("+");
            string        siteName     = name.Substring(0, nameendIndex);

            namer.NtripMountPoint = siteName;
            string timeString = name.Substring(nameendIndex + 1, name.IndexOf(".") - nameendIndex - 1);


            namer.Time = Geo.Times.Time.Parse(timeString, new char[] { '_', '-' });
            Setting.ReceivingTimeOfNtripData = namer.Time;
            // var name = NtripMountPoint + "+" + DateTime.UtcNow.ToString("yyyy-MM-dd_HH_mm_ss") + ".rtcm3";
            return(namer);
        }
Ejemplo n.º 2
0
        private void WriteRawDataToLocal(byte[] myBytes)
        {
            Time day = Setting.ReceivingTimeOfNtripData;//Time.UtcNow;//

            if (BinaryDataWriter == null || CurrentLocalFileTime.DayOfYear != day.DayOfYear)
            {
                CurrentLocalFileTime = day;
                var outfileName = RtcmFileNamer.BuildRtcm3FileName();
                var path        = Path.Combine(this.Option.LocalDirectory, outfileName);
                Geo.Utils.FileUtil.CheckOrCreateDirectory(Path.GetDirectoryName(path));
                BinaryDataWriter = new BinaryDataWriter(path);
            }

            BinaryDataWriter.Write(myBytes);
            BinaryDataWriter.Flush();
        }