Commit 52e819c6 by 戴尚尚

1

parents 1e88c64c 2707a861
......@@ -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;
......
......@@ -9,6 +9,8 @@ QT -= gui
TARGET = fmPrinter
TEMPLATE = lib
CONFIG += C++11
DEFINES += FMPRINTER_LIBRARY
INCLUDEPATH += ../fmTakeaway
......
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