#ifndef IY_DRONESCREWCTRL_STATUS_H #define IY_DRONESCREWCTRL_STATUS_H #include #include #include #include /** * @brief 单个检测目标 */ struct CtrlDetectionBox { int classId{0}; float score{0.0f}; int x{0}; int y{0}; int width{0}; int height{0}; bool hasPhysicalHeight{false}; float physicalHeightMm{0.0f}; }; /** * @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 boxes; std::vector distances; bool success{true}; int errorCode{0}; QString message; }; Q_DECLARE_METATYPE(CtrlDetectionFrame) /** * @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