GrabBag/App/DroneScrewbolt/DroneScrewCtrlApp/IYDroneScrewCtrlStatus.h

89 lines
2.2 KiB
C
Raw Normal View History

2026-06-26 17:55:15 +08:00
#ifndef IY_DRONESCREWCTRL_STATUS_H
#define IY_DRONESCREWCTRL_STATUS_H
#include <QImage>
#include <QMetaType>
2026-06-26 17:55:15 +08:00
#include <QString>
#include <vector>
/**
* @brief
*/
struct CtrlDetectionBox
{
int classId{0};
float score{0.0f};
int x{0};
int y{0};
int width{0};
int height{0};
2026-07-02 10:57:32 +08:00
bool hasPhysicalHeight{false};
float physicalHeightMm{0.0f};
2026-07-03 14:19:06 +08:00
bool hasStereoMatch{false};
bool trusted{false};
int matchConfidence{1};
QString matchStatus;
int pairId{-1};
int leftIndex{-1};
int rightIndex{-1};
2026-06-26 17:55:15 +08:00
};
/**
* @brief
*/
// Stereo distance result in millimeters.
struct CtrlDetectionDistance
{
int fromId{0};
int toId{0};
float distanceMm{0.0f};
};
struct CtrlDetectionFrame
{
qint64 frameId{0};
qint64 timestampUs{0};
int imageWidth{0};
int imageHeight{0};
std::vector<CtrlDetectionBox> boxes;
std::vector<CtrlDetectionDistance> distances;
bool success{true};
int errorCode{0};
QString message;
2026-07-03 14:19:06 +08:00
bool isFinalResult{false};
double rankScore{0.0};
int rankSampleCount{0};
qint64 saveIndex{0};
2026-06-26 17:55:15 +08:00
};
Q_DECLARE_METATYPE(CtrlDetectionFrame)
2026-06-26 17:55:15 +08:00
/**
* @brief
*/
enum class CtrlWorkStatus
{
Idle = 0, // 闲置
Connecting, // 正在连接
Streaming, // 拉流中
Detecting, // 检测中(推算)
Error, // 错误
};
/**
* @brief Presenter UI
*/
class IYDroneScrewCtrlStatus
{
public:
virtual ~IYDroneScrewCtrlStatus() = default;
virtual void OnRtspFrame(const QImage& frame) = 0;
virtual void OnDetectionResult(const CtrlDetectionFrame& result) = 0;
virtual void OnWorkStatusChanged(CtrlWorkStatus status) = 0;
virtual void OnServerConnectionChanged(bool connected) = 0;
virtual void OnStatusMessage(const QString& msg) = 0;
};
#endif // IY_DRONESCREWCTRL_STATUS_H