DiagnosisPage.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // *****************************************************************************
  2. // 版权所有(C)2023~2099 上海骄成超声波技术有限公司
  3. // 保留所有权利
  4. // *****************************************************************************
  5. // 作者 : 杨坚
  6. // 版本 : 1.0
  7. // 功能说明:
  8. // 诊断页面
  9. // *****************************************************************************
  10. #ifndef __DIAGNOSISPAGE_H__
  11. #define __DIAGNOSISPAGE_H__ 1
  12. #include <QWidget>
  13. #include <QPointer>
  14. #include "QStandardItemModel"
  15. #include "ui_DiagnosisPage.h"
  16. #include "CViewInterface.h"
  17. class DiagnosisPage : public QWidget
  18. {
  19. Q_OBJECT
  20. public:
  21. DiagnosisPage(QWidget *parent = nullptr);
  22. ~DiagnosisPage();
  23. private:
  24. void Init();
  25. /**切换操作轴页面
  26. */
  27. void SwitchOperationAxisPage(bool isSwitch);
  28. /**
  29. * @brief 绘制父节点到子节点的“拐角线”
  30. * @param childIndex 子节点索引
  31. * @param painter QPainter 引用
  32. */
  33. void drawParentChildLine(const QModelIndex& childIndex, QPainter& painter);
  34. /**
  35. * @brief 兄弟节点之间的竖线连接
  36. * @param childIndex 当前节点索引
  37. * @param painter QPainter 引用
  38. */
  39. void drawSiblingLine(const QModelIndex& childIndex, QPainter& painter);
  40. void paintAllBranches(const QModelIndex& parentIndex, QPainter& painter);
  41. void uncheckAllItems(const QModelIndex& parent = QModelIndex());
  42. private:
  43. void timerEvent(QTimerEvent* event) override;
  44. bool eventFilter(QObject* watched, QEvent* event) override;
  45. private slots:
  46. void on_axisListTree_doubleClicked(const QModelIndex& index);
  47. void on_xAxisDisable_clicked();
  48. void on_xAxisHomeBut_clicked();
  49. void on_setPosBut_clicked();
  50. void on_setNegBut_clicked();
  51. void on_setSpeedBut_clicked();
  52. void on_retBut_clicked();
  53. private:
  54. Ui::DiagnosisPageClass ui;
  55. /**树指针
  56. */
  57. QStandardItemModel* m_model = nullptr;
  58. /**所有轴指针
  59. */
  60. std::vector<CAxis*> m_veCAxis;
  61. /**当前轴指针
  62. */
  63. //std::unique_ptr<CAxis> m_pCurrOpenCAxis;
  64. QSharedPointer<CAxis> m_pCurrOpenCAxis;
  65. /**使能
  66. */
  67. bool m_IsDriveEnabled = false;
  68. /**定时获取位置
  69. */
  70. int m_nTimerID = -1;
  71. };
  72. #endif //__DIAGNOSISPAGE_H__