コード例 #1
0
        public void Recalculate()
        {
            bool   settingsChanged = false;
            string s = appDayDateTime.EncodedString;

            if (!s.Equals(Properties.Settings.Default.AppDayDateTime))
            {
                Properties.Settings.Default.AppDayDateTime = s;
                settingsChanged = true;
            }
            s = appDayLocation.EncodedString;
            if (!s.Equals(Properties.Settings.Default.AppDayLocation))
            {
                Properties.Settings.Default.AppDayLocation = s;
                settingsChanged = true;
            }
            if (settingsChanged)
            {
                Properties.Settings.Default.Save();
            }

            LocationText(appDayLocation.Title);
            StartDateText(appDayDateTime.ToString());
            StartTimeText(appDayDateTime.ShortTimeString());

            if (p_mode == 0 || p_mode == 1)
            {
                m_appday = new TResultApp();
                m_appday.calculateAppDay(appDayLocation, appDayDateTime);
                DisplayCalendarResult();
            }
        }
コード例 #2
0
ファイル: TodayTab.cs プロジェクト: icfsoft/GCAL-NET-Core
 private void onDateRangeClickDone(object sender, EventArgs e)
 {
     if (sender is GregorianDateTime)
     {
         GregorianDateTime gdt = sender as GregorianDateTime;
         selectedDate = gdt;
         StartDateText(gdt.ToString());
         Recalculate();
     }
 }
コード例 #3
0
ファイル: TodayTab.cs プロジェクト: icfsoft/GCAL-NET-Core
        public TodayTab()
        {
            InitializeComponent();
            richTextBox1.Dock = DockStyle.Fill;
            pictureBox1.Dock  = DockStyle.Fill;

            selectedDate = new GregorianDateTime();
            LocationText(GCGlobal.myLocation.Title);
            StartDateText(selectedDate.ToString());
            SetMode(Properties.Settings.Default.TodayShowMode);
        }
コード例 #4
0
 private void onDateRangeCallback(object sender, EventArgs e)
 {
     if (sender is GregorianDateTime)
     {
         GregorianDateTime gdt = sender as GregorianDateTime;
         appDayDateTime = gdt;
         StartDateText(gdt.ToString());
         StartTimeText(gdt.ShortTimeString());
         Recalculate();
     }
 }
コード例 #5
0
        public void Recalculate()
        {
            bool   settingsChanged = false;
            string s = ratedLocation.EncodedString;

            if (!s.Equals(Properties.Settings.Default.RatedLocation))
            {
                Properties.Settings.Default.RatedLocation = s;
                settingsChanged = true;
            }
            s = ratedStartDate.EncodedString;
            if (!s.Equals(Properties.Settings.Default.RatedStartDate))
            {
                Properties.Settings.Default.RatedStartDate = s;
                settingsChanged = true;
            }
            s = ratedEndDate.EncodedString;
            if (!s.Equals(Properties.Settings.Default.RatedEndDate))
            {
                Properties.Settings.Default.RatedEndDate = s;
                settingsChanged = true;
            }
            if (settingsChanged)
            {
                Properties.Settings.Default.Save();
            }

            if (p_mode == 0 || p_mode == 1)
            {
                LocationText(ratedLocation.Title);
                StartDateText(ratedStartDate.ToString());
                EndDateText(ratedEndDate.ToString());

                richTextBox1.Visible = false;
                pictureBox1.Visible  = true;

                doNotRecalculate = false;
                backgroundWorker1.RunWorkerAsync();

/*                m_events = new TResultRatedEvents();
 *              m_events.CompleteCalculation(ratedLocation, ratedStartDate, ratedEndDate, SelectedConfiguration);
 *              CalcDeleg caller = new CalcDeleg(m_events.CompleteCalculation);
 *              IAsyncResult result = caller.BeginInvoke(ratedLocation, ratedStartDate, ratedEndDate, SelectedConfiguration,
 *                  new AsyncCallback(RecalculationDone),
 *                  "Recalculation");*/

                //DisplayCalendarResult();
            }
        }
コード例 #6
0
        private void buttonSaveImage_Click(object sender, EventArgs e)
        {
            Bitmap bmp = eventMapOverlayView1.ExportBitmap();

            if (bmp != null)
            {
                SaveFileDialog sfd = new SaveFileDialog();
                sfd.Filter     = "PNG Images (*.png)|*.png";
                sfd.FileName   = SelectedMap.Title + " " + SelectedDate.ToString() + ".png";
                sfd.DefaultExt = ".ext";
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    bmp.Save(sfd.FileName, ImageFormat.Png);
                }
            }
        }
コード例 #7
0
        private static void TestAscendant()
        {
            GCEarthData earth = new GCEarthData();

            earth.latitudeDeg  = 48.133;
            earth.longitudeDeg = 17.1;
            GregorianDateTime gt = new GregorianDateTime(2016, 9, 26);

            gt.shour         = 0.0;
            gt.TimezoneHours = 2.0;
            for (int i = 0; i < 144; i++)
            {
                double d = earth.GetAscendantDegrees(gt.GetJulianDetailed());
                Debugger.Log(0, "", string.Format("{0} {1}     {2}\n", gt.ToString(), gt.LongTimeString(), d));
                gt.shour += 10 / 1440.0;
            }
        }
コード例 #8
0
        private static void TestHouses(StringBuilder sb)
        {
            GregorianDateTime g = new GregorianDateTime(2016, 9, 1);

            g.shour         = 0.0;
            g.TimezoneHours = 0.0;

            GCEarthData earth = GCGlobal.myLocation.GetEarthData();
            GCEarth     e     = new GCEarth();

            sb.AppendLine(string.Format("{0,12} {1,8} {2,-15}  ", "Date", "Time", "Julian"));
            sb.AppendLine("---------------------------------------------------------------------------------------");
            for (int i = 0; i < 400; i++)
            {
                double jd = g.GetJulianComplete();
                double t = (jd - 2451545) / 365250;
                double sl1 = GCCoreAstronomy.GetSunLongitude(g, earth);
                double el, eb, er;
                GCEarth.Calculate(jd, out el, out eb, out er);
                double rl, rb, rr;
                GCRahu.Calculate(jd, out rl, out rb, out rr);
                double ml, mb, mr;
                GCMoonData.Calculate(jd, out ml, out mb, out mr);
                double ay = GCAyanamsha.GetAyanamsa(jd);
                sb.AppendLine(string.Format("{0,12} {1,8} {2,-15:F6}", g.ToString(), g.LongTime, jd));
                sb.AppendLine();
                for (int j = 5; j < 6; j++)
                {
                    GCVSOPAstronomy.GetGeocentricCoordinates(j, jd, out rl, out rb, out rr);
                    sb.AppendLine(string.Format("    {0,14} {1:F6}", GCStrings.GetPlanetNameEn(j), rl));
                }
                sb.AppendLine();

                g.AddHours(24);
            }


            File.WriteAllText("d:\\Temp\\gcaltest.txt", sb.ToString());
        }
コード例 #9
0
        public void Recalculate()
        {
            bool   settingsChanged = false;
            string s = coreLocation.EncodedString;

            if (!s.Equals(Properties.Settings.Default.CoreEventsLocation))
            {
                Properties.Settings.Default.CoreEventsLocation = s;
                settingsChanged = true;
            }
            s = coreStartDate.EncodedString;
            if (!s.Equals(Properties.Settings.Default.CoreEventsStartDate))
            {
                Properties.Settings.Default.CoreEventsStartDate = s;
                settingsChanged = true;
            }
            s = coreEndDate.EncodedString;
            if (!s.Equals(Properties.Settings.Default.CoreEventsEndDate))
            {
                Properties.Settings.Default.CoreEventsEndDate = s;
                settingsChanged = true;
            }
            if (settingsChanged)
            {
                Properties.Settings.Default.Save();
            }

            if (p_mode == 0 || p_mode == 1)
            {
                LocationText(coreLocation.Title);
                StartDateText(coreStartDate.ToString());
                EndDateText(coreEndDate.ToString());

                m_events = new TResultEvents();
                m_events.CalculateEvents(coreLocation, coreStartDate, coreEndDate);
                DisplayCalendarResult();
            }
        }
コード例 #10
0
ファイル: TodayTab.cs プロジェクト: icfsoft/GCAL-NET-Core
 private void toolStripButton4_Click(object sender, EventArgs e)
 {
     selectedDate.SubtractDays(1);
     StartDateText(selectedDate.ToString());
     Recalculate();
 }
コード例 #11
0
ファイル: TodayTab.cs プロジェクト: icfsoft/GCAL-NET-Core
 private void toolStripButton5_Click(object sender, EventArgs e)
 {
     selectedDate = new GregorianDateTime();
     StartDateText(selectedDate.ToString());
     Recalculate();
 }
コード例 #12
0
 public void UpdateSubtitle()
 {
     Subtitle = string.Format("Period: {0} - {1}", StartDate.ToString(), EndDate.ToString());
 }