96 lines
2.5 KiB
C++
96 lines
2.5 KiB
C++
#include "VisibleCube.h"
|
|
|
|
|
|
// ͨ¹ý ProcList ¼Ì³Ð
|
|
|
|
void VisibleCubePlugin::recoveryFrom(const QJsonObject& obj) {
|
|
DOUBLE_PEAK(_self_d3._length_m);
|
|
DOUBLE_PEAK(_self_d3._width_m);
|
|
DOUBLE_PEAK(_self_d3._height_m);
|
|
|
|
DOUBLE_PEAK(_self_lla._lon_deg);
|
|
DOUBLE_PEAK(_self_lla._lat_deg);
|
|
DOUBLE_PEAK(_self_lla._alt_m);
|
|
|
|
DOUBLE_PEAK(_self_posture._azimuth_deg);
|
|
DOUBLE_PEAK(_self_posture._pitch_deg);
|
|
DOUBLE_PEAK(_self_posture._roll_deg);
|
|
}
|
|
|
|
void VisibleCubePlugin::saveTo(QJsonObject& obj) const {
|
|
DOUBLE_SAVE(_self_d3._length_m);
|
|
DOUBLE_SAVE(_self_d3._width_m);
|
|
DOUBLE_SAVE(_self_d3._height_m);
|
|
|
|
DOUBLE_SAVE(_self_lla._lon_deg);
|
|
DOUBLE_SAVE(_self_lla._lat_deg);
|
|
DOUBLE_SAVE(_self_lla._alt_m);
|
|
|
|
DOUBLE_SAVE(_self_posture._azimuth_deg);
|
|
DOUBLE_SAVE(_self_posture._pitch_deg);
|
|
DOUBLE_SAVE(_self_posture._roll_deg);
|
|
}
|
|
|
|
std::shared_ptr<Serializable> VisibleCubePlugin::newDefault() const {
|
|
auto copy = std::make_shared<VisibleCubePlugin>();
|
|
copy->_bind_entity = _bind_entity;
|
|
copy->_self_d3 = _self_d3;
|
|
copy->_self_lla = _self_lla;
|
|
copy->_self_posture = _self_posture;
|
|
return copy;
|
|
}
|
|
|
|
QString VisibleCubePlugin::bindDataTopic() const
|
|
{
|
|
return "";
|
|
}
|
|
|
|
void VisibleCubePlugin::bindEntity(std::weak_ptr<WsEntity> ins)
|
|
{
|
|
this->_bind_entity = ins;
|
|
}
|
|
|
|
QString VisibleCubePlugin::name() const {
|
|
return NAME(VisibleCubePlugin);
|
|
}
|
|
|
|
void VisibleCubePlugin::execute(std::shared_ptr<const Get3DBox> in, QList<std::shared_ptr<Box3DDesc>>& out)
|
|
{
|
|
auto ins = std::make_shared<Box3DDesc>();
|
|
ins->_lla_pos = _self_lla;
|
|
ins->_posture_d3 = _self_posture;
|
|
ins->_d3_data = _self_d3;
|
|
ins->reset(in->targetEntity(), in->sourceEntity());
|
|
out << ins;
|
|
}
|
|
|
|
void VisibleCubePlugin::execute(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<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<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;
|
|
}
|