From: <mk...@us...> - 2003-08-15 05:34:51
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv3940 Modified Files: Date.h Log Message: Index: Date.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Date.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Date.h 15 Aug 2003 01:17:06 -0000 1.13 --- Date.h 15 Aug 2003 04:52:05 -0000 1.14 *************** *** 646,654 **** ! /** ! * @brief Class combining time and date operations. ! * ! * @author Mark Rose <mr...@st...> ! */ class SIMDATA_EXPORT DateZulu: public Date, public Zulu { --- 646,652 ---- ! /// Class combining time and date operations. ! /// ! /// @author Mark Rose <mr...@st...> class SIMDATA_EXPORT DateZulu: public Date, public Zulu { *************** *** 657,662 **** --- 655,671 ---- public: + /// Default constructor + /// + /// @see Date() and Zulu() DateZulu(): Date(), Zulu() {} + /// Construct a new DateZulu. + /// + /// @param year the year (e.g. 2000) + /// @param the month (1-12) + /// @param the day (1-31) + /// @param hour the hour (0-23) + /// @param minute the minute (0-59) + /// @param second the second (0.0-60.0) DateZulu(year_t year, month_t month, day_t day, int hour, int minute, time_t second): Date(year, month, day), *************** *** 665,668 **** --- 674,683 ---- } + /// Construct a new DateZulu. + /// + /// @param julian the Julian date. + /// @param hour the hour (0-23) + /// @param minute the minute (0-59) + /// @param second the second (0.0-60.0) DateZulu(julian_t julian, int hour, int minute, time_t second): Date(julian), *************** *** 671,676 **** --- 686,694 ---- } + /// Copy constructor. DateZulu(const DateZulu &dz): Date(dz), Zulu(dz) { } + #ifndef SWIG + /// Assignment operator from another DateZulu. const DateZulu &operator=(const DateZulu &dz) { Date::operator=(dz); *************** *** 681,700 **** void convert(struct tm *tm, bool local=false) const; std::string formatString(const char *format, bool local=false) const; virtual std::string asString() const { return formatString("%Y/%m/%d %H:%M:%Sz"); } ! /** ! * Return a string representation of the type. ! */ virtual std::string typeString() const { return "type::DateZulu"; } ! /** ! * Increment the current time, with date rollover. ! * ! * @param dt The time interval (in seconds) ! */ int addTime(time_t dt) { int days = Zulu::addTime(dt); --- 699,732 ---- + /// Store the time into a standard time structure. + /// + /// @param The time structure to set (see <time.h>) + /// @param local Optionally adjust the time for the local + /// timezone. void convert(struct tm *tm, bool local=false) const; + + /// Format the date and time to a string. + /// + /// @param format Identical to the format string used by + /// strftime() (Google: strftime) + /// @param local Optionally adjust the time for the local + /// timezone. + /// @returns The formatted date/time string. std::string formatString(const char *format, bool local=false) const; + + /// Return a string representation of the date and time. + /// + /// The format is "YYYY/MM/DD HH:MM::SSz". virtual std::string asString() const { return formatString("%Y/%m/%d %H:%M:%Sz"); } ! /// Return a string representation of the type. virtual std::string typeString() const { return "type::DateZulu"; } ! /// Increment the current time, with date rollover. ! /// ! /// @param dt The time interval (in seconds) ! /// @returns The number of rollover days. int addTime(time_t dt) { int days = Zulu::addTime(dt); *************** *** 703,711 **** } ! /** ! * Set the current time, with date rollover. ! * ! * @param t The current time of day (in seconds) ! */ int setTime(time_t t) { int days = Zulu::setTime(t); --- 735,742 ---- } ! /// Set the current time, with date rollover. ! /// ! /// @param t The current time of day (in seconds) ! /// @returns The number of rollover days. int setTime(time_t t) { int days = Zulu::setTime(t); *************** *** 714,717 **** --- 745,754 ---- } + /// Get the real-valued Julian date. + /// + /// @returns The Julian date and time as a real value, + /// with the whole part of the result equal to + /// the Julian day, and the fractional part of + /// the result encoding the time of day. double getJulianDate() const { double j = getJulian(); *************** *** 720,724 **** --- 757,773 ---- } + /// Get the (accurate) Mean Sidereal time. + /// + /// @deprecated This routine now calls getMST and remains + /// only for backwards compatibility. It may + /// be removed in a future version of SimData. double getAccurateMST(radian_t longitude=0.0L) const; + + /// Get the Mean Sidereal time. + /// + /// @param longitude The local longitude in radians. + /// @returns The mean sidereal time (in radians) for the + /// specified latitude using a third-order + /// polynomial approximation. double getMST(radian_t longitude=0.0L) const; |