Test addons support and add tutorial ir control
This commit is contained in:
@@ -56,6 +56,10 @@ bool API::Supports(const Option &option) const {
|
||||
return device_->Supports(option);
|
||||
}
|
||||
|
||||
bool API::Supports(const AddOns &addon) const {
|
||||
return device_->Supports(addon);
|
||||
}
|
||||
|
||||
const std::vector<StreamRequest> &API::GetStreamRequests(
|
||||
const Capabilities &capability) const {
|
||||
return device_->GetStreamRequests(capability);
|
||||
|
||||
@@ -49,6 +49,7 @@ class MYNTEYE_API API {
|
||||
bool Supports(const Stream &stream) const;
|
||||
bool Supports(const Capabilities &capability) const;
|
||||
bool Supports(const Option &option) const;
|
||||
bool Supports(const AddOns &addon) const;
|
||||
|
||||
const std::vector<StreamRequest> &GetStreamRequests(
|
||||
const Capabilities &capability) const;
|
||||
|
||||
@@ -91,6 +91,18 @@ bool Device::Supports(const Option &option) const {
|
||||
return supports.find(option) != supports.end();
|
||||
}
|
||||
|
||||
bool Device::Supports(const AddOns &addon) const {
|
||||
CHECK_NOTNULL(device_info_);
|
||||
auto &&hw_flag = device_info_->hardware_version.flag();
|
||||
switch (addon) {
|
||||
case AddOns::INFRARED:
|
||||
return hw_flag[0];
|
||||
case AddOns::INFRARED2:
|
||||
return hw_flag[1];
|
||||
default: { LOG(FATAL) << "Unknown add-on"; }
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<StreamRequest> &Device::GetStreamRequests(
|
||||
const Capabilities &capability) const {
|
||||
if (!Supports(capability)) {
|
||||
|
||||
@@ -54,6 +54,7 @@ class MYNTEYE_API Device {
|
||||
bool Supports(const Stream &stream) const;
|
||||
bool Supports(const Capabilities &capability) const;
|
||||
bool Supports(const Option &option) const;
|
||||
bool Supports(const AddOns &addon) const;
|
||||
|
||||
const std::vector<StreamRequest> &GetStreamRequests(
|
||||
const Capabilities &capability) const;
|
||||
|
||||
@@ -225,4 +225,9 @@ std::ostream &operator<<(std::ostream &os, const Extrinsics &ex) {
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const OptionInfo &info) {
|
||||
return os << "min: " << info.min << ", max: " << info.max
|
||||
<< ", def: " << info.def;
|
||||
}
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user