Skip to content

Commit

Permalink
Fixed serialization of TrkConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Dec 23, 2023
1 parent 86c7457 commit 1363214
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions data/tests/config/tracking_cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ Demo ground station:
handoff: Eager
cadence: Continuous
min_samples: 10
sample_alignment: null
sampling: 1 min

Canberra:
scheduler:
handoff: Eager
cadence: Continuous
min_samples: 10
sample_alignment: 10 s
sampling: 1 min
2 changes: 1 addition & 1 deletion src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ where
if let Some(duration) = duration {
duration_to_str(duration, serializer)
} else {
serializer.serialize_str("")
serializer.serialize_none()
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/od/simulator/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ mod scheduler_ut {

let scheduler = Scheduler::default();
let serialized = serde_yaml::to_string(&scheduler).unwrap();
assert_eq!(serialized, "handoff: Eager\ncadence: Continuous\n");
assert_eq!(
serialized,
"handoff: Eager\ncadence: Continuous\nmin_samples: 0\nsample_alignment: null\n"
);
let deserd: Scheduler = serde_yaml::from_str(&serialized).unwrap();
assert_eq!(deserd, scheduler);

Expand All @@ -169,7 +172,7 @@ mod scheduler_ut {
let serialized = serde_yaml::to_string(&scheduler).unwrap();
assert_eq!(
serialized,
"handoff: Eager\ncadence: !Intermittent\n on: 12 min\n off: 17 h 5 min\n"
"handoff: Eager\ncadence: !Intermittent\n on: 12 min\n off: 17 h 5 min\nmin_samples: 10\nsample_alignment: null\n"
);
let deserd: Scheduler = serde_yaml::from_str(&serialized).unwrap();
assert_eq!(deserd, scheduler);
Expand Down

0 comments on commit 1363214

Please sign in to comment.