EvalSchemeWidget.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef EVALSCHEMEWIDGET_H
  2. #define EVALSCHEMEWIDGET_H
  3. #include "EvalWidget.h"
  4. #include <QMap>
  5. class CSchemeView;
  6. class PushButton;
  7. class RoundMenu;
  8. class CheckBox;
  9. class QHBoxLayout;
  10. class QAction;
  11. /**
  12. * @brief The EvalSchemeWidget class
  13. * 评估方案
  14. */
  15. class EvalSchemeWidget : public EvalWidget
  16. {
  17. Q_OBJECT
  18. public:
  19. enum Scheme
  20. {
  21. Index = 0b1 << 1,
  22. Collect = 0b1 << 2,
  23. Process = 0b1 << 3,
  24. Output = 0b1 << 4,
  25. };
  26. Q_ENUM(Scheme)
  27. static QString nameOfScheme(Scheme s);
  28. static QString descriptionOfScheme(Scheme s);
  29. enum Algorithm
  30. {
  31. Alg1 = Process | 0b1 << 11,
  32. Alg2 = Process | 0b1 << 12,
  33. Alg3 = Process | 0b1 << 13,
  34. Alg4 = Process | 0b1 << 14,
  35. Alg5 = Process | 0b1 << 15,
  36. };
  37. Q_ENUM(Algorithm)
  38. struct SchemeAndAlg
  39. {
  40. int scheme;
  41. Algorithm alg;
  42. };
  43. static QString nameOfAlgorithm(Algorithm a);
  44. explicit EvalSchemeWidget(ProjectInfo *proj, QWidget *parent);
  45. void initWidgets();
  46. void initLayout();
  47. void connectSignalsAndSlots();
  48. void refreshSchemeView();
  49. void loadScheme(const QString &scheme);
  50. void updateButtonState();
  51. signals:
  52. private slots:
  53. void slotShowSchemeMenu();
  54. void slotIndexClicked();
  55. void slotDataClicked();
  56. void slotAlgBtnClicked();
  57. void slotClearClicked();
  58. void slotSelectAlgorithm(Algorithm alg);
  59. private:
  60. PushButton *m_schemeBtn = nullptr; // 弹出模板菜单
  61. CheckBox *m_index = nullptr; // 选择是否使用指标体系
  62. CheckBox *m_data = nullptr; // 选择是否收集专家数据
  63. PushButton *m_algBtn = nullptr; // 弹出算法菜单
  64. PushButton *m_clear = nullptr; // 清空方案
  65. RoundMenu *m_schemeMenu = nullptr; // 方案模板菜单
  66. RoundMenu *m_algMenu = nullptr; // 算法菜单
  67. CSchemeView *m_schemeView = nullptr;
  68. QWidget *m_schemeSep = nullptr; // 方案视图和方案说明间的分割线
  69. QLabel *m_description = nullptr;
  70. QHBoxLayout *m_buttonLayout = nullptr;
  71. QHBoxLayout *m_schemeLayout = nullptr;
  72. int m_scheme = 0;
  73. QList<Algorithm> m_algs;
  74. QMap<QString, SchemeAndAlg> m_schemes;
  75. };
  76. #endif // EVALSCHEMEWIDGET_H