Make monotonic_now a required parameter to PhasedLoop
This prepares us much better for mocking out time as part of the event
loop conversion.
Change-Id: I57560b97b265ddd41fe7a4e9f74d7b1324d15955
diff --git a/y2016/dashboard/dashboard.cc b/y2016/dashboard/dashboard.cc
index 98fcd7b..300986e 100644
--- a/y2016/dashboard/dashboard.cc
+++ b/y2016/dashboard/dashboard.cc
@@ -49,7 +49,8 @@
//#define DASHBOARD_READ_VISION_QUEUE
DataCollector::DataCollector(::aos::EventLoop *event_loop)
- : vision_status_fetcher_(
+ : event_loop_(event_loop),
+ vision_status_fetcher_(
event_loop->MakeFetcher<::y2016::vision::VisionStatus>(
".y2016.vision.vision_status")),
ball_detector_fetcher_(
@@ -235,6 +236,7 @@
::aos::SetCurrentThreadName("DashboardData");
::aos::time::PhasedLoop phased_loop(chrono::milliseconds(100),
+ event_loop_->monotonic_now(),
chrono::seconds(0));
while (run_) {
phased_loop.SleepUntilNext();
diff --git a/y2016/dashboard/dashboard.h b/y2016/dashboard/dashboard.h
index 2e01f40..58c9890 100644
--- a/y2016/dashboard/dashboard.h
+++ b/y2016/dashboard/dashboard.h
@@ -65,6 +65,8 @@
::std::vector<ItemDatapoint> datapoints;
};
+ ::aos::EventLoop *event_loop_;
+
::aos::Fetcher<::y2016::vision::VisionStatus> vision_status_fetcher_;
::aos::Fetcher<::y2016::sensors::BallDetector> ball_detector_fetcher_;
::aos::Fetcher<::frc971::autonomous::AutonomousMode> autonomous_mode_fetcher_;