// ***************************************************************************** // 版权所有(C)2023~2099 上海骄成超声波技术有限公司 // 保留所有权利 // ***************************************************************************** // 作者 : 杨坚 // 版本 : 1.0 // 功能说明: // 诊断页面 // ***************************************************************************** #ifndef __DIAGNOSISPAGE_H__ #define __DIAGNOSISPAGE_H__ 1 #include #include #include "QStandardItemModel" #include "ui_DiagnosisPage.h" #include "CViewInterface.h" class DiagnosisPage : public QWidget { Q_OBJECT public: DiagnosisPage(QWidget *parent = nullptr); ~DiagnosisPage(); private: void Init(); /**切换操作轴页面 */ void SwitchOperationAxisPage(bool isSwitch); /** * @brief 绘制父节点到子节点的“拐角线” * @param childIndex 子节点索引 * @param painter QPainter 引用 */ void drawParentChildLine(const QModelIndex& childIndex, QPainter& painter); /** * @brief 兄弟节点之间的竖线连接 * @param childIndex 当前节点索引 * @param painter QPainter 引用 */ void drawSiblingLine(const QModelIndex& childIndex, QPainter& painter); void paintAllBranches(const QModelIndex& parentIndex, QPainter& painter); void uncheckAllItems(const QModelIndex& parent = QModelIndex()); private: void timerEvent(QTimerEvent* event) override; bool eventFilter(QObject* watched, QEvent* event) override; private slots: void on_axisListTree_doubleClicked(const QModelIndex& index); void on_xAxisDisable_clicked(); void on_xAxisHomeBut_clicked(); void on_setPosBut_clicked(); void on_setNegBut_clicked(); void on_setSpeedBut_clicked(); void on_retBut_clicked(); private: Ui::DiagnosisPageClass ui; /**树指针 */ QStandardItemModel* m_model = nullptr; /**所有轴指针 */ std::vector m_veCAxis; /**当前轴指针 */ //std::unique_ptr m_pCurrOpenCAxis; QSharedPointer m_pCurrOpenCAxis; /**使能 */ bool m_IsDriveEnabled = false; /**定时获取位置 */ int m_nTimerID = -1; }; #endif //__DIAGNOSISPAGE_H__