2025-09-14 14:51:38 +08:00
|
|
|
|
#ifndef IYLAPWELDSTATUS_H
|
|
|
|
|
|
#define IYLAPWELDSTATUS_H
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
#include <QImage>
|
2025-06-22 14:08:15 +08:00
|
|
|
|
#include <QMetaType>
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 使用 AppCommon 提供的通用接口和类型
|
|
|
|
|
|
#include "IVisionApplicationStatus.h"
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 使用 AppCommon 的 WorkStatus 枚举
|
|
|
|
|
|
// WorkStatus, WorkStatusToString 已在 IVisionApplicationStatus.h 中定义
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 搭接焊位置结构体(继承自 PositionData 模板)
|
|
|
|
|
|
struct LapWeldPosition : public PositionData<double> {
|
2025-06-22 14:08:15 +08:00
|
|
|
|
// 默认构造函数
|
2025-11-09 21:01:51 +08:00
|
|
|
|
LapWeldPosition() : PositionData<double>() {}
|
|
|
|
|
|
|
|
|
|
|
|
// 带参构造函数
|
|
|
|
|
|
LapWeldPosition(double _x, double _y, double _z, double _roll, double _pitch, double _yaw)
|
|
|
|
|
|
: PositionData<double>(_x, _y, _z, _roll, _pitch, _yaw) {}
|
|
|
|
|
|
|
|
|
|
|
|
// 拷贝构造函数和赋值运算符
|
2025-09-14 14:51:38 +08:00
|
|
|
|
LapWeldPosition(const LapWeldPosition&) = default;
|
|
|
|
|
|
LapWeldPosition& operator=(const LapWeldPosition&) = default;
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 从 PositionData 拷贝构造
|
|
|
|
|
|
LapWeldPosition(const PositionData<double>& pos)
|
|
|
|
|
|
: PositionData<double>(pos) {}
|
|
|
|
|
|
};
|
2025-06-28 23:06:09 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 检测结果结构体(继承自 DetectionResultData 模板)
|
|
|
|
|
|
struct DetectionResult : public DetectionResultData<LapWeldPosition> {
|
|
|
|
|
|
// 默认构造函数
|
|
|
|
|
|
DetectionResult() = default;
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 拷贝构造函数和赋值运算符
|
|
|
|
|
|
DetectionResult(const DetectionResult&) = default;
|
|
|
|
|
|
DetectionResult& operator=(const DetectionResult&) = default;
|
2025-06-08 12:48:04 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 状态回调接口(继承自 IVisionApplicationStatus 模板)
|
|
|
|
|
|
// 使用 AppCommon 提供的通用接口,无需重复定义回调方法
|
|
|
|
|
|
class IYLapWeldStatus : public IVisionApplicationStatus<DetectionResult>
|
2025-09-14 14:51:38 +08:00
|
|
|
|
{
|
2025-06-08 12:48:04 +08:00
|
|
|
|
public:
|
2025-09-14 14:51:38 +08:00
|
|
|
|
virtual ~IYLapWeldStatus() = default;
|
2025-06-08 12:48:04 +08:00
|
|
|
|
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// 所有回调方法已由 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)
|
2025-06-08 12:48:04 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-06-22 14:08:15 +08:00
|
|
|
|
// 声明Qt元类型,使这些结构体能够在信号槽中传递
|
2025-09-14 14:51:38 +08:00
|
|
|
|
Q_DECLARE_METATYPE(LapWeldPosition)
|
2025-06-22 14:08:15 +08:00
|
|
|
|
Q_DECLARE_METATYPE(DetectionResult)
|
2025-11-09 21:01:51 +08:00
|
|
|
|
// WorkStatus 已在 IVisionApplicationStatus.h 中声明
|
2025-06-22 14:08:15 +08:00
|
|
|
|
|
2025-09-14 14:51:38 +08:00
|
|
|
|
#endif // IYLAPWELDSTATUS_H
|