mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
完成系统管理web端功能,实现系统管理服务端接口,实现登录功能
This commit is contained in:
28
src/protocol/Communicator.cpp
Normal file
28
src/protocol/Communicator.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "Communicator.h"
|
||||
#include "TcpEntity.h"
|
||||
|
||||
std::shared_ptr<CommEntity> Communicator::createEntity(DataFields& data)
|
||||
{
|
||||
std::string commType = data.getStr("commType");
|
||||
std::string ip = data.getStr("ip");
|
||||
int port = data.getInt("port");
|
||||
int isclient = data.getInt("isclient");
|
||||
|
||||
if (commType == "TCP")
|
||||
{
|
||||
auto entity = std::make_shared<TcpEntity>();
|
||||
entity->setHost(ip, port, isclient);
|
||||
return entity;
|
||||
}
|
||||
else if (commType == "MODBUS")
|
||||
{
|
||||
}
|
||||
else if (commType == "ACTIVEX")
|
||||
{
|
||||
}
|
||||
else if (commType == "SDK")
|
||||
{
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user