Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
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
shangshang.dai
FmTakeaway
Commits
52e819c6
Commit
52e819c6
authored
Nov 20, 2018
by
戴尚尚
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
1e88c64c
2707a861
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
fmPrinter/fmPrinter.cpp
+0
-0
fmPrinter/fmPrinter.h
+31
-0
fmPrinter/fmPrinter.pro
+2
-0
No files found.
fmPrinter/fmPrinter.cpp
View file @
52e819c6
This diff is collapsed.
Click to expand it.
fmPrinter/fmPrinter.h
View file @
52e819c6
...
...
@@ -5,6 +5,8 @@
#include "Model/orderObject.h"
#include "Model/productObject.h"
#include <QLibrary>
#include <functional>
#include <iostream>
//中科英泰POS 打印接口返回值
#define HS_OK 0xF0
...
...
@@ -15,6 +17,7 @@ class FMPRINTERSHARED_EXPORT FmPrinter
public
:
static
FmPrinter
&
GetInstance
();
~
FmPrinter
();
/* 功能:打印订单
* 参数:[1]物理打印机名[2]订单对象
* 返回:true成功false失败
...
...
@@ -39,6 +42,13 @@ private:
* 返回:打印数据
* */
QString
_GetPrintData
(
OrderObject
*
pData
);
/* 功能:从订单对象获取打印数据
* 参数:[1]订单对象
* 返回:打印数据
* */
bool
_PrintBodyForShangmiPrinter
(
OrderObject
*
pData
);
/* 功能:打印数据
* 参数:[1]物理打印机名[2]信息内容
* 返回:打印数据
...
...
@@ -79,6 +89,27 @@ private:
typedef
int
(
*
fmCutPaper
)(
int
i
);
typedef
int
(
*
fmPrintHex
)(
char
*
pStr
,
int
nLength
);
//商米打印机接口
QLibrary
m_UAN_lib
;
using
PrintTextWithStyles
=
int
(
char
*
,
int
,
int
,
int
);
using
PrintBitmapFile
=
int
(
char
*
,
int
);
using
BeginPrint
=
int
(
int
);
using
PrintTicketBarcode
=
int
(
int
,
int
,
int
,
char
*
);
std
::
function
<
PrintTextWithStyles
>
m_printTextWithStyles
;
std
::
function
<
PrintBitmapFile
>
m_printBitmapFile
;
std
::
function
<
BeginPrint
>
m_beginPrint
;
std
::
function
<
PrintTicketBarcode
>
m_printTicketBarcode
;
bool
_shangmiPrinter
(
OrderObject
*
pData
);
bool
_shangmiPrinter
(
QString
data
);
enum
PRINTERTYPE
{
//打印机类型
SHANGMI
,
ZHONGKEYINGTAI
,
OTHER
};
PRINTERTYPE
printer
;
fmOpenPrinter
m_pOpenPrinter
;
fmPrintText
m_pPrintText
;
fmPrintBitmapFile
m_pPrintBitmapFile
;
...
...
fmPrinter/fmPrinter.pro
View file @
52e819c6
...
...
@@ -9,6 +9,8 @@ QT -= gui
TARGET
=
fmPrinter
TEMPLATE
=
lib
CONFIG
+=
C
++
11
DEFINES
+=
FMPRINTER_LIBRARY
INCLUDEPATH
+=
..
/
fmTakeaway
...
...
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