Mech-Eye API 2.2.1
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Profiler.h
1#pragma once
2#include <memory>
3#include <functional>
4#include "api_global.h"
5#include "ProfilerInfo.h"
6#include "ProfileData.h"
7#include "UserSetManager.h"
8#include "UserSet.h"
9
10namespace mmind {
11
12namespace eye {
13
14class ProfilerImpl;
18enum class OutputLineGPIO {
19 Line21 = 0,
20 Line22,
21 Line23,
22 Line24,
23 Line25,
24 Line26,
25 Line27,
26 Line28,
27};
28
32enum class OutputLevel { Low, High };
36enum class AcquisitionStatus {
37 AcquisitionTriggerWait,
38 AcquisitionActive,
39 FrameTriggerWait,
41 FrameActive,
43};
44
50class MMIND_API_EXPORT Profiler
51{
52public:
59 using AcquisitionCallback = std::function<void(const ProfileBatch& batch, void* pUser)>;
64
69
73 Profiler(const Profiler& other) noexcept;
74
78 Profiler& operator=(const Profiler& other) noexcept;
79
86 static std::vector<ProfilerInfo> discoverProfilers();
87
104 ErrorStatus connect(const ProfilerInfo& info, unsigned int timeoutMs = 5000);
105
121 ErrorStatus connect(const std::string& ipAddress, unsigned int timeoutMs = 5000);
122
134
146 ErrorStatus setHeartbeatInterval(unsigned int intervalMs);
147
159
168
177
197 ErrorStatus retrieveBatchData(ProfileBatch& batch, int timeoutMs = 4000) const;
198
212
231
244
258
269 ErrorStatus setOutputForGPIO(OutputLineGPIO outputLine, OutputLevel value);
270
281 ErrorStatus getAcquisitionStatus(AcquisitionStatus& status);
282
283private:
284 friend class ProfilerEvent;
285 std::shared_ptr<ProfilerImpl> _d;
286};
287
288} // namespace eye
289
290} // namespace mmind
Represents a batch of profiles, which can be obtained by calling Profiler::retrieveBatchData()....
Definition ProfileData.h:30
Describes the event of profiler. Use ProfilerEvent::registerProfilerEventCallback to register an even...
Operates the laser profiler. Use Profiler::connect to connect an available laser profiler,...
Definition Profiler.h:51
std::function< void(const ProfileBatch &batch, void *pUser)> AcquisitionCallback
The type of callback function.
Definition Profiler.h:59
ErrorStatus retrieveBatchData(ProfileBatch &batch, int timeoutMs=4000) const
Retrieves a batch of the profiles in scan mode. There are two ways to retrieve profile data,...
ErrorStatus registerAcquisitionCallback(const Profiler::AcquisitionCallback &func, void *pUser)
Registers the callback function for data acquisition. The function only needs to be called when profi...
UserSetManager & userSetManager()
Gets the UserSetManager of the laser profiler. UserSetManager provides various operations to manage a...
ErrorStatus disconnect()
Disconnects from the current laser profiler and releases the associated resources.
ErrorStatus setHeartbeatInterval(unsigned int intervalMs)
Sets the time interval at which the client sends periodic heartbeat messages to the profiler side....
Profiler(const Profiler &other) noexcept
Copy constructor.
UserSet & currentUserSet()
Gets the UserSet currently in effect of the laser profiler. UserSet can access all available paramete...
~Profiler()
Destructor.
ErrorStatus triggerSoftware()
Sends a software signal to trigger data acquisition. This method is used when no external signals are...
ErrorStatus getAcquisitionStatus(AcquisitionStatus &status)
Gets the acquisition status.
static std::vector< ProfilerInfo > discoverProfilers()
Discovers all available laser profilers, and returns the laser profiler information list....
ErrorStatus getProfilerInfo(ProfilerInfo &info) const
Gets the basic information of the laser profiler, such as model, serial number, firmware version,...
ErrorStatus setOutputForGPIO(OutputLineGPIO outputLine, OutputLevel value)
Sets controller GPIO output value.
ErrorStatus stopAcquisition()
Exits the laser profiler from the data acquisition status, and then it can not accept trigger signals...
ErrorStatus connect(const std::string &ipAddress, unsigned int timeoutMs=5000)
Connects to a laser profiler via IP address.
ErrorStatus connect(const ProfilerInfo &info, unsigned int timeoutMs=5000)
Connects to a laser profiler via ProfilerInfo.
Profiler()
Constructor.
ErrorStatus startAcquisition()
Enters the laser profiler into the data acquisition status, where it can accept trigger signals....
Profiler & operator=(const Profiler &other) noexcept
Copy assignment.
Manages device user sets.
Describes the types of errors.
Definition ErrorStatus.h:12
Describes the laser profiler information.