라이브러리 qwebpage 에서 qwebenginepage로 변경 qt5.4 -> qt5.5.1 이상으로 변경 (이것만) git-svn-id: svn://192.168.0.12/source@307 8346c931-da38-4b9b-9d4c-e48b93cbd075
70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
#include "seffectprocess.h"
|
|
#include "sutilclass.h"
|
|
#include "sutilfunction.h"
|
|
#include <QDebug>
|
|
#include <iostream>
|
|
#include <QApplication>
|
|
namespace
|
|
{
|
|
const QString SEPERATOR = "!@#";
|
|
}
|
|
|
|
SEffectProcess::SEffectProcess(const QString& _platform_name, const QString& _platform_form,
|
|
const QString& _event_code, const QString& _url): m_pResultSender(new SResultSender)
|
|
{
|
|
m_pParam[E_PARAM_URL] = _url;
|
|
m_pParam[E_PARAM_EVENT_CODE] = _event_code;
|
|
m_pParam[E_PARAM_PLATFORM_FORM] = _platform_form;
|
|
m_pParam[E_PARAM_PLATFORM_NAME] = _platform_name;
|
|
initConnect();
|
|
}
|
|
|
|
int SEffectProcess::eventCode()
|
|
{
|
|
return m_pParam[E_PARAM_EVENT_CODE].toInt();
|
|
}
|
|
|
|
void SEffectProcess::slotOk()
|
|
{
|
|
qDebug() << "slotOk";
|
|
std::cout << 'o' << SEPERATOR.toStdString() << m_pParam[E_PARAM_EVENT_CODE].toStdString() <<
|
|
SEPERATOR.toStdString() << m_pParam[E_PARAM_URL].toStdString();
|
|
QApplication::quit();
|
|
}
|
|
|
|
void SEffectProcess::slotError(E_ERROR_CODE _error, const QString& _msg)
|
|
{
|
|
qDebug() << "slotError";
|
|
qDebug() << _msg;
|
|
std::cout << 'x' << SEPERATOR.toStdString() << m_pParam[E_PARAM_EVENT_CODE].toStdString()
|
|
<< SEPERATOR.toStdString() << m_pParam[E_PARAM_URL].toStdString()
|
|
<< SEPERATOR.toStdString() << EnumErrorCodetostrErrorCode(_error).toStdString()
|
|
<< SEPERATOR.toStdString() << _msg.toStdString();
|
|
QApplication::quit();
|
|
}
|
|
|
|
void SEffectProcess::slotDataOk(const EffectData& _data)
|
|
{
|
|
qDebug() << "slotDataOk";
|
|
State_s1_effect result = processData(_data);
|
|
if (send(result))
|
|
slotOk();
|
|
/*
|
|
else
|
|
slotError(E_ERROR_CODE::DB_UNKNOWN_ERROR, "");
|
|
*/
|
|
}
|
|
|
|
void SEffectProcess::initConnect()
|
|
{
|
|
QObject::connect(&(*m_pResultSender), &SResultSender::signalError,
|
|
this, &SEffectProcess::slotError);
|
|
}
|
|
|
|
bool SEffectProcess::send(const State_s1_effect& _result)
|
|
{
|
|
return m_pResultSender->send(_result);
|
|
}
|
|
|
|
|