示例#1
0
        private void CoordSystemForm_Shown(object sender, EventArgs e)
        {
            CadastralMapModel map = CadastralMapModel.Current;
            ISpatialSystem    sys = map.SpatialSystem;

            systemNameLabel.Text = sys.Name;
            epsgNumberLabel.Text = sys.EpsgNumber.ToString();

            // Display mean elevation and geoid separation in the current data entry units.
            EditingController ec     = EditingController.Current;
            DistanceUnit      eUnit  = ec.EntryUnit;
            DistanceUnit      meters = EditingController.GetUnits(DistanceUnitType.Meters);

            // The mean elevation & geoid separation fields are always editable (even
            // if the map contains stuff). The values are used to calculate the ground
            // area of polygons.

            Distance elev = new Distance(sys.MeanElevation.Meters, meters);

            meanElevationTextBox.Text = elev.Format(eUnit, true);

            Distance sep = new Distance(sys.GeoidSeparation.Meters, meters);

            geoidSeparationTextBox.Text = sep.Format(eUnit, true);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Distance"/> class
        /// using the data read from persistent storage.
        /// </summary>
        /// <param name="editDeserializer">The mechanism for reading back content.</param>
        internal Distance(EditDeserializer editDeserializer)
        {
            double           distance = editDeserializer.ReadDouble(DataField.Value);
            DistanceUnitType unitType = (DistanceUnitType)editDeserializer.ReadByte(DataField.Unit);

            m_EnteredUnit    = EditingController.GetUnits(unitType);
            m_ObservedMetric = m_EnteredUnit.ToMetric(distance);

            if (editDeserializer.IsNextField(DataField.Fixed))
            {
                m_IsFixed = editDeserializer.ReadBool(DataField.Fixed);
            }
            else
            {
                m_IsFixed = false;
            }

            if (editDeserializer.IsNextField(DataField.Flipped))
            {
                IsAnnotationFlipped = editDeserializer.ReadBool(DataField.Flipped);
            }
            else
            {
                IsAnnotationFlipped = false;
            }
        }
示例#3
0
        void ShowResults(DistanceUnitType dunit)
        {
            DistanceUnit unit = EditingController.GetUnits(dunit);

            lengthTextBox.Text       = unit.Format(m_Length);
            totalEnteredTextBox.Text = unit.Format(m_Entered);
            lengthLeftTextBox.Text   = unit.Format(m_Length - m_Entered);
        }
示例#4
0
        void ShowResults(DistanceUnitType type)
        {
            DistanceUnit unit = EditingController.GetUnits(type);

            if (unit == null)
            {
                return;
            }

            lengthLabel.Text        = unit.Format(m_Length, false, -1);
            deltaNorthingLabel.Text = unit.Format(m_DeltaN, false, -1);
            deltaEastingLabel.Text  = unit.Format(m_DeltaE, false, -1);
        }
示例#5
0
 void SetUnit(DistanceUnitType type)
 {
     m_Unit = EditingController.GetUnits(type);
 }
示例#6
0
 private void cRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     m_Unit = EditingController.GetUnits(DistanceUnitType.Chains);
     SetNewDefault();
 }