🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiFeasibleRegionStudy.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstGUI/UiObject.hpp"
25#include <QWidget>
26#include <QTableWidget>
27#include <QTabWidget>
28#include <QLabel>
29#include <QPushButton>
30#include <QCheckBox>
31#include <QSpinBox>
32#include <QDoubleSpinBox>
33
34AST_NAMESPACE_BEGIN
35
36class FeasibleRegionStudy;
37class FeasibleRegionVariable;
38class FeasibleRegionConstraint;
39class Expr;
40
43class AST_GUI_API UiFeasibleRegionStudy : public UiObject
44{
45 Q_OBJECT
46public:
47 explicit UiFeasibleRegionStudy(Object* object, QWidget* parent = nullptr);
48 explicit UiFeasibleRegionStudy(QWidget* parent = nullptr);
49 ~UiFeasibleRegionStudy() override;
51 UiFeasibleRegionStudy& operator=(const UiFeasibleRegionStudy&) = delete;
52
53 void setStudy(FeasibleRegionStudy* study);
54 FeasibleRegionStudy* getStudy() const;
55
56private slots:
57 // ---- 变量表 ----
58 void onAddVariable();
59 void onRemoveVariable();
60 void onVariableCellChanged(int row, int col);
61 void onVariableExprClicked(int row);
62
63 // ---- 约束表 ----
64 void onAddConstraint();
65 void onRemoveConstraint();
66 void onConstraintCellChanged(int row, int col);
67 void onConstraintExprClicked(int row);
68
69private:
70 void setupUi();
71 void setupVariablesTab(QWidget* tab);
72 void setupConstraintsTab(QWidget* tab);
73 void setupSettingsTab(QWidget* tab);
74 void refreshFromStudy();
75 void refreshVariablesTable();
76 void refreshConstraintsTable();
77 void updateTotalRunsLabel();
78
80 static Expr* browseExpression(QWidget* parent);
81
82 // ---- 变量列索引 ----
83 enum VarCol { VAR_NAME = 0, VAR_EXPR = 1, VAR_LOWER = 2, VAR_UPPER = 3, VAR_STEPS = 4, VAR_COUNT = 5 };
84
85 // ---- 约束列索引 ----
86 enum CtrCol { CTR_NAME = 0, CTR_EXPR = 1, CTR_USE_LOWER = 2, CTR_LOWER = 3,
87 CTR_USE_UPPER = 4, CTR_UPPER = 5, CTR_EXCLUDE = 6, CTR_COUNT = 7 };
88
89 QTabWidget* tabWidget_ = nullptr;
90
91 // 变量页
92 QTableWidget* varTable_ = nullptr;
93 QPushButton* addVarBtn_ = nullptr;
94 QPushButton* removeVarBtn_ = nullptr;
95
96 // 约束页
97 QTableWidget* ctrTable_ = nullptr;
98 QPushButton* addCtrBtn_ = nullptr;
99 QPushButton* removeCtrBtn_ = nullptr;
100
101 // 设置页
102 QLabel* totalRunsLabel_ = nullptr;
103};
104
105AST_NAMESPACE_END
表达式基类
定义 Expr.hpp:40
可行域研究,用于搜索满足约束的解空间
定义 FeasibleRegionStudy.hpp:116
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
FeasibleRegionStudy 段编辑器
定义 UiFeasibleRegionStudy.hpp:44
与对象关联的 QWidget
定义 UiObject.hpp:36