Mech-Eye API 2.3.3
API reference documentation for Mech-Eye 3D Laser Profiler
Loading...
Searching...
No Matches
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 saveVirtualDeviceFile(const ProfileBatch& data, const std::string& filePath);
122
138 ErrorStatus connect(const std::string& ipAddress, unsigned int timeoutMs = 5000);
139
151
163 ErrorStatus setHeartbeatInterval(unsigned int intervalMs);
164
176
185
194
214 ErrorStatus retrieveBatchData(ProfileBatch& batch, int timeoutMs = 4000) const;
215
229
249
262
276
287 ErrorStatus setOutputForGPIO(OutputLineGPIO outputLine, OutputLevel value);
288
299 ErrorStatus getAcquisitionStatus(AcquisitionStatus& status);
300
301private:
302 friend class ProfilerEvent;
303 friend class InternalInterfaces;
304 std::shared_ptr<ProfilerImpl> _d;
305};
306
307} // namespace eye
308
309} // 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. There are two ways to retrieve profile data, by polling or callbac...
ErrorStatus registerAcquisitionCallback(const Profiler::AcquisitionCallback &func, void *pUser)
Registers the callback function for data acquisition. There are two ways to retrieve profile data,...
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...
ErrorStatus saveVirtualDeviceFile(const ProfileBatch &data, const std::string &filePath)
Saves the acquired ProfileBatch data collected, Parameter s, and ProfilerInfo in an MRAW format file ...
~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 acquisition ready status to avoid accidental triggering of scanning...
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 acquisition ready status, where it can accept trigger signals for ...
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.