Esempio n. 1
0
        public SettingsAnimator(StockSkyOverlayTypes type)
        {
            settingsType = type;
            SettingParameter sp = Settings.Ambient.GetSetting(settingsType);

            constant = sp.EdgeTrigger;

            if (sp.Filter != null)
            {
                filter = sp.Filter.Clone();
            }
        }
Esempio n. 2
0
        public double[] GetParams()
        {
            SettingParameter sp = Settings.Ambient.GetSetting(settingsType);

            if (sp.Filter == null)
            {
                return(new double[] { sp.Opacity });
            }
            else
            {
                filter.SetBits(sp.Filter.GetBits());
                return(new double[] { sp.Opacity, filter.Bits[0], filter.Bits[1], filter.Bits[2] });
            }
        }
Esempio n. 3
0
        public SettingParameter GetSetting(StockSkyOverlayTypes type)
        {
            bool edgeTrigger = true;
            double opacity = 0;
            bool animated = false;
            ConstellationFilter filter = null;
            bool targetState = false;
            if (SettingsAnimators.ContainsKey(type))
            {
                SettingsAnimator sa = SettingsAnimators[type];
                edgeTrigger = sa.Constant;
                opacity = sa.CurrentValue;
                filter = sa.Filter;
                animated = true;
            }
            else
            {

                switch (type)
                {
                    case StockSkyOverlayTypes.FadeToBlack:
                        opacity = FaderOpacity;
                        break;
                    case StockSkyOverlayTypes.EquatorialGrid:
                        opacity = this.showGrid ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.EquatorialGridText:
                        opacity = this.showEquatorialGridText ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.GalacticGrid:
                        opacity = this.showGalacticGrid ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.GalacticGridText:
                        opacity = this.showGalacticGridText ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.EclipticGrid:
                        opacity = this.showEclipticGrid ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.EclipticGridText:
                        opacity = this.showEclipticGridText ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.EclipticOverview:
                        opacity = this.showEcliptic ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.EclipticOverviewText:
                        opacity = this.showEclipticOverviewText ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.PrecessionChart:
                        opacity = this.showPrecessionChart ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.AltAzGrid:
                        opacity = this.showAltAzGrid ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.AltAzGridText:
                        opacity = this.showAltAzGridText ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.ConstellationFigures:
                        opacity = this.showConstellationFigures ? 1 : 0;
                        filter = this.constellationFiguresFilter.Clone();
                        break;
                    case StockSkyOverlayTypes.ConstellationBoundaries:
                        opacity = this.showConstellationBoundries ? 1 : 0;
                        filter = this.constellationBoundariesFilter.Clone();
                        break;
                    case StockSkyOverlayTypes.ConstellationFocusedOnly:
                        opacity = this.showConstellationSelection ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.ConstellationNames:
                        opacity = this.showConstellationLabels ? 1 : 0;
                        filter = this.constellationNamesFilter.Clone();
                        break;
                    case StockSkyOverlayTypes.ConstellationPictures:
                        opacity = this.showConstellationPictures ? 1 : 0;
                        filter = this.constellationArtFilter.Clone();
                        break;
                    case StockSkyOverlayTypes.SkyGrids:
                        opacity = this.showSkyGrids ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.Constellations:
                        opacity = this.showConstellations ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemStars:
                        opacity = this.solarSystemStars ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemMilkyWay:
                        opacity = this.solarSystemMilkyWay ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemCosmos:
                        opacity = this.solarSystemCosmos ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemCMB:
                        opacity = this.solarSystemCMB ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemOrbits:
                        opacity = this.solarSystemOrbits ? 1 : 0;
                        edgeTrigger = true;
                        break;
                    case StockSkyOverlayTypes.OrbitFilters:
                        opacity = Properties.Settings.Default.PlanetOrbitsFilter;
                        edgeTrigger = true;
                        break;

                    case StockSkyOverlayTypes.MPCZone1:
                    case StockSkyOverlayTypes.MPCZone2:
                    case StockSkyOverlayTypes.MPCZone3:
                    case StockSkyOverlayTypes.MPCZone4:
                    case StockSkyOverlayTypes.MPCZone5:
                    case StockSkyOverlayTypes.MPCZone6:
                    case StockSkyOverlayTypes.MPCZone7:
                        {
                            int id = (int)type - (int)StockSkyOverlayTypes.MPCZone1;
                            int bit = (int)Math.Pow(2, id);
                            targetState = (this.minorPlanetsFilter & bit) != 0;
                            opacity = targetState ? 1 : 0;
                            edgeTrigger = true;
                        }
                        break;

                    case StockSkyOverlayTypes.SolarSystemPlanets:
                        opacity = this.solarSystemPlanets ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemAsteroids:
                        opacity = this.solarSystemMinorPlanets ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemLighting:
                        opacity = this.solarSystemLighting ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.ShowISSModel:
                        opacity = this.showISSModel ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.SolarSystemMinorOrbits:
                        opacity = this.solarSystemMinorOrbits ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.ShowEarthCloudLayer:
                        opacity = this.showClouds ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.ShowElevationModel:
                        opacity = this.showElevationModel ? 1 : 0;
                        break;

                    case StockSkyOverlayTypes.MultiResSolarSystemBodies:
                        opacity = this.solarSystemMultiRes ? 1 : 0;
                        break;

                    case StockSkyOverlayTypes.EarthCutAway:
                        opacity = earthCutawayView ? 1 : 0;
                        break;
                    case StockSkyOverlayTypes.ShowSolarSystem:
                        opacity = this.showSolarSystem ? 1 : 0;
                        break;

                    case StockSkyOverlayTypes.FiledOfView:
                        opacity = this.showFieldOfView ? 1 : 0;
                        break;
                    default:
                        return new SettingParameter(false, -1, false, filter);
                }
            }

            SettingParameter sp = new SettingParameter(edgeTrigger, opacity, opacity != 0, filter);
            sp.Animated = animated;
            return sp;
        }