Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_date.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_date.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_date.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 8 8 *****************************************************************************/ 9 9 10 #ifndef _QWT_DATE_H_11 #define _QWT_DATE_H_10 #ifndef QWT_DATE_H 11 #define QWT_DATE_H 12 12 13 13 #include "qwt_global.h" … … 15 15 16 16 /*! 17 \brief A collection of methods around date/time values 17 \brief A collection of methods around date/time values 18 18 19 Qt offers convenient classes for dealing with date/time values, 20 but Qwt uses coordinate systems that are based on doubles. 21 QwtDate offers methods to translate from QDateTime to double and v.v. 19 Qt offers convenient classes for dealing with date/time values, 20 but Qwt uses coordinate systems that are based on doubles. 21 QwtDate offers methods to translate from QDateTime to double and v.v. 22 22 23 A double is interpreted as the number of milliseconds since 24 1970-01-01T00:00:00 Universal Coordinated Time - also known 25 as "The Epoch". 23 A double is interpreted as the number of milliseconds since 24 1970-01-01T00:00:00 Universal Coordinated Time - also known 25 as "The Epoch". 26 26 27 While the range of the Julian day in Qt4 is limited to [0, MAX_INT], 28 Qt5 stores it as qint64 offering a huge range of valid dates. 29 As the significance of a double is below this ( assuming a 30 fraction of 52 bits ) the translation is not 31 bijective with rounding errors for dates very far from Epoch. 32 For a resolution of 1 ms those start to happen for dates above the 33 year 144683. 27 While the range of the Julian day in Qt4 is limited to [0, MAX_INT], 28 Qt5 stores it as qint64 offering a huge range of valid dates. 29 As the significance of a double is below this ( assuming a 30 fraction of 52 bits ) the translation is not 31 bijective with rounding errors for dates very far from Epoch. 32 For a resolution of 1 ms those start to happen for dates above the 33 year 144683. 34 34 35 An axis for a date/time interval is expected to be aligned 36 and divided in time/date units like seconds, minutes, ... 37 QwtDate offers several algorithms that are needed to 38 calculate these axes. 35 An axis for a date/time interval is expected to be aligned 36 and divided in time/date units like seconds, minutes, ... 37 QwtDate offers several algorithms that are needed to 38 calculate these axes. 39 39 40 \sa QwtDateScaleEngine, QwtDateScaleDraw, QDate, QTime 41 */ 40 \sa QwtDateScaleEngine, QwtDateScaleDraw, QDate, QTime 41 */ 42 42 class QWT_EXPORT QwtDate 43 43 { 44 public: 44 public: 45 45 /*! 46 46 How to identify the first week of year differs between … … 55 55 FirstThursday corresponds to the numbering that is 56 56 implemented in QDate::weekNumber(). 57 */ 57 */ 58 58 FirstThursday, 59 59 … … 63 63 In the U.S. this definition is more common than 64 64 FirstThursday. 65 */ 65 */ 66 66 FirstDay 67 67 }; 68 68 69 69 /*! 70 Classification of an time interval 70 Classification of an time interval 71 71 72 Time intervals needs to be classified to decide how to 73 align and divide it. 72 Time intervals needs to be classified to decide how to 73 align and divide it. 74 74 */ 75 75 enum IntervalType … … 112 112 Qt::TimeSpec = Qt::UTC ); 113 113 114 static double toDouble( const QDateTime & );114 static double toDouble( const QDateTime& ); 115 115 116 static QDateTime ceil( const QDateTime &, IntervalType );117 static QDateTime floor( const QDateTime &, IntervalType );116 static QDateTime ceil( const QDateTime&, IntervalType ); 117 static QDateTime floor( const QDateTime&, IntervalType ); 118 118 119 119 static QDate dateOfWeek0( int year, Week0Type ); 120 static int weekNumber( const QDate &, Week0Type );120 static int weekNumber( const QDate&, Week0Type ); 121 121 122 static int utcOffset( const QDateTime & );122 static int utcOffset( const QDateTime& ); 123 123 124 static QString toString( const QDateTime &,125 const QString & format, Week0Type );124 static QString toString( const QDateTime&, 125 const QString& format, Week0Type ); 126 126 }; 127 127
Note:
See TracChangeset
for help on using the changeset viewer.
