3dcube独立设置诸元机制
This commit is contained in:
parent
d7a6270dfe
commit
93dd448fd0
|
@ -4,17 +4,17 @@
|
|||
// 通过 ProcList 继承
|
||||
|
||||
void VisibleCubePlugin::recoveryFrom(const QJsonObject& obj) {
|
||||
DOUOBLE_PEAK(_self_d3._length_m);
|
||||
DOUOBLE_PEAK(_self_d3._width_m);
|
||||
DOUOBLE_PEAK(_self_d3._height_m);
|
||||
DOUBLE_PEAK(_self_d3._length_m);
|
||||
DOUBLE_PEAK(_self_d3._width_m);
|
||||
DOUBLE_PEAK(_self_d3._height_m);
|
||||
|
||||
DOUOBLE_PEAK(_self_lla._lon_deg);
|
||||
DOUOBLE_PEAK(_self_lla._lat_deg);
|
||||
DOUOBLE_PEAK(_self_lla._alt_m);
|
||||
DOUBLE_PEAK(_self_lla._lon_deg);
|
||||
DOUBLE_PEAK(_self_lla._lat_deg);
|
||||
DOUBLE_PEAK(_self_lla._alt_m);
|
||||
|
||||
DOUOBLE_PEAK(_self_posture._azimuth_deg);
|
||||
DOUOBLE_PEAK(_self_posture._pitch_deg);
|
||||
DOUOBLE_PEAK(_self_posture._roll_deg);
|
||||
DOUBLE_PEAK(_self_posture._azimuth_deg);
|
||||
DOUBLE_PEAK(_self_posture._pitch_deg);
|
||||
DOUBLE_PEAK(_self_posture._roll_deg);
|
||||
}
|
||||
|
||||
void VisibleCubePlugin::saveTo(QJsonObject& obj) const {
|
||||
|
@ -58,3 +58,33 @@ void VisibleCubePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<
|
|||
ins->reset(in->targetEntity(), in->sourceEntity());
|
||||
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,7 +7,10 @@
|
|||
/// 可视化3d体积盒
|
||||
/// </summary>
|
||||
class COMPONENTBASIC_EXPORT VisibleCubePlugin : public ProcList<
|
||||
WsRespond<Get3DBox, Box3DDesc>
|
||||
WsRespond<Get3DBox, Box3DDesc>,
|
||||
WsRespond<Set3DBoxD3Data, RespondDefault>,
|
||||
WsRespond<Set3DBoxLLAPos, RespondDefault>,
|
||||
WsRespond<Set3DBoxPosture, RespondDefault>
|
||||
>
|
||||
{
|
||||
private:
|
||||
|
@ -25,6 +28,10 @@ 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 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;
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
|
|
|
@ -22,7 +22,7 @@ SyncRequest::SyncRequest()
|
|||
void SyncRequest::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
AbstractMessage::recoveryFrom(obj);
|
||||
DOUOBLE_PEAK(_time_current);
|
||||
DOUBLE_PEAK(_time_current);
|
||||
}
|
||||
|
||||
void SyncRequest::saveTo(QJsonObject& obj) const
|
||||
|
@ -39,7 +39,7 @@ RespondDefault::RespondDefault()
|
|||
void RespondDefault::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
AbstractMessage::recoveryFrom(obj);
|
||||
DOUOBLE_PEAK(_time_consume);
|
||||
DOUBLE_PEAK(_time_consume);
|
||||
UINT64_PEAK(_success_mark);
|
||||
STRING_PEAK(_reason_text);
|
||||
}
|
||||
|
@ -64,17 +64,17 @@ void Box3DDesc::recoveryFrom(const QJsonObject& obj)
|
|||
{
|
||||
AbstractMessage::recoveryFrom(obj);
|
||||
|
||||
DOUOBLE_PEAK(this->_d3_data._height_m);
|
||||
DOUOBLE_PEAK(this->_d3_data._length_m);
|
||||
DOUOBLE_PEAK(this->_d3_data._width_m);
|
||||
DOUBLE_PEAK(this->_d3_data._height_m);
|
||||
DOUBLE_PEAK(this->_d3_data._length_m);
|
||||
DOUBLE_PEAK(this->_d3_data._width_m);
|
||||
|
||||
DOUOBLE_PEAK(this->_lla_pos._lon_deg);
|
||||
DOUOBLE_PEAK(this->_lla_pos._lat_deg);
|
||||
DOUOBLE_PEAK(this->_lla_pos._alt_m);
|
||||
DOUBLE_PEAK(this->_lla_pos._lon_deg);
|
||||
DOUBLE_PEAK(this->_lla_pos._lat_deg);
|
||||
DOUBLE_PEAK(this->_lla_pos._alt_m);
|
||||
|
||||
DOUOBLE_PEAK(this->_posture_d3._azimuth_deg);
|
||||
DOUOBLE_PEAK(this->_posture_d3._pitch_deg);
|
||||
DOUOBLE_PEAK(this->_posture_d3._roll_deg);
|
||||
DOUBLE_PEAK(this->_posture_d3._azimuth_deg);
|
||||
DOUBLE_PEAK(this->_posture_d3._pitch_deg);
|
||||
DOUBLE_PEAK(this->_posture_d3._roll_deg);
|
||||
}
|
||||
|
||||
void Box3DDesc::saveTo(QJsonObject& obj) const
|
||||
|
@ -308,7 +308,7 @@ void ProcedureSignatureQueryResult::recoveryFrom(const QJsonObject& obj)
|
|||
STRLIST_PEAK(input);
|
||||
STRLIST_PEAK(output);
|
||||
|
||||
for(auto idx=0; idx<input.size(); ++idx)
|
||||
for (auto idx = 0; idx < input.size(); ++idx)
|
||||
this->_signature_list << std::make_pair(input[idx], output[idx]);
|
||||
}
|
||||
|
||||
|
@ -326,3 +326,63 @@ void ProcedureSignatureQueryResult::saveTo(QJsonObject& obj) const
|
|||
STRLIST_SAVE(input);
|
||||
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 DOUBLE_SAVE(u) obj[NAME(u)] = u
|
||||
#define DOUOBLE_PEAK(u) u = obj[NAME(u)].toDouble()
|
||||
#define DOUBLE_PEAK(u) u = obj[NAME(u)].toDouble()
|
||||
|
||||
#define UINT64_SAVE(u) obj[NAME(u)] = QJsonValue::fromVariant(QVariant::fromValue(u))
|
||||
#define UINT64_PEAK(u) u = obj[NAME(u)].toVariant().toULongLong()
|
||||
|
@ -115,6 +115,38 @@ struct MESSAGEBASIC_EXPORT Box3DDesc : public AbstractMessage {
|
|||
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>
|
||||
|
|
Loading…
Reference in New Issue