68 lines
2.3 KiB
C++
68 lines
2.3 KiB
C++
#ifndef IYLAPWELDSTATUS_H
|
||
#define IYLAPWELDSTATUS_H
|
||
|
||
#include <string>
|
||
#include <functional>
|
||
#include <vector>
|
||
#include <QImage>
|
||
#include <QMetaType>
|
||
|
||
// 使用 AppCommon 提供的通用接口和类型
|
||
#include "IVisionApplicationStatus.h"
|
||
|
||
// 使用 AppCommon 的 WorkStatus 枚举
|
||
// WorkStatus, WorkStatusToString 已在 IVisionApplicationStatus.h 中定义
|
||
|
||
// 搭接焊位置结构体(继承自 PositionData 模板)
|
||
struct LapWeldPosition : public PositionData<double> {
|
||
// 默认构造函数
|
||
LapWeldPosition() : PositionData<double>() {}
|
||
|
||
// 带参构造函数
|
||
LapWeldPosition(double _x, double _y, double _z, double _roll, double _pitch, double _yaw)
|
||
: PositionData<double>(_x, _y, _z, _roll, _pitch, _yaw) {}
|
||
|
||
// 拷贝构造函数和赋值运算符
|
||
LapWeldPosition(const LapWeldPosition&) = default;
|
||
LapWeldPosition& operator=(const LapWeldPosition&) = default;
|
||
|
||
// 从 PositionData 拷贝构造
|
||
LapWeldPosition(const PositionData<double>& pos)
|
||
: PositionData<double>(pos) {}
|
||
};
|
||
|
||
// 检测结果结构体(继承自 DetectionResultData 模板)
|
||
struct DetectionResult : public DetectionResultData<LapWeldPosition> {
|
||
// 默认构造函数
|
||
DetectionResult() = default;
|
||
|
||
// 拷贝构造函数和赋值运算符
|
||
DetectionResult(const DetectionResult&) = default;
|
||
DetectionResult& operator=(const DetectionResult&) = default;
|
||
};
|
||
|
||
// 状态回调接口(继承自 IVisionApplicationStatus 模板)
|
||
// 使用 AppCommon 提供的通用接口,无需重复定义回调方法
|
||
class IYLapWeldStatus : public IVisionApplicationStatus<DetectionResult>
|
||
{
|
||
public:
|
||
virtual ~IYLapWeldStatus() = default;
|
||
|
||
// 所有回调方法已由 IVisionApplicationStatus 定义:
|
||
// - OnStatusUpdate(const std::string& statusMessage)
|
||
// - OnDetectionResult(const DetectionResult& result)
|
||
// - OnCamera1StatusChanged(bool isConnected)
|
||
// - OnCamera2StatusChanged(bool isConnected)
|
||
// - OnRobotConnectionChanged(bool isConnected)
|
||
// - OnSerialConnectionChanged(bool isConnected)
|
||
// - OnCameraCountChanged(int cameraCount)
|
||
// - OnWorkStatusChanged(WorkStatus status)
|
||
};
|
||
|
||
// 声明Qt元类型,使这些结构体能够在信号槽中传递
|
||
Q_DECLARE_METATYPE(LapWeldPosition)
|
||
Q_DECLARE_METATYPE(DetectionResult)
|
||
// WorkStatus 已在 IVisionApplicationStatus.h 中声明
|
||
|
||
#endif // IYLAPWELDSTATUS_H
|