private Aspect(Double degree, string name, char symbol, AspectImportance importance, double orb) : base(degree) { Name = name; Symbol = symbol; Importance = importance; Orb = orb; }
public Phenomena(DateTimeOffset start, DateTimeOffset end, AspectImportance concerned) { Kind = PeriodType.Customer; Concerned = concerned; Since = (start < end) ? start : end; Until = (start < end) ? end : start; GeoAspectarian = Ephemeris.Geocentric.AspectarianDuring(Since, Until, Concerned); HelioAspectarian = Ephemeris.Heliocentric.AspectarianDuring(Since, Until, Concerned); //getAllEvents(); }
public Phenomena(DateTimeOffset time, PeriodType kind, AspectImportance concerned) { Kind = kind; Concerned = concerned; #region set the eventDate/end of the period DateTimeOffset theDate = new DateTimeOffset(time.Year, time.Month, time.Day, 0, 0, 0, TimeSpan.Zero); switch (kind) { default: throw new ArgumentException("The PeriodType is unexpected"); case PeriodType.AroundTheDay: Since = workingDayBefore(theDate); Until = workingDayAfter(theDate); break; case PeriodType.AroundTheWeek: DateTimeOffset mondayOfTheWeek = theDate.AddDays(DayOfWeek.Monday - theDate.DayOfWeek); Since = workingDayBefore(mondayOfTheWeek); Until = mondayOfTheWeek.AddDays(7); break; case PeriodType.AroundTheMonth: Since = workingDayBefore(new DateTimeOffset(theDate.Year, theDate.Month, 1, 0, 0, 0, TimeSpan.Zero)); theDate = Since + TimeSpan.FromDays(35); Until = workingDayAfter(new DateTimeOffset(theDate.Year, theDate.Month, 1, 0, 0, 0, TimeSpan.Zero)); break; case PeriodType.AroundTheSeason: int season = theDate.Month / 3; Since = workingDayBefore(new DateTimeOffset(theDate.Year, season * 3 + 1, 1, 0, 0, 0, TimeSpan.Zero)); theDate = Since + TimeSpan.FromDays(95); Until = workingDayAfter(new DateTimeOffset(theDate.Year, theDate.Month, 1, 0, 0, 0, TimeSpan.Zero)); break; case PeriodType.AroundTheYear: Since = workingDayBefore(new DateTimeOffset(theDate.Year, 1, 1, 0, 0, 0, TimeSpan.Zero)); Until = workingDayAfter(new DateTimeOffset(theDate.Year + 1, 1, 1, 0, 0, 0, TimeSpan.Zero)); break; case PeriodType.DayExactly: Since = theDate; Until = theDate.AddDays(1); break; } #endregion GeoAspectarian = Ephemeris.Geocentric.AspectarianDuring(Since, Until, Concerned); HelioAspectarian = Ephemeris.Heliocentric.AspectarianDuring(Since, Until, Concerned); }
private void comboBoxImportance_SelectedIndexChanged(object sender, EventArgs e) { AspectImportance newImportance = (AspectImportance)comboBoxImportance.SelectedIndex; if (Concerned != newImportance) { Concerned = newImportance; if (PeriodParameterChangedEvent != null) { PeriodParameterChangedEvent(this); } } }
public static List <Double> DegreesOf(AspectImportance importance) { switch (importance) { case AspectImportance.Critical: return(Aspect.CriticalAspectDegrees); case AspectImportance.Important: return(Aspect.ImportantAspectDegrees); case AspectImportance.Effective: return(Aspect.EffectiveAspectDegrees); default: return(Aspect.AllAspectDegrees); } }
private void checkBoxAspect_CheckedChanged(object sender, EventArgs e) { comboBoxImportance.Enabled = comboBoxConcernedStar.Enabled = checkBoxAspect.Checked; if (triggerEvent && AspectsConcernedChanged != null) { AspectImportance importance = (AspectImportance)Enum.Parse(typeof(AspectImportance), comboBoxImportance.SelectedItem.ToString()); PlanetId star1 = (comboBoxConcernedStar.SelectedIndex == comboBoxConcernedStar.Items.Count - 1) ? PlanetId.SE_ECL_NUT : theParent.CurrentEphemeris.Luminaries[comboBoxConcernedStar.SelectedIndex]; PlanetId star2 = (comboBoxAnother.SelectedIndex == comboBoxAnother.Items.Count - 1) ? PlanetId.SE_ECL_NUT : theParent.CurrentEphemeris.Luminaries[comboBoxAnother.SelectedIndex]; AspectsConcernedChanged(checkBoxAspect.Checked, star1, star2, importance); } }
private void comboBoxPeriodType_SelectedIndexChanged(object sender, EventArgs e) { PeriodType newPeriodType = (PeriodType)Enum.Parse(typeof(PeriodType), comboBoxPeriodType.SelectedItem.ToString()); if (Kind != newPeriodType) { Kind = newPeriodType; AspectImportance importance = EventsSummary.ConcernedAspect[Kind]; dateTimePicker.Format = DateTimePickerFormat.Custom; dateTimePicker.CustomFormat = EventsSummary.DateTimeFormats[Kind]; comboBoxImportance.SelectedIndex = (int)importance; if (PeriodParameterChangedEvent != null) { PeriodParameterChangedEvent(this); } } }