Пример #1
0
        /// <summary>
        /// 两个测站信息之差。
        /// </summary>
        /// <param name="one"></param>
        /// <param name="another"></param>
        /// <returns></returns>
        public static SinexSiteDetail Compare(SinexSiteDetail one, SinexSiteDetail another)
        {
            if (one.Name != another.Name)
            {
                throw new ArgumentException("必须是同一测站才能比较。" + one.Name + " " + another.Name);
            }

            SinexSiteDetail site = new SinexSiteDetail()
            {
                Name              = one.Name,
                Antenna           = one.Antenna,
                DateEnd           = one.DateEnd,
                ApproxGeoCoord    = one.ApproxGeoCoord - another.ApproxGeoCoord,
                DateStart         = one.DateStart,
                EstimateGeoCoord  = one.EstimateGeoCoord - another.EstimateGeoCoord,
                EstimateXYZ       = one.EstimateXYZ - another.EstimateXYZ,
                EstimateXyzStdDev = one.EstimateXyzStdDev - another.EstimateXyzStdDev,
                Receiver          = one.Receiver
            };

            if (one.Eccentricity != null && null != another.Eccentricity)
            {
                site.Eccentricity = one.Eccentricity - another.Eccentricity;
            }
            if (one.AprioriGeoCoord != null && null != another.AprioriGeoCoord)
            {
                site.AprioriGeoCoord  = one.AprioriGeoCoord - another.AprioriGeoCoord;
                site.AprioriXYZ       = one.AprioriXYZ - another.AprioriXYZ;
                site.AprioriXyzStdDev = one.AprioriXyzStdDev - another.AprioriXyzStdDev;
            }
            return(site);
        }
Пример #2
0
        /// <summary>
        /// 比较列表。以A为基准,比较两个列表同时有的测站。
        /// </summary>
        /// <param name="sitesA"></param>
        /// <param name="sitesB"></param>
        /// <returns></returns>
        public static List <SinexSiteDetail> Compare(List <SinexSiteDetail> sitesA, List <SinexSiteDetail> sitesB)
        {
            List <SinexSiteDetail> list = new List <SinexSiteDetail>();

            foreach (var item in sitesA)
            {
                SinexSiteDetail site = sitesB.Find(m => m.Name == item.Name);
                if (site != null)
                {
                    list.Add(item.Compare(site));
                }
            }
            return(list);
        }
Пример #3
0
 /// <summary>
 /// 与另一个测站进行比较
 /// </summary>
 /// <param name="another"></param>
 /// <returns></returns>
 public SinexSiteDetail Compare(SinexSiteDetail another)
 {
     return(Compare(this, another));
 }
Пример #4
0
        /// <summary>
        /// 便于使用的测站信息。
        /// </summary>
        /// <returns></returns>
        public List <SinexSiteDetail> GetSinexSites()
        {
            List <SinexSiteDetail> list = new List <SinexSiteDetail>();

            foreach (var item in SiteIdBlock.Items)
            {
                SinexSiteDetail site = new SinexSiteDetail()
                {
                    Name           = item.SiteCode,
                    ApproxGeoCoord = item.GeoCoord
                };
                list.Add(site);
            }

            foreach (var item in list)
            {
                if (SiteEccentricityBlock != null)
                {
                    SiteEccentricity siteEccentricity = SiteEccentricityBlock.Items.Find(m => m.SiteCode == item.Name);
                    if (siteEccentricity != null)
                    {
                        item.Eccentricity = siteEccentricity.Une;
                    }
                }
                if (SolutionEpochBlock != null)
                {
                    SolutionEpoch epoch = SolutionEpochBlock.Items.Find(m => m.SiteCode.ToLower() == item.Name.ToLower());
                    if (epoch != null)
                    {
                        item.DateStart = epoch.DateStart;
                        item.DateEnd   = epoch.DateEnd;
                    }
                }

                if (SolutionEstimateBlock != null && SolutionEstimateBlock.Count != 0)
                {
                    SolutionValue esX = SolutionEstimateBlock.Items.Find(
                        m => m.SiteCode == item.Name && m.ParameterType == ParameterType.STAX);
                    SolutionValue esY = SolutionEstimateBlock.Items.Find(
                        m => m.SiteCode == item.Name && m.ParameterType == ParameterType.STAY);
                    SolutionValue esZ = SolutionEstimateBlock.Items.Find(
                        m => m.SiteCode == item.Name && m.ParameterType == ParameterType.STAZ);

                    if (esX != null && esY != null && esZ != null)
                    {
                        item.EstimateXYZ       = new XYZ(esX.ParameterValue, esY.ParameterValue, esZ.ParameterValue);
                        item.EstimateXyzStdDev = new XYZ(esX.StdDev, esY.StdDev, esZ.StdDev);
                        item.EstimateGeoCoord  = CoordTransformer.XyzToGeoCoord(item.EstimateXYZ);
                    }
                }

                if (SolutionAprioriBlock != null && SolutionAprioriBlock.Count != 0)
                {
                    SolutionValue apX = SolutionAprioriBlock.Items.Find(
                        m => m.SiteCode == item.Name && m.ParameterType == ParameterType.STAX);
                    SolutionValue apY = SolutionAprioriBlock.Items.Find(
                        m => m.SiteCode == item.Name && m.ParameterType == ParameterType.STAY);
                    SolutionValue apZ = SolutionAprioriBlock.Items.Find(
                        m => m.SiteCode == item.Name && m.ParameterType == ParameterType.STAZ);
                    if (apX != null && apY != null && apZ != null)
                    {
                        item.AprioriXYZ       = new XYZ(apX.ParameterValue, apY.ParameterValue, apZ.ParameterValue);
                        item.AprioriXyzStdDev = new XYZ(apX.StdDev, apY.StdDev, apZ.StdDev);
                        item.AprioriGeoCoord  = CoordTransformer.XyzToGeoCoord(item.EstimateXYZ);
                    }
                }
                if (SiteReceiverBlock != null)
                {
                    SiteReceiver receiver = SiteReceiverBlock.Items.Find(m => m.SiteCode == item.Name);
                    if (receiver != null)
                    {
                        item.Receiver = receiver.ReceiverType;
                    }
                }
                if (SiteAntennaBlock != null)
                {
                    SiteAntenna antenna = SiteAntennaBlock.Items.Find(m => m.SiteCode == item.Name);
                    if (antenna != null)
                    {
                        item.Antenna = antenna.AntennaType;
                    }
                }
            }

            return(list);
        }