#ifndef CALIBDATAWIDGET_H #define CALIBDATAWIDGET_H #include #include #include #include #include #include #include #include #include #include "HandEyeCalibTypes.h" /** * @brief 标定数据输入控件 * 支持 Eye-To-Hand、Eye-In-Hand 和 TCP 三种模式的数据输入 */ class CalibDataWidget : public QWidget { Q_OBJECT public: explicit CalibDataWidget(QWidget* parent = nullptr); ~CalibDataWidget() override; /** * @brief 获取 Eye-To-Hand 标定数据 */ void getEyeToHandData(std::vector& eyePoints, std::vector& robotPoints) const; /** * @brief 获取 Eye-In-Hand 标定数据 */ void getEyeInHandData(std::vector& calibData) const; /** * @brief 获取当前标定模式 */ HECCalibrationType getCalibType() const; /** * @brief 清除所有数据 */ void clearAll(); /** * @brief 供外部设置机械臂数据到输入框(根据当前模式自动填充) */ void setRobotInput(double x, double y, double z, double rx, double ry, double rz); /** * @brief 供外部设置相机数据到输入框(Eye-To-Hand 模式) */ void setCameraInput(double x, double y, double z, double rx, double ry, double rz); /** * @brief 获取 TCP 标定输入数据 */ HECTCPCalibData getTCPCalibData() const; signals: /** * @brief 标定模式改变信号 */ void calibTypeChanged(HECCalibrationType type); /** * @brief 请求 Eye-To-Hand 标定 */ void requestEyeToHandCalib(); /** * @brief 请求 Eye-In-Hand 标定 */ void requestEyeInHandCalib(); /** * @brief 请求 TCP 标定 */ void requestTCPCalib(); private slots: /** * @brief 标定模式切换 */ void onCalibTypeChanged(int index); /** * @brief TCP 模式切换(3-DOF / 6-DOF) */ void onTCPModeChanged(int index); /** * @brief TCP 添加行 */ void onTCPAddRow(); /** * @brief TCP 删除行 */ void onTCPRemoveRow(); private: /** * @brief 初始化界面 */ void setupUI(); /** * @brief 创建 Eye-To-Hand 数据表格 */ QWidget* createEyeToHandGroup(); /** * @brief 创建 Eye-In-Hand 数据表格 */ QWidget* createEyeInHandGroup(); /** * @brief 创建 TCP 标定数据组 */ QWidget* createTCPCalibGroup(); /** * @brief 更新表格显示 */ void updateTableVisibility(); // 标定模式选择 QComboBox* m_cbCalibType; // Eye-To-Hand 数据表格 QTableWidget* m_tableEyeToHand; QWidget* m_groupEyeToHand; // Eye-In-Hand 数据表格 QTableWidget* m_tableEyeInHand; QWidget* m_groupEyeInHand; // Eye-To-Hand 内联按钮 QPushButton* m_btnEyeToHandAddRow; QPushButton* m_btnEyeToHandDeleteRow; QPushButton* m_btnEyeToHandCalib; // Eye-In-Hand 内联按钮 QPushButton* m_btnEyeInHandAddRow; QPushButton* m_btnEyeInHandDeleteRow; QPushButton* m_btnEyeInHandCalib; // TCP 标定相关 QWidget* m_groupTCPCalib; QTableWidget* m_tableTCP; QComboBox* m_tcpModeCombo; QComboBox* m_tcpEulerOrderCombo; QSpinBox* m_tcpRefPoseIndex; QDoubleSpinBox* m_tcpWorldRx; QDoubleSpinBox* m_tcpWorldRy; QDoubleSpinBox* m_tcpWorldRz; QGroupBox* m_tcpOrientationGroup; QPushButton* m_tcpAddRowBtn; QPushButton* m_tcpRemoveRowBtn; QPushButton* m_btnTCPCalib; // Eye-To-Hand 输入框 QDoubleSpinBox* m_inputEyeX; QDoubleSpinBox* m_inputEyeY; QDoubleSpinBox* m_inputEyeZ; QDoubleSpinBox* m_inputRobotX; QDoubleSpinBox* m_inputRobotY; QDoubleSpinBox* m_inputRobotZ; QPushButton* m_btnEyeToHandAddInput; // Eye-In-Hand 输入框 QDoubleSpinBox* m_inputEndX; QDoubleSpinBox* m_inputEndY; QDoubleSpinBox* m_inputEndZ; QDoubleSpinBox* m_inputEndRoll; QDoubleSpinBox* m_inputEndPitch; QDoubleSpinBox* m_inputEndYaw; QDoubleSpinBox* m_inputCamX; QDoubleSpinBox* m_inputCamY; QDoubleSpinBox* m_inputCamZ; QPushButton* m_btnEyeInHandAddInput; // TCP 输入框 QDoubleSpinBox* m_inputTcpX; QDoubleSpinBox* m_inputTcpY; QDoubleSpinBox* m_inputTcpZ; QDoubleSpinBox* m_inputTcpRx; QDoubleSpinBox* m_inputTcpRy; QDoubleSpinBox* m_inputTcpRz; QPushButton* m_btnTcpAddInput; }; #endif // CALIBDATAWIDGET_H