Esempio n. 1
0
        public static Week Common2GPS(CommonT dt)
        {
            int    week;
            double sow;

            Common2GPS(out week, out sow, dt);

            return(new Week(week, sow));
        }
Esempio n. 2
0
        /// <summary>
        /// Time 类的静态方法,通用时到儒略日
        /// </summary>
        /// <param name="pct">通用时</param>
        /// <returns>通用时一秒之内的小数部分,单位:皮秒</returns>
        public static Day Common2MJD(CommonT dt)
        {
            int y, m;
            int temp;

            Day mjd = new Day();

            y = dt.Year;

            if (dt.Year < 1900)
            {
                if (dt.Year < 80)
                {
                    y = y + 2000;
                }
                else
                {
                    y = y + 1900;
                }
            }

            if (dt.Month <= 2)
            {
                y = y - 1;
                m = dt.Month + 12;
            }
            else
            {
                m = dt.Month;
            }

            temp  = (int)(365.25 * y);
            temp += (int)(30.6001 * (m + 1));
            temp += dt.Day;
            temp += -679019;

            mjd.Days = temp;

            mjd.Seconds = dt.Hour * 3600 + dt.Minute * 60 + (double)dt.Second;

            return(mjd);
        }
Esempio n. 3
0
 public GPST(int year, int month, int day, int hour, int minute, decimal second)
 {
     CommonT = new CommonT(year, month, day, hour, minute, second);
 }
Esempio n. 4
0
        public static void Common2GPS(int year, int month, int day, int hour, int minute, decimal second, out int week, out double sow)
        {
            CommonT ct = new CommonT(year, month, day, hour, minute, second);

            Common2GPS(out week, out sow, ct);
        }
Esempio n. 5
0
        /// <summary>
        /// 通用时转GPS时
        /// </summary>
        /// <param name="week"></param>
        /// <param name="sow"></param>
        /// <param name="dt"></param>
        /// <param name="picoSeconds"></param>
        public static void Common2GPS(out int week, out double sow, CommonT dt)
        {
            Day mjd = Common2MJD(dt);

            MJD2GPS(mjd, out week, out sow);
        }