重构名称
This commit is contained in:
parent
86cbc5a9d6
commit
fa10045601
|
@ -105,14 +105,14 @@
|
||||||
<ClCompile Include="DeduceFramework.cpp" />
|
<ClCompile Include="DeduceFramework.cpp" />
|
||||||
<ClCompile Include="InvisibleComponent.cpp" />
|
<ClCompile Include="InvisibleComponent.cpp" />
|
||||||
<ClCompile Include="RouteManage.cpp" />
|
<ClCompile Include="RouteManage.cpp" />
|
||||||
<ClCompile Include="SurfaceMotionPlugin.cpp" />
|
<ClCompile Include="SurfaceMotion.cpp" />
|
||||||
<ClCompile Include="VisibleCube.cpp" />
|
<ClCompile Include="VisibleCube.cpp" />
|
||||||
<ClInclude Include="componentbasic_global.h" />
|
<ClInclude Include="componentbasic_global.h" />
|
||||||
<ClInclude Include="componentbasic.h" />
|
<ClInclude Include="componentbasic.h" />
|
||||||
<QtMoc Include="DeduceFramework.h" />
|
<QtMoc Include="DeduceFramework.h" />
|
||||||
<ClInclude Include="InvisibleComponent.h" />
|
<ClInclude Include="InvisibleComponent.h" />
|
||||||
<ClInclude Include="RouteManage.h" />
|
<ClInclude Include="RouteManage.h" />
|
||||||
<ClInclude Include="SurfaceMotionPlugin.h" />
|
<ClInclude Include="SurfaceMotion.h" />
|
||||||
<ClInclude Include="VisibleCube.h" />
|
<ClInclude Include="VisibleCube.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<ClInclude Include="InvisibleComponent.h">
|
<ClInclude Include="InvisibleComponent.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="SurfaceMotionPlugin.h">
|
<ClInclude Include="SurfaceMotion.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
<ClCompile Include="InvisibleComponent.cpp">
|
<ClCompile Include="InvisibleComponent.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="SurfaceMotionPlugin.cpp">
|
<ClCompile Include="SurfaceMotion.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -71,7 +71,7 @@ void DeduceFramework::init_framework()
|
||||||
auto res_e = std::make_shared<RtResourceManager>();
|
auto res_e = std::make_shared<RtResourceManager>();
|
||||||
info_pulls = std::make_shared<ComponentsInfoPull>();
|
info_pulls = std::make_shared<ComponentsInfoPull>();
|
||||||
res_e->append(info_pulls);
|
res_e->append(info_pulls);
|
||||||
auto route_mgr = std::make_shared<PlainRouteManage>();
|
auto route_mgr = std::make_shared<PlainRouteManagePlugin>();
|
||||||
res_e->append(route_mgr);
|
res_e->append(route_mgr);
|
||||||
this->_entity_map_over_0xffff[res_e->entityID()] = res_e;
|
this->_entity_map_over_0xffff[res_e->entityID()] = res_e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "RouteManage.h"
|
#include "RouteManage.h"
|
||||||
|
|
||||||
PlainRouteManage::PlainRouteManage()
|
PlainRouteManagePlugin::PlainRouteManagePlugin()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ PlainRouteManage::PlainRouteManage()
|
||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
|
||||||
void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const NewPlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out)
|
void PlainRouteManagePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const NewPlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto resp = std::make_shared<RespondDefault>();
|
auto resp = std::make_shared<RespondDefault>();
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
resp->reset(in->targetEntity(), in->sourceEntity());
|
||||||
|
@ -24,7 +24,7 @@ void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<c
|
||||||
out << resp;
|
out << resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const RemovePlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out)
|
void PlainRouteManagePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const RemovePlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto resp = std::make_shared<RespondDefault>();
|
auto resp = std::make_shared<RespondDefault>();
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
resp->reset(in->targetEntity(), in->sourceEntity());
|
||||||
|
@ -40,7 +40,7 @@ void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<c
|
||||||
out << resp;
|
out << resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const PlainRouteReset> in, QList<std::shared_ptr<RespondDefault>>& out)
|
void PlainRouteManagePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const PlainRouteReset> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto resp = std::make_shared<RespondDefault>();
|
auto resp = std::make_shared<RespondDefault>();
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
resp->reset(in->targetEntity(), in->sourceEntity());
|
||||||
|
@ -59,7 +59,7 @@ void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<c
|
||||||
out << resp;
|
out << resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const PlainRouteQuery> in, QList<std::shared_ptr<PlainRouteInfo>>& out)
|
void PlainRouteManagePlugin::execute(std::shared_ptr<Immediate> map, std::shared_ptr<const PlainRouteQuery> in, QList<std::shared_ptr<PlainRouteInfo>>& out)
|
||||||
{
|
{
|
||||||
auto resp = std::make_shared<PlainRouteInfo>();
|
auto resp = std::make_shared<PlainRouteInfo>();
|
||||||
resp->reset(in->targetEntity(), in->sourceEntity());
|
resp->reset(in->targetEntity(), in->sourceEntity());
|
||||||
|
@ -76,7 +76,7 @@ void PlainRouteManage::execute(std::shared_ptr<Immediate> map, std::shared_ptr<c
|
||||||
out << resp;
|
out << resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainRouteManage::recoveryFrom(const QJsonObject& obj)
|
void PlainRouteManagePlugin::recoveryFrom(const QJsonObject& obj)
|
||||||
{
|
{
|
||||||
auto route_array = obj["total_route"].toArray();
|
auto route_array = obj["total_route"].toArray();
|
||||||
for (auto idx = 0; idx < route_array.size(); ++idx) {
|
for (auto idx = 0; idx < route_array.size(); ++idx) {
|
||||||
|
@ -95,7 +95,7 @@ void PlainRouteManage::recoveryFrom(const QJsonObject& obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainRouteManage::saveTo(QJsonObject& obj) const
|
void PlainRouteManagePlugin::saveTo(QJsonObject& obj) const
|
||||||
{
|
{
|
||||||
QJsonArray route_array;
|
QJsonArray route_array;
|
||||||
for (auto route_name : this->_route_resource_map.keys()) {
|
for (auto route_name : this->_route_resource_map.keys()) {
|
||||||
|
@ -116,19 +116,19 @@ void PlainRouteManage::saveTo(QJsonObject& obj) const
|
||||||
obj["total_route"] = route_array;
|
obj["total_route"] = route_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<WsComponent> PlainRouteManage::defaultNew() const
|
std::shared_ptr<WsComponent> PlainRouteManagePlugin::defaultNew() const
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainRouteManage::bindEntity(std::weak_ptr<WsEntity> host)
|
void PlainRouteManagePlugin::bindEntity(std::weak_ptr<WsEntity> host)
|
||||||
{
|
{
|
||||||
this->_bind_entity = host;
|
this->_bind_entity = host;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PlainRouteManage::name() const
|
QString PlainRouteManagePlugin::name() const
|
||||||
{
|
{
|
||||||
return NAME(PlainRouteManage);
|
return NAME(PlainRouteManagePlugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteResource& RouteResource::operator=(const RouteResource& other)
|
RouteResource& RouteResource::operator=(const RouteResource& other)
|
||||||
|
|
|
@ -15,7 +15,7 @@ struct RouteResource {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 平面路径管理插件
|
/// 平面路径管理插件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class PlainRouteManage : public ProcList<
|
class COMPONENTBASIC_EXPORT PlainRouteManagePlugin : public ProcList<
|
||||||
WsRespond<NewPlainRoute, RespondDefault>,
|
WsRespond<NewPlainRoute, RespondDefault>,
|
||||||
WsRespond<RemovePlainRoute, RespondDefault>,
|
WsRespond<RemovePlainRoute, RespondDefault>,
|
||||||
WsRespond<PlainRouteReset, RespondDefault>,
|
WsRespond<PlainRouteReset, RespondDefault>,
|
||||||
|
@ -26,7 +26,7 @@ private:
|
||||||
QHash<QString, RouteResource> _route_resource_map;
|
QHash<QString, RouteResource> _route_resource_map;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlainRouteManage();
|
PlainRouteManagePlugin();
|
||||||
|
|
||||||
// 通过 ProcList 继承
|
// 通过 ProcList 继承
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const NewPlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const NewPlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
#include "SurfaceMotionPlugin.h"
|
#include "SurfaceMotion.h"
|
||||||
|
|
||||||
SurfaceMotionControlPlugin::SurfaceMotionControlPlugin()
|
SurfaceMotionPlugin::SurfaceMotionPlugin()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceMotionControlPlugin::recoveryFrom(const QJsonObject& obj)
|
void SurfaceMotionPlugin::recoveryFrom(const QJsonObject& obj)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceMotionControlPlugin::saveTo(QJsonObject& obj) const
|
void SurfaceMotionPlugin::saveTo(QJsonObject& obj) const
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
void SurfaceMotionPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
std::shared_ptr<const HorizontalArcMotion> in, QList<std::shared_ptr<RespondDefault>>& out)
|
std::shared_ptr<const HorizontalArcMotion> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto exec_result = std::make_shared<RespondDefault>();
|
auto exec_result = std::make_shared<RespondDefault>();
|
||||||
|
@ -45,7 +45,7 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
out << exec_result;
|
out << exec_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
void SurfaceMotionPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
std::shared_ptr<const StrightLineMotion> in, QList<std::shared_ptr<RespondDefault>>& out)
|
std::shared_ptr<const StrightLineMotion> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto exec_result = std::make_shared<RespondDefault>();
|
auto exec_result = std::make_shared<RespondDefault>();
|
||||||
|
@ -79,7 +79,7 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QMatrix4x4>
|
#include <QMatrix4x4>
|
||||||
void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
void SurfaceMotionPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
std::shared_ptr<const SyncRequest> in, QList<std::shared_ptr<RespondDefault>>& out)
|
std::shared_ptr<const SyncRequest> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto reqs = std::make_shared<MotionDeduceRequest>();
|
auto reqs = std::make_shared<MotionDeduceRequest>();
|
||||||
|
@ -93,7 +93,7 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
void SurfaceMotionPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
std::shared_ptr<const MotionDeduceRequest> in, QList<std::shared_ptr<RespondDefault>>& out)
|
std::shared_ptr<const MotionDeduceRequest> in, QList<std::shared_ptr<RespondDefault>>& out)
|
||||||
{
|
{
|
||||||
auto rst = std::make_shared<RespondDefault>();
|
auto rst = std::make_shared<RespondDefault>();
|
||||||
|
@ -142,17 +142,17 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
out << rst;
|
out << rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<WsComponent> SurfaceMotionControlPlugin::defaultNew() const
|
std::shared_ptr<WsComponent> SurfaceMotionPlugin::defaultNew() const
|
||||||
{
|
{
|
||||||
return std::make_shared<SurfaceMotionControlPlugin>();
|
return std::make_shared<SurfaceMotionPlugin>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceMotionControlPlugin::bindEntity(std::weak_ptr<WsEntity> host)
|
void SurfaceMotionPlugin::bindEntity(std::weak_ptr<WsEntity> host)
|
||||||
{
|
{
|
||||||
this->_bind_entity = host;
|
this->_bind_entity = host;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SurfaceMotionControlPlugin::name() const
|
QString SurfaceMotionPlugin::name() const
|
||||||
{
|
{
|
||||||
return NAME(SurfaceMotionControlPlugin);
|
return NAME(SurfaceMotionPlugin);
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 水面平台机动组件
|
/// 水面平台机动组件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class COMPONENTBASIC_EXPORT SurfaceMotionControlPlugin : public ProcList<
|
class COMPONENTBASIC_EXPORT SurfaceMotionPlugin : public ProcList<
|
||||||
WsRespond<HorizontalArcMotion, RespondDefault>,
|
WsRespond<HorizontalArcMotion, RespondDefault>,
|
||||||
WsRespond<StrightLineMotion, RespondDefault>,
|
WsRespond<StrightLineMotion, RespondDefault>,
|
||||||
WsRespond<MotionDeduceRequest, RespondDefault>,
|
WsRespond<MotionDeduceRequest, RespondDefault>,
|
||||||
|
@ -18,7 +18,7 @@ private:
|
||||||
Posture _start_posture;
|
Posture _start_posture;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SurfaceMotionControlPlugin();
|
SurfaceMotionPlugin();
|
||||||
|
|
||||||
// 通过 ProcList 继承
|
// 通过 ProcList 继承
|
||||||
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const HorizontalArcMotion> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const HorizontalArcMotion> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
@ -3,7 +3,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <motion_access.h>
|
#include <motion_access.h>
|
||||||
#include <SurfaceMotionPlugin.h>
|
#include <SurfaceMotion.h>
|
||||||
#include <internal_impl.h>
|
#include <internal_impl.h>
|
||||||
#include <VisibleCube.h>
|
#include <VisibleCube.h>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ int main(int argc, char* argv[])
|
||||||
cmd->_length_total = 200000;
|
cmd->_length_total = 200000;
|
||||||
|
|
||||||
auto enti = std::make_shared<RtWsEntity>();
|
auto enti = std::make_shared<RtWsEntity>();
|
||||||
auto motion = std::make_shared<SurfaceMotionControlPlugin>();
|
auto motion = std::make_shared<SurfaceMotionPlugin>();
|
||||||
enti->append(motion);
|
enti->append(motion);
|
||||||
auto box3d = std::make_shared<VisibleCubePlugin>();
|
auto box3d = std::make_shared<VisibleCubePlugin>();
|
||||||
enti->append(box3d);
|
enti->append(box3d);
|
||||||
|
|
Loading…
Reference in New Issue