コード例 #1
0
 /// <summary>
 /// 网络访问器,构造函数。
 /// </summary>
 /// <param name="NtripParam"></param>
 /// <param name="GPS"></param>
 public NtripDataRequestor(NtripOption NtripParam, LocalGps GPS)
 {
     this.NtripParam          = NtripParam;
     this.GPS                 = this.GPS;//是否应该为this.GPS = GPS;
     this.DataType            = Ntrip.RtcmVersion.Rtcm3;
     this.NtripRtcm3Requestor = new NtripRtcm3Requestor(NtripParam, GPS);
     this.NtripRtcm3Requestor.NtripDataStateChanged += NoticeNtripDataState;
 }
コード例 #2
0
        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="Option"></param>
        /// <param name="GPS"></param>
        public NtripRtcm3Requestor(NtripOption Option, LocalGps GPS)
        {
            this.Option          = Option;
            this.GPS             = this.GPS;
            this.NtripMountPoint = Option.PreferredMountPoint;
            this.RtcmVersion     = Ntrip.RtcmVersion.Rtcm3;
            sourcetablePath      = Application.StartupPath + "\\sourcetable.dat";

            NetDataReceiver = new NtripDataTransceiver(Option.CasterIp, Option.Port);
            NetDataReceiver.DataReceived += NetDataReceiver_DataReceived;
        }
コード例 #3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="option"></param>
        public NtripRunner(NtripOption option)
        {
            this.COMPort = new System.IO.Ports.SerialPort();
            this.COMPort.DataReceived += SerialInput;
            this.GPS                      = new Gnsser.Ntrip.LocalGps();
            this.Option                   = option;
            this.NtripMountPoint          = this.Option.PreferredMountPoint;
            this.RtcmFileNamer            = new RtcmFileNamer();
            RtcmFileNamer.NtripMountPoint = this.NtripMountPoint;

            this.IsRequiresGGA = option.IsRequiresGGA;
            this.Name          = this.Option.CasterName + "->" + this.Option.PreferredMountPoint;
            GnssSolverType     = Gnsser.GnssSolverType.最简伪距定位;
        }
コード例 #4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="NtripMountPoint"></param>
 /// <param name="NtripParam"></param>
 public NtripRequestStringBuilder(string NtripMountPoint, NtripOption NtripParam)
 {
     this.NtripMountPoint = NtripMountPoint;
     this.NtripParam      = NtripParam;
 }
コード例 #5
0
ファイル: NtripParam.cs プロジェクト: yxw027/GNSSer
 public void SaveSetting(string key1, string value1, string key2 = "", string value2 = "", string key3 = "", string value3 = "")
 {
     NtripOption.SaveSetting(ConfigPath, key1, value1, key2, value2, key3, value3);
 }
コード例 #6
0
ファイル: NtripParam.cs プロジェクト: yxw027/GNSSer
        /// <summary>
        /// 加载设置。文本行模式
        /// </summary>
        /// <param name="ntripconfigfile"></param>
        /// <returns></returns>
        public static NtripOption LoadNtripConfig(string ntripconfigfile)
        {
            NtripOption NtripParam = new NtripOption()
            {
                ConfigPath = ntripconfigfile
            };

            var lines = File.ReadAllLines(ntripconfigfile);

            foreach (var line in lines)
            {
                if (line.Trim().StartsWith("#"))
                {
                    continue;
                }

                var pair = line.Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
                if (pair.Length < 2)
                {
                    continue;
                }

                var value = pair[1];

                NtripParam.AllConfigs.Add(pair[0].Trim(), value);


                switch (pair[0].Trim().ToLower())
                {
                case "ntrip caster":
                    NtripParam.CasterIp = value;
                    break;

                case "ntrip caster port":
                    NtripParam.Port = int.Parse(value);
                    break;

                case "ntrip username":
                    NtripParam.Username = value;
                    break;

                case "ntrip password":
                    NtripParam.Password = value;
                    break;

                case "ntrip mountpoint":
                    NtripParam.PreferredMountPoint = value;
                    break;

                case "serial should be connected":
                    NtripParam.SerialShouldBeConnected = bool.Parse(value);
                    break;

                case "ntrip should be connected":
                    NtripParam.NTRIPShouldBeConnected = bool.Parse(value);
                    break;

                case "ntrip manual longitude":
                    NtripParam.ManualLon = Double.Parse(value);
                    break;

                case "ntrip manual latitude":
                    NtripParam.ManualLat = Double.Parse(value);
                    break;

                case "ntrip use manual gga":
                    NtripParam.UseManualGGA = bool.Parse(value);
                    break;

                default: break;
                }
            }
            NtripParam.InitFromConfigs();
            return(NtripParam);
        }