effectprocess 추가
git-svn-id: svn://192.168.0.12/source@306 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -1,33 +1,70 @@
|
||||
#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)
|
||||
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)
|
||||
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() << EnumErrorCodetostrErrorCode(_error).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);
|
||||
qDebug() << "slotDataOK asdf";
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user