Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_takeout
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_takeout
Commits
b1018e6d
Commit
b1018e6d
authored
May 04, 2017
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.配置文件 Key 使用宏
parent
1398ffa3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
25 deletions
+50
-25
Tool/HttpSocket.cpp
+2
-2
Tool/configManger.cpp
+6
-4
Tool/initclass.cpp
+14
-7
Ui/DetailForm.cpp
+2
-2
Ui/MainWindow.cpp
+6
-4
fmp_takeout.pro
+2
-1
fmp_takeout_def.h
+12
-0
fmp_takeout_i.h
+5
-2
fmp_takeout_p.cpp
+1
-3
global/preDefine.h
+0
-0
No files found.
Tool/HttpSocket.cpp
View file @
b1018e6d
#include "HttpSocket.h"
#
include
"HttpSocket.h"
#include "Tool//configManger.h"
#include "global/preDefine.h"
#include <QEventLoop>
...
...
@@ -35,7 +35,7 @@ HttpSocket::~HttpSocket()
connect
(
reply
,
SIGNAL
(
finished
()),
&
eventLoop
,
SLOT
(
quit
()));
connect
(
reply
,
SIGNAL
(
error
(
QNetworkReply
::
NetworkError
)),
&
eventLoop
,
SLOT
(
quit
()));
//
m_time->singleShot(VALUE_NETTIMEOUT, &eventLoop, &QEventLoop::quit);
m_time
->
singleShot
(
VALUE_NETTIMEOUT
,
&
eventLoop
,
&
QEventLoop
::
quit
);
eventLoop
.
exec
();
if
(
reply
)
{
...
...
Tool/configManger.cpp
View file @
b1018e6d
...
...
@@ -2,6 +2,8 @@
#include <QApplication>
#include "global/preDefine.h"
#include "fmp_takeout_def.h"
#include <fmp_printer_i.h>
ConfigManger
&
ConfigManger
::
GetInstance
()
{
...
...
@@ -46,17 +48,17 @@ void ConfigManger::SetSqlConnectInfo(const ConfigManger::SqlConnectInfo &info)
QUrl
ConfigManger
::
GetServerUrl
()
{
return
m_config
->
value
(
INI_
SERVER
).
toUrl
();
return
m_config
->
value
(
FMP_INIKEY_TAKEOUT
SERVER
).
toUrl
();
}
QString
ConfigManger
::
GetPrinterName
()
{
return
m_userConfig
->
value
(
INI
_PRINTERNAME
).
toString
();
return
m_userConfig
->
value
(
FMP_INIKEY
_PRINTERNAME
).
toString
();
}
void
ConfigManger
::
SetPrinterName
(
const
QString
&
printer
)
{
m_userConfig
->
setValue
(
INI
_PRINTERNAME
,
printer
);
m_userConfig
->
setValue
(
FMP_INIKEY
_PRINTERNAME
,
printer
);
}
QPoint
ConfigManger
::
GetFloatInitPostion
()
...
...
@@ -86,7 +88,7 @@ int ConfigManger::GetListenPort()
QString
ConfigManger
::
GetAutoConfirm
()
{
return
m_Autoconfirm
->
value
(
INI_AUTOCONFIRM
).
toString
();
return
m_Autoconfirm
->
value
(
FMP_INIKEY_TAKEOUTAUTO
).
toString
();
}
//=================test================//
QString
ConfigManger
::
GetTestStoreName
()
...
...
Tool/initclass.cpp
View file @
b1018e6d
...
...
@@ -13,9 +13,16 @@
#include "Ui/DbsetForm.h"
#include "Ui/FloatWidget.h"
#include "Ui/MainWindow.h"
#include "fmp_takeout_def.h"
#include <fmp_home_i.h>
#ifdef Q_OS_WIN
#include "windows.h"
#endif
using
namespace
QsLogging
;
ThreadController
*
g_threadCtl
=
0
;
#if 0
fm_post FM_Networkpost = 0;
...
...
@@ -455,10 +462,10 @@ bool InitClass::GetStoreInfo(QString &m_storeid,QString &m_posid,QString &m_pass
{
QString
apppath
=
QCoreApplication
::
applicationDirPath
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/FreemudPOS.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
m_storeid
=
settings
->
value
(
"FMTAKEOOUT/storeId"
).
toString
();
m_posid
=
settings
->
value
(
"FMTAKEOOUT/posid"
).
toString
();
m_passd
=
settings
->
value
(
"FMTAKEOOUT/passwd"
).
toString
();
m_cashid
=
settings
->
value
(
"FMTAKEOOUT/cashierId"
).
toString
();
m_storeid
=
settings
->
value
(
FMP_INIKEY_LOGINSTOREID
).
toString
();
m_posid
=
settings
->
value
(
FMP_INIKEY_LOGINPOSID
).
toString
();
m_passd
=
settings
->
value
(
FMP_INIKEY_TAKEOUTPWD
).
toString
();
m_cashid
=
settings
->
value
(
FMP_INIKEY_LOGINCASHIER
).
toString
();
delete
settings
;
return
1
;
}
...
...
@@ -467,9 +474,9 @@ void InitClass::GetCathInfo(QString &m_cashname,QString &m_shiftid,QString &m_sh
{
QString
apppath
=
QCoreApplication
::
applicationDirPath
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/FreemudPOS.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
m_cashname
=
settings
->
value
(
"
FMTAKEOOUT
/cashname"
).
toString
();
m_shiftid
=
settings
->
value
(
"
FMTAKEOOUT
/shiftid"
).
toInt
();
m_shiftname
=
settings
->
value
(
"
FMTAKEOOUT
/shiftname"
).
toInt
();
m_cashname
=
settings
->
value
(
"
Takeout
/cashname"
).
toString
();
m_shiftid
=
settings
->
value
(
"
Takeout
/shiftid"
).
toInt
();
m_shiftname
=
settings
->
value
(
"
Takeout
/shiftname"
).
toInt
();
delete
settings
;
}
...
...
Ui/DetailForm.cpp
View file @
b1018e6d
...
...
@@ -115,8 +115,8 @@ void DetailForm::Readconfig()
{
QString
apppath
=
QCoreApplication
::
applicationDirPath
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/FreemudPOS.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
printsize
=
settings
->
value
(
"Printer/
printsize
"
).
toInt
();
printType
=
settings
->
value
(
"Printer/
printTyp
e"
).
toInt
();
printsize
=
settings
->
value
(
"Printer/
PaperWidth
"
).
toInt
();
printType
=
settings
->
value
(
"Printer/
Mod
e"
).
toInt
();
delete
settings
;
}
void
DetailForm
::
Writeconfig
()
...
...
Ui/MainWindow.cpp
View file @
b1018e6d
...
...
@@ -330,8 +330,11 @@ void MainWindow::onShowAlert(alertForm::Type type, const QString &msg)
{
//fms 错误的提示框暂时关闭
m_alertForm
->
SetContent
(
type
,
msg
);
if
(
!
m_reset
)
m_alertForm
->
show
();
if
(
!
m_reset
)
{
if
(
isVisible
())
{
m_alertForm
->
show
();
}
}
}
void
MainWindow
::
OnBtnHide
()
...
...
@@ -343,7 +346,6 @@ void MainWindow::showMain()
{
if
(
this
->
isVisible
())
{
this
->
hide
();
}
else
...
...
@@ -353,7 +355,7 @@ void MainWindow::showMain()
}
void
MainWindow
::
OnshowMainUi
()
{
m_reset
=
0
;
m_reset
=
0
;
}
void
MainWindow
::
OnResetHide
(
bool
var
)
...
...
fmp_takeout.pro
View file @
b1018e6d
...
...
@@ -89,7 +89,8 @@ HEADERS +=fmp_takeout_i.h \
Thread
/
workThread
/
OtherThreadctr
.
h
\
Thread
/
workThread
/
NetStoreInfo
.
h
\
Ui
/
RejectForm
.
h
\
Tool
/
HttpSocket
.
h
Tool
/
HttpSocket
.
h
\
fmp_takeout_def
.
h
FORMS
+=
\
Ui
/
mainwindow
.
ui
\
...
...
fmp_takeout_def.h
0 → 100644
View file @
b1018e6d
#ifndef FMP_TAKEOUT_DEF_H
#define FMP_TAKEOUT_DEF_H
#define FMP_INIKEY_TAKEOUTCUSTOMER "Takeout/Customer"
#define FMP_INIKEY_TAKEOUTDELIVER "Takeout/Deliver"
#define FMP_INIKEY_TAKEOUTPWD "Takeout/Password"
#define FMP_INIKEY_TAKEOUTENTRYPORT "Takeout/Entryport"
#define FMP_INIKEY_TAKEOUTENTRYSERVER "Takeout/Entryurl"
#define FMP_INIKEY_TAKEOUTAUTO "Takeout/AutoConfirm"
#define FMP_INIKEY_TAKEOUTSERVER "Takeout/Server"
#endif // FMP_TAKEOUT_DEF_H
fmp_takeout_i.h
View file @
b1018e6d
...
...
@@ -2,6 +2,9 @@
#define FMPTAKEOUTINTERFACE_H
#include <fmp_plugin_i.h>
#include "fmp_takeout_def.h"
/**
* 业务插件接口,必须继承自 FMPluginInterface
* @brief The FMPTakeoutInterface class
...
...
@@ -14,8 +17,8 @@ class FMPTakeoutInterface : public QObject, public FMPluginInterface
public
:
explicit
FMPTakeoutInterface
(
ctkPluginContext
*
ctx
)
:
FMPluginInterface
(
ctx
)
{
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerInit
,
this
,
&
FMPTakeoutInterface
::
OnTriggerInit
);
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerUninit
,
this
,
&
FMPTakeoutInterface
::
OnTriggerUninit
);
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerInit
,
this
,
&
FMPTakeoutInterface
::
OnTriggerInit
,
Qt
::
UniqueConnection
);
connect
(
this
,
&
FMPTakeoutInterface
::
TriggerUninit
,
this
,
&
FMPTakeoutInterface
::
OnTriggerUninit
,
Qt
::
UniqueConnection
);
}
signals
:
...
...
fmp_takeout_p.cpp
View file @
b1018e6d
...
...
@@ -30,7 +30,6 @@ int FMPTakeoutPrivate::Init()
{
_Home
=
q
->
GetService
<
FMPHomeInterface
>
(
q
->
_ctx
);
_Printer
=
q
->
GetService
<
FMPPrinterInterface
>
(
q
->
_ctx
);
_Printer
->
StartService
();
connect
(
&
InitClass
::
GetInstance
(),
&
InitClass
::
sgnHome
,
this
,
&
FMPTakeoutPrivate
::
sltHome
);
connect
(
&
InitClass
::
GetInstance
(),
&
InitClass
::
sgnStopRemind
,
this
,
&
FMPTakeoutPrivate
::
sltStopBlink
);
connect
(
this
,
&
FMPTakeoutPrivate
::
sgnGetFromHome
,
&
InitClass
::
GetInstance
(),
&
InitClass
::
sgnMainUi
);
...
...
@@ -39,7 +38,6 @@ int FMPTakeoutPrivate::Init()
connect
(
this
,
&
FMPTakeoutPrivate
::
sgnSendPrintName
,
&
InitClass
::
GetInstance
(),
&
InitClass
::
sgnSendPrintName
);
connect
(
this
,
&
FMPTakeoutPrivate
::
sgnReceiveStatus
,
&
InitClass
::
GetInstance
(),
&
InitClass
::
sgnReceStatus
);
connect
(
this
,
&
FMPTakeoutPrivate
::
sgnStopTime
,
&
InitClass
::
GetInstance
(),
&
InitClass
::
sgnGetThreadnet
);
FMPStartEventHandler
*
handler
=
new
FMPStartEventHandler
(
q
->
_ctx
,
q
);
InitClass
::
GetInstance
().
inItGloal
();
// InitClass::GetInstance().LoadDll();
InitClass
::
GetInstance
().
InitLogger
();
...
...
@@ -89,7 +87,7 @@ void FMPTakeoutPrivate::sltHome(QString path)
void
FMPTakeoutPrivate
::
sltStopBlink
(
int
type
)
{
_Home
->
stopBlink
(
type
);
_Home
->
stopBlink
(
q_ptr
);
}
void
FMPTakeoutPrivate
::
sltPrint
(
QString
data
)
...
...
global/preDefine.h
View file @
b1018e6d
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment