コード例 #1
0
        /// <summary>
        /// Obtains the observed lengths of each span on
        /// this leg. In the case of cul-de-sacs that have no observed span,
        /// the distance will be derived from the central angle and radius.
        /// </summary>
        internal Distance[] GetObservedDistances()
        {
            List <Distance> distances = new List <Distance>();

            foreach (SpanInfo sd in m_Spans)
            {
                Distance d = sd.ObservedDistance;
                if (d == null)
                {
                    Debug.Assert(this.Leg is CircularLeg);
                    Debug.Assert(m_Spans.Length == 1);

                    // If this is a cul-de-sac that had no observed spans, get the
                    // circular leg to define the distance (in meters on the ground).
                    DistanceUnit mUnit = EditingController.GetUnits(DistanceUnitType.Meters);
                    distances.Add(new Distance(this.Leg.Length.Meters, mUnit));
                }
                else
                {
                    distances.Add(d);
                }
            }

            return(distances.ToArray());
        }
コード例 #2
0
        /// <summary>
        /// Reads a distance unit type.
        /// </summary>
        /// <param name="field">A tag associated with the item</param>
        /// <returns>The distance unit that was read.</returns>
        internal DistanceUnit ReadDistanceUnit(DataField field)
        {
            DistanceUnitType unitType = (DistanceUnitType)m_Reader.ReadInt32(field.ToString());

            return(EditingController.GetUnits(unitType));
        }