58 lines
1.1 KiB
C++
58 lines
1.1 KiB
C++
#include "exec_delegate.h"
|
|
|
|
ConsolePresent::ConsolePresent()
|
|
: _write_port(new QUdpSocket()){
|
|
_input_list[u8"Êä³ö±äÁ¿"] = std::shared_ptr<GeneralData>();
|
|
}
|
|
|
|
ConsolePresent::~ConsolePresent()
|
|
{
|
|
delete _write_port;
|
|
}
|
|
|
|
QString ConsolePresent::typeName() const
|
|
{
|
|
return NAME(ConsolePresent);
|
|
}
|
|
|
|
QHash<QString, std::shared_ptr<TopicData>> ConsolePresent::inputList() const
|
|
{
|
|
return _input_list;
|
|
}
|
|
|
|
QHash<QString, std::shared_ptr<TopicData>> ConsolePresent::outputList() const
|
|
{
|
|
return QHash<QString, std::shared_ptr<TopicData>>();
|
|
}
|
|
|
|
void ConsolePresent::reset()
|
|
{
|
|
}
|
|
|
|
#include <QJsonDocument>
|
|
#include <QJsonObject>
|
|
ExecuteResult ConsolePresent::execute()
|
|
{
|
|
QJsonObject obj;
|
|
_input_list[u8"Êä³ö±äÁ¿"]->saveTo(obj);
|
|
QJsonDocument doc(obj);
|
|
|
|
auto cnt = _write_port->writeDatagram(doc.toJson(), QHostAddress::LocalHost, 6000);
|
|
if(cnt < 0)
|
|
return ExecuteResult::FAILURE;
|
|
return ExecuteResult::SUCCESS;
|
|
}
|
|
|
|
std::shared_ptr<Serializable> ConsolePresent::newDefault() const
|
|
{
|
|
return std::make_shared<ConsolePresent>();
|
|
}
|
|
|
|
void ConsolePresent::recoveryFrom(const QJsonObject& obj)
|
|
{
|
|
}
|
|
|
|
void ConsolePresent::saveTo(QJsonObject& obj) const
|
|
{
|
|
}
|