private void populateTextBoxes() { this.tbHorMale.Text = "Current Chart"; this.tbHorFemale.Text = "Current Chart"; foreach (Form f in ((MhoraContainer)MhoraGlobalOptions.mainControl).MdiChildren) { if (f is MhoraChild) { MhoraChild mch = (MhoraChild)f; if (mch.getHoroscope() == this.h) { this.tbHorMale.Text = mch.Text; } if (mch.getHoroscope() == this.h2) { this.tbHorFemale.Text = mch.Text; } } } }
private void menuItemNewView_Click(object sender, System.EventArgs e) { MhoraChild curr = (MhoraChild)this.ActiveMdiChild; if (null == curr) { return; } MhoraChild child2 = new MhoraChild(curr.getHoroscope()); child2.Text = curr.Text; child2.MdiParent = this; child2.Name = curr.Name; child2.Show(); }
public Horoscope GetHorsocope() { if (lBox.SelectedIndex < 0) { return(null); } MhoraContainer mc = (MhoraContainer)MhoraGlobalOptions.mainControl; foreach (Form c in mc.MdiChildren) { if (c is MhoraChild) { if (((MhoraChild)c).Name == (string)lBox.Items[lBox.SelectedIndex]) { MhoraChild ch = (MhoraChild)c; return(ch.getHoroscope()); } } } return(null); }
public void SetView(BaseUserOptions.ViewType view) { MhoraControl mc = null;; switch (view) { case BaseUserOptions.ViewType.DivisionalChart: mc = new DivisionalChart(h); break; case BaseUserOptions.ViewType.Ashtakavarga: mc = new AshtakavargaControl(h); break; case BaseUserOptions.ViewType.ChakraSarvatobhadra81: mc = new Sarvatobhadra81Control(h); break; case BaseUserOptions.ViewType.NavamsaCircle: mc = new NavamsaControl(h); break; case BaseUserOptions.ViewType.VaraChakra: mc = new VaraChakra(h); break; case BaseUserOptions.ViewType.Panchanga: mc = new PanchangaControl(h); break; case BaseUserOptions.ViewType.KutaMatching: { Horoscope h2 = h; foreach (Form f in ((MhoraContainer)MhoraGlobalOptions.mainControl).MdiChildren) { if (f is MhoraChild) { MhoraChild mch = (MhoraChild)f; if (h == h2 && mch.getHoroscope() != h2) { h2 = mch.getHoroscope(); break; } } } mc = new KutaMatchingControl(h, h); } break; case BaseUserOptions.ViewType.DasaVimsottari: mc = new DasaControl(h, new VimsottariDasa(h)); break; case BaseUserOptions.ViewType.DasaYogini: mc = new DasaControl(h, new YoginiDasa(h)); break; case BaseUserOptions.ViewType.DasaShodashottari: mc = new DasaControl(h, new ShodashottariDasa(h)); break; case BaseUserOptions.ViewType.DasaAshtottari: mc = new DasaControl(h, new AshtottariDasa(h)); break; case BaseUserOptions.ViewType.DasaTithiAshtottari: mc = new DasaControl(h, new TithiAshtottariDasa(h)); break; case BaseUserOptions.ViewType.DasaKaranaChaturashitiSama: mc = new DasaControl(h, new KaranaChaturashitiSamaDasa(h)); break; case BaseUserOptions.ViewType.DasaYogaVimsottari: mc = new DasaControl(h, new YogaVimsottariDasa(h)); break; case BaseUserOptions.ViewType.DasaLagnaKendradiRasi: mc = new DasaControl(h, new LagnaKendradiRasiDasa(h)); break; case BaseUserOptions.ViewType.DasaKarakaKendradiGraha: mc = new DasaControl(h, new KarakaKendradiGrahaDasa(h)); break; case BaseUserOptions.ViewType.DasaKalachakra: mc = new DasaControl(h, new KalachakraDasa(h)); break; case BaseUserOptions.ViewType.DasaMoola: mc = new DasaControl(h, new MoolaDasa(h)); break; case BaseUserOptions.ViewType.DasaNavamsa: mc = new DasaControl(h, new NavamsaDasa(h)); break; case BaseUserOptions.ViewType.DasaMandooka: mc = new DasaControl(h, new MandookaDasa(h)); break; case BaseUserOptions.ViewType.DasaChara: mc = new DasaControl(h, new CharaDasa(h)); break; case BaseUserOptions.ViewType.DasaTrikona: mc = new DasaControl(h, new TrikonaDasa(h)); break; case BaseUserOptions.ViewType.DasaSu: mc = new DasaControl(h, new SuDasa(h)); break; case BaseUserOptions.ViewType.DasaSudarshanaChakra: mc = new DasaControl(h, new SudarshanaChakraDasa(h)); break; case BaseUserOptions.ViewType.DasaMudda: { DasaControl dc = new DasaControl(h, new VimsottariDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.SolarYear; dc.DasaOptions.YearLength = 360; dc.DasaOptions.Compression = 1; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaSudarshanaChakraCompressed: { DasaControl dc = new DasaControl(h, new SudarshanaChakraDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.SolarYear; dc.DasaOptions.YearLength = 360; dc.DasaOptions.Compression = 1; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaYogaPraveshVimsottariCompressedYoga: { DasaControl dc = new DasaControl(h, new YogaVimsottariDasa(h)); dc.compressToYogaPraveshaYearYoga(); mc = dc; } break; case BaseUserOptions.ViewType.DasaTithiPraveshAshtottariCompressedTithi: { DasaControl dc = new DasaControl(h, new TithiAshtottariDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.TithiYear; ToDate td_pravesh = new ToDate(h.baseUT, ToDate.DateType.TithiPraveshYear, 360.0, 0, h); ToDate td_tithi = new ToDate(h.baseUT, ToDate.DateType.TithiYear, 360.0, 0, h); sweph.obtainLock(h); if (td_tithi.AddYears(1).toUniversalTime() + 15.0 < td_pravesh.AddYears(1).toUniversalTime()) { dc.DasaOptions.YearLength = 390; } sweph.releaseLock(h); dc.DasaOptions.Compression = 1; TithiAshtottariDasa.UserOptions tuo = (TithiAshtottariDasa.UserOptions)dc.DasaSpecificOptions; tuo.UseTithiRemainder = true; dc.DasaSpecificOptions = tuo; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaTithiPraveshAshtottariCompressedFixed: { DasaControl dc = new DasaControl(h, new TithiAshtottariDasa(h)); ToDate td_pravesh = new ToDate(h.baseUT, ToDate.DateType.TithiPraveshYear, 360.0, 0, h); sweph.obtainLock(h); dc.DasaOptions.YearType = ToDate.DateType.FixedYear; dc.DasaOptions.YearLength = td_pravesh.AddYears(1).toUniversalTime() - td_pravesh.AddYears(0).toUniversalTime(); sweph.releaseLock(h); TithiAshtottariDasa.UserOptions tuo = (TithiAshtottariDasa.UserOptions)dc.DasaSpecificOptions; tuo.UseTithiRemainder = true; dc.DasaSpecificOptions = tuo; dc.DasaOptions.Compression = 1; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaTithiPraveshAshtottariCompressedSolar: { DasaControl dc = new DasaControl(h, new TithiAshtottariDasa(h)); ToDate td_pravesh = new ToDate(h.baseUT, ToDate.DateType.TithiPraveshYear, 360.0, 0, h); sweph.obtainLock(h); double ut_start = td_pravesh.AddYears(0).toUniversalTime(); double ut_end = td_pravesh.AddYears(1).toUniversalTime(); BodyPosition sp_start = Basics.CalculateSingleBodyPosition( ut_start, sweph.BodyNameToSweph(Body.Name.Sun), Body.Name.Sun, BodyType.Name.Graha, this.h); BodyPosition sp_end = Basics.CalculateSingleBodyPosition( ut_end, sweph.BodyNameToSweph(Body.Name.Sun), Body.Name.Sun, BodyType.Name.Graha, this.h); Longitude lDiff = sp_end.longitude.sub(sp_start.longitude); double diff = lDiff.value; if (diff < 120.0) { diff += 360.0; } dc.DasaOptions.YearType = ToDate.DateType.SolarYear; dc.DasaOptions.YearLength = diff; sweph.releaseLock(h); TithiAshtottariDasa.UserOptions tuo = (TithiAshtottariDasa.UserOptions)dc.DasaSpecificOptions; tuo.UseTithiRemainder = true; dc.DasaSpecificOptions = tuo; //dc.DasaOptions.YearType = ToDate.DateType.FixedYear; //dc.DasaOptions.YearLength = td_pravesh.AddYears(1).toUniversalTime() - // td_pravesh.AddYears(0).toUniversalTime(); dc.DasaOptions.Compression = 1; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaDwadashottari: mc = new DasaControl(h, new DwadashottariDasa(h)); break; case BaseUserOptions.ViewType.DasaPanchottari: mc = new DasaControl(h, new PanchottariDasa(h)); break; case BaseUserOptions.ViewType.DasaShatabdika: mc = new DasaControl(h, new ShatabdikaDasa(h)); break; case BaseUserOptions.ViewType.DasaChaturashitiSama: mc = new DasaControl(h, new ChaturashitiSamaDasa(h)); break; case BaseUserOptions.ViewType.DasaDwisaptatiSama: mc = new DasaControl(h, new DwisaptatiSamaDasa(h)); break; case BaseUserOptions.ViewType.DasaShatTrimshaSama: mc = new DasaControl(h, new ShatTrimshaSamaDasa(h)); break; case BaseUserOptions.ViewType.BasicCalculations: mc = new BasicCalculationsControl(h); break; case BaseUserOptions.ViewType.KeyInfo: mc = new KeyInfoControl(h); break; case BaseUserOptions.ViewType.Balas: mc = new BalasControl(h); break; case BaseUserOptions.ViewType.TransitSearch: mc = new TransitSearch(h); break; case BaseUserOptions.ViewType.NaisargikaRasiDasa: mc = new DasaControl(h, new NaisargikaRasiDasa(h)); break; case BaseUserOptions.ViewType.NaisargikaGrahaDasa: mc = new DasaControl(h, new NaisargikaGrahaDasa(h)); break; case BaseUserOptions.ViewType.DasaNarayana: mc = new DasaControl(h, new NarayanaDasa(h)); break; case BaseUserOptions.ViewType.DasaNarayanaSama: mc = new DasaControl(h, new NarayanaSamaDasa(h)); break; case BaseUserOptions.ViewType.DasaShoola: mc = new DasaControl(h, new ShoolaDasa(h)); break; case BaseUserOptions.ViewType.DasaNiryaanaShoola: mc = new DasaControl(h, new NirayaanaShoolaDasa(h)); break; case BaseUserOptions.ViewType.DasaDrig: mc = new DasaControl(h, new DrigDasa(h)); break; case BaseUserOptions.ViewType.DasaTajaka: mc = new DasaControl(h, new TajakaDasa(h)); break; case BaseUserOptions.ViewType.DasaTithiPravesh: { DasaControl dc = new DasaControl(h, new TithiPraveshDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.TithiPraveshYear; dc.LinkToHoroscope = false; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaYogaPravesh: { DasaControl dc = new DasaControl(h, new YogaPraveshDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.YogaPraveshYear; dc.LinkToHoroscope = false; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaNakshatraPravesh: { DasaControl dc = new DasaControl(h, new NakshatraPraveshDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.NakshatraPraveshYear; dc.LinkToHoroscope = false; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaKaranaPravesh: { DasaControl dc = new DasaControl(h, new KaranaPraveshDasa(h)); dc.DasaOptions.YearType = ToDate.DateType.KaranaPraveshYear; dc.LinkToHoroscope = false; dc.Reset(); mc = dc; } break; case BaseUserOptions.ViewType.DasaTattwa: mc = new DasaControl(h, new TattwaDasa(h)); break; default: Debug.Assert(false, "Unknown View Internal error"); break; } mc.Dock = DockStyle.Fill; if (null != this.Control) { this.Control.Dispose(); } this.Control = mc; return; }