39#include "ErrorStatus.h"
40#include "CommonTypes.h"
42#include "ProfilerInfo.h"
49 std::cout <<
"........................................." << std::endl;
50 std::cout <<
"Profiler Model Name: " << profilerInfo.
model << std::endl;
51 std::cout <<
"Controller Serial Number: " << profilerInfo.
controllerSN << std::endl;
52 std::cout <<
"Sensor Serial Number: " << profilerInfo.
sensorSN << std::endl;
53 std::cout <<
"Profiler IP Address: " << profilerInfo.
ipAddress << std::endl;
54 std::cout <<
"Profiler IP Subnet Mask: " << profilerInfo.
subnetMask << std::endl;
55 std::cout <<
"Profiler IP Assignment Method: "
58 std::cout <<
"Hardware Version: "
60 std::cout <<
"Firmware Version: "
62 std::cout <<
"........................................." << std::endl;
63 std::cout << std::endl;
68 std::cout <<
".....Profiler temperatures....." << std::endl;
69 std::cout <<
"Controller CPU: " << std::setprecision(4)
71 std::cout <<
"Sensor CPU: " << std::setprecision(4)
73 std::cout <<
"..............................." << std::endl;
74 std::cout << std::endl;
83 std::cout <<
"Find Mech-Eye 3D Laser Profilers..." << std::endl;
84 std::vector<mmind::eye::ProfilerInfo> profilerInfoList =
87 if (profilerInfoList.empty()) {
88 std::cout <<
"No Mech-Eye 3D Laser Profiler found." << std::endl;
92 for (
int i = 0; i < profilerInfoList.size(); i++) {
93 std::cout <<
"Mech-Eye 3D Laser profiler index : " << i << std::endl;
94 printProfilerInfo(profilerInfoList[i]);
97 std::cout <<
"Please enter the profiler index you want to connect: ";
98 unsigned inputIndex = 0;
103 if (std::regex_match(str.begin(), str.end(), std::regex{
"[0-9]+"}) &&
104 atoi(str.c_str()) < profilerInfoList.size()) {
105 inputIndex = atoi(str.c_str());
108 std::cout <<
"Input invalid! Please enter the profiler index you want to connect: ";
112 status = profiler.
connect(profilerInfoList[inputIndex]);
114 if (!status.
isOK()) {
119 std::cout <<
"Connect Mech-Eye 3D Laser Profiler Successfully." << std::endl;
123inline std::vector<mmind::eye::Profiler> findAndConnectMultiProfiler()
125 std::cout <<
"Find Mech-Eye 3D Laser Profilers..." << std::endl;
126 std::vector<mmind::eye::ProfilerInfo> profilerInfoList =
129 if (profilerInfoList.empty()) {
130 std::cout <<
"No Mech-Eye 3D Laser Profilers found." << std::endl;
134 for (
int i = 0; i < profilerInfoList.size(); i++) {
135 std::cout <<
"Mech-Eye 3D Laser Profiler index : " << i << std::endl;
136 printProfilerInfo(profilerInfoList[i]);
140 std::set<unsigned> indices;
143 std::cout <<
"Please enter the device index you want to connect: " << std::endl;
144 std::cout <<
"Enter the character 'c' to terminate adding devices" << std::endl;
149 if (std::regex_match(str.begin(), str.end(), std::regex{
"[0-9]+"}) &&
150 atoi(str.c_str()) < profilerInfoList.size())
151 indices.insert(atoi(str.c_str()));
153 std::cout <<
"Input invalid. Please enter the device index you want to connect: ";
156 std::vector<mmind::eye::Profiler> profilerList{};
158 auto iter = indices.cbegin();
159 for (
int i = 0; i < indices.size(); ++i, ++iter) {
161 auto status = profiler.
connect(profilerInfoList[*iter]);
163 profilerList.push_back(profiler);
171inline bool confirmCapture()
173 std::cout <<
"Do you want the profiler to capture image? Please input y/n to confirm: "
176 std::string confirmStr;
177 std::cin >> confirmStr;
178 if (confirmStr ==
"y") {
180 }
else if (confirmStr ==
"n") {
181 std::cout <<
"program ends!" << std::endl;
184 std::cout <<
"Please input y/n again!" << std::endl;
Operates the laser profiler. Use Profiler::connect to connect an available laser profiler,...
static std::vector< ProfilerInfo > discoverProfilers()
Discovers all available laser profilers, and returns the laser profiler information list....
ErrorStatus connect(const ProfilerInfo &info, unsigned int timeoutMs=5000)
Connects to a laser profiler via ProfilerInfo.
std::string toString() const
Converts a Version object to a string.
Describes the types of errors.
bool isOK() const
Returns true if the operation succeeded.
Describes the laser profiler information.
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
The IP subnet mask of the laser profiler.
IpAssignmentMethod ipAssignmentMethod
The IP address assignment method of the laser profiler.
std::string model
The laser profiler model.
std::string controllerSN
The controller serial number.
std::string sensorSN
The sensor serial number.
std::string ipAddress
The IP address of the laser profiler.
Describes the laser profiler's statuses.
float controllerCpuTemperature
The temperature (in °C) of the controller CPU.
float sensorCpuTemperature
The temperature (in °C) of the FPGA.