From 96a1b2a62dc8ef9652615c180dde7f4d22eb6a90 Mon Sep 17 00:00:00 2001 From: TinyOh Date: Sat, 2 Mar 2019 08:22:04 +0800 Subject: [PATCH] fix(samples): check sample enable code --- samples/tutorials/control/auto_exposure.cc | 2 ++ samples/tutorials/control/framerate.cc | 2 ++ samples/tutorials/control/imu_low_pass_filter.cc | 2 ++ samples/tutorials/control/imu_range.cc | 2 ++ samples/tutorials/control/infrared.cc | 2 ++ samples/tutorials/control/manual_exposure.cc | 2 ++ samples/tutorials/data/get_imu.cc | 2 ++ src/mynteye/api/synthetic.cc | 3 +-- 8 files changed, 15 insertions(+), 2 deletions(-) diff --git a/samples/tutorials/control/auto_exposure.cc b/samples/tutorials/control/auto_exposure.cc index cabe6ad..258504f 100644 --- a/samples/tutorials/control/auto_exposure.cc +++ b/samples/tutorials/control/auto_exposure.cc @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) { bool ok; auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); api->ConfigStreamRequest(request); Model model = api->GetModel(); diff --git a/samples/tutorials/control/framerate.cc b/samples/tutorials/control/framerate.cc index 41f1e5d..faa1aec 100644 --- a/samples/tutorials/control/framerate.cc +++ b/samples/tutorials/control/framerate.cc @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) { bool ok; auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); api->ConfigStreamRequest(request); Model model = api->GetModel(); diff --git a/samples/tutorials/control/imu_low_pass_filter.cc b/samples/tutorials/control/imu_low_pass_filter.cc index 88e71b8..f0119f2 100644 --- a/samples/tutorials/control/imu_low_pass_filter.cc +++ b/samples/tutorials/control/imu_low_pass_filter.cc @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) { bool ok; auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); api->ConfigStreamRequest(request); Model model = api->GetModel(); diff --git a/samples/tutorials/control/imu_range.cc b/samples/tutorials/control/imu_range.cc index 1431b20..e6edecf 100644 --- a/samples/tutorials/control/imu_range.cc +++ b/samples/tutorials/control/imu_range.cc @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) { bool ok; auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); api->ConfigStreamRequest(request); Model model = api->GetModel(); diff --git a/samples/tutorials/control/infrared.cc b/samples/tutorials/control/infrared.cc index c261e7a..b44d49d 100644 --- a/samples/tutorials/control/infrared.cc +++ b/samples/tutorials/control/infrared.cc @@ -25,6 +25,8 @@ int main(int argc, char *argv[]) { bool ok; auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); api->ConfigStreamRequest(request); Model model = api->GetModel(); diff --git a/samples/tutorials/control/manual_exposure.cc b/samples/tutorials/control/manual_exposure.cc index 2761f58..b1ca5c5 100644 --- a/samples/tutorials/control/manual_exposure.cc +++ b/samples/tutorials/control/manual_exposure.cc @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) { bool ok; auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); api->ConfigStreamRequest(request); Model model = api->GetModel(); diff --git a/samples/tutorials/data/get_imu.cc b/samples/tutorials/data/get_imu.cc index c09d225..26d4653 100644 --- a/samples/tutorials/data/get_imu.cc +++ b/samples/tutorials/data/get_imu.cc @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) { auto &&request = api->SelectStreamRequest(&ok); if (!ok) return 1; api->ConfigStreamRequest(request); + api->EnableStreamData(Stream::LEFT); + api->EnableStreamData(Stream::RIGHT); // Enable this will cache the motion datas until you get them. api->EnableMotionDatas(); diff --git a/src/mynteye/api/synthetic.cc b/src/mynteye/api/synthetic.cc index 818dad0..abb7c36 100644 --- a/src/mynteye/api/synthetic.cc +++ b/src/mynteye/api/synthetic.cc @@ -238,8 +238,7 @@ void Synthetic::DisableStreamData(const Stream &stream) { bool Synthetic::IsStreamDataEnabled(const Stream &stream) const { if (checkControlDateWithStream(stream)) { auto data = getControlDateWithStream(stream); - return data.enabled_mode_ == MODE_SYNTHETIC || - data.enabled_mode_ == MODE_NATIVE; + return data.enabled_mode_ == MODE_SYNTHETIC; } return false; }