示例#1
0
        private string timeToString(double time)
        {
            HMSInfo hms = new HMSInfo(time);

            return(string.Format("{0:00}:{1:00}",
                                 hms.degree, hms.minute, hms.second));
        }
示例#2
0
        public MhoraGlobalOptions()
        {
            HOptions = new HoroscopeOptions();
            SOptions = new StrengthOptions();
            mLat     = new HMSInfo(47, 40, 27, HMSInfo.dir_type.NS);
            mLon     = new HMSInfo(-122, 7, 13, HMSInfo.dir_type.EW);
            mTz      = new HMSInfo(-7, 0, 0, HMSInfo.dir_type.EW);

            this.mfFixedWidth = new Font("Courier New", 10);
            this.mfGeneral    = new Font("Microsoft Sans Serif", 10);

            this.bDasaHoverSelect      = false;
            this.bDasaMoveSelect       = true;
            this.bDasaShowEvents       = true;
            this.miDasaShowEventsLevel = 2;
            this.mcDasaBackColor       = Color.Lavender;
            this.mcDasaDateColor       = Color.DarkRed;
            this.mcDasaPeriodColor     = Color.DarkBlue;
            this.mcDasaHighlightColor  = Color.White;

            this.mbShowSplashScreeen = true;
            this.mbSavePrefsOnExit   = true;
            this.msNotesExtension    = "txt";

            this.mcBodyLagna   = Color.BlanchedAlmond;
            this.mcBodySun     = Color.Orange;
            this.mcBodyMoon    = Color.LightSkyBlue;
            this.mcBodyMars    = Color.Red;
            this.mcBodyMercury = Color.Green;
            this.mcBodyJupiter = Color.Yellow;
            this.mcBodyVenus   = Color.Violet;
            this.mcBodySaturn  = Color.DarkBlue;
            this.mcBodyRahu    = Color.LightBlue;
            this.mcBodyKetu    = Color.LightPink;
            this.mcBodyOther   = Color.Black;

            this.mcVargaBackground   = Color.AliceBlue;
            this.mcVargaSecondary    = Color.CadetBlue;
            this.mcVargaGraha        = Color.DarkRed;
            this.mcVargaLagna        = Color.DarkViolet;
            this.mcVargaSAV          = Color.Gainsboro;
            this.mcVargaSpecialLagna = Color.Gray;
            this.mChartStyle         = DivisionalChart.UserOptions.EChartStyle.SouthIndian;
            this.mfVarga             = new Font("Times New Roman", 7);
            this.bVargaSquare        = true;
            this.bVargaShowDob       = true;
            this.bVargaShowSAVVarga  = true;
            this.bVargaShowSAVRasi   = false;

            this.mcTableBackground       = Color.Lavender;
            this.mcTableForeground       = Color.Black;
            this.mcTableInterleaveFirst  = Color.AliceBlue;
            this.mcTableInterleaveSecond = Color.Lavender;

            this.mcChakraBackground = Color.AliceBlue;
        }
示例#3
0
        private string utTimeToString(double ut_event, double ut_sr, double sunrise)
        {
            Moment  m   = this.utToMoment(ut_event);
            HMSInfo hms = new HMSInfo(m.time);

            if (ut_event >= (ut_sr - (sunrise / 24.0) + 1.0))
            {
                if (false == opts.LargeHours)
                {
                    return(string.Format("*{0}:{1:00}", hms.degree, hms.minute));
                }
                else
                {
                    return(string.Format("{0:00}:{1:00}", hms.degree + 24, hms.minute));
                }
            }
            return(string.Format("{0:00}:{1:00}", hms.degree, hms.minute));
        }
示例#4
0
        void Repopulate()
        {
            string[] weekdays = new string[]
            {
                "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
            };

            mList.Items.Clear();

            ListViewItem li;

            li = new ListViewItem("Date of Birth");
            li.SubItems.Add(h.info.tob.ToString());
            mList.Items.Add(li);

            li = new ListViewItem("Time Zone");
            li.SubItems.Add(h.info.tz.ToString());
            mList.Items.Add(li);

            li = new ListViewItem("Latitude");
            li.SubItems.Add(h.info.lat.ToString());
            mList.Items.Add(li);

            li = new ListViewItem("Longitude");
            li.SubItems.Add(h.info.lon.ToString());
            mList.Items.Add(li);

            li = new ListViewItem("Altitude");
            li.SubItems.Add(h.info.alt.ToString());
            mList.Items.Add(li);

            {
                HMSInfo hms_srise = new HMSInfo(h.sunrise);
                li = new ListViewItem("Sunrise");
                string fmt = String.Format("{0:00}:{1:00}:{2:00}",
                                           hms_srise.degree, hms_srise.minute, hms_srise.second);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                HMSInfo hms_sset = new HMSInfo(h.sunset);
                li = new ListViewItem("Sunset");
                string fmt = String.Format("{0:00}:{1:00}:{2:00}",
                                           hms_sset.degree, hms_sset.minute, hms_sset.second);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("Weekday");
                string fmt = String.Format("{0}", h.wday);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                Longitude ltithi = h.getPosition(Body.Name.Moon).longitude.sub(h.getPosition(Body.Name.Sun).longitude);
                double    offset = (360.0 / 30.0) - ltithi.toTithiOffset();
                Tithi     ti     = ltithi.toTithi();
                Body.Name tiLord = ti.getLord();
                li = new ListViewItem("Tithi");
                string fmt = String.Format("{0} ({1}) {2:N}% left", ti.ToString(), tiLord, offset / 12.0 * 100);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                Longitude lmoon     = h.getPosition(Body.Name.Moon).longitude;
                Nakshatra nmoon     = lmoon.toNakshatra();
                Body.Name nmoonLord = VimsottariDasa.LordOfNakshatra(nmoon);
                double    offset    = (360.0 / 27.0) - lmoon.toNakshatraOffset();
                int       pada      = lmoon.toNakshatraPada();
                string    fmt       = String.Format("{0} {1} ({2}) {3:N}% left",
                                                    nmoon.value, pada, nmoonLord, offset / (360.0 / 27.0) * 100);
                li = new ListViewItem("Nakshatra");
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("Karana");
                Longitude lkarana = h.getPosition(Body.Name.Moon).longitude.sub(h.getPosition(Body.Name.Sun).longitude);
                double    koffset = (360.0 / 60.0) - lkarana.toKaranaOffset();
                Karana    k       = lkarana.toKarana();
                Body.Name kLord   = k.getLord();
                string    fmt     = string.Format("{0} ({1}) {2:N}% left", k.value, kLord, koffset / 6.0 * 100);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("Yoga");
                Longitude   smLon  = h.getPosition(Body.Name.Sun).longitude.add(h.getPosition(Body.Name.Moon).longitude);
                double      offset = (360.0 / 27.0) - smLon.toSunMoonYogaOffset();
                SunMoonYoga smYoga = smLon.toSunMoonYoga();
                Body.Name   smLord = smYoga.getLord();
                string      fmt    = string.Format("{0} ({1}) {2:N}% left", smYoga, smLord, offset / (360.0 / 27.0) * 100);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("Hora");
                Body.Name b   = h.calculateHora();
                string    fmt = String.Format("{0}", b);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("Kala");
                Body.Name b   = h.calculateKala();
                string    fmt = String.Format("{0}", b);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("Muhurta");
                int            mIndex = (int)(Math.Floor((h.hoursAfterSunrise() / h.lengthOfDay()) * 30.0) + 1);
                Basics.Muhurta m      = (Basics.Muhurta)mIndex;
                string         fmt    = String.Format("{0} ({1})", m, Basics.NakLordOfMuhurta(m));
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                double ghatisSr = h.hoursAfterSunrise() * 2.5;
                double ghatisSs = h.hoursAfterSunRiseSet() * 2.5;
                li = new ListViewItem("Ghatis");
                string fmt = String.Format("{0:0.0000} / {1:0.0000}", ghatisSr, ghatisSs);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                int vgOff = (int)Math.Ceiling(h.hoursAfterSunRiseSet() * 150.0);
                vgOff = vgOff % 9;
                if (vgOff == 0)
                {
                    vgOff = 9;
                }
                Body.Name b = (Body.Name)((int)Body.Name.Sun + vgOff - 1);
                li = new ListViewItem("Vighatika Graha");
                string fmt = String.Format("{0}", b);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
            }
            {
                li = new ListViewItem("LMT Offset");
                double e      = h.lmt_offset;
                double orig_e = e;
                e  = e < 0 ? -e : e;
                e *= 24.0;
                int hour = (int)Math.Floor(e);
                e = (e - Math.Floor(e)) * 60.0;
                int min = (int)Math.Floor(e);
                e = (e - Math.Floor(e)) * 60.0;
                string prefix = "";
                if (orig_e < 0)
                {
                    prefix = "-";
                }
                string fmt = String.Format("{0}{1:00}:{2:00}:{3:00.00}",
                                           prefix, hour, min, e);
                string fmt2 = String.Format(" ({0:00.00} minutes)", h.lmt_offset * 24.0 * 60.0);
                li.SubItems.Add(fmt + fmt2);
                mList.Items.Add(li);
            }
            {
                sweph.obtainLock(h);
                li = new ListViewItem("Ayanamsa");
                double aya      = sweph.swe_get_ayanamsa_ut(h.baseUT);
                int    aya_hour = (int)Math.Floor(aya);
                aya = (aya - Math.Floor(aya)) * 60.0;
                int aya_min = (int)Math.Floor(aya);
                aya = (aya - Math.Floor(aya)) * 60.0;
                string fmt = String.Format("{0:00}-{1:00}-{2:00.00}", aya_hour, aya_min, aya);
                li.SubItems.Add(fmt);
                mList.Items.Add(li);
                sweph.releaseLock(h);
            }
            {
                li = new ListViewItem("Universal Time");
                li.SubItems.Add(h.baseUT.ToString());
                mList.Items.Add(li);
            }


            this.ColorAndFontRows(mList);
        }