This commit is contained in:
codeboss 2025-07-06 14:36:43 +08:00
parent 885065d38e
commit 5c0a48b3f4
3 changed files with 30 additions and 7 deletions

View File

@ -95,10 +95,33 @@ void MapKernel::registExecute(std::shared_ptr<ExecuteDelegate> ins)
_execute_types[ins->typeName()] = ins;
}
struct JsonString : public TopicData {
QString _string_content;
// ͨ¹ý TopicData ¼Ì³Ð
std::shared_ptr<Serializable> newDefault() const override
{
return std::shared_ptr<JsonString>();
}
void recoveryFrom(const QJsonObject& obj) override
{
STRING_PEAK(_string_content);
}
void saveTo(QJsonObject& obj) const override
{
STRING_SAVE(_string_content);
}
QString topicString() const override
{
return NAME(JsonString);
}
};
void MapKernel::initial()
{
// 注册基础数据类型
registData(std::make_shared<GeneralData>());
registData(std::make_shared<JsonString>());
for (auto key : _bind_loader->allType())
registData(_bind_loader->makeDefault(key));
@ -181,8 +204,8 @@ void MapKernel::recoveryFrom(const QJsonObject& obj)
if (this->executeTypes().contains(key))
continue;
throw new UniException("当前环境不包含指定执行器类型:" + key);
}
}
// 变量类型校验
for (auto key : variable_keys) {
if (this->dataTypes().contains(key))
@ -940,7 +963,7 @@ QList<std::shared_ptr<LogicalNode>> ExecuteNode::getForwards() const
QString ExecuteNode::rtName() const
{
return QString("%1<%2>(%3)").arg(typeName(),delegateName()).arg(getID());
return QString("%1<%2>(%3)").arg(typeName(), delegateName()).arg(getID());
}
QString ExecuteNode::typeName() const

View File

@ -26,9 +26,9 @@ ActionNodeConfiguration::ActionNodeConfiguration(QWidget* p)
p_layout->setColumnStretch(1, 1);
_input_model->setHorizontalHeaderLabels(QStringList()
<< u8"变量名" << u8"变量类型" << u8"关联变量序列" << u8"关联转换器类型");
<< u8"变量名" << u8"变量类型" << u8"关联转换器类型"<< u8"关联输入序列" );
_output_model->setHorizontalHeaderLabels(QStringList()
<< u8"变量名" << u8"变量类型" << u8"关联变量序列" << u8"关联转换器类型");
<< u8"变量名" << u8"变量类型" << u8"关联转换器类型"<< u8"关联目标变量" );
}
void ActionNodeConfiguration::setTarget(NodePresent* ins)

View File

@ -99,8 +99,8 @@ VariableAdd::VariableAdd(std::shared_ptr<BehaviorMapNode> node, QWidget* parent)
auto cancel = new QPushButton(u8"È¡Ïû");
auto yes = new QPushButton(u8"È·¶¨");
d_layout->addWidget(yes, 2, 0);
d_layout->addWidget(cancel, 2, 2);
d_layout->addWidget(yes, 3, 0);
d_layout->addWidget(cancel, 3, 2);
connect(cancel, &QPushButton::clicked, this, &QDialog::reject);
connect(yes, &QPushButton::clicked, this, &VariableAdd::appendVariable);