refactor(device): merge device_s210a to device_s2
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
#include "mynteye/device/motions.h"
|
||||
#include "mynteye/device/standard/device_s.h"
|
||||
#include "mynteye/device/standard2/device_s2.h"
|
||||
#include "mynteye/device/standard2/device_s210a.h"
|
||||
#include "mynteye/device/streams.h"
|
||||
#include "mynteye/device/types.h"
|
||||
#include "mynteye/util/strings.h"
|
||||
@@ -104,7 +103,6 @@ std::shared_ptr<Device> Device::Create(
|
||||
if (name == "MYNTEYE") {
|
||||
return std::make_shared<StandardDevice>(device);
|
||||
} else if (strings::starts_with(name, "MYNT-EYE-")) {
|
||||
// TODO(JohnZhao): Create different device by name, such as MYNT-EYE-S1000
|
||||
std::string model_s = name.substr(9, 5);
|
||||
VLOG(2) << "MYNE EYE Model: " << model_s;
|
||||
DeviceModel model(model_s);
|
||||
@@ -113,9 +111,9 @@ std::shared_ptr<Device> Device::Create(
|
||||
return std::make_shared<StandardDevice>(device);
|
||||
} else if (model.generation == '2') {
|
||||
if (model.custom_code == '0') {
|
||||
return std::make_shared<Standard2Device>(device);
|
||||
return std::make_shared<Standard2Device>(Model::STANDARD2, device);
|
||||
} else if (model.custom_code == 'A') {
|
||||
return std::make_shared<Standard210aDevice>(device);
|
||||
return std::make_shared<Standard2Device>(Model::STANDARD210A, device);
|
||||
} else {
|
||||
LOG(FATAL) << "No such custom code now";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user