Commit 123a16d2 by 李定达

1.限制杯贴打印高度

parent 0eae3a71
#include "StdAfx.h"
#include "LoadDll.h"
#include "BPLAPrint.h"
#include <sstream>
#define RESULT -1
#define LENTH_FMS 30
......@@ -1976,6 +1977,11 @@ int WinPrintlnTsc(int x, int y, int font_size, int rotate, int font_type, int hi
if(heigth > y + 1)
y = heigth + high_len;
if(y > atoi(m_printclass.tsc_high.c_str())*10 - 80)
y = atoi(m_printclass.tsc_high.c_str())*10 - 80;
printf("高度:%d\r\n", y);
Function_Argv argv = {0};
INIT_FUN_ARGV(x, y, font_size, font_type, line, font_name, data, font_ratio);
......@@ -2002,8 +2008,8 @@ int WinPrintlnTsc(int x, int y, int font_size, int rotate, int font_type, int hi
tmpi = 1;
}
if(y > atoi(m_printclass.tsc_high.c_str()) * 10 - font_size - 60)
y = atoi(m_printclass.tsc_high.c_str()) * 10 - font_size - 60;
if(y > atoi(m_printclass.tsc_high.c_str()) * 10 - 80)
y = atoi(m_printclass.tsc_high.c_str()) * 10 - 80;
VC_Log_WriteLog(0," %d", y);
......@@ -2231,30 +2237,63 @@ int PrintCloseTsc(char *page, char *num)
strcpy(tmp2, m_printclass.tsc_speed.c_str());
strcpy(tmp3, m_printclass.tsc_chroma.c_str());
if(TSC_setup(tmp0, tmp1, tmp2, tmp3, "0", "3", "0") == 0)
VC_Log_WriteLog(1," %s","标签打印机设置打印区域失败");
//if(TSC_setup(tmp0, tmp1, tmp2, tmp3, "0", "f", "2") == 0)
// VC_Log_WriteLog(1," %s","标签打印机设置打印区域失败");
heigth = 0;
TSC_sendcommand("DIRECTION 1");
TSC_clearbuffer();
int tmpi = 0;
std::stringstream stm1, stm2, stm3;
stm1 << "SIZE " << tmp0 << "mm," << tmp1 << "mm";
char tmps1[64] = {0};
char tmps2[64] = {0};
strcpy(tmps1, stm1.str().data());
tmpi = TSC_sendcommand(tmps1);
tmpi = TSC_sendcommand("GAP 2 mm,0");
tmpi = TSC_sendcommand("SPEED 6");
tmpi = TSC_sendcommand("DENSITY 12");
tmpi = TSC_sendcommand("CLS");
tmpi = TSC_sendcommand("DIRECTION 1");
tmpi = TSC_sendcommand("SHIFT 0");
printf("\r\ntmpi:%d\r\n",tmpi);
//TSC_clearbuffer();
int i = 0;
while(i < m_label_args.size())
{
std::stringstream stm;
char tmpfont_name[40] = {0};
char tmpdata[256] = {0};
char tmpdata[512] = {0};
char tmpsdata[512] = {0};
Function_Argv argv = m_label_args[i];
//TSC_windowsfont(x, heigth, font_size, rotate, font_type, line, font_name, tmp);
strcpy(tmpfont_name, argv.font_name.c_str());
strcpy(tmpdata, argv.data.c_str());
TSC_windowsfont(argv.x, argv.y, argv.font_size, argv.rotate, argv.font_type, argv.line, tmpfont_name, tmpdata);
//TSC_windowsfont(argv.x, argv.y, argv.font_size, argv.rotate, argv.font_type, argv.line, tmpfont_name, tmpdata);
stm << "TEXT " << argv.x << "," << argv.y << ",\"TSS24.BF2\"," << argv.rotate << "," << 1 << "," << 1 << ",\"" << tmpdata<<"\"";
VC_Log_WriteLog(0,"打印CMD: %s", stm.str().data());
strcpy(tmpsdata, stm.str().data());
tmpi = TSC_sendcommand(tmpsdata);
++ i;
}
if(TSC_printlabel("1", "1") == 0)
VC_Log_WriteLog(1," %s","标签打印标签页失败");
//if(TSC_printlabel("1", "1") == 0)
// VC_Log_WriteLog(1," %s","标签打印标签页失败");
//TSC_closeport();
tmpi = TSC_sendcommand("PRINT 1,1");
tmpi = TSC_sendcommand("EOP");
TSC_closeport();
heigth = 0;
......
......@@ -344,6 +344,10 @@ typedef int (__stdcall *windowsfont)(int x, int y, int fontheight,
char* szFaceName, char* content);
//----------------------------------end----------------------------------//
typedef struct {
} COM_Info;
typedef struct
{
......
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