🛰️航天仿真算法库 SpaceAST
0.3.1
载入中...
搜索中...
未找到
PilotCommander.hpp
浏览该文件的文档.
1
19
20
#pragma once
21
22
#include "AstGlobal.h"
23
#include <QObject>
24
#include <string>
25
#include <atomic>
26
#include <functional>
27
#include "AstUtil/Thread.hpp"
28
29
AST_NAMESPACE_BEGIN
30
31
class
PilotSession;
32
class
PilotRecorder;
33
43
class
AST_UIPILOT_API
PilotCommander
:
public
QObject
44
{
45
Q_OBJECT
46
47
public
:
52
explicit
PilotCommander
(
PilotSession
* session,
PilotRecorder
* recorder,
53
QObject* parent =
nullptr
);
54
56
~PilotCommander
()
override
;
57
PilotCommander
(
const
PilotCommander
&) =
delete
;
58
PilotCommander
& operator=(
const
PilotCommander
&) =
delete
;
59
63
std::string execute(
const
std::string& line);
64
66
void
executeAsync(
const
std::string& line);
67
69
void
startStdinLoop();
70
72
void
stop();
73
75
bool
isRunning
()
const
{
return
running_; }
76
78
static
const
char
* helpText();
79
81
void
setOutputCallback(std::function<
void
(
const
std::string&)> cb);
82
83
Q_SIGNALS:
85
void
outputReady
(
const
QString& text);
86
88
void
quitRequested
();
89
90
private
:
92
std::string dispatch(
const
std::string& line);
93
95
std::string executeSafe(
const
std::string& line);
96
97
PilotSession
* session_;
98
PilotRecorder
* recorder_;
99
std::atomic<bool> running_{
true
};
100
Thread
stdinThread_{};
101
std::function<void(
const
std::string&)> outputCb_{};
102
};
103
106
AST_NAMESPACE_END
ast::PilotCommander
命令调度器
定义
PilotCommander.hpp:44
ast::PilotCommander::quitRequested
void quitRequested()
请求退出应用
ast::PilotCommander::outputReady
void outputReady(const QString &text)
有输出内容就绪
ast::PilotCommander::isRunning
bool isRunning() const
是否正在运行
定义
PilotCommander.hpp:75
ast::PilotRecorder
界面操作录制器
定义
PilotRecorder.hpp:39
ast::PilotSession
AstUiPilot 对话会话
定义
PilotSession.hpp:40
ast::Thread
线程
定义
Thread.hpp:42
src
AstUiPilot
PilotCommander.hpp
制作者
1.12.0