🛰️航天仿真算法库 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;
50
51 void setStudy(FeasibleRegionStudy* study);
52 FeasibleRegionStudy* getStudy() const;
53
54private slots:
55 // ---- 变量表 ----
56 void onAddVariable();
57 void onRemoveVariable();
58 void onVariableCellChanged(int row, int col);
59 void onVariableExprClicked(int row);
60
61 // ---- 约束表 ----
62 void onAddConstraint();
63 void onRemoveConstraint();
64 void onConstraintCellChanged(int row, int col);
65 void onConstraintExprClicked(int row);
66
67private:
68 void setupUi();
69 void setupVariablesTab(QWidget* tab);
70 void setupConstraintsTab(QWidget* tab);
71 void setupSettingsTab(QWidget* tab);
72 void refreshFromStudy();
73 void refreshVariablesTable();
74 void refreshConstraintsTable();
75 void updateTotalRunsLabel();
76
78 static Expr* browseExpression(QWidget* parent);
79
80 // ---- 变量列索引 ----
81 enum VarCol { VAR_NAME = 0, VAR_EXPR = 1, VAR_LOWER = 2, VAR_UPPER = 3, VAR_STEPS = 4, VAR_COUNT = 5 };
82
83 // ---- 约束列索引 ----
84 enum CtrCol { CTR_NAME = 0, CTR_EXPR = 1, CTR_USE_LOWER = 2, CTR_LOWER = 3,
85 CTR_USE_UPPER = 4, CTR_UPPER = 5, CTR_EXCLUDE = 6, CTR_COUNT = 7 };
86
87 QTabWidget* tabWidget_ = nullptr;
88
89 // 变量页
90 QTableWidget* varTable_ = nullptr;
91 QPushButton* addVarBtn_ = nullptr;
92 QPushButton* removeVarBtn_ = nullptr;
93
94 // 约束页
95 QTableWidget* ctrTable_ = nullptr;
96 QPushButton* addCtrBtn_ = nullptr;
97 QPushButton* removeCtrBtn_ = nullptr;
98
99 // 设置页
100 QLabel* totalRunsLabel_ = nullptr;
101};
102
103AST_NAMESPACE_END
表达式基类
定义 Expr.hpp:40
可行域研究,用于搜索满足约束的解空间
定义 FeasibleRegionStudy.hpp:116
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
FeasibleRegionStudy 段编辑器
定义 UiFeasibleRegionStudy.hpp:44
与对象关联的 QWidget
定义 UiObject.hpp:36