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
7a00d66d
Commit
7a00d66d
authored
Oct 18, 2018
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加对商米打印机的支持
parent
31985820
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 @
7a00d66d
This diff is collapsed.
Click to expand it.
fmPrinter/fmPrinter.h
View file @
7a00d66d
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#include "Model/orderObject.h"
#include "Model/orderObject.h"
#include "Model/productObject.h"
#include "Model/productObject.h"
#include <QLibrary>
#include <QLibrary>
#include <functional>
#include <iostream>
//中科英泰POS 打印接口返回值
//中科英泰POS 打印接口返回值
#define HS_OK 0xF0
#define HS_OK 0xF0
...
@@ -15,6 +17,7 @@ class FMPRINTERSHARED_EXPORT FmPrinter
...
@@ -15,6 +17,7 @@ class FMPRINTERSHARED_EXPORT FmPrinter
public
:
public
:
static
FmPrinter
&
GetInstance
();
static
FmPrinter
&
GetInstance
();
~
FmPrinter
();
/* 功能:打印订单
/* 功能:打印订单
* 参数:[1]物理打印机名[2]订单对象
* 参数:[1]物理打印机名[2]订单对象
* 返回:true成功false失败
* 返回:true成功false失败
...
@@ -39,6 +42,13 @@ private:
...
@@ -39,6 +42,13 @@ private:
* 返回:打印数据
* 返回:打印数据
* */
* */
QString
_GetPrintData
(
OrderObject
*
pData
);
QString
_GetPrintData
(
OrderObject
*
pData
);
/* 功能:从订单对象获取打印数据
* 参数:[1]订单对象
* 返回:打印数据
* */
bool
_PrintBodyForShangmiPrinter
(
OrderObject
*
pData
);
/* 功能:打印数据
/* 功能:打印数据
* 参数:[1]物理打印机名[2]信息内容
* 参数:[1]物理打印机名[2]信息内容
* 返回:打印数据
* 返回:打印数据
...
@@ -79,6 +89,27 @@ private:
...
@@ -79,6 +89,27 @@ private:
typedef
int
(
*
fmCutPaper
)(
int
i
);
typedef
int
(
*
fmCutPaper
)(
int
i
);
typedef
int
(
*
fmPrintHex
)(
char
*
pStr
,
int
nLength
);
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
;
fmOpenPrinter
m_pOpenPrinter
;
fmPrintText
m_pPrintText
;
fmPrintText
m_pPrintText
;
fmPrintBitmapFile
m_pPrintBitmapFile
;
fmPrintBitmapFile
m_pPrintBitmapFile
;
...
...
fmPrinter/fmPrinter.pro
View file @
7a00d66d
...
@@ -9,6 +9,8 @@ QT -= gui
...
@@ -9,6 +9,8 @@ QT -= gui
TARGET
=
fmPrinter
TARGET
=
fmPrinter
TEMPLATE
=
lib
TEMPLATE
=
lib
CONFIG
+=
C
++
11
DEFINES
+=
FMPRINTER_LIBRARY
DEFINES
+=
FMPRINTER_LIBRARY
INCLUDEPATH
+=
..
/
fmTakeaway
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