style(api): change sdk version api

This commit is contained in:
TinyOh 2019-03-01 16:25:59 +08:00
parent 2896e00acf
commit 3b22fa3abc
5 changed files with 19 additions and 22 deletions

View File

@ -187,7 +187,10 @@ class MYNTEYE_API API {
* Get the device info. * Get the device info.
*/ */
std::string GetInfo(const Info &info) const; std::string GetInfo(const Info &info) const;
/**
* Get the sdk version.
*/
std::string GetSDKVersion() const;
/** /**
* @deprecated Get the intrinsics (pinhole) of stream. * @deprecated Get the intrinsics (pinhole) of stream.
*/ */

View File

@ -126,8 +126,6 @@ enum class Info : std::uint8_t {
AUXILIARY_CHIP_VERSION, AUXILIARY_CHIP_VERSION,
/** Isp version */ /** Isp version */
ISP_VERSION, ISP_VERSION,
/** SDK version*/
SDK_VERSION,
/** Last guard */ /** Last guard */
LAST LAST
}; };

View File

@ -328,7 +328,10 @@ std::shared_ptr<DeviceInfo> API::GetInfo() const {
} }
std::string API::GetInfo(const Info &info) const { std::string API::GetInfo(const Info &info) const {
if (info == Info::SDK_VERSION) { return device_->GetInfo(info);
}
std::string API::GetSDKVersion() const {
std::string info_path = std::string info_path =
utils::get_sdk_install_dir(); utils::get_sdk_install_dir();
info_path.append(MYNTEYE_OS_SEP "share" \ info_path.append(MYNTEYE_OS_SEP "share" \
@ -340,9 +343,6 @@ std::string API::GetInfo(const Info &info) const {
return "null"; return "null";
} }
return fs["MYNTEYE_VERSION"]; return fs["MYNTEYE_VERSION"];
}
return device_->GetInfo(info);
} }
IntrinsicsPinhole API::GetIntrinsics(const Stream &stream) const { IntrinsicsPinhole API::GetIntrinsics(const Stream &stream) const {

View File

@ -385,8 +385,6 @@ void Synthetic::InitProcessors() {
processors_.push_back(points_processor); processors_.push_back(points_processor);
processors_.push_back(depth_processor); processors_.push_back(depth_processor);
using namespace std::placeholders; // NOLINT using namespace std::placeholders; // NOLINT
root_processor->SetProcessCallback(
std::bind(&Synthetic::OnDeviceProcess, this, _1, _2, _3));
rectify_processor->SetProcessCallback( rectify_processor->SetProcessCallback(
std::bind(&Synthetic::OnRectifyProcess, this, _1, _2, _3)); std::bind(&Synthetic::OnRectifyProcess, this, _1, _2, _3));
disparity_processor->SetProcessCallback( disparity_processor->SetProcessCallback(
@ -398,8 +396,6 @@ void Synthetic::InitProcessors() {
depth_processor->SetProcessCallback( depth_processor->SetProcessCallback(
std::bind(&Synthetic::OnDepthProcess, this, _1, _2, _3)); std::bind(&Synthetic::OnDepthProcess, this, _1, _2, _3));
root_processor->SetPostProcessCallback(
std::bind(&Synthetic::OnDevicePostProcess, this, _1));
rectify_processor->SetPostProcessCallback( rectify_processor->SetPostProcessCallback(
std::bind(&Synthetic::OnRectifyPostProcess, this, _1)); std::bind(&Synthetic::OnRectifyPostProcess, this, _1));
disparity_processor->SetPostProcessCallback( disparity_processor->SetPostProcessCallback(

View File

@ -113,7 +113,7 @@ STATUS_UNIT checkUnit(const std::string& sdkv,
} }
bool checkFirmwareVersion(const std::shared_ptr<API> api) { bool checkFirmwareVersion(const std::shared_ptr<API> api) {
auto sdkv = api->GetInfo(Info::SDK_VERSION); auto sdkv = api->GetSDKVersion();
auto devn = api->GetInfo(Info::DEVICE_NAME); auto devn = api->GetInfo(Info::DEVICE_NAME);
auto firmv = api->GetInfo(Info::FIRMWARE_VERSION); auto firmv = api->GetInfo(Info::FIRMWARE_VERSION);