Compare commits
2 Commits
86df9ab110
...
c0b2fc7709
Author | SHA1 | Date |
---|---|---|
|
c0b2fc7709 | |
|
6602641bcc |
|
@ -15,9 +15,9 @@ QString ComponentsInfoPull::name() const
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
void ComponentsInfoPull::execute(std::shared_ptr<Immediate> map,
|
void ComponentsInfoPull::execute(std::shared_ptr<Immediate> map,
|
||||||
std::shared_ptr<const ComponentInfosQuery> in, QList<std::shared_ptr<ComponentInfoQueryResult>>& out)
|
std::shared_ptr<const ComponentDatasQuery> in, QList<std::shared_ptr<ComponentDatasQueryResult>>& out)
|
||||||
{
|
{
|
||||||
auto rst = std::make_shared<ComponentInfoQueryResult>();
|
auto rst = std::make_shared<ComponentDatasQueryResult>();
|
||||||
rst->reset(in->targetEntity(), in->sourceEntity());
|
rst->reset(in->targetEntity(), in->sourceEntity());
|
||||||
|
|
||||||
auto bind_e = this->_bind_entity.lock();
|
auto bind_e = this->_bind_entity.lock();
|
||||||
|
@ -40,17 +40,17 @@ void ComponentsInfoPull::execute(std::shared_ptr<Immediate> map,
|
||||||
out << rst;
|
out << rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ComponentsInfoPull::execute(std::shared_ptr<Immediate> map,
|
||||||
|
std::shared_ptr<const ProcedureSignatureQuery> in, QList<std::shared_ptr<ProcedureSignatureQueryResult>>& out)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<WsComponent> ComponentsInfoPull::defaultNew() const
|
std::shared_ptr<WsComponent> ComponentsInfoPull::defaultNew() const
|
||||||
{
|
{
|
||||||
return std::make_shared<ComponentsInfoPull>();
|
return std::make_shared<ComponentsInfoPull>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComponentsInfoPull::recoveryFrom(const QJsonObject& obj)
|
void ComponentsInfoPull::recoveryFrom(const QJsonObject& obj) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
void ComponentsInfoPull::saveTo(QJsonObject& obj) const {}
|
||||||
|
|
||||||
void ComponentsInfoPull::saveTo(QJsonObject& obj) const
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,8 +2,12 @@
|
||||||
#include <messagebasic.h>
|
#include <messagebasic.h>
|
||||||
#include "componentbasic.h"
|
#include "componentbasic.h"
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 组件信息提取
|
||||||
|
/// </summary>
|
||||||
class COMPONENTBASIC_EXPORT ComponentsInfoPull : public ProcList<
|
class COMPONENTBASIC_EXPORT ComponentsInfoPull : public ProcList<
|
||||||
WsRespond<ComponentInfosQuery, ComponentInfoQueryResult>
|
WsRespond<ComponentDatasQuery, ComponentDatasQueryResult>,
|
||||||
|
WsRespond<ProcedureSignatureQuery, ProcedureSignatureQueryResult>
|
||||||
> {
|
> {
|
||||||
private:
|
private:
|
||||||
std::weak_ptr<WsEntity> _bind_entity;
|
std::weak_ptr<WsEntity> _bind_entity;
|
||||||
|
@ -15,7 +19,8 @@ public:
|
||||||
void bindEntity(std::weak_ptr<WsEntity> ins) override;
|
void bindEntity(std::weak_ptr<WsEntity> ins) override;
|
||||||
QString name() const override;
|
QString name() const override;
|
||||||
|
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const ComponentInfosQuery> in, QList<std::shared_ptr<ComponentInfoQueryResult>>& out) override;
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const ComponentDatasQuery> in, QList<std::shared_ptr<ComponentDatasQueryResult>>& out) override;
|
||||||
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const ProcedureSignatureQuery> in, QList<std::shared_ptr<ProcedureSignatureQueryResult>>& out) override;
|
||||||
|
|
||||||
std::shared_ptr<WsComponent> defaultNew() const override;
|
std::shared_ptr<WsComponent> defaultNew() const override;
|
||||||
void recoveryFrom(const QJsonObject& obj) override;
|
void recoveryFrom(const QJsonObject& obj) override;
|
||||||
|
|
|
@ -234,33 +234,21 @@ TypesQuery::TypesQuery()
|
||||||
:AbstractMessage(NAME(TypesQuery)) {
|
:AbstractMessage(NAME(TypesQuery)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentInfosQuery::ComponentInfosQuery()
|
ComponentDatasQuery::ComponentDatasQuery()
|
||||||
:AbstractMessage(NAME(ComponentInfosQuery)) {
|
:AbstractMessage(NAME(ComponentDatasQuery)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComponentInfosQuery::recoveryFrom(const QJsonObject& obj)
|
ComponentDatasQueryResult::ComponentDatasQueryResult()
|
||||||
{
|
:AbstractMessage(NAME(ComponentDatasQueryResult)) {
|
||||||
AbstractMessage::recoveryFrom(obj);
|
|
||||||
UINT64_PEAK(_bind_entity_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComponentInfosQuery::saveTo(QJsonObject& obj) const
|
void ComponentDatasQueryResult::recoveryFrom(const QJsonObject& obj)
|
||||||
{
|
|
||||||
AbstractMessage::saveTo(obj);
|
|
||||||
UINT64_SAVE(_bind_entity_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
ComponentInfoQueryResult::ComponentInfoQueryResult()
|
|
||||||
:AbstractMessage(NAME(ComponentInfoQueryResult)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void ComponentInfoQueryResult::recoveryFrom(const QJsonObject& obj)
|
|
||||||
{
|
{
|
||||||
AbstractMessage::recoveryFrom(obj);
|
AbstractMessage::recoveryFrom(obj);
|
||||||
_entity_json = obj["result_json"].toObject();
|
_entity_json = obj["result_json"].toObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComponentInfoQueryResult::saveTo(QJsonObject& obj) const
|
void ComponentDatasQueryResult::saveTo(QJsonObject& obj) const
|
||||||
{
|
{
|
||||||
AbstractMessage::saveTo(obj);
|
AbstractMessage::saveTo(obj);
|
||||||
obj["result_json"] = _entity_json;
|
obj["result_json"] = _entity_json;
|
||||||
|
@ -303,3 +291,38 @@ void ComponentOperate::saveTo(QJsonObject& obj) const
|
||||||
UINT64_SAVE(_entity_id_within_0x2ff_0xffffffffffffffff);
|
UINT64_SAVE(_entity_id_within_0x2ff_0xffffffffffffffff);
|
||||||
STRLIST_SAVE(_component_types);
|
STRLIST_SAVE(_component_types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProcedureSignatureQuery::ProcedureSignatureQuery()
|
||||||
|
: AbstractMessage(NAME(ProcedureSignatureQuery)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcedureSignatureQueryResult::ProcedureSignatureQueryResult()
|
||||||
|
:AbstractMessage(NAME(ProcedureSignatureQueryResult)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcedureSignatureQueryResult::recoveryFrom(const QJsonObject& obj)
|
||||||
|
{
|
||||||
|
AbstractMessage::recoveryFrom(obj);
|
||||||
|
|
||||||
|
QStringList input, output;
|
||||||
|
STRLIST_PEAK(input);
|
||||||
|
STRLIST_PEAK(output);
|
||||||
|
|
||||||
|
for(auto idx=0; idx<input.size(); ++idx)
|
||||||
|
this->_signature_list << std::make_pair(input[idx], output[idx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcedureSignatureQueryResult::saveTo(QJsonObject& obj) const
|
||||||
|
{
|
||||||
|
AbstractMessage::saveTo(obj);
|
||||||
|
|
||||||
|
QStringList input, output;
|
||||||
|
for (auto sig : this->_signature_list)
|
||||||
|
{
|
||||||
|
input << sig.first;
|
||||||
|
output << sig.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
STRLIST_SAVE(input);
|
||||||
|
STRLIST_SAVE(output);
|
||||||
|
}
|
||||||
|
|
|
@ -209,20 +209,29 @@ struct MESSAGEBASIC_EXPORT EntityTotalList : public AbstractMessage {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取指定实体的所有组件数据
|
/// 获取指定实体的所有组件数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
struct MESSAGEBASIC_EXPORT ComponentInfosQuery : public AbstractMessage {
|
struct MESSAGEBASIC_EXPORT ComponentDatasQuery : public AbstractMessage {
|
||||||
uint64_t _bind_entity_id = 0;
|
ComponentDatasQuery();
|
||||||
|
};
|
||||||
|
|
||||||
ComponentInfosQuery();
|
struct MESSAGEBASIC_EXPORT ComponentDatasQueryResult : public AbstractMessage {
|
||||||
|
QJsonObject _entity_json;
|
||||||
|
|
||||||
|
ComponentDatasQueryResult();
|
||||||
|
|
||||||
// 通过 WsMessage 继承
|
// 通过 WsMessage 继承
|
||||||
void recoveryFrom(const QJsonObject& obj) override;
|
void recoveryFrom(const QJsonObject& obj) override;
|
||||||
void saveTo(QJsonObject& obj) const override;
|
void saveTo(QJsonObject& obj) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MESSAGEBASIC_EXPORT ComponentInfoQueryResult : public AbstractMessage {
|
struct MESSAGEBASIC_EXPORT ProcedureSignatureQuery : public AbstractMessage {
|
||||||
QJsonObject _entity_json;
|
ProcedureSignatureQuery();
|
||||||
|
};
|
||||||
|
|
||||||
ComponentInfoQueryResult();
|
struct MESSAGEBASIC_EXPORT ProcedureSignatureQueryResult : public AbstractMessage
|
||||||
|
{
|
||||||
|
QList<WsRespondSignatureType> _signature_list;
|
||||||
|
|
||||||
|
ProcedureSignatureQueryResult();
|
||||||
|
|
||||||
// 通过 WsMessage 继承
|
// 通过 WsMessage 继承
|
||||||
void recoveryFrom(const QJsonObject& obj) override;
|
void recoveryFrom(const QJsonObject& obj) override;
|
||||||
|
|
Loading…
Reference in New Issue