37#include "ErrorStatus.h"
38#include "CommonTypes.h"
40#include "ProfilerInfo.h"
49 std::cout <<
"Error Code : " << status.
errorCode
56inline bool isNumber(
const std::string& str)
59 if (it <
'0' || it >
'9')
70 std::cout <<
"........................................." << std::endl;
71 std::cout <<
"Profiler Model Name: " << profilerInfo.
model << std::endl;
72 std::cout <<
"Controller Serial Number: " << profilerInfo.
controllerSN << std::endl;
73 std::cout <<
"Sensor Head Serial Number: " << profilerInfo.
sensorSN << std::endl;
74 std::cout <<
"Profiler IP Address: " << profilerInfo.
ipAddress << std::endl;
75 std::cout <<
"Profiler IP Subnet Mask: " << profilerInfo.
subnetMask << std::endl;
76 std::cout <<
"Profiler IP Assignment Method: "
79 std::cout <<
"Hardware Version: "
81 std::cout <<
"Firmware Version: "
83 std::cout <<
"........................................." << std::endl;
84 std::cout << std::endl;
92 std::cout <<
"Find Mech-Eye 3D Laser Profilers..." << std::endl;
93 std::vector<mmind::eye::ProfilerInfo> profilerInfoList =
96 if (profilerInfoList.empty()) {
97 std::cout <<
"No Mech-Eye 3D Laser Profiler found." << std::endl;
101 for (
int i = 0; i < profilerInfoList.size(); i++) {
102 std::cout <<
"Mech-Eye 3D Laser profiler index : " << i << std::endl;
103 printProfilerInfo(profilerInfoList[i]);
106 std::cout <<
"Please enter the profiler index you want to connect: ";
107 unsigned inputIndex = 0;
112 if (isNumber(str) && atoi(str.c_str()) < profilerInfoList.size()) {
113 inputIndex = atoi(str.c_str());
116 std::cout <<
"Input invalid! Please enter the profiler index you want to connect: ";
120 status = profiler.
connect(profilerInfoList[inputIndex]);
122 if (!status.
isOK()) {
127 std::cout <<
"Connect Mech-Eye 3D Laser Profiler Successfully." << std::endl;
131inline bool confirmCapture()
133 std::cout <<
"Do you want the profiler to capture image ? Please input y/n to confirm: "
136 std::string confirmStr;
137 std::cin >> confirmStr;
138 if (confirmStr ==
"y") {
140 }
else if (confirmStr ==
"n") {
141 std::cout <<
"program ends!" << std::endl;
144 std::cout <<
"Please input y/n again!" << std::endl;
Represents a Mech-Eye 3D Laser Profiler device.
static MMIND_API_EXPORT std::vector< ProfilerInfo > discoverProfilers()
Discovers all available laser profilers.
MMIND_API_EXPORT ErrorStatus connect(const ProfilerInfo &info, unsigned int timeoutMs=5000)
Connects to a laser profiler by its information.
std::string toString() const
Converts a Version object to string.
std::string errorDescription
bool isOK() const
Returns true if the operation succeeded.
The information of the laser profiler.
Version hardwareVersion
The version of the hardware. The hardware cannot be upgraded.
Version firmwareVersion
The version of the firmware. The firmware can be upgraded.
std::string subnetMask
Subnet mask.
IpAssignmentMethod ipAssignmentMethod
IP address assignment method.
std::string model
Laser profiler model.
std::string controllerSN
Controller serial number.
std::string sensorSN
Sensor head serial number.
std::string ipAddress
IP address of the laser profiler.