Exemple #1
0
        /// <summary>
        /// Removes Latitude and Longitude column mappings from the current layer mappings details..
        /// </summary>
        private void RemoveLatLongMappings()
        {
            if (MappedColumnType.IndexOf(ColumnType.Lat) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.Lat)] = ColumnType.None;
            }

            if (MappedColumnType.IndexOf(ColumnType.Long) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.Long)] = ColumnType.None;
            }
        }
Exemple #2
0
        /// <summary>
        /// Removes RA and Dec column mappings from the current layer mappings details.
        /// </summary>
        private void RemoveRaDecMappings()
        {
            if (MappedColumnType.IndexOf(ColumnType.RA) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.RA)] = ColumnType.None;
            }

            if (MappedColumnType.IndexOf(ColumnType.Dec) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.Dec)] = ColumnType.None;
            }
        }
Exemple #3
0
        /// <summary>
        /// Removes Altitude or Depth or Distance column mappings from the current layer mappings details, if they exists.
        /// </summary>
        private void RemoveDepthColumnMappings()
        {
            if (MappedColumnType.IndexOf(ColumnType.Alt) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.Alt)] = ColumnType.None;
            }

            if (MappedColumnType.IndexOf(ColumnType.Depth) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.Depth)] = ColumnType.None;
            }

            if (MappedColumnType.IndexOf(ColumnType.Distance) > -1)
            {
                MappedColumnType[MappedColumnType.IndexOf(ColumnType.Distance)] = ColumnType.None;
            }
        }
Exemple #4
0
        /// <summary>
        /// Set Layer properties based on auto mappings done
        /// </summary>
        internal void SetLayerProperties()
        {
            this.SetLayerColumnProperties();

            // If magnitude column is mapped, use index of magnitude column, else set to none
            var magColumn = MappedColumnType.Where(item => item == ColumnType.Mag).FirstOrDefault();

            if (magColumn != ColumnType.None)
            {
                this.LayerDetails.SizeColumn  = MappedColumnType.IndexOf(magColumn);
                this.LayerDetails.ScaleFactor = 1;
            }
            else
            {
                this.LayerDetails.SizeColumn  = Microsoft.Research.Wwt.Excel.Common.Constants.DefaultColumnIndex;
                this.LayerDetails.ScaleFactor = Microsoft.Research.Wwt.Excel.Common.Constants.DefaultScaleFactor;
            }

            // Sets the name column to first value in the sheet
            this.LayerDetails.NameColumn = Microsoft.Research.Wwt.Excel.Common.Constants.DefaultNameColumnIndex;

            // Set the scale type based on the group the layer belongs to.
            this.LayerDetails.PointScaleType = this.LayerDetails.Group.IsPlanet() ? ScaleType.Power : ScaleType.StellarMagnitude;
        }