Exemplo n.º 1
0
static void timeDisplay( ostream & os, const CommonTime& t )
{
    // Convert to CommonTime struct from GPS wk,SOW to M/D/Y, H:M:S.
    GPSWeekSecond dummyTime;
    dummyTime = GPSWeekSecond(t);
    os << dec;
    os << setw(4) << dummyTime.week << "(";
    os << setw(4) << (dummyTime.week & 0x03FF) << ")  ";
    os << setw(6) << setfill(' ') << dummyTime.sow << "   ";

    switch (dummyTime.getDayOfWeek())
    {
    case 0:
        os << "Sun-0";
        break;
    case 1:
        os << "Mon-1";
        break;
    case 2:
        os << "Tue-2";
        break;
    case 3:
        os << "Wed-3";
        break;
    case 4:
        os << "Thu-4";
        break;
    case 5:
        os << "Fri-5";
        break;
    case 6:
        os << "Sat-6";
        break;
    default:
        break;
    }
    os << "   " << (static_cast<YDSTime>(t)).printf("%3j   %5.0s  ")
       << (static_cast<CivilTime>(t)).printf("%02m/%02d/%04Y   %02H:%02M:%02S");
}
Exemplo n.º 2
0
   void CNavDataElement::timeDisplay( ostream & os, const CommonTime& t )
   {
      os.setf(ios::dec, ios::basefield);
         // Convert to CommonTime struct from GPS wk,SOW to M/D/Y, H:M:S.
      GPSWeekSecond dummyTime;
      dummyTime = GPSWeekSecond(t);
      os << setw(4) << dummyTime.week << "(";
      os << setw(4) << (dummyTime.week & 0x03FF) << ")  ";
      os << setw(6) << setfill(' ') << dummyTime.sow << "   ";

      switch (dummyTime.getDayOfWeek())
      {
         case 0: os << "Sun-0"; break;
         case 1: os << "Mon-1"; break;
         case 2: os << "Tue-2"; break;
         case 3: os << "Wed-3"; break;
         case 4: os << "Thu-4"; break;
         case 5: os << "Fri-5"; break;
         case 6: os << "Sat-6"; break;
         default: break;
      }
      os << printTime(t,"   %3j   %5.0s   %02m/%02d/%04Y   %02H:%02M:%02S");
   }