This commit is contained in:
2025-07-04 18:21:03 +03:00
parent b3b275edd8
commit c9e9115ebc
4 changed files with 265 additions and 12 deletions

View File

@@ -42,6 +42,11 @@ public:
return _expireDate;
}
auto expireMJD() const
{
return _expireMJD;
}
// load from stream
bool load(std::derived_from<std::basic_istream<char>> auto& stream, char comment_sym = '#')
{
@@ -118,7 +123,7 @@ public:
int64_t mjd_int = (1461LL * (iypmy + 4800LL)) / 4LL + (367LL * (im - 2LL - 12LL * my)) / 12LL -
(3LL * ((iypmy + 4900LL) / 100LL)) / 4LL + id - 2432076LL;
_expireJulDate = static_cast<double>(mjd_int);
_expireMJD = static_cast<double>(mjd_int);
_db = std::move(db);
@@ -169,7 +174,7 @@ public:
{
double e_mjd;
if (mjd > _expireJulDate) { // ???????!!!!!!!!!!!
if (mjd > _expireMJD) { // ???????!!!!!!!!!!!
return std::nullopt;
// return _db.back().tai_utc;
}
@@ -201,7 +206,7 @@ private:
inline static const std::regex data_rx{"^ *[0-9]{5,}(\\.?[0-9]+) +[0-9]{1,2} +[0-9]{1,2} +[0-9]{4} +[0-9]{1,} *$"};
time_point_t _expireDate{};
double _expireJulDate{};
double _expireMJD{};
struct leapsecond_db_elem_t {
double mjd;