/// <summary> /// 插值器 /// </summary> /// <param name="prnStr"></param> /// <returns></returns> private SimpleClockInterpolator GetClockInterpolator(string prnStr) { if (clockInterpolators.ContainsKey(prnStr)) { return(clockInterpolators[prnStr]); } lock (locker2) { if (clockInterpolators.ContainsKey(prnStr)) { return(clockInterpolators[prnStr]); } if (SatelliteNumber.IsPrn(prnStr)) { var prn = SatelliteNumber.Parse(prnStr); var items = ClockFile.Get(prn); if (items == null || items.Count == 0) { return(null); } var inter = new SimpleClockInterpolator(items.Values); clockInterpolators.TryAdd(prnStr, inter); return(inter); } } return(null); }
/// <summary> /// 是否可用 /// </summary> /// <param name="prn"></param> /// <param name="time"></param> /// <returns></returns> public bool IsAvailable(SatelliteNumber prn, Time time) { string prnStr = prn.ToString(); SimpleClockInterpolator clockInterpolator = GetClockInterpolator(prnStr); if (clockInterpolator == null || !clockInterpolator.IsAvailable(time)) { return(false); } return(true); }
/// <summary> /// 根据接收机时间和位置,获取计算卫星发射时刻的位置。不计算相对地面的延迟。 /// </summary> /// <param name="nameOrPrn">卫星编号</param> /// <param name="gpsTime">时间</param> /// <returns>如果返回 null,在表示计算失败</returns> public override SimpleClockBias Get(string nameOrPrn, Time gpsTime) { SimpleClockInterpolator clockInterpolator = GetClockInterpolator(nameOrPrn); if (clockInterpolator == null || !clockInterpolator.IsAvailable(gpsTime)) { return(null); } #region czs SimpleClockBias fittedClock = clockInterpolator.GetAtomicClock(gpsTime); #endregion return(fittedClock); }
/// <summary> /// 插值器 /// </summary> /// <param name="prnStr"></param> /// <returns></returns> private SimpleClockInterpolator GetClockInterpolator(string prnStr) { if (clockInterpolators.ContainsKey(prnStr)) { return(clockInterpolators[prnStr]); } lock (locker2) { if (clockInterpolators.ContainsKey(prnStr)) { return(clockInterpolators[prnStr]); } var items = ClockFile.GetClockItems(prnStr); if (items == null || items.Count == 0) { return(null); } var inter = new SimpleClockInterpolator(items); clockInterpolators.TryAdd(prnStr, inter); return(inter); } }