Compare commits
No commits in common. "93dd448fd09703cc6ec5305f6b3afda82577b237" and "22be09682db49264376b0f6a715ea8c92902480f" have entirely different histories.
93dd448fd0
...
22be09682d
|
@ -4,17 +4,17 @@
|
||||||
// 通过 ProcList 继承
|
// 通过 ProcList 继承
|
||||||
|
|
||||||
void VisibleCubePlugin::recoveryFrom(const QJsonObject& obj) {
|
void VisibleCubePlugin::recoveryFrom(const QJsonObject& obj) {
|
||||||
DOUBLE_PEAK(_self_d3._length_m);
|
DOUOBLE_PEAK(_self_d3._length_m);
|
||||||
DOUBLE_PEAK(_self_d3._width_m);
|
DOUOBLE_PEAK(_self_d3._width_m);
|
||||||
DOUBLE_PEAK(_self_d3._height_m);
|
DOUOBLE_PEAK(_self_d3._height_m);
|
||||||
|
|
||||||
DOUBLE_PEAK(_self_lla._lon_deg);
|
DOUOBLE_PEAK(_self_lla._lon_deg);
|
||||||
DOUBLE_PEAK(_self_lla._lat_deg);
|
DOUOBLE_PEAK(_self_lla._lat_deg);
|
||||||
DOUBLE_PEAK(_self_lla._alt_m);
|
DOUOBLE_PEAK(_self_lla._alt_m);
|
||||||
|
|
||||||
DOUBLE_PEAK(_self_posture._azimuth_deg);
|
DOUOBLE_PEAK(_self_posture._azimuth_deg);
|
||||||
DOUBLE_PEAK(_self_posture._pitch_deg);
|
DOUOBLE_PEAK(_self_posture._pitch_deg);
|
||||||
DOUBLE_PEAK(_self_posture._roll_deg);
|
DOUOBLE_PEAK(_self_posture._roll_deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisibleCubePlugin::saveTo(QJsonObject& obj) const {
|
void VisibleCubePlugin::saveTo(QJsonObject& obj) const {
|
||||||
|
@ -58,33 +58,3 @@ void VisibleCubePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<
|
||||||
ins->reset(in->targetEntity(), in->sourceEntity());
|
ins->reset(in->targetEntity(), in->sourceEntity());
|
||||||
out << ins;
|
out << ins;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisibleCubePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Set3DBoxD3Data> in, QList<std::shared_ptr<RespondDefault>>& out)
|
|
||||||
{
|
|
||||||
auto resp = std::make_shared<RespondDefault>();
|
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
|
||||||
resp->_success_mark = true;
|
|
||||||
|
|
||||||
this->_self_d3 = in->_d3_data;
|
|
||||||
out << resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VisibleCubePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Set3DBoxLLAPos> in, QList<std::shared_ptr<RespondDefault>>& out)
|
|
||||||
{
|
|
||||||
auto resp = std::make_shared<RespondDefault>();
|
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
|
||||||
resp->_success_mark = true;
|
|
||||||
|
|
||||||
this->_self_lla = in->_lla_pos;
|
|
||||||
out << resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VisibleCubePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Set3DBoxPosture> in, QList<std::shared_ptr<RespondDefault>>& out)
|
|
||||||
{
|
|
||||||
auto resp = std::make_shared<RespondDefault>();
|
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
|
||||||
resp->_success_mark = true;
|
|
||||||
|
|
||||||
this->_self_posture = in->_posture_d3;
|
|
||||||
out << resp;
|
|
||||||
}
|
|
||||||
|
|
|
@ -7,10 +7,7 @@
|
||||||
/// 可视化3d体积盒
|
/// 可视化3d体积盒
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class COMPONENTBASIC_EXPORT VisibleCubePlugin : public ProcList<
|
class COMPONENTBASIC_EXPORT VisibleCubePlugin : public ProcList<
|
||||||
WsRespond<Get3DBox, Box3DDesc>,
|
WsRespond<Get3DBox, Box3DDesc>
|
||||||
WsRespond<Set3DBoxD3Data, RespondDefault>,
|
|
||||||
WsRespond<Set3DBoxLLAPos, RespondDefault>,
|
|
||||||
WsRespond<Set3DBoxPosture, RespondDefault>
|
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -28,10 +25,6 @@ public:
|
||||||
|
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Get3DBox> in, QList<std::shared_ptr<Box3DDesc>>& out) override;
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Get3DBox> in, QList<std::shared_ptr<Box3DDesc>>& out) override;
|
||||||
|
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Set3DBoxD3Data> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Set3DBoxLLAPos> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const Set3DBoxPosture> in, QList<std::shared_ptr<RespondDefault>>& 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;
|
||||||
void saveTo(QJsonObject& obj) const override;
|
void saveTo(QJsonObject& obj) const override;
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
#include "invisible_component.h"
|
|
||||||
|
|
||||||
ComponentsInfoPull::ComponentsInfoPull() {}
|
|
||||||
|
|
||||||
void ComponentsInfoPull::bindEntity(std::weak_ptr<WsEntity> ins)
|
|
||||||
{
|
|
||||||
this->_bind_entity = ins;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ComponentsInfoPull::name() const
|
|
||||||
{
|
|
||||||
return NAME(ComponentsInfoPull);
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <QVariant>
|
|
||||||
#include <QJsonArray>
|
|
||||||
void ComponentsInfoPull::execute(std::shared_ptr<Immediate> map,
|
|
||||||
std::shared_ptr<const ComponentDatasQuery> in, QList<std::shared_ptr<ComponentDatasQueryResult>>& out)
|
|
||||||
{
|
|
||||||
auto rst = std::make_shared<ComponentDatasQueryResult>();
|
|
||||||
rst->reset(in->targetEntity(), in->sourceEntity());
|
|
||||||
|
|
||||||
auto bind_e = this->_bind_entity.lock();
|
|
||||||
rst->_entity_json["entity_templet"] = bind_e->templetName();
|
|
||||||
rst->_entity_json["entity_id"] = QJsonValue::fromVariant(QVariant::fromValue(bind_e->entityID()));
|
|
||||||
rst->_entity_json["entity_name"] = bind_e->name();
|
|
||||||
|
|
||||||
QList<std::shared_ptr<WsComponent>> comp_list;
|
|
||||||
auto host_conv = std::dynamic_pointer_cast<ComponentSet>(bind_e);
|
|
||||||
comp_list = host_conv->components();
|
|
||||||
|
|
||||||
auto array = QJsonArray();
|
|
||||||
for (auto ins : comp_list) {
|
|
||||||
auto info_comp = QJsonObject();
|
|
||||||
info_comp["component_type"] = ins->name();
|
|
||||||
ins->saveTo(info_comp);
|
|
||||||
array.append(info_comp);
|
|
||||||
}
|
|
||||||
rst->_entity_json["component_list"] = array;
|
|
||||||
out << rst;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ComponentsInfoPull::execute(std::shared_ptr<Immediate> map,
|
|
||||||
std::shared_ptr<const ProcedureSignatureQuery> in, QList<std::shared_ptr<ProcedureSignatureQueryResult>>& out)
|
|
||||||
{
|
|
||||||
dd
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<WsComponent> ComponentsInfoPull::defaultNew() const
|
|
||||||
{
|
|
||||||
return std::make_shared<ComponentsInfoPull>();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ComponentsInfoPull::recoveryFrom(const QJsonObject& obj) {}
|
|
||||||
|
|
||||||
void ComponentsInfoPull::saveTo(QJsonObject& obj) const {}
|
|
|
@ -22,7 +22,7 @@ SyncRequest::SyncRequest()
|
||||||
void SyncRequest::recoveryFrom(const QJsonObject& obj)
|
void SyncRequest::recoveryFrom(const QJsonObject& obj)
|
||||||
{
|
{
|
||||||
AbstractMessage::recoveryFrom(obj);
|
AbstractMessage::recoveryFrom(obj);
|
||||||
DOUBLE_PEAK(_time_current);
|
DOUOBLE_PEAK(_time_current);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncRequest::saveTo(QJsonObject& obj) const
|
void SyncRequest::saveTo(QJsonObject& obj) const
|
||||||
|
@ -39,7 +39,7 @@ RespondDefault::RespondDefault()
|
||||||
void RespondDefault::recoveryFrom(const QJsonObject& obj)
|
void RespondDefault::recoveryFrom(const QJsonObject& obj)
|
||||||
{
|
{
|
||||||
AbstractMessage::recoveryFrom(obj);
|
AbstractMessage::recoveryFrom(obj);
|
||||||
DOUBLE_PEAK(_time_consume);
|
DOUOBLE_PEAK(_time_consume);
|
||||||
UINT64_PEAK(_success_mark);
|
UINT64_PEAK(_success_mark);
|
||||||
STRING_PEAK(_reason_text);
|
STRING_PEAK(_reason_text);
|
||||||
}
|
}
|
||||||
|
@ -64,17 +64,17 @@ void Box3DDesc::recoveryFrom(const QJsonObject& obj)
|
||||||
{
|
{
|
||||||
AbstractMessage::recoveryFrom(obj);
|
AbstractMessage::recoveryFrom(obj);
|
||||||
|
|
||||||
DOUBLE_PEAK(this->_d3_data._height_m);
|
DOUOBLE_PEAK(this->_d3_data._height_m);
|
||||||
DOUBLE_PEAK(this->_d3_data._length_m);
|
DOUOBLE_PEAK(this->_d3_data._length_m);
|
||||||
DOUBLE_PEAK(this->_d3_data._width_m);
|
DOUOBLE_PEAK(this->_d3_data._width_m);
|
||||||
|
|
||||||
DOUBLE_PEAK(this->_lla_pos._lon_deg);
|
DOUOBLE_PEAK(this->_lla_pos._lon_deg);
|
||||||
DOUBLE_PEAK(this->_lla_pos._lat_deg);
|
DOUOBLE_PEAK(this->_lla_pos._lat_deg);
|
||||||
DOUBLE_PEAK(this->_lla_pos._alt_m);
|
DOUOBLE_PEAK(this->_lla_pos._alt_m);
|
||||||
|
|
||||||
DOUBLE_PEAK(this->_posture_d3._azimuth_deg);
|
DOUOBLE_PEAK(this->_posture_d3._azimuth_deg);
|
||||||
DOUBLE_PEAK(this->_posture_d3._pitch_deg);
|
DOUOBLE_PEAK(this->_posture_d3._pitch_deg);
|
||||||
DOUBLE_PEAK(this->_posture_d3._roll_deg);
|
DOUOBLE_PEAK(this->_posture_d3._roll_deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Box3DDesc::saveTo(QJsonObject& obj) const
|
void Box3DDesc::saveTo(QJsonObject& obj) const
|
||||||
|
@ -326,63 +326,3 @@ void ProcedureSignatureQueryResult::saveTo(QJsonObject& obj) const
|
||||||
STRLIST_SAVE(input);
|
STRLIST_SAVE(input);
|
||||||
STRLIST_SAVE(output);
|
STRLIST_SAVE(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set3DBoxD3Data::Set3DBoxD3Data()
|
|
||||||
:AbstractMessage(NAME(Set3DBoxD3Data)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set3DBoxD3Data::recoveryFrom(const QJsonObject& obj)
|
|
||||||
{
|
|
||||||
AbstractMessage::recoveryFrom(obj);
|
|
||||||
DOUBLE_PEAK(_d3_data._length_m);
|
|
||||||
DOUBLE_PEAK(_d3_data._width_m);
|
|
||||||
DOUBLE_PEAK(_d3_data._height_m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set3DBoxD3Data::saveTo(QJsonObject& obj) const
|
|
||||||
{
|
|
||||||
AbstractMessage::saveTo(obj);
|
|
||||||
DOUBLE_SAVE(_d3_data._length_m);
|
|
||||||
DOUBLE_SAVE(_d3_data._width_m);
|
|
||||||
DOUBLE_SAVE(_d3_data._height_m);
|
|
||||||
}
|
|
||||||
|
|
||||||
Set3DBoxPosture::Set3DBoxPosture()
|
|
||||||
:AbstractMessage(NAME(Set3DBoxPosture)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set3DBoxPosture::recoveryFrom(const QJsonObject& obj)
|
|
||||||
{
|
|
||||||
AbstractMessage::recoveryFrom(obj);
|
|
||||||
DOUBLE_PEAK(_posture_d3._azimuth_deg);
|
|
||||||
DOUBLE_PEAK(_posture_d3._pitch_deg);
|
|
||||||
DOUBLE_PEAK(_posture_d3._roll_deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set3DBoxPosture::saveTo(QJsonObject& obj) const
|
|
||||||
{
|
|
||||||
AbstractMessage::saveTo(obj);
|
|
||||||
DOUBLE_SAVE(_posture_d3._azimuth_deg);
|
|
||||||
DOUBLE_SAVE(_posture_d3._pitch_deg);
|
|
||||||
DOUBLE_SAVE(_posture_d3._roll_deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
Set3DBoxLLAPos::Set3DBoxLLAPos()
|
|
||||||
:AbstractMessage(NAME(Set3DBoxLLAPos)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set3DBoxLLAPos::recoveryFrom(const QJsonObject& obj)
|
|
||||||
{
|
|
||||||
AbstractMessage::recoveryFrom(obj);
|
|
||||||
DOUBLE_PEAK(_lla_pos._lon_deg);
|
|
||||||
DOUBLE_PEAK(_lla_pos._lat_deg);
|
|
||||||
DOUBLE_PEAK(_lla_pos._alt_m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set3DBoxLLAPos::saveTo(QJsonObject& obj) const
|
|
||||||
{
|
|
||||||
AbstractMessage::saveTo(obj);
|
|
||||||
DOUBLE_SAVE(_lla_pos._lon_deg);
|
|
||||||
DOUBLE_SAVE(_lla_pos._lat_deg);
|
|
||||||
DOUBLE_SAVE(_lla_pos._alt_m);
|
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#define NAME(v) #v
|
#define NAME(v) #v
|
||||||
#define DOUBLE_SAVE(u) obj[NAME(u)] = u
|
#define DOUBLE_SAVE(u) obj[NAME(u)] = u
|
||||||
#define DOUBLE_PEAK(u) u = obj[NAME(u)].toDouble()
|
#define DOUOBLE_PEAK(u) u = obj[NAME(u)].toDouble()
|
||||||
|
|
||||||
#define UINT64_SAVE(u) obj[NAME(u)] = QJsonValue::fromVariant(QVariant::fromValue(u))
|
#define UINT64_SAVE(u) obj[NAME(u)] = QJsonValue::fromVariant(QVariant::fromValue(u))
|
||||||
#define UINT64_PEAK(u) u = obj[NAME(u)].toVariant().toULongLong()
|
#define UINT64_PEAK(u) u = obj[NAME(u)].toVariant().toULongLong()
|
||||||
|
@ -115,38 +115,6 @@ struct MESSAGEBASIC_EXPORT Box3DDesc : public AbstractMessage {
|
||||||
void saveTo(QJsonObject& obj) const override;
|
void saveTo(QJsonObject& obj) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MESSAGEBASIC_EXPORT Set3DBoxD3Data : public AbstractMessage {
|
|
||||||
D3Data _d3_data;
|
|
||||||
|
|
||||||
Set3DBoxD3Data();
|
|
||||||
|
|
||||||
// 通过 WsMessage 继承
|
|
||||||
void recoveryFrom(const QJsonObject& obj) override;
|
|
||||||
void saveTo(QJsonObject& obj) const override;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MESSAGEBASIC_EXPORT Set3DBoxPosture : public AbstractMessage
|
|
||||||
{
|
|
||||||
Posture _posture_d3;
|
|
||||||
|
|
||||||
Set3DBoxPosture();
|
|
||||||
|
|
||||||
// 通过 WsMessage 继承
|
|
||||||
void recoveryFrom(const QJsonObject& obj) override;
|
|
||||||
void saveTo(QJsonObject& obj) const override;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MESSAGEBASIC_EXPORT Set3DBoxLLAPos : public AbstractMessage
|
|
||||||
{
|
|
||||||
LLAPos _lla_pos;
|
|
||||||
|
|
||||||
Set3DBoxLLAPos();
|
|
||||||
|
|
||||||
// 通过 WsMessage 继承
|
|
||||||
void recoveryFrom(const QJsonObject& obj) override;
|
|
||||||
void saveTo(QJsonObject& obj) const override;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 实体构造消息定义 ==========================================
|
// 实体构造消息定义 ==========================================
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue