🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiCommandSummary.hpp
浏览该文件的文档.
1
19
20#pragma once
21
22#include "AstGlobal.h"
23#include "AstGUI/UiObject.hpp"
24#include "AstCore/OrbitElement.hpp"
25#include "AstCore/TimePoint.hpp"
26#include <functional>
27#include <vector>
28
29class QTextEdit;
30
31AST_NAMESPACE_BEGIN
32
33class Segment;
34class Command;
35class SpacecraftState;
36class State;
37class Frame;
38
39// ============================================================================
40// 管道类型
41// ============================================================================
42
45{
46 const Segment* seg = nullptr;
47 const SpacecraftState* outputState = nullptr;
48 const State* orbitState = nullptr;
49 Frame* frame = nullptr;
50 CartState cart;
51 ModOrbElem moe;
52 TimePoint stateEpoch;
53
55 bool valid() const { return orbitState != nullptr; }
56};
57
63{
64 QString title;
65 std::function<bool (const SegmentContext&)> applicable;
66 std::function<QString(const SegmentContext&)> generate;
67};
68
70using SectionGroup = std::vector<SummarySection>;
71
72// ============================================================================
73// UiCommandSummary
74// ============================================================================
75
81class AST_GUI_API UiCommandSummary : public UiObject
82{
83 Q_OBJECT
84public:
85 explicit UiCommandSummary(Object* object, QWidget* parent = nullptr);
86 explicit UiCommandSummary(QWidget* parent = nullptr);
87 ~UiCommandSummary() override;
88
90 void setCommand(Command* command);
91
93 Command* getCommand() const;
94
96 void refresh();
97
98protected:
100 virtual std::vector<SectionGroup> buildSectionGroups() const;
101
102private:
103 void setupUi();
104
106 QString generateSummary() const;
107
109 SegmentContext buildContext() const;
110
112 static QString renderSingle(const SummarySection& sec, const SegmentContext& ctx);
113
115 static QString renderSideBySide(const SummarySection& left,
116 const SummarySection& right,
117 const SegmentContext& ctx,
118 int colWidth = 52);
119
120 // ---- 区块生成函数(静态,仅依赖 SegmentContext) ----
121 static QString formatTimeSystems(const SegmentContext& ctx);
122 static QString formatCartesian(const SegmentContext& ctx);
123 static QString formatSpherical(const SegmentContext& ctx);
124 static QString formatLLR(const SegmentContext& ctx);
125 static QString formatKeplerian(const SegmentContext& ctx);
126
127 QTextEdit* textEdit_ = nullptr;
128};
129
130AST_NAMESPACE_END
Unit sec
定义 Unit.cpp:434
直角坐标
定义 OrbitElement.hpp:46
命令(虚基类),用于定义任务序列中的命令,例如初始状态、轨道机动、轨道预报等
定义 Command.hpp:42
坐标系类
定义 Frame.hpp:60
修正轨道根数
定义 OrbitElement.hpp:131
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
轨道段(虚基类),用于描述任务序列中的轨道段,例如初始状态段、轨道机动段、轨道预报段等
定义 Segment.hpp:45
航天器状态,包含轨道状态、航天器参数(质量、面积、阻力系数、光压、密度、压力、温度等)
定义 SpacecraftState.hpp:39
航天器状态
定义 State.hpp:53
绝对时间点
定义 TimePoint.hpp:107
任务命令概要显示控件
定义 UiCommandSummary.hpp:82
与对象关联的 QWidget
定义 UiObject.hpp:36
std::vector< SummarySection > SectionGroup
区块组:1 个 = 独占整行,2 个 = 横向并排
定义 UiCommandSummary.hpp:70
段上下文,汇总所有区块需要的公共数据,避免每个区块各自解析
定义 UiCommandSummary.hpp:45
bool valid() const
上下文数据是否完整可用
定义 UiCommandSummary.hpp:55
概要区块:独立生成一段多行文本(标题 + 内容)
定义 UiCommandSummary.hpp:63
QString title
区块标题(仅用于标识)
定义 UiCommandSummary.hpp:64
std::function< QString(const SegmentContext &)> generate
生成区块文本
定义 UiCommandSummary.hpp:66
std::function< bool(const SegmentContext &)> applicable
是否适用
定义 UiCommandSummary.hpp:65