Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
posprintdll
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
yunpeng.song
posprintdll
Commits
123a16d2
Commit
123a16d2
authored
Dec 06, 2018
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.限制杯贴打印高度
parent
0eae3a71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
10 deletions
+53
-10
LoadDll.cpp
+49
-10
LoadDll.h
+4
-0
No files found.
LoadDll.cpp
View file @
123a16d2
#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
-
6
0
)
y
=
atoi
(
m_printclass
.
tsc_high
.
c_str
())
*
10
-
font_size
-
6
0
;
if
(
y
>
atoi
(
m_printclass
.
tsc_high
.
c_str
())
*
10
-
8
0
)
y
=
atoi
(
m_printclass
.
tsc_high
.
c_str
())
*
10
-
8
0
;
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\n
tmpi:%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
;
...
...
LoadDll.h
View file @
123a16d2
...
...
@@ -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
{
...
...
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