Example #1
0
        public override bool Equals(object obj)
        {
            SolutionValue o = obj as SolutionValue;

            if (o == null)
            {
                return(false);
            }

            return(this.SiteCode.Equals(o.SiteCode) && this.ParameterType == o.ParameterType);
        }
Example #2
0
        public static SolutionValue ParseLine(string line)
        {
            SolutionValue b = new SolutionValue();

            b.Index          = int.Parse(line.Substring(1, 5));
            b.ParameterType  = line.Substring(7, 6).Trim();
            b.SiteCode       = line.Substring(14, 4).Trim();
            b.PointCode      = line.Substring(19, 2).Trim();
            b.SolutionID     = line.Substring(22, 4).Trim();
            b.RefEpoch       = Time.ParseYds(line.Substring(27, 12));
            b.ParameterUnits = line.Substring(40, 4).Trim();
            b.ConstraintCode = line.Substring(45, 1).Trim();
            b.ParameterValue = double.Parse(line.Substring(47, 21).Trim());
            b.StdDev         = double.Parse(line.Substring(69, 11).Trim());

            return(b);
        }
Example #3
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);
        }