43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
#pragma once
|
|
#include <motion_access.h>
|
|
#include "componentbasic.h"
|
|
#include <visiblecube_access.h>
|
|
|
|
|
|
/// <summary>
|
|
/// 水面平台机动组件
|
|
/// </summary>
|
|
class COMPONENTBASIC_EXPORT SurfaceMotionPlugin :
|
|
public RespondRoute<
|
|
WsRespond<HorizontalArcMotion, RespondDefault>,
|
|
WsRespond<StrightLineMotion, RespondDefault>,
|
|
WsRespond<MotionDeduceRequest, RespondDefault>,
|
|
WsRespond<SyncRequest, RespondDefault>>,
|
|
public RequestRoute<
|
|
WsRequest<Get3DBox, Box3DDesc>>
|
|
{
|
|
private:
|
|
std::weak_ptr<WsEntity> _bind_entity;
|
|
std::shared_ptr<const PlatformMotionCommand> _current_cmd = nullptr;
|
|
LonLatAlt _start_lla;
|
|
Posture _start_posture;
|
|
|
|
public:
|
|
SurfaceMotionPlugin();
|
|
|
|
// 通过 ProcList 继承
|
|
void execute(std::shared_ptr<const HorizontalArcMotion> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
void execute(std::shared_ptr<const StrightLineMotion> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
void execute(std::shared_ptr<const MotionDeduceRequest> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
void execute(std::shared_ptr<const SyncRequest> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
|
|
std::shared_ptr<Serializable> newDefault() const override;
|
|
void bindEntity(std::weak_ptr<WsEntity> host) override;
|
|
QString name() const override;
|
|
|
|
void recoveryFrom(const QJsonObject& obj) override;
|
|
void saveTo(QJsonObject& obj) const override;
|
|
|
|
};
|
|
|