Ejemplo n.º 1
0
        public void SaveInterfaceValues(string prefix)
        {
            int year;

            int.TryParse(textBox1.Text, out year);
            GPUserDefaults.SetIntForKey(prefix + ".gsd_year", year);
            GPUserDefaults.SetIntForKey(prefix + ".gsd_month", comboBox2.SelectedIndex + 1);
            GPUserDefaults.SetIntForKey(prefix + ".gsd_day", comboBox1.SelectedIndex + 1);
        }
Ejemplo n.º 2
0
        private void TodayForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            shared_today_form = null;
            GPUserDefaults.SetIntForKey("todayform.bounds.left", Location.X);
            GPUserDefaults.SetIntForKey("todayform.bounds.top", Location.Y);
            GPUserDefaults.SetIntForKey("todayform.bounds.width", Size.Width);
            GPUserDefaults.SetIntForKey("todayform.bounds.height", Size.Height);
            GPUserDefaults.SetBoolForKey("todayform.bounds.initd", true);

            SupervisorForm.WindowClosed(this);
        }
Ejemplo n.º 3
0
 public void SaveInterfaceValues(string prefix)
 {
     GPUserDefaults.SetIntForKey(prefix + ".tabctrl", tabControl1.SelectedIndex);
     GPUserDefaults.SetStringForKey(prefix + ".findtext", textBox1.Text);
     GPUserDefaults.SetStringForKey(prefix + ".city", textBox2.Text);
     GPUserDefaults.SetIntForKey(prefix + ".cc", comboBox1.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".cb2", comboBox2.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".cb3", comboBox3.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".cb4", comboBox4.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".cb5", comboBox5.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".cb6", comboBox6.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".cb7", comboBox7.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".tzoneindex", comboBox8.SelectedIndex);
     GPUserDefaults.SetBoolForKey(prefix + ".modifyflag", modifiedFlagAdded);
 }
Ejemplo n.º 4
0
        protected override void Execute()
        {
            loc = GPAppHelper.getMyLocation();

            //Testing.Report(loc, "gcal13");

            //loc1.setLatitudeNorthPositive(48.16);
            //loc1.setLongitudeEastPositive(17.09);
            //loc1.setTimeZoneName("Europe/Bratislava");
            p_today = new GPGregorianTime(loc);
            p_today.Today();

            /*
             * Debugger.Log(0,"", String.Format("Location: {0} {1} {2}\n", loc.getFullName(), loc1.getLongitudeString(), loc1.getLatitudeString()));
             *
             * double date = p_today.getJulianLocalNoon();
             * TEclipse te;
             * for (int i = 0; i < 30; i++)
             * {
             *  te = MA.Engine.NextEclipse(ref date, true);
             *  int y, m, d;
             *  MA.Engine.DecodeDateCorrect(date, out y, out m, out d);
             *  Debugger.Log(0, "", String.Format("eclipse:{0}  date: {1} {2} {3}\n", te, y, m, d));
             *  date += 20;
             * }
             *
             * //double a1 = MA.GPMeeusEngine.star_time(2456708.3200) ;
             * //a1 = MA.GPMeeusEngine.star_time(2452083) - a1;
             *
             *
             * double lat1 = 48.16, lat2 = 120;
             * double lon1 = 17.09, lon2 = 123;
             * double dStart = 0.287399999999998;
             * double dEnd = 0.287799999999998;
             * GPObserver obs = new GPObserver();
             * obs.setLatitudeNorthPositive(lat1).setLongitudeEastPositive(lon1).SetAltitude(0.2);
             *
             * GPJulianTime rise, trans, set;
             *
             *
             * GPJulianTime time = new GPJulianTime();
             *
             * time.setLocalJulianDay(2456708.5);
             * time.setLocalTimezoneOffset(1);
             * for (int l = 0; l < 40; l++)
             * {
             *  Log("Julian  {0}     = {1} / {2} / {3}   {4}:{5}:{6}\n", time.GetJulianDay(), time.GetYear(),
             *      time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());
             *  time.AddSeconds(79367.6);
             * }
             *
             * //GPGregorianTime gt = new GPGregorianTime(loc);
             * //gt.setJulianGreenwichTime(time);
             * //double rise = MA.GPMeeusEngine.Sun_Rise(p_today.GetJulianDetailed() - 0.5, loc.Latitude, -loc.Longitude);
             * //GPAstroEngine.CalculateTimeSun(gt, obs, out rise, out trans, out set);
             *
             * //Log("Rise: {0}, \nTrans:{1}, \nSet:{2}", rise, trans, set);
             *
             * //MA.Testing.TestSunCoordinates();
             * //MA.Testing.TestSiderealTime();
             * //MA.Testing.TestMoonEvents();
             *
             * //GPSun sun = new GPSun();
             * //sun.SunCalc(p_today, loc);
             * TRiseSet kind;
             * double deltaphi, epsilon, srt;
             * GPJulianTime dp = new GPJulianTime();
             * dp.setLocalJulianDay(2456710.500000);
             *
             * obs.setLongitudeEastPositive(-25.858).setLatitudeNorthPositive(-23.983);
             * srt = 2452081.000000;
             *
             * //MA.Testing.TestMoonEclipse();
             *
             * Testing.TestConjunctions();
             *
             * //MA.GPCelestialBodyCoordinates coord = MA.GPMeeusEngine.moon_coordinate(2448724.5);
             * //double phi, eps;
             * //MA.GPMeeusEngine.calc_epsilon_phi(2446895.5, out phi, out eps);
             * //Log("Sidereal time: {0}", MA.GPMeeusEngine.star_time(2446895.5));
             * //Log("Epsilon: {0}, phi: {1}", eps, phi);
             * //Log("Sunrise {0}", sun.rise.LongTimeString);
             *
             * return;
             */
            int maxCount = GPUserDefaults.IntForKey("nextfest.days", 16);

            if (maxCount < 3)
            {
                maxCount = 16;
                GPUserDefaults.SetIntForKey("nextfest.days", maxCount);
            }
            bool onlyFast = GPUserDefaults.BoolForKey("nextfest.onlyfast", true);

            p_cal.CalculateCalendar(p_today, maxCount);
            List <string> temp = new List <string>();

            for (int i = 0; i < p_cal.getCount(); i++)
            {
                temp.Clear();
                GPCalendarDay vd = p_cal.get(i);
                if (onlyFast)
                {
                    if (vd.sEkadasiVrataName.Length > 0)
                    {
                        temp.Add(string.Format(GPStrings.getString(87), vd.sEkadasiVrataName));
                    }
                    else if (vd.hasEkadasiParana())
                    {
                        temp.Add(vd.getEkadasiParanaString());
                    }
                }
                else
                {
                    if (vd.hasEkadasiParana())
                    {
                        temp.Add(vd.getEkadasiParanaString());
                    }
                    foreach (GPCalendarDay.Festival fest in vd.Festivals)
                    {
                        if (GPUserDefaults.BoolForKey(fest.ShowSettingItem, true))
                        {
                            temp.Add(fest.Text);
                        }
                    }
                }

                if (temp.Count > 0)
                {
                    for (int j = 0; j < temp.Count; j++)
                    {
                        GPStringPair dr = new GPStringPair();
                        if (j == 0)
                        {
                            dr.Name = vd.date.ToString() + " " + GPStrings.getString(150 + vd.date.getDayOfWeek());
                        }
                        dr.Value = temp[j];
                        lines.Add(dr);
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public void SaveInterfaceValues(string prefix)
 {
     GPUserDefaults.SetIntForKey(prefix + ".yp_year", comboBox1.SelectedIndex);
     GPUserDefaults.SetIntForKey(prefix + ".yp_count", comboBox2.SelectedIndex);
 }