123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef EVALSCHEMEWIDGET_H
- #define EVALSCHEMEWIDGET_H
- #include "EvalWidget.h"
- #include <QMap>
- class CSchemeView;
- class PushButton;
- class RoundMenu;
- class CheckBox;
- class QHBoxLayout;
- class QAction;
- /**
- * @brief The EvalSchemeWidget class
- * 评估方案
- */
- class EvalSchemeWidget : public EvalWidget
- {
- Q_OBJECT
- public:
- enum Scheme
- {
- Index = 0b1 << 1,
- Collect = 0b1 << 2,
- Process = 0b1 << 3,
- Output = 0b1 << 4,
- };
- Q_ENUM(Scheme)
- static QString nameOfScheme(Scheme s);
- static QString descriptionOfScheme(Scheme s);
- enum Algorithm
- {
- Alg1 = Process | 0b1 << 11,
- Alg2 = Process | 0b1 << 12,
- Alg3 = Process | 0b1 << 13,
- Alg4 = Process | 0b1 << 14,
- Alg5 = Process | 0b1 << 15,
- };
- Q_ENUM(Algorithm)
- struct SchemeAndAlg
- {
- int scheme;
- Algorithm alg;
- };
- static QString nameOfAlgorithm(Algorithm a);
- explicit EvalSchemeWidget(ProjectInfo *proj, QWidget *parent);
- void initWidgets();
- void initLayout();
- void connectSignalsAndSlots();
- void refreshSchemeView();
- void loadScheme(const QString &scheme);
- void updateButtonState();
- signals:
- private slots:
- void slotShowSchemeMenu();
- void slotIndexClicked();
- void slotDataClicked();
- void slotAlgBtnClicked();
- void slotClearClicked();
- void slotSelectAlgorithm(Algorithm alg);
- private:
- PushButton *m_schemeBtn = nullptr; // 弹出模板菜单
- CheckBox *m_index = nullptr; // 选择是否使用指标体系
- CheckBox *m_data = nullptr; // 选择是否收集专家数据
- PushButton *m_algBtn = nullptr; // 弹出算法菜单
- PushButton *m_clear = nullptr; // 清空方案
- RoundMenu *m_schemeMenu = nullptr; // 方案模板菜单
- RoundMenu *m_algMenu = nullptr; // 算法菜单
- CSchemeView *m_schemeView = nullptr;
- QWidget *m_schemeSep = nullptr; // 方案视图和方案说明间的分割线
- QLabel *m_description = nullptr;
- QHBoxLayout *m_buttonLayout = nullptr;
- QHBoxLayout *m_schemeLayout = nullptr;
- int m_scheme = 0;
- QList<Algorithm> m_algs;
- QMap<QString, SchemeAndAlg> m_schemes;
- };
- #endif // EVALSCHEMEWIDGET_H
|