修改结点名称,完善配置框架
This commit is contained in:
parent
23a7ba1d4a
commit
0187d1bd9f
|
@ -354,6 +354,16 @@ QList<QString> BehaviorMapNode::outputVariableKeys() const
|
|||
return keys;
|
||||
}
|
||||
|
||||
QList<QString> BehaviorMapNode::internalVariableKeys() const
|
||||
{
|
||||
QList<QString> keys;
|
||||
for (auto key : this->_variables.keys())
|
||||
if (this->_variables[key].first == IO_TYPE::INTERNAL)
|
||||
keys << key;
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
void BehaviorMapNode::removeVariable(const QString& key)
|
||||
{
|
||||
this->_variables.remove(key);
|
||||
|
@ -403,9 +413,14 @@ void BehaviorMapNode::reset()
|
|||
this->_state_value = ExecuteResult::UNDEFINED;
|
||||
}
|
||||
|
||||
QString BehaviorMapNode::rtName() const
|
||||
{
|
||||
return QString(u8"行为树节点<%1>(%2)").arg(_map_name).arg(getID());
|
||||
}
|
||||
|
||||
QString BehaviorMapNode::typeName() const
|
||||
{
|
||||
return _map_name;
|
||||
return u8"行为树节点";
|
||||
}
|
||||
|
||||
ExecuteResult BehaviorMapNode::execute()
|
||||
|
@ -460,7 +475,7 @@ QList<std::shared_ptr<LogicalNode>> SequenceNode::getForwards() const
|
|||
|
||||
QString SequenceNode::typeName() const
|
||||
{
|
||||
return u8"顺序";
|
||||
return u8"顺序节点";
|
||||
}
|
||||
|
||||
ExecuteResult SequenceNode::execute() {
|
||||
|
@ -608,7 +623,7 @@ void SelectorNode::reset()
|
|||
|
||||
QString SelectorNode::typeName() const
|
||||
{
|
||||
return u8"选择";
|
||||
return u8"选择节点";
|
||||
}
|
||||
|
||||
ExecuteResult SelectorNode::execute()
|
||||
|
@ -650,7 +665,7 @@ void ParallelNode::reset()
|
|||
|
||||
QString ParallelNode::typeName() const
|
||||
{
|
||||
return u8"并行";
|
||||
return u8"并行节点";
|
||||
}
|
||||
|
||||
ExecuteResult ParallelNode::execute()
|
||||
|
@ -704,11 +719,6 @@ void ParallelNode::saveTo(QJsonObject& obj) const
|
|||
void CompareNode::reset() {
|
||||
}
|
||||
|
||||
QString CompareNode::typeName() const
|
||||
{
|
||||
return QString(u8"%1<%2>").arg(u8"比较", delegateName());
|
||||
}
|
||||
|
||||
ExecuteResult CompareNode::execute()
|
||||
{
|
||||
if (this->_bind_delegate) {
|
||||
|
@ -729,6 +739,16 @@ QList<std::shared_ptr<LogicalNode>> CompareNode::getForwards() const
|
|||
return QList<std::shared_ptr<LogicalNode>>();
|
||||
}
|
||||
|
||||
QString CompareNode::rtName() const
|
||||
{
|
||||
return QString(u8"%1<%2>(%3)").arg(typeName(), delegateName()).arg(getID());
|
||||
}
|
||||
|
||||
QString CompareNode::typeName() const
|
||||
{
|
||||
return u8"比较节点";
|
||||
}
|
||||
|
||||
bool CompareNode::fallback(std::shared_ptr<LogicalNode> node, ExecuteResult ste) {
|
||||
return true;
|
||||
}
|
||||
|
@ -918,9 +938,14 @@ QList<std::shared_ptr<LogicalNode>> ExecuteNode::getForwards() const
|
|||
return QList<std::shared_ptr<LogicalNode>>();
|
||||
}
|
||||
|
||||
QString ExecuteNode::rtName() const
|
||||
{
|
||||
return QString("%1<%2>(%3)").arg(typeName(),delegateName()).arg(getID());
|
||||
}
|
||||
|
||||
QString ExecuteNode::typeName() const
|
||||
{
|
||||
return QString(u8"执行<%1>").arg(delegateName());
|
||||
return u8"执行节点";
|
||||
}
|
||||
|
||||
QHash<QString, std::shared_ptr<TopicData>> ExecuteNode::inputList() const
|
||||
|
@ -1015,19 +1040,27 @@ void ModifiedNode::insert(std::shared_ptr<LogicalNode> node, int index /*= -1*/)
|
|||
LogicalNode::insert(node);
|
||||
}
|
||||
|
||||
QString ModifiedNode::typeName() const
|
||||
QString ModifiedNode::rtName() const
|
||||
{
|
||||
QString temp_string;
|
||||
switch (modifyType())
|
||||
{
|
||||
case ModifyType::ALWAYS_SUCCESS:
|
||||
return u8"修饰<永远成功>";
|
||||
temp_string = u8"修饰节点<永远成功>";
|
||||
case ModifyType::ALWAYS_FAILURE:
|
||||
return u8"修饰<永远失败>";
|
||||
temp_string = u8"修饰节点<永远失败>";
|
||||
case ModifyType::RESULT_INVENTER:
|
||||
return u8"修饰<结果反转>";
|
||||
temp_string = u8"修饰节点<结果反转>";
|
||||
default:
|
||||
return u8"修饰<>";
|
||||
temp_string = u8"修饰节点<>";
|
||||
}
|
||||
|
||||
return temp_string + QString("(%1)").arg(getID());
|
||||
}
|
||||
|
||||
QString ModifiedNode::typeName() const
|
||||
{
|
||||
return u8"修饰节点";
|
||||
}
|
||||
|
||||
QHash<QString, std::shared_ptr<TopicData>> ModifiedNode::inputList() const
|
||||
|
|
|
@ -405,7 +405,7 @@ public:
|
|||
/// 实例化节点名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
QString rtName() const;
|
||||
virtual QString rtName() const;
|
||||
|
||||
/// <summary>
|
||||
/// 获取节点名称
|
||||
|
@ -460,14 +460,16 @@ public:
|
|||
/// 逻辑树节点输入输出类型
|
||||
/// </summary>
|
||||
enum class IO_TYPE {
|
||||
INPUT, OUTPUT
|
||||
INPUT, // 输入
|
||||
OUTPUT, // 输出
|
||||
INTERNAL// 内部变量
|
||||
};
|
||||
/// <summary>
|
||||
/// 自定义行为树节点根节点实例
|
||||
/// </summary>
|
||||
class COMPONENTBASIC_EXPORT BehaviorMapNode : public LogicalNode {
|
||||
private:
|
||||
QString _map_name = u8"行为树";
|
||||
QString _map_name = u8"行为树节点";
|
||||
|
||||
/// <summary>
|
||||
/// 地图变量表
|
||||
|
@ -485,6 +487,7 @@ public:
|
|||
virtual void setVariable(const QString& key, IO_TYPE t, std::shared_ptr<TopicData> ins);
|
||||
virtual QList<QString> inputVariableKeys() const;
|
||||
virtual QList<QString> outputVariableKeys() const;
|
||||
virtual QList<QString> internalVariableKeys() const;
|
||||
virtual void removeVariable(const QString &key);
|
||||
/// <summary>
|
||||
/// 获取指定名称的数据变量
|
||||
|
@ -504,6 +507,11 @@ public:
|
|||
/// </summary>
|
||||
void reset() override;
|
||||
/// <summary>
|
||||
/// 实例名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
QString rtName() const override;
|
||||
/// <summary>
|
||||
/// 获取节点类型名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
@ -641,6 +649,7 @@ public:
|
|||
void bindDelegate(std::shared_ptr<CompareDelegate> ins);
|
||||
|
||||
virtual QList<std::shared_ptr<LogicalNode>> getForwards() const override;
|
||||
virtual QString rtName() const override;
|
||||
QString typeName() const override;
|
||||
|
||||
QHash<QString, std::shared_ptr<TopicData>> inputList() const override;
|
||||
|
@ -671,6 +680,7 @@ public:
|
|||
void bindDelegate(std::shared_ptr<ExecuteDelegate> ins);
|
||||
|
||||
virtual QList<std::shared_ptr<LogicalNode>> getForwards() const override;
|
||||
virtual QString rtName() const override;
|
||||
QString typeName() const override;
|
||||
|
||||
QHash<QString, std::shared_ptr<TopicData>> inputList() const override;
|
||||
|
@ -710,6 +720,7 @@ public:
|
|||
|
||||
void insert(std::shared_ptr<LogicalNode> node, int index = -1) override;
|
||||
|
||||
virtual QString rtName() const override;
|
||||
QString typeName() const override;
|
||||
QHash<QString, std::shared_ptr<TopicData>> inputList() const override;
|
||||
QHash<QString, std::shared_ptr<TopicData>> outputList() const override;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtInstall>5.12.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core;xml;gui;qml;concurrent</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtInstall>5.12.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core;gui</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtInstall>5.12.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
#include "BehaviorConfigurationPanel.h"
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
|
||||
BehaviorMapConfigurationPanel::BehaviorMapConfigurationPanel(QWidget* p)
|
||||
:QFrame(p),
|
||||
_root_name(new QLineEdit(this)),
|
||||
_variable_table(new QTableView(this)),
|
||||
_variable_model(new QStandardItemModel(this))
|
||||
{
|
||||
setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
|
||||
auto p_layout = new QGridLayout(this);
|
||||
p_layout->addWidget(new QLabel(u8"行为树名称:", this));
|
||||
p_layout->addWidget(_root_name, 0, 1, 1, 3);
|
||||
|
||||
auto addVar = new QPushButton(u8"添加变量", this);
|
||||
auto rmVar = new QPushButton(u8"删除变量", this);
|
||||
p_layout->addWidget(addVar, 0, 4);
|
||||
p_layout->addWidget(rmVar, 0, 5);
|
||||
|
||||
p_layout->addWidget(_variable_table, 1, 0, 3, 6);
|
||||
_variable_table->setModel(_variable_model);
|
||||
_variable_model->setHorizontalHeaderLabels(QStringList()
|
||||
<< u8"输入/输出" << u8"变量名" << u8"变量类型");
|
||||
|
||||
p_layout->setColumnStretch(1, 1);
|
||||
|
||||
|
||||
connect(addVar, &QPushButton::clicked, [=](){
|
||||
VariableAdd dia(this->_bind_node, this);
|
||||
dia.exec();
|
||||
});
|
||||
}
|
||||
|
||||
void BehaviorMapConfigurationPanel::setTarget(std::shared_ptr<LogicalNode> map_root, NodePresent* ins)
|
||||
{
|
||||
this->_bind_graph = ins;
|
||||
this->_bind_node = std::dynamic_pointer_cast<BehaviorMapNode>(map_root);
|
||||
_variable_model->removeRows(0, _variable_model->rowCount());
|
||||
|
||||
_root_name->setText(map_root->typeName());
|
||||
for (auto key : _bind_node->inputVariableKeys()) {
|
||||
auto ins_prop = _bind_node->getVariable(key);
|
||||
QList<QStandardItem*> row;
|
||||
row << new QStandardItem(u8"输入");
|
||||
row << new QStandardItem(key);
|
||||
row << new QStandardItem(ins_prop->topicString());
|
||||
std::for_each(row.begin(), row.end(),
|
||||
[](QStandardItem* ins) {ins->setEditable(false); }
|
||||
);
|
||||
|
||||
_variable_model->appendRow(row);
|
||||
}
|
||||
|
||||
for (auto key : _bind_node->outputVariableKeys()) {
|
||||
auto ins_prop = _bind_node->getVariable(key);
|
||||
QList<QStandardItem*> row;
|
||||
row << new QStandardItem(u8"输出");
|
||||
row << new QStandardItem(key);
|
||||
row << new QStandardItem(ins_prop->topicString());
|
||||
std::for_each(row.begin(), row.end(),
|
||||
[](QStandardItem* ins) { ins->setEditable(false); }
|
||||
);
|
||||
|
||||
_variable_model->appendRow(row);
|
||||
}
|
||||
|
||||
for (auto key : _bind_node->internalVariableKeys()) {
|
||||
auto ins_prop = _bind_node->getVariable(key);
|
||||
QList<QStandardItem*> row;
|
||||
row << new QStandardItem(u8"内部");
|
||||
row << new QStandardItem(key);
|
||||
row << new QStandardItem(ins_prop->topicString());
|
||||
std::for_each(row.begin(), row.end(),
|
||||
[](QStandardItem* ins) {ins->setEditable(false); }
|
||||
);
|
||||
|
||||
_variable_model->appendRow(row);
|
||||
}
|
||||
}
|
||||
|
||||
VariableAdd::VariableAdd(std::shared_ptr<BehaviorMapNode> node, QWidget* parent)
|
||||
: QDialog(parent), _bind_node(node),
|
||||
_io_type(new QComboBox(this)),
|
||||
_data_type(new QComboBox(this)),
|
||||
_var_name(new QLineEdit(this))
|
||||
{
|
||||
setWindowTitle(u8"添加变量");
|
||||
|
||||
auto d_layout = new QGridLayout(this);
|
||||
d_layout->addWidget(new QLabel(u8"输入/输出", this));
|
||||
d_layout->addWidget(_io_type, 0, 1, 1, 2);
|
||||
d_layout->addWidget(new QLabel(u8"变量类型", this), 1, 0);
|
||||
d_layout->addWidget(_data_type, 1, 1, 1, 2);
|
||||
d_layout->addWidget(new QLabel(u8"变量名", this), 2, 0);
|
||||
d_layout->addWidget(_var_name, 2, 1, 1, 2);
|
||||
|
||||
auto cancel = new QPushButton(u8"取消");
|
||||
auto yes = new QPushButton(u8"确定");
|
||||
d_layout->addWidget(yes, 2, 0);
|
||||
d_layout->addWidget(cancel, 2, 2);
|
||||
|
||||
connect(cancel, &QPushButton::clicked, this, &QDialog::reject);
|
||||
connect(yes, &QPushButton::clicked, this, &VariableAdd::appendVariable);
|
||||
|
||||
_io_type->addItems(QStringList()<<u8"输入"<<u8"输出");
|
||||
_data_type->addItems(_bind_node->getKernal()->dataTypes());
|
||||
}
|
||||
|
||||
void VariableAdd::appendVariable()
|
||||
{
|
||||
auto iotype = this->_io_type->currentText();
|
||||
IO_TYPE typemark = IO_TYPE::INPUT;
|
||||
if(iotype == u8"输出")
|
||||
typemark = IO_TYPE::OUTPUT;
|
||||
|
||||
auto type_topic = this->_data_type->currentText();
|
||||
auto type_o = this->_bind_node->getKernal()->getData(type_topic);
|
||||
auto type_def = std::dynamic_pointer_cast<TopicData>(type_o->newDefault());
|
||||
this->_bind_node->setVariable(this->_var_name->text(), typemark, type_def);
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
#include <QWidget>
|
||||
#include <QFrame>
|
||||
#include <BehaviorPerform.h>
|
||||
#include <QLineEdit>
|
||||
#include <QTableView>
|
||||
#include <QStandardItemModel>
|
||||
#include <QDialog>
|
||||
#include <QComboBox>
|
||||
|
||||
class VariableAdd : public QDialog {
|
||||
private:
|
||||
std::shared_ptr<BehaviorMapNode> _bind_node = nullptr;
|
||||
|
||||
QComboBox *const _io_type;
|
||||
QComboBox *const _data_type;
|
||||
QLineEdit *const _var_name;
|
||||
|
||||
public:
|
||||
VariableAdd(std::shared_ptr<BehaviorMapNode> node, QWidget *parent = nullptr);
|
||||
|
||||
void appendVariable();
|
||||
};
|
||||
|
||||
class NodePresent;
|
||||
class BehaviorMapConfigurationPanel : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QLineEdit *const _root_name;
|
||||
QTableView *const _variable_table;
|
||||
QStandardItemModel *const _variable_model;
|
||||
|
||||
std::shared_ptr<BehaviorMapNode> _bind_node; // 绑定内容结点
|
||||
NodePresent *_bind_graph = nullptr; // 绑定图形显示结点
|
||||
|
||||
public:
|
||||
BehaviorMapConfigurationPanel(QWidget *p = nullptr);
|
||||
|
||||
void setTarget(std::shared_ptr<LogicalNode> map_root, NodePresent *ins);
|
||||
};
|
||||
|
|
@ -443,19 +443,41 @@ void BehaviorEditor::new_behavior_map()
|
|||
// 清空行为树节点变量列表
|
||||
auto variable_key_set = this->_map_root->inputVariableKeys();
|
||||
variable_key_set << this->_map_root->outputVariableKeys();
|
||||
for(auto key : variable_key_set)
|
||||
for (auto key : variable_key_set)
|
||||
this->_map_root->removeVariable(key);
|
||||
|
||||
// 重置地图节点
|
||||
this->_logical_present->setRoot(_map_root);
|
||||
}
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QGridLayout>
|
||||
#include <QComboBox>
|
||||
QWidget* BehaviorEditor::newModifyNodeConfigration(QWidget* pwidget)
|
||||
{
|
||||
auto panel = new QFrame(this);
|
||||
panel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
|
||||
auto p_layout = new QGridLayout(panel);
|
||||
|
||||
p_layout->addWidget(new QLabel(u8"修饰类型:", this));
|
||||
p_layout->addWidget(new QComboBox(this), 0, 1, 1, 3);
|
||||
p_layout->addWidget(new QWidget(this), 1, 0, 1, 4);
|
||||
|
||||
p_layout->setRowStretch(1, 1);
|
||||
p_layout->setColumnStretch(1, 1);
|
||||
return panel;
|
||||
}
|
||||
|
||||
BehaviorEditor::BehaviorEditor(QWidget* parent /*= nullptr*/)
|
||||
: QMainWindow(parent),
|
||||
_type_view(new NodeTypesView(this)),
|
||||
_type_model(new QStandardItemModel(this)),
|
||||
_logical_present(new BehaviorsPresent(this)),
|
||||
_logs_present(new QTextBrowser(this))
|
||||
_message_panel(new QTabWidget(this)),
|
||||
_stacked_panel(new QStackedWidget(this)),
|
||||
_logs_present(new QTextBrowser(this)),
|
||||
_map_configuration(new BehaviorMapConfigurationPanel(this))
|
||||
{
|
||||
_global_loader = std::make_shared<MessageLoader>();
|
||||
_global_kernal = std::make_shared<MapKernel>(_global_loader);
|
||||
|
@ -477,7 +499,7 @@ BehaviorEditor::BehaviorEditor(QWidget* parent /*= nullptr*/)
|
|||
|
||||
auto split_h = new QSplitter(Qt::Horizontal, this);
|
||||
split_v->addWidget(split_h);
|
||||
split_v->addWidget(_logs_present);
|
||||
split_v->addWidget(_message_panel);
|
||||
split_v->setStretchFactor(0, 1);
|
||||
split_v->setStretchFactor(1, 0);
|
||||
|
||||
|
@ -488,6 +510,16 @@ BehaviorEditor::BehaviorEditor(QWidget* parent /*= nullptr*/)
|
|||
|
||||
_type_view->setModel(_type_model);
|
||||
nodeTypesViewInit(_type_model);
|
||||
|
||||
|
||||
// 下方堆叠面板
|
||||
_message_panel->addTab(_logs_present, u8"控制台");
|
||||
_message_panel->addTab(_stacked_panel, u8"属性配置");
|
||||
_stacked_panel->addWidget(new BehaviorMapConfigurationPanel(this));
|
||||
_stacked_panel->addWidget(newModifyNodeConfigration(this));
|
||||
_stacked_panel->addWidget(newActionNodeConfigration(this));
|
||||
_stacked_panel->addWidget(newCompareNodeConfigration(this));
|
||||
_stacked_panel->addWidget(newDefaultConfigration(this));
|
||||
}
|
||||
|
||||
void BehaviorEditor::nodeTypesViewInit(QStandardItemModel* m)
|
||||
|
@ -501,6 +533,61 @@ void BehaviorEditor::nodeTypesViewInit(QStandardItemModel* m)
|
|||
}
|
||||
}
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
|
||||
QWidget* BehaviorEditor::newDefaultConfigration(QWidget* pwidget)
|
||||
{
|
||||
auto ins = new QLabel(u8"该结点无需配置", pwidget);
|
||||
ins->setAlignment(Qt::AlignCenter);
|
||||
ins->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
|
||||
return ins;
|
||||
}
|
||||
|
||||
QWidget* BehaviorEditor::newCompareNodeConfigration(QWidget* pwidget)
|
||||
{
|
||||
auto panel = new QFrame(this);
|
||||
panel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
|
||||
auto p_layout = new QGridLayout(panel);
|
||||
|
||||
auto compare_types = new QComboBox(this);
|
||||
p_layout->addWidget(new QLabel(u8"类型筛选:", this), 0, 0);
|
||||
p_layout->addWidget(new QComboBox(this), 0, 1, 1, 5);
|
||||
p_layout->addWidget(new QLabel(u8"比较器类型:"), 1, 0);
|
||||
p_layout->addWidget(compare_types, 1, 1, 1, 5);
|
||||
p_layout->addWidget(new QLabel(u8"输入变量A:", this), 2, 0);
|
||||
p_layout->addWidget(new QComboBox(this), 2, 1, 1, 5);
|
||||
p_layout->addWidget(new QLabel(u8"输入变量B:", this), 3, 0);
|
||||
p_layout->addWidget(new QComboBox(this), 3, 1, 1, 5);
|
||||
|
||||
p_layout->setColumnStretch(1, 1);
|
||||
return panel;
|
||||
}
|
||||
|
||||
QWidget* BehaviorEditor::newActionNodeConfigration(QWidget* pwidget)
|
||||
{
|
||||
auto panel = new QFrame(this);
|
||||
panel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
|
||||
auto p_layout = new QGridLayout(panel);
|
||||
|
||||
p_layout->addWidget(new QLabel(u8"执行器类型:", this));
|
||||
p_layout->addWidget(new QComboBox(this), 0, 1, 1, 4);
|
||||
auto vars_tabw = new QTabWidget(this);
|
||||
p_layout->addWidget(vars_tabw, 1, 0, 3, 5);
|
||||
vars_tabw->setTabPosition(QTabWidget::West);
|
||||
|
||||
vars_tabw->addTab(new QTableView(this), u8"输入变量");
|
||||
vars_tabw->addTab(new QTableView(this), u8"输出变量");
|
||||
|
||||
p_layout->setColumnStretch(1, 1);
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NodeTypesView::NodeTypesView(QWidget* parent /*= nullptr*/)
|
||||
: QListView(parent)
|
||||
{
|
||||
|
|
|
@ -144,6 +144,11 @@ protected:
|
|||
#include <QStandardItemModel>
|
||||
#include <QTextBrowser>
|
||||
#include <MessageLoader.h>
|
||||
#include <QStandardItemModel>
|
||||
#include <QTableView>
|
||||
#include <QStackedWidget>
|
||||
|
||||
#include "BehaviorConfigurationPanel.h"
|
||||
|
||||
/// <summary>
|
||||
/// 行为树节点编辑器
|
||||
|
@ -156,7 +161,9 @@ private:
|
|||
NodeTypesView* const _type_view;
|
||||
QStandardItemModel* const _type_model;
|
||||
BehaviorsPresent* const _logical_present;
|
||||
QTextBrowser* const _logs_present;
|
||||
QTabWidget *const _message_panel;
|
||||
QStackedWidget *const _stacked_panel;
|
||||
BehaviorMapConfigurationPanel *const _map_configuration;
|
||||
|
||||
std::shared_ptr<BehaviorMapNode> _map_root;
|
||||
QUrl _current_fileurl;
|
||||
|
@ -164,8 +171,25 @@ private:
|
|||
void open_behavior_map();
|
||||
void new_behavior_map();
|
||||
|
||||
void nodeTypesViewInit(QStandardItemModel* m);
|
||||
|
||||
// ==============================================
|
||||
QTextBrowser* const _logs_present;
|
||||
|
||||
// ==============================================
|
||||
|
||||
// ==============================================
|
||||
QWidget* newDefaultConfigration(QWidget* pwidget);
|
||||
|
||||
// ==============================================
|
||||
QWidget* newCompareNodeConfigration(QWidget* pwidget);
|
||||
|
||||
// ==============================================
|
||||
QWidget* newActionNodeConfigration(QWidget* pwidget);
|
||||
|
||||
// ==============================================
|
||||
QWidget* newModifyNodeConfigration(QWidget* pwidget);
|
||||
public:
|
||||
BehaviorEditor(QWidget* parent = nullptr);
|
||||
|
||||
void nodeTypesViewInit(QStandardItemModel* m);
|
||||
};
|
|
@ -36,7 +36,7 @@
|
|||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtInstall>5.12.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core;gui;widgets;qml</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
@ -99,6 +99,7 @@
|
|||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BehaviorConfigurationPanel.cpp" />
|
||||
<ClCompile Include="BehaviorEditor.cpp" />
|
||||
<ClCompile Include="PerspectiveView.cpp" />
|
||||
<ClCompile Include="TempletAssemble.cpp" />
|
||||
|
@ -117,6 +118,7 @@
|
|||
<QtMoc Include="PerspectiveView.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="BehaviorConfigurationPanel.h" />
|
||||
<ClInclude Include="BehaviorEditor.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
<ClCompile Include="BehaviorEditor.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BehaviorConfigurationPanel.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="TempletAssemble.h">
|
||||
|
@ -63,6 +66,9 @@
|
|||
<QtMoc Include="PerspectiveView.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="BehaviorConfigurationPanel.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="BehaviorEditor.h">
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtInstall>5.12.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core;gui</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtInstall>5.12.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core;gui</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
|
|
Loading…
Reference in New Issue