123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- // *****************************************************************************
- // 版权所有(C)2023~2099 上海骄成超声波技术有限公司
- // 保留所有权利
- // *****************************************************************************
- // 作者 : 杨坚
- // 版本 : 1.0
- // 功能说明:
- // 诊断页面
- // *****************************************************************************
- #ifndef __DIAGNOSISPAGE_H__
- #define __DIAGNOSISPAGE_H__ 1
- #include <QWidget>
- #include <QPointer>
- #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<CAxis*> m_veCAxis;
- /**当前轴指针
- */
- //std::unique_ptr<CAxis> m_pCurrOpenCAxis;
- QSharedPointer<CAxis> m_pCurrOpenCAxis;
- /**使能
- */
- bool m_IsDriveEnabled = false;
- /**定时获取位置
- */
- int m_nTimerID = -1;
- };
- #endif //__DIAGNOSISPAGE_H__
|