🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
Sequence.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "MissionCommand.hpp"
25#include "Segment.hpp"
26#include "AstCore/ScriptingToolProfile.hpp"
27
28AST_NAMESPACE_BEGIN
29
36/*
37 MCS 的全程是 Mission Command Sequence (任务命令序列) 或者 Mission Control Sequence (任务控制序列)
38*/
39
40
42class AST_CORE_API Sequence: public Segment
43{
44public:
45 AST_OBJECT(Sequence)
46 Sequence() = default;
47 ~Sequence() = default;
48public:
49 errc_t execute() override;
50 void setCommands(const std::vector<HMissionCommand>& commands);
51 void setCommands(std::vector<HMissionCommand>&& commands);
52 const std::vector<HMissionCommand>& getCommands() const{return commands_;}
53
54 ScriptingToolProfile* scriptingTool() const{return scriptingTool_.get();}
55 void setScriptingTool(ScriptingToolProfile* tool){scriptingTool_ = tool;}
56
60 Segment* getSegmentByPath(StringView path);
61 MissionCommand* getCommandByPath(StringView path);
62
66 Segment* getSegmentByName(StringView name);
67 MissionCommand* getCommandByName(StringView name);
68
71 int repeatCount() const{return repeatCount_;}
72 void setRepeatCount(int count){repeatCount_ = count;}
73protected:
75 void linkCommands();
76private:
77 int repeatCount_{1};
78 std::vector<HMissionCommand> commands_;
79 SharedPtr<ScriptingToolProfile> scriptingTool_;
80};
81
82
85AST_NAMESPACE_END
任务命令(虚基类),用于定义任务序列中的任务命令,例如初始状态、轨道机动、轨道预报等
定义 MissionCommand.hpp:44
脚本工具配置
定义 ScriptingToolProfile.hpp:41
轨道段(虚基类),用于描述任务序列中的轨道段,例如初始状态段、轨道机动段、轨道预报段等
定义 Segment.hpp:44
virtual errc_t execute() override=0
执行任务
任务序列段,内部包含多个任务命令或轨道段,并会按顺序执行
定义 Sequence.hpp:43
int repeatCount() const
获取重复次数
定义 Sequence.hpp:71