Ticket #40114: patch-UTCTime.cpp.diff

File patch-UTCTime.cpp.diff, 1.5 KB (added by venabled@…, 11 years ago)

fixes Compilation errors in UTCTime.cpp

  • lib/geodyn/UTCTime.cpp

    old new  
    364364      // GPS time to UTC time
    365365      // @param gpst    GPST as input
    366366      // @param utc     UTC as output
    367    void GPST2UTC(const UTCTime& gpst, UTCTime& utc)
     367   void GPST2UTC(const CommonTime& gpst, UTCTime& utc)
    368368   {
    369       UTCTime T;
    370 
    371       double mjdGPST = static_cast<Epoch>(gpst).MJD();
    372       double mjdTAI = mjdGPST+ UTCTime::TAI_GPS/UTCTime::DAY_TO_SECOND;
    373 
    374          // input should be utc
    375       double dtu = IERS::TAImUTC(mjdTAI);               
    376       double mjdUTC = mjdTAI - dtu / UTCTime::DAY_TO_SECOND;
    377 
    378       dtu = IERS::TAImUTC(mjdUTC);
    379       mjdUTC = mjdTAI - dtu / UTCTime::DAY_TO_SECOND;     
    380 
    381       utc = gpst;                           // GPST
    382       utc += UTCTime::TAI_GPS;            // TAI
    383       utc += -IERS::TAImUTC(mjdUTC);      // UTC
    384 
     369      CommonTime gps_ct = gpst;
     370      utc = UTCTime(gps_ct);             // utc
    385371   }
     372
    386373      // UTC time to GPS time
    387374      // @param utc    UTC as input
    388375      // @param gpst   GPST as output
     
    422409      // TT time to UTC time
    423410      // @param tt      TT as input
    424411      // @param utc     UTC as output
    425    void TT2UTC(const CommonTime& tt, CommonTime& utc)
     412   void TT2UTC(const CommonTime& tt, UTCTime& utc)
    426413   {
    427414      UTCTime T(static_cast<YDSTime>(tt).year,static_cast<YDSTime>(tt).doy,static_cast<YDSTime>(tt).sod);
    428415