Beispiel #1
0
        public int MahadvadasiCalc(GCEarthData earth)
        {
            VAISNAVADAY t = this;

            if (t.Previous == null || t.Next == null)
            {
                return(0);
            }

            int nMahaType = MahadvadasiType.EV_NULL;
            //int nMhdDay = -1;

            VAISNAVADAY s       = t.Previous;
            VAISNAVADAY u       = t.Next;
            VAISNAVADAY mahaDay = null;

            // if yesterday is dvadasi
            // then we skip this day
            if (GCTithi.TITHI_DVADASI(s.astrodata.sunRise.Tithi))
            {
                return(1);
            }

            if (TithiId.TITHI_GAURA_DVADASI == t.astrodata.sunRise.Tithi && TithiId.TITHI_GAURA_DVADASI == t.astrodata.sunSet.Tithi && t.IsMhd58(out nMahaType))
            {
                t.nMahadvadasiID = nMahaType;
                mahaDay          = t;
            }
            else if (GCTithi.TITHI_DVADASI(t.astrodata.sunRise.Tithi))
            {
                if (GCTithi.TITHI_DVADASI(u.astrodata.sunRise.Tithi) && GCTithi.TITHI_EKADASI(s.astrodata.sunRise.Tithi) && GCTithi.TITHI_EKADASI(s.astrodata.sunArunodaya.Tithi))
                {
                    t.nMahadvadasiID = MahadvadasiType.EV_VYANJULI;
                    mahaDay          = t;
                }
                else if (t.NextNewFullIsVriddhi(earth))
                {
                    t.nMahadvadasiID = MahadvadasiType.EV_PAKSAVARDHINI;
                    mahaDay          = t;
                }
                else if (GCTithi.TITHI_LESS_EKADASI(s.astrodata.sunArunodaya.Tithi))
                {
                    t.nMahadvadasiID = MahadvadasiType.EV_SUDDHA;
                    mahaDay          = t;
                }
            }

            if (mahaDay != null && mahaDay.Next != null)
            {
                // fasting day
                mahaDay.nFastID            = FastType.FAST_EKADASI;
                mahaDay.ekadasi_vrata_name = GCEkadasi.GetEkadasiName(t.astrodata.Masa, t.astrodata.sunRise.Paksa);
                mahaDay.ekadasi_parana     = false;
                mahaDay.eparana_time1      = null;
                mahaDay.eparana_time2      = null;

                // parana day
                mahaDay.Next.nFastID        = FastType.FAST_NULL;
                mahaDay.Next.ekadasi_parana = true;
                mahaDay.Next.eparana_time1  = null;
                mahaDay.Next.eparana_time2  = null;
            }

            return(1);
        }
Beispiel #2
0
        public int EkadasiCalc(GCEarthData earth)
        {
            VAISNAVADAY t = this;

            if (t.Previous == null || t.Next == null)
            {
                return(0);
            }

            VAISNAVADAY s = t.Previous;
            VAISNAVADAY u = t.Next;

            if (GCTithi.TITHI_EKADASI(t.astrodata.sunRise.Tithi))
            {
                // if TAT < 11 then NOT_EKADASI
                if (GCTithi.TITHI_LESS_EKADASI(t.astrodata.sunArunodaya.Tithi))
                {
                    t.nMahadvadasiID     = MahadvadasiType.EV_NULL;
                    t.ekadasi_vrata_name = "";
                    t.nFastID            = FastType.FAST_NULL;
                }
                else
                {
                    // else ak MD13 then MHD1 and/or 3
                    if (GCTithi.TITHI_EKADASI(s.astrodata.sunRise.Tithi) && GCTithi.TITHI_EKADASI(s.astrodata.sunArunodaya.Tithi))
                    {
                        if (GCTithi.TITHI_TRAYODASI(u.astrodata.sunRise.Tithi))
                        {
                            t.nMahadvadasiID     = MahadvadasiType.EV_UNMILANI_TRISPRSA;
                            t.ekadasi_vrata_name = GCEkadasi.GetEkadasiName(t.astrodata.Masa, t.astrodata.sunRise.Paksa);
                            t.nFastID            = FastType.FAST_EKADASI;
                        }
                        else
                        {
                            t.nMahadvadasiID     = MahadvadasiType.EV_UNMILANI;
                            t.ekadasi_vrata_name = GCEkadasi.GetEkadasiName(t.astrodata.Masa, t.astrodata.sunRise.Paksa);
                            t.nFastID            = FastType.FAST_EKADASI;
                        }
                    }
                    else
                    {
                        if (GCTithi.TITHI_TRAYODASI(u.astrodata.sunRise.Tithi))
                        {
                            t.nMahadvadasiID     = MahadvadasiType.EV_TRISPRSA;
                            t.ekadasi_vrata_name = GCEkadasi.GetEkadasiName(t.astrodata.Masa, t.astrodata.sunRise.Paksa);
                            t.nFastID            = FastType.FAST_EKADASI;
                        }
                        else
                        {
                            // else ak U je MAHADVADASI then NOT_EKADASI
                            if (GCTithi.TITHI_EKADASI(u.astrodata.sunRise.Tithi) || (u.nMahadvadasiID >= MahadvadasiType.EV_SUDDHA))
                            {
                                t.nMahadvadasiID     = MahadvadasiType.EV_NULL;
                                t.ekadasi_vrata_name = "";
                                t.nFastID            = FastType.FAST_NULL;
                            }
                            else if (u.nMahadvadasiID == MahadvadasiType.EV_NULL)
                            {
                                // else suddha ekadasi
                                t.nMahadvadasiID     = MahadvadasiType.EV_SUDDHA;
                                t.ekadasi_vrata_name = GCEkadasi.GetEkadasiName(t.astrodata.Masa, t.astrodata.sunRise.Paksa);
                                t.nFastID            = FastType.FAST_EKADASI;
                            }
                        }
                    }
                }
            }
            // test for break fast


            return(1);
        }