mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
Compare commits
No commits in common. "c27b4f5dbb0b0a46b3438883901fdecc72f0c06b" and "f39db7e67d0c3852c3ab3020ec7ae3c219cc26b8" have entirely different histories.
c27b4f5dbb
...
f39db7e67d
1 changed files with 6 additions and 4 deletions
|
|
@ -160,9 +160,11 @@ impl LtcState {
|
|||
pub fn get_sync_status(delta_ms: i64, config: &Config) -> &'static str {
|
||||
if config.timeturner_offset.is_active() {
|
||||
"TIMETURNING"
|
||||
} else if delta_ms.abs() <= 1 {
|
||||
} else if config.auto_sync_enabled {
|
||||
"TIME LOCK ACTIVE"
|
||||
} else if delta_ms.abs() <= 8 {
|
||||
"IN SYNC"
|
||||
} else if delta_ms > 2 {
|
||||
} else if delta_ms > 10 {
|
||||
"CLOCK AHEAD"
|
||||
} else {
|
||||
"CLOCK BEHIND"
|
||||
|
|
@ -348,8 +350,8 @@ mod tests {
|
|||
assert_eq!(get_sync_status(-100, &config), "CLOCK BEHIND");
|
||||
|
||||
// Test auto-sync status
|
||||
// config.auto_sync_enabled = true;
|
||||
// assert_eq!(get_sync_status(0, &config), "IN SYNC");
|
||||
config.auto_sync_enabled = true;
|
||||
assert_eq!(get_sync_status(0, &config), "TIME LOCK ACTIVE");
|
||||
|
||||
// Test TIMETURNING status takes precedence
|
||||
config.timeturner_offset = TimeturnerOffset { hours: 1, minutes: 0, seconds: 0, frames: 0, milliseconds: 0 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue