Mech-Eye API 2.4.0
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
53
58{
59 ProfilerTemperature temperature;
60};
61
67class MMIND_API_EXPORT Profiler
68{
69public:
76 using AcquisitionCallback = std::function<void(const ProfileBatch& batch, void* pUser)>;
81
86
90 Profiler(const Profiler& other) noexcept;
91
95 Profiler& operator=(const Profiler& other) noexcept;
96
103 static std::vector<ProfilerInfo> discoverProfilers();
104
121 ErrorStatus connect(const ProfilerInfo& info, unsigned int timeoutMs = 5000);
122
138 ErrorStatus saveVirtualDeviceFile(const ProfileBatch& data, const std::string& filePath);
139
155 ErrorStatus connect(const std::string& ipAddress, unsigned int timeoutMs = 5000);
156
168
180 ErrorStatus setHeartbeatInterval(unsigned int intervalMs);
181
193
203
212
221
241 ErrorStatus retrieveBatchData(ProfileBatch& batch, int timeoutMs = 4000) const;
242
256
276
289
303
314 ErrorStatus setOutputForGPIO(OutputLineGPIO outputLine, OutputLevel value);
315
326 ErrorStatus getAcquisitionStatus(AcquisitionStatus& status);
327
328private:
329 friend class ProfilerEvent;
330 friend class InternalInterfaces;
331 std::shared_ptr<ProfilerImpl> _d;
332};
333
334} // namespace eye
335
336} // 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:68
std::function< void(const ProfileBatch &batch, void *pUser)> AcquisitionCallback
The type of callback function.
Definition Profiler.h:76
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....
ErrorStatus getProfilerStatus(ProfilerStatus &status) const
Gets various statuses of the laser profiler.
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.
Describes the laser profiler's statuses.
Definition Profiler.h:58
Describes the laser profiler temperatures.
Definition Profiler.h:49
float controllerCpuTemperature
The temperature (in °C) of the controller CPU.
Definition Profiler.h:50
float sensorCpuTemperature
The temperature (in °C) of the FPGA.
Definition Profiler.h:51