Ejemplo n.º 1
0
        public CaptionInfo(string loc, Position pos, UTCDate udt)
        {
            this.loc = loc;
            this.pos = pos;
            this.dst = udt.GetDST();
            this.udt = udt;
            this.sp = Orbit.CalcSolarPosition(pos, udt);
            this.st = Orbit.CalcSolarTimes(pos, udt);

            SolarTimes st_ss = PointFinder.FindDawnDusk(pos, udt);
            this.dawn = st_ss.Sunrise;
            this.dusk = st_ss.Sunset;
        }
Ejemplo n.º 2
0
        public static void SetDetails(string location, Position pos, UTCDate udt)
        {
            SetValue(registry[Id.DETAIL_LOCATION], location);
            SetValue(registry[Id.DETAIL_POSITION], Formatter.FormatPosition(pos));
            SetValue(registry[Id.DETAIL_TIMEZONE], Formatter.FormatTimezone(udt.Timezone,
                                                                            udt.Timezone + udt.GetDST()));
            SetValue(registry[Id.DETAIL_DATE], udt.PrintDate());
            SetValue(registry[Id.DETAIL_TIME], Formatter.FormatTimeLong(udt, true));

            SolarPosition sp = Orbit.CalcSolarPosition(pos, udt);
            SetValue(registry[Id.DETAIL_ELEVATION], Formatter.FormatAngle(sp.Elevation));
            SetValue(registry[Id.DETAIL_AZIMUTH], Formatter.FormatAngle(sp.Azimuth));

            SolarTimes st_ss = Orbit.CalcSolarTimes(pos, udt);
            SetValue(registry[Id.DETAIL_SUNRISE], Formatter.FormatMaybeTimeLong(st_ss.Sunrise, false));
            SetValue(registry[Id.DETAIL_SOLARNOON], Formatter.FormatTimeLong(st_ss.Noon, false));
            SetValue(registry[Id.DETAIL_SUNSET], Formatter.FormatMaybeTimeLong(st_ss.Sunset, false));
            SetValue(registry[Id.DETAIL_SOLARDAYLENGTH], Formatter.FormatDayLength(st_ss, sp));

            SolarTimes st_dd = PointFinder.FindDawnDusk(pos, udt);
            SetValue(registry[Id.DETAIL_DAWN], Formatter.FormatMaybeTimeLong(st_dd.Sunrise, false));
            SetValue(registry[Id.DETAIL_DUSK], Formatter.FormatMaybeTimeLong(st_dd.Sunset, false));
            SetValue(registry[Id.DETAIL_DAYLENGTH], Formatter.FormatDayLength(st_dd, sp));
        }