Commit e5ce05bd by jackalone

解决退出不能正常退出的bug问题。(打印的操作待打印机来了一并测试)

parent 6f71ce4d
......@@ -19,20 +19,20 @@ ThreadController::ThreadController(QObject *parent) :
connect(&_flowcontroll, SIGNAL(finished()), this, SLOT(deleteLater()));
//拒单线程
_refusecontroll.setObjectName(QString("refusecontrollThread"));
reufuseControl::GetInstance().moveToThread(&_refusecontroll);
reufuseControl::GetInstance().SetListenPort(ConfigManger::GetInstance().GetListenPort());
connect(&_refusecontroll, SIGNAL(started()), this, SLOT(sltThreadStarted()));
connect(&_refusecontroll,&QThread::started, &reufuseControl::GetInstance(),&reufuseControl::run);
_refusecontroll.start();
connect(&_refusecontroll, SIGNAL(finished()), this, SLOT(deleteLater()));
// _refusecontroll.setObjectName(QString("refusecontrollThread"));
// reufuseControl::GetInstance().moveToThread(&_refusecontroll);
// reufuseControl::GetInstance().SetListenPort(ConfigManger::GetInstance().GetListenPort());
// connect(&_refusecontroll, SIGNAL(started()), this, SLOT(sltThreadStarted()));
// connect(&_refusecontroll,&QThread::started, &reufuseControl::GetInstance(),&reufuseControl::run);
// _refusecontroll.start();
// connect(&_refusecontroll, SIGNAL(finished()), this, SLOT(deleteLater()));
//其他辅助线程
_othercontroll.setObjectName(QString("_othercontrollThread"));
otherThreadctr::GetInstance().moveToThread(&_othercontroll);
connect(&_othercontroll, SIGNAL(started()), this, SLOT(sltThreadStarted()));
_othercontroll.start();
connect(&_othercontroll, SIGNAL(finished()), this, SLOT(deleteLater()));
// _othercontroll.setObjectName(QString("_othercontrollThread"));
// otherThreadctr::GetInstance().moveToThread(&_othercontroll);
// connect(&_othercontroll, SIGNAL(started()), this, SLOT(sltThreadStarted()));
// _othercontroll.start();
// connect(&_othercontroll, SIGNAL(finished()), this, SLOT(deleteLater()));
#if 0
// 网络连接获取门店的信息进程
......@@ -52,24 +52,37 @@ ThreadController::ThreadController(QObject *parent) :
ThreadController::~ThreadController()
{
}
void ThreadController::terminateFlowcontrollThread()
{
_flowcontroll.terminate();
_flowcontroll.wait(500);
_flowcontroll.quit();
_flowcontroll.wait();
//_flowcontroll.terminate();
// _flowcontroll.wait(500);
}
void ThreadController::terminateRefusecontrollThread()
{
_refusecontroll.terminate();
_refusecontroll.wait(500);
while(QThread::currentThread()->isRunning())
{
QThread::currentThread()->quit();
}
//_refusecontroll.terminate();
// _refusecontroll.wa//t(500);
}
void ThreadController::terminateOthercontrollThread()
{
_othercontroll.terminate();
_othercontroll.wait(500);
while(QThread::currentThread()->isRunning())
{
QThread::currentThread()->quit();
}
//_othercontroll.terminate();
// _othercontroll.wait(500);
}
//void ThreadController::terminateNetstoreinfoctrlThread()
......
......@@ -17,6 +17,7 @@
#include "Ui/DetailForm.h"
#include <QNetworkInterface>
#if 0
int getdata(void* ptr, int size, int nmemb, void* stream)
{
unsigned int i = size * nmemb;
......@@ -24,11 +25,11 @@ int getdata(void* ptr, int size, int nmemb, void* stream)
memcpy((char *)stream + totalSize, ptr, i);
return size*nmemb;
}
#endif
flowControll::flowControll(QObject *parent) : QObject(parent),m_loginSocket(0),
m_pullOrderSocket(0),
m_procOrderSocket(0),
m_syncStockSocket(0)
m_syncStockSocket(0),m_follow(0),m_syncTime(0)
{
m_storeId="",
......@@ -37,6 +38,8 @@ flowControll::flowControll(QObject *parent) : QObject(parent),m_loginSocket(0),
m_cashierId="",
m_cashiername="";
m_timestamp="0";
m_time = new QTimer();
}
......@@ -54,6 +57,8 @@ void flowControll::onStartFlow()
m_procOrderSocket = new HttpSocket(this);
m_syncStockSocket = new HttpSocket(this);
qDebug()<<"~~~~~~~~~~~~~~~~~~~~~flowControll work is~~~~~~~~~~~~~~~~~~~~~"<< QThread::currentThread();
if(_GetStoreInfo())
{
_Login();
......@@ -76,7 +81,6 @@ bool flowControll::_Login()
if(!result)
{
QLOG_INFO() << "11111111111111111111111111111111";
emit showAlert(alertForm::ERROR, InitClass::GetInstance().GB2312ToUnicode("登录失败![网络错误]"));
}
else
......@@ -84,7 +88,7 @@ bool flowControll::_Login()
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{
result = false;
//emit showAlert(alertForm::ERROR, InitClass::GetInstance().GB2312ToUnicode("登录失败![%1]").arg( InitClass::GetInstance().GB2312ToUnicode(recvJson[JSON_MESSAGE].toString().toLatin1().data())));
emit showAlert(alertForm::ERROR, InitClass::GetInstance().GB2312ToUnicode("登录失败![%1]").arg( InitClass::GetInstance().GB2312ToUnicode(recvJson[JSON_MESSAGE].toString().toLatin1().data())));
}
else
{
......@@ -109,6 +113,35 @@ bool flowControll::_Login()
return result;
}
void flowControll::onStopTimer()
{
m_time->stop();
m_follow = 1;
if(m_loginSocket)
{
delete m_loginSocket;
m_loginSocket = 0;
}
if(m_pullOrderSocket)
{
delete m_pullOrderSocket;
m_pullOrderSocket = 0;
}
if(m_syncStockSocket)
{
delete m_syncStockSocket;
m_syncStockSocket = 0;
}
if(m_procOrderSocket)
{
delete m_procOrderSocket;
m_procOrderSocket = 0;
}
emit sgnKillThread();
}
void flowControll::_netData(QJsonObject &sendJson)
{
#if 0
......@@ -168,7 +201,21 @@ bool flowControll::_PullOrder()
qDebug()<<"m_timestamp is"<<m_timestamp;
sendJson = DataManger::GetInstance().GetPullOrderData(m_timestamp,ConfigManger::GetInstance().GetAutoConfirm());
QLOG_INFO() << QString("[---pull order---][requestData:%1]").arg(_GetJsonStr(sendJson));
result = m_pullOrderSocket->HttpRequest(sendJson, recvJson, error);
if(m_follow)
{
emit sgnKillThread();
return 0;
}
else
{
if(m_pullOrderSocket)
{
result = m_pullOrderSocket->HttpRequest(sendJson, recvJson, error);
}
else {
return 0;
}
}
QLOG_INFO() << QString("pull order finsh. [result:%1][msg:%2]")
.arg(result).arg(error);
......@@ -219,6 +266,7 @@ bool flowControll::_PullOrder()
.arg(_GetJsonStr(jsonObject));
WriteData(orderObject->order_id);
emit changeOrderStatus(orderObject);
// DetailForm::GetInstance().printData();
}
else
{
......@@ -237,11 +285,12 @@ bool flowControll::_PullOrder()
m_timestamp = orderObject->timestamp;
}
syncTime = recvJson[JSON_SYNCTIME].toInt()*1000;
m_syncTime = syncTime;
}
}
QLOG_INFO() << QString("%1 msec after pull order...").arg(syncTime);
QTimer::singleShot(syncTime, this, &flowControll::_PullOrder);
m_time->singleShot(syncTime, this, &flowControll::_PullOrder);
return result;
......@@ -323,7 +372,7 @@ bool flowControll::_SynStock()
}
QLOG_INFO() << QString("%1 msec after synStock...").arg(synInterval);
QTimer::singleShot(synInterval, this, &flowControll::_SynStock);
m_time->singleShot(synInterval, this, &flowControll::_SynStock);
return result;
}
......
......@@ -10,6 +10,7 @@
#include "Model/cashierObject.h"
#include "global/externalinterface.h"
#include "Tool/HttpSocket.h"
#include <QTimer>
class flowControll : public QObject
{
......@@ -35,6 +36,8 @@ public:
HttpSocket *m_pullOrderSocket;
HttpSocket *m_procOrderSocket;
HttpSocket *m_syncStockSocket;
QTimer *m_time;
int m_syncTime;
private:
// 门店信息
......@@ -48,6 +51,7 @@ private:
QMap<QString, OrderObject*> m_ordersMap; // 订单容器
// 当前收银员
CashierObject m_cashierObject;
bool m_follow;
signals:
void showAlert(alertForm::Type type, const QString& msg);//显示通知窗口
void hideAlert(); //隐藏通知窗口
......@@ -60,6 +64,8 @@ signals:
void showOrderDetails(OrderObject* orderObject);//获取订单详情信号
void TodetailForm(const QString& str);
void updateCashier(QString str);
void sgnThreadFollow();
void sgnKillThread();
public slots:
void onStartFlow(); //线程的初始化工作
......@@ -80,6 +86,7 @@ public slots:
void onNetReEntryOrder(const QString &orderId);//发送数据到服务端
void onProcessRejectOrder(const QString& orderId, const int& reason, const int &reasontype);
bool _RefundOrder(const QString& orderId, QString reason);//退单
void onStopTimer();
};
......
......@@ -13,6 +13,7 @@ reufuseControl::reufuseControl(QObject *parent) :
m_tcpServer(0),
QObject(parent)
{
qDebug()<<"~~~~~~~~~~~~~~~~~~~~~reufuseControl work is~~~~~~~~~~~~~~~~~~~~~ "<<QThread::currentThread();
refuseSocket = new HttpSocket(this);
m_tcpServer = new QTcpServer(this);
}
......
......@@ -5,15 +5,20 @@
#include <QTimer>
#include <QNetworkReply>
HttpSocket::HttpSocket(QObject *parent) : QObject(parent)
HttpSocket::HttpSocket(QObject *parent) : QObject(parent),m_time(0)
{
m_time = new QTimer();
m_networkRequest.setUrl(ConfigManger::GetInstance().GetServerUrl());
m_networkRequest.setRawHeader("Content-Type","text/json");
}
HttpSocket::~HttpSocket()
{
if(m_time)
{
delete m_time;
m_time = 0;
}
}
......@@ -23,7 +28,6 @@ HttpSocket::~HttpSocket()
{
m_networkManger.setNetworkAccessible(QNetworkAccessManager::Accessible);
}
QByteArray sendArray = QJsonDocument(requestJson).toJson(QJsonDocument::Compact);
QEventLoop eventLoop;
QNetworkReply *reply = m_networkManger.post(m_networkRequest , sendArray);
......@@ -31,9 +35,12 @@ HttpSocket::~HttpSocket()
connect(reply, SIGNAL(finished()), &eventLoop, SLOT(quit()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), &eventLoop, SLOT(quit()));
QTimer::singleShot(VALUE_NETTIMEOUT, &eventLoop, &QEventLoop::quit);
// m_time->singleShot(VALUE_NETTIMEOUT, &eventLoop, &QEventLoop::quit);
eventLoop.exec();
if(reply)
{
qDebug()<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
}
if(reply->error() != QNetworkReply::NoError)
{
error = reply->errorString();
......
......@@ -6,6 +6,7 @@
#include <QJsonDocument>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QTimer>
class HttpSocket : public QObject
{
......@@ -17,6 +18,7 @@ public:
private:
QNetworkAccessManager m_networkManger;
QNetworkRequest m_networkRequest;
QTimer *m_time;
};
#endif // HTTPSOCKET_H
......@@ -37,7 +37,7 @@ int m_netflag = 0;
char getch[40960] = {0};
Request req = {0};
#endif
DbsetForm *m_dbsetWidget = 0;
FloatWidget *m_floatWidget = 0;
MainWindow *m_mainWidget = 0 ;
......@@ -253,6 +253,27 @@ InitClass::~InitClass()
}
void InitClass::slotThread()
{
g_threadCtl->terminateFlowcontrollThread();
if(g_threadCtl)
{
delete g_threadCtl;
g_threadCtl = 0;
}
if(m_floatWidget)
{
delete m_floatWidget;
m_floatWidget=0;
}
if(m_mainWidget)
{
delete m_mainWidget;
m_mainWidget=0;
}
}
void InitClass::initnetData()
{
......@@ -336,7 +357,7 @@ void InitClass::startInit()
void InitClass::initTheme(const QString& theme)
{
QString rccPath = QString("%1/image/%2.rcc").arg(strpath).arg(theme);
QString rccPath = QString("%1/../rcc/image/%2.rcc").arg(strpath).arg(theme);
qDebug()<<"rccPath is"<<rccPath;
if(!QFile(rccPath).exists())
{
......@@ -381,11 +402,17 @@ void InitClass::InitDialog()
m_floatWidget = new FloatWidget ;
m_mainWidget = new MainWindow;
//响声音
connect(m_mainWidget,&MainWindow::sgnSound,m_floatWidget,&FloatWidget::onStartRemind);
// connect(m_mainWidget,&MainWindow::sgnSound,m_floatWidget,&FloatWidget::onStartRemind);
connect(m_mainWidget,&MainWindow::sgnMainHome,this,&InitClass::sgnHome);
connect(this, &InitClass::sgnMainUi,m_mainWidget,&MainWindow::OnshowMainUi);
connect(this, &InitClass::sgnMainUi, m_mainWidget, &MainWindow::show);
connect(m_mainWidget, &MainWindow::sgnStopRemind, this, &InitClass::sgnStopRemind);
// 退出线程
connect(this,SIGNAL(sgnGetThreadnet()),m_mainWidget,SIGNAL(sgnThreadNet()));
connect(m_mainWidget,SIGNAL(sgnThreadKillMain()),this,SLOT(slotThread()));
//打印接口
connect(m_mainWidget,&MainWindow::sgnPrintNameInit,this,&InitClass::sgnPrintName2); //发出信号
......
......@@ -43,5 +43,8 @@ public:
Q_SIGNAL void sgnPrintName2();
Q_SIGNAL void sgnSendPrintName(QString str);
Q_SIGNAL void sgnReceStatus(bool var);
Q_SIGNAL void sgnGetThreadnet();
Q_SIGNAL void sgnGetThread();
Q_SLOT void slotThread();
};
#endif // INITCLASS_H
......@@ -390,10 +390,10 @@ QString DetailForm::PrintdataNormal(OrderObject *pData) //传入一般模式的
QString str_comd_list;
total=pData->proList.count()*2;
QString filePath = QString("%1/PrinterModle.txt").arg(QCoreApplication::applicationDirPath());
QString filePath = QString("%1/Printer.template").arg(QCoreApplication::applicationDirPath());
QFile file(filePath);
if( !file.open( QFile::ReadOnly)){
return InitClass::GetInstance().GB2312ToUnicode("无法打开PrinterModle.txt!");
return InitClass::GetInstance().GB2312ToUnicode("无法打开Printer.template");
}
QLOG_INFO()<<"GetPrintData Normal is star";
......@@ -415,17 +415,17 @@ QString DetailForm::PrintdataNormal(OrderObject *pData) //传入一般模式的
{
if(!v.compare(InitClass::GetInstance().GB2312ToUnicode("顾客留存")))
{
fee = Penny2Dollar(pData->user_fee);
fee = InitClass::GetInstance().GB2312ToUnicode("应付金额:¥ ")+Penny2Dollar(pData->user_fee);
}
else if(!v.compare(InitClass::GetInstance().GB2312ToUnicode("商户留存")))
{
if(!pData->pay_type.compare(InitClass::GetInstance().GB2312ToUnicode("货到付款")))
{
fee= Penny2Dollar(pData->shop_fee);
fee= InitClass::GetInstance().GB2312ToUnicode("应收现金:¥ ")+Penny2Dollar(pData->shop_fee);
}
else
{
fee = "0";
fee = InitClass::GetInstance().GB2312ToUnicode("应收金额:¥ 0");
}
}
......@@ -433,7 +433,11 @@ QString DetailForm::PrintdataNormal(OrderObject *pData) //传入一般模式的
{
if(!pData->pay_type.compare(InitClass::GetInstance().GB2312ToUnicode("货到付款")))
{
fee=Penny2Dollar(pData->user_fee);
fee=InitClass::GetInstance().GB2312ToUnicode("应收金额:¥")+Penny2Dollar(pData->user_fee);
}
else
{
fee=InitClass::GetInstance().GB2312ToUnicode("应收金额:¥ 0");
}
}
print = str_print.append(v).append("|").append(pData->channelName).append("|").append(pData->order_id).append("|").append(pData->pay_type).append("|")
......
......@@ -91,7 +91,9 @@ MainWindow::MainWindow(QWidget *parent) :
connect(&flowControll::GetInstance(),&flowControll::showCashierChooseForm,this,&MainWindow::onShowCashierChooseForm);//显示收银员选择窗
connect(&flowControll::GetInstance(),&flowControll::showOrderDetails,this,&MainWindow::onShowOrderDetails);//显示订单的详情
connect(&flowControll::GetInstance(),&flowControll::updateCashier,this,&MainWindow::onUpdateshowCashier);
connect(this,&MainWindow::sgnThreadNet,&flowControll::GetInstance(),&flowControll::sgnThreadFollow); //kill线程
connect(&flowControll::GetInstance(),&flowControll::sgnThreadFollow,&flowControll::GetInstance(),&flowControll::onStopTimer);
connect(&flowControll::GetInstance(),&flowControll::sgnKillThread,this,&MainWindow::sgnThreadKillMain);
psetting = new PrintSetting(this);
m_keyBoadForm = new KeyBoardForm(this);
......@@ -139,19 +141,23 @@ MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow()
{
g_threadCtl->terminateFlowcontrollThread();
g_threadCtl->terminateRefusecontrollThread();
// g_threadCtl->terminateFlowcontrollThread();
// g_threadCtl->terminateRefusecontrollThread();
// g_threadCtl->terminateOthercontrollThread();
delete g_threadCtl;
g_threadCtl = 0;
//FM_Destroy();
delete m_dbsetWidget;
delete m_floatWidget;
// delete m_dbsetWidget;
// delete m_floatWidget;
// FM_deletpr();
delete ui;
// delete ui;
}
void MainWindow::InitstyleMain()
{
QString strpath= QCoreApplication::applicationDirPath();
rccPath = QString("%1/image/%2.rcc").arg(strpath).arg(APP_THEME);
rccPath = QString("%1/../rcc/image/%2.rcc").arg(strpath).arg(APP_THEME);
qDebug()<<"rccPath is"<<rccPath;
if(!QFile(rccPath).exists())
{
......@@ -182,7 +188,7 @@ void MainWindow::unRegisterInitstyle()
{
QString strpath= QCoreApplication::applicationDirPath();
qDebug()<<"strpath is"<<strpath;
rccPath = QString("%1/image/%2.rcc").arg(strpath).arg(APP_THEME);
rccPath = QString("%1/../rcc/image/%2.rcc").arg(strpath).arg(APP_THEME);
qDebug()<<"rccPath is"<<rccPath;
if(!QFile(rccPath).exists())
{
......@@ -450,19 +456,20 @@ void MainWindow::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
// 检测是否需要提示
if(ui->mainTableNew->rowCount() > 0)
{
emit sgnMainHome(QCoreApplication::applicationDirPath()+"/image/float_remind.png");
emit sgnMainHome(QString("%1/../rcc/image/float_remind.png").arg(QCoreApplication::applicationDirPath()));
// emit sgnSound(0);
}
else if( orderObject->status == 2)
{
if(!ReadData(orderObject->order_id))
{
emit sgnMainHome(QCoreApplication::applicationDirPath()+"/image/float_remind.png");
emit sgnMainHome(QString("%1/../rcc/image/float_remind.png").arg(QCoreApplication::applicationDirPath()));
}
}
else if(ui->mainTableRefund->rowCount() > 0)
{
emit sgnMainHome(QCoreApplication::applicationDirPath()+"/image/float_remind.png");
emit sgnMainHome(QString("%1/../rcc/image/float_remind.png").arg(QCoreApplication::applicationDirPath()));
// emit sgnSound(1);
}
else
......
......@@ -76,6 +76,8 @@ public:
Q_SIGNAL void sgnSendPrintNameInit(QString str);
Q_SIGNAL void sgnReceiveStatusInit(bool var);
Q_SIGNAL void sgnResetHide(bool var);
Q_SIGNAL void sgnThreadNet();
Q_SIGNAL void sgnThreadKillMain();
//
// Q_SIGNAL void getOrderDetails(const QString& orderId,int i);//获取订单详情信号
Q_SLOT void OnBtnCashier(); //查看在线收银员
......
......@@ -19,9 +19,7 @@ FMPTakeout::~FMPTakeout()
void FMPTakeout::InitService()
{
if (!_inited) {
d_func()->Init();
}
d_func()->Init();
}
void FMPTakeout::UninitService()
......
TEMPLATE = lib
QT += core gui network sql printsupport
QT += core gui network sql printsupport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
DESTDIR = ./bin
MOC_DIR = ./tmp
......
......@@ -10,9 +10,9 @@
#include <QDebug>
#include "fmp_home_i.h"
#include "fmp_printer_i.h"
FMPTakeoutPrivate::FMPTakeoutPrivate(FMPTakeout *q)
: q_ptr(q)
#include "fmp_te_handlers.h"
FMPTakeoutPrivate::FMPTakeoutPrivate(FMPTakeout *parent)
: q_ptr(parent)
{
}
......@@ -38,15 +38,17 @@ int FMPTakeoutPrivate::Init()
connect(&InitClass::GetInstance(),&InitClass::sgnPrintName2,this,&FMPTakeoutPrivate::sltPrintName);
connect(this,&FMPTakeoutPrivate::sgnSendPrintName,&InitClass::GetInstance(),&InitClass::sgnSendPrintName);
connect(this,&FMPTakeoutPrivate::sgnReceiveStatus,&InitClass::GetInstance(),&InitClass::sgnReceStatus);
// FMPStartEventHandler* handler = new FMPStartEventHandler(q->_ctx, q);
connect(this,&FMPTakeoutPrivate::sgnStopTime,&InitClass::GetInstance(),&InitClass::sgnGetThreadnet);
FMPStartEventHandler* handler = new FMPStartEventHandler(q->_ctx, q);
InitClass::GetInstance().inItGloal();
// InitClass::GetInstance().LoadDll();
InitClass::GetInstance().InitLogger();
InitClass::GetInstance().InitDialog();
q->_inited = true;
q->_inited = true;
return FMP_SUCCESS;
}
else{
//InitClass::GetInstance().inItGloal();
emit sgnGetFromHome();
return 1;
}
......@@ -61,32 +63,24 @@ FMPTakeoutPrivate::~FMPTakeoutPrivate()
int FMPTakeoutPrivate::Uninit()
{
Q_Q(FMPTakeout);
emit sgnStopTime();
if(_Printer != nullptr)
{
delete _Printer;
_Printer = 0;
}
if(_Home!= nullptr)
{
delete _Home;
_Home = 0;
}
if(_settings!= nullptr)
{
delete _settings;
_settings = 0;
}
q->_inited = false;
return FMP_SUCCESS;
}
void FMPTakeoutPrivate::ShowForm()
{
}
// home 提供接口
void FMPTakeoutPrivate::sltHome(QString path)
{
......@@ -101,14 +95,14 @@ void FMPTakeoutPrivate::sltStopBlink(int type)
void FMPTakeoutPrivate::sltPrint(QString data)
{
// emit sgnReceiveStatus(_Printer->DoPrint(data));
emit sgnReceiveStatus(_Printer->DoPrint(data));
}
void FMPTakeoutPrivate::sltPrintName()
{
// if(_Printer)
// {
// emit sgnSendPrintName(_Printer->GetPrintName());
// }
if(_Printer)
{
emit sgnSendPrintName(_Printer->GetPrintName());
}
}
......@@ -14,7 +14,6 @@ public:
int Init();
int Uninit();
~FMPTakeoutPrivate();
void ShowForm();
private:
......@@ -22,15 +21,16 @@ public:
FMPTakeout *q_ptr;
FMPHomeInterface *_Home;
FMPPrinterInterface *_Printer;
private:
FMPSettingsInterface *_settings;
Q_SLOT void sltHome(QString path);
Q_SLOT void sltStopBlink(int type);
Q_SLOT void sltPrint(QString data);
Q_SLOT void sltPrintName();
Q_SIGNAL void sgnGetFromHome();
Q_SIGNAL void sgnQuitThread();
Q_SIGNAL void sgnSendPrintName(QString str);
Q_SIGNAL void sgnReceiveStatus(bool var);
Q_SIGNAL void sgnStopTime();
};
#endif // FMP_TAKEOUT_P_H
......@@ -29,24 +29,26 @@
#include <QDebug>
FMPTakeoutPlugin::FMPTakeoutPlugin()
: _Takeout_service(0)
: _takeout_service(0)
{
}
void FMPTakeoutPlugin::start(ctkPluginContext* context)
{
_Takeout_service = new FMPTakeout(context);
context->registerService<FMPTakeoutInterface>( _Takeout_service);
_takeout_service = new FMPTakeout(context);
context->registerService<FMPTakeoutInterface>( _takeout_service);
}
void FMPTakeoutPlugin::stop(ctkPluginContext* context)
{
Q_UNUSED(context)
if (_Takeout_service)
if (_takeout_service)
{
delete _Takeout_service;
_Takeout_service = 0;
delete _takeout_service;
_takeout_service = 0;
}
int a = 0;
}
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
......
......@@ -21,7 +21,7 @@ public:
private:
FMPTakeout* _Takeout_service;
FMPTakeout* _takeout_service;
}; // FMPTakeoutPlugin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment