diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-08-15 10:37:45 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-08-15 10:37:45 +0200 |
commit | 2980f73251c631960fcbe048eda861afa7a1be89 (patch) | |
tree | d648100ba4d88378f31415b5627494000bb79acc /src/output/Dexter.cpp | |
parent | 6c0732dcfc2af963e2b8577e9fc38f71307a1033 (diff) | |
download | dabmod-2980f73251c631960fcbe048eda861afa7a1be89.tar.gz dabmod-2980f73251c631960fcbe048eda861afa7a1be89.tar.bz2 dabmod-2980f73251c631960fcbe048eda861afa7a1be89.zip |
Dexter: Add in_holdover_since metric
Diffstat (limited to 'src/output/Dexter.cpp')
-rw-r--r-- | src/output/Dexter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/output/Dexter.cpp b/src/output/Dexter.cpp index 14edace..457ec78 100644 --- a/src/output/Dexter.cpp +++ b/src/output/Dexter.cpp @@ -407,6 +407,7 @@ SDRDevice::run_statistics_t Dexter::get_run_statistics(void) const rs["frames"].v = num_frames_modulated; rs["in_holdover_since"].v = 0; + rs["remaining_holdover_s"].v = nullopt; switch (m_clock_state) { case DexterClockState::Startup: rs["clock_state"].v = "startup"; break; @@ -415,6 +416,12 @@ SDRDevice::run_statistics_t Dexter::get_run_statistics(void) const case DexterClockState::Holdover: rs["clock_state"].v = "holdover"; rs["in_holdover_since"].v = m_holdover_since_t; + { + using namespace std::chrono; + const auto max_holdover_duration = seconds(m_conf.maxGPSHoldoverTime); + const duration<double> remaining = max_holdover_duration - (steady_clock::now() - m_holdover_since); + rs["remaining_holdover_s"].v = duration_cast<seconds>(remaining).count(); + } break; } |