Commit fe830050 by 李定达

1.修补tsc杯贴打印去除指令集打印

parent 00ae810a
......@@ -2348,63 +2348,30 @@ 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", "f", "2") == 0)
// VC_Log_WriteLog(1," %s","标签打印机设置打印区域失败");
if(TSC_setup(tmp0, tmp1, tmp2, tmp3, "0", "3", "0") == 0)
VC_Log_WriteLog(1," %s","标签打印机设置打印区域失败");
heigth = 0;
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();
TSC_sendcommand("DIRECTION 1");
TSC_clearbuffer();
int i = 0;
while(i < m_label_args.size())
{
std::stringstream stm;
char tmpfont_name[40] = {0};
char tmpdata[512] = {0};
char tmpsdata[512] = {0};
char tmpdata[256] = {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);
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);
TSC_windowsfont(argv.x, argv.y, argv.font_size, argv.rotate, argv.font_type, argv.line, tmpfont_name, tmpdata);
++ i;
}
//if(TSC_printlabel("1", "1") == 0)
// VC_Log_WriteLog(1," %s","标签打印标签页失败");
//TSC_closeport();
tmpi = TSC_sendcommand("PRINT 1,1");
tmpi = TSC_sendcommand("EOP");
if(TSC_printlabel("1", "1") == 0)
VC_Log_WriteLog(1," %s","标签打印标签页失败");
TSC_closeport();
heigth = 0;
......@@ -2412,6 +2379,97 @@ int PrintCloseTsc(char *page, char *num)
return 1;
}
//int PrintCloseTsc(char *page, char *num)
//{
// VC_Log_WriteLog(1," %s",m_printclass.printtscname.c_str());
// char name[128]={0};
// strcpy(name,m_printclass.printtscname.c_str());
//
// VC_Log_WriteLog(0," %s","驱动名称 : ", name);
//
// printf("TSC驱动名称 : %s", name);
//
// int var=TSC_openport(name);
// if(1 != var )
// {
// VC_Log_WriteLog(1," %s","标签打印机打开失败或者标签打印机名字不对");
// return 0;
// }
//
// char tmp0[20] = {0};
// char tmp1[20] = {0};
// char tmp2[20] = {0};
// char tmp3[20] = {0};
//
// strcpy(tmp0, m_printclass.tsc_widgth.c_str());
// strcpy(tmp1, m_printclass.tsc_high.c_str());
// strcpy(tmp2, m_printclass.tsc_speed.c_str());
// strcpy(tmp3, m_printclass.tsc_chroma.c_str());
//
// //if(TSC_setup(tmp0, tmp1, tmp2, tmp3, "0", "f", "2") == 0)
// // VC_Log_WriteLog(1," %s","标签打印机设置打印区域失败");
//
// heigth = 0;
//
// 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[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);
//
// 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","标签打印标签页失败");
// //TSC_closeport();
//
// tmpi = TSC_sendcommand("PRINT 1,1");
// tmpi = TSC_sendcommand("EOP");
// TSC_closeport();
//
// heigth = 0;
//
// return 1;
//}
int PrintClose(char *page, char *num)
{
VC_Log_WriteLog(1, "%s : %s", "开始标签打印", m_printclass.label_type.data());
......
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