Ejemplo n.º 1
0
Archivo: time.cs Proyecto: yxw027/CORS
        /// <summary>
        /// GPS时间转儒略日
        /// </summary>
        public static void tmGPSTimeToJulianDay(GPSTIME pGPSTime, JULIANDAY pJulianDay)
        {
            double dTemp;

            dTemp = pGPSTime.lWeek * 7L + (double)pGPSTime.lSecond / 86400.0
                    + pGPSTime.dFraction;

            pJulianDay.lDay      = (long)(dTemp + 2444244.5);
            pJulianDay.lSecond   = (pGPSTime.lSecond % 86400 + 43200L) % 86400L;
            pJulianDay.dFraction = pGPSTime.dFraction;
        }
Ejemplo n.º 2
0
Archivo: time.cs Proyecto: yxw027/CORS
        /// <summary>
        /// GPS时间转日历时
        /// </summary>
        public static void tmGPSTimeToTime(ref GPSTIME pGPSTime, ref TIME pTime)
        {
            JULIANDAY jd;
            double    dTemp;

            dTemp = pGPSTime.lWeek * 7L + (double)pGPSTime.lSecond / 86400.0
                    + pGPSTime.dFraction / 86400.0;

            jd.lDay      = (long)(dTemp + 2444244.5);
            jd.lSecond   = (pGPSTime.lSecond % 86400 + 43200L) % 86400L;
            jd.dFraction = pGPSTime.dFraction;

            tmJulianDayToTime(ref jd, ref pTime);
        }
Ejemplo n.º 3
0
Archivo: time.cs Proyecto: yxw027/CORS
        /// <summary>
        /// 儒略日转GPS时间
        /// </summary>
        public static void tmJulianDayToGPSTime(JULIANDAY pJulianDay, GPSTIME pGPSTime)
        {
            double dTemp;
            long   lTemp;

            dTemp = pJulianDay.lDay +
                    (double)(pJulianDay.lSecond + pJulianDay.dFraction) / 86400.0;
            lTemp = (long)(dTemp - 2444244.5);

            pGPSTime.lWeek   = (long)((lTemp) / 7);
            pGPSTime.lSecond = (long)(lTemp % 7 * 86400L)
                               + (pJulianDay.lSecond + 43200L) % 86400L;
            pGPSTime.dFraction = pJulianDay.dFraction;
        }
Ejemplo n.º 4
0
Archivo: time.cs Proyecto: yxw027/CORS
        /// <summary>
        /// 日历时转GPS时间
        /// </summary>
        public static void tmTimeToGPSTime(ref TIME pTime, ref GPSTIME pGPSTime)
        {
            JULIANDAY jd;
            double    dTemp;
            long      lTemp;

            jd.dFraction = 0.0;
            jd.lDay      = 0;
            jd.lSecond   = 0;

            tmTimeToJulianDay(ref pTime, ref jd);
            dTemp = jd.lDay + (double)(jd.lSecond + jd.dFraction) / 86400.0;
            lTemp = (long)(dTemp - 2444244.5);

            pGPSTime.lWeek   = (long)((lTemp) / 7);
            pGPSTime.lSecond = (long)(lTemp % 7 * 86400L) + pTime.byHour * 3600L
                               + pTime.byMinute * 60L + (long)pTime.dSecond;
            pGPSTime.dFraction = pTime.dSecond - (long)pTime.dSecond;
        }