Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PrtLib
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
李定达
PrtLib
Commits
ac50e867
Commit
ac50e867
authored
Apr 05, 2019
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.测试预留
parent
1a9ab21d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
PrtLib/PrtLib.suo
+0
-0
PrtLib/PrtLib/PrintLib.cpp
+12
-0
PrtLib/PrtLib/test.cpp
+4
-2
No files found.
PrtLib/PrtLib.suo
View file @
ac50e867
No preview for this file type
PrtLib/PrtLib/PrintLib.cpp
View file @
ac50e867
...
@@ -376,6 +376,9 @@ bool PrintLib::DoPrint(std::string prtStr, std::string orderStr, std::string xml
...
@@ -376,6 +376,9 @@ bool PrintLib::DoPrint(std::string prtStr, std::string orderStr, std::string xml
Document
dJson
;
Document
dJson
;
int
intType
=
1
;
int
intType
=
1
;
//try
//{
if
(
_ParseJson
(
orderStr
,
dJson
))
if
(
_ParseJson
(
orderStr
,
dJson
))
{
{
stringstream
stm
;
stringstream
stm
;
...
@@ -392,6 +395,15 @@ bool PrintLib::DoPrint(std::string prtStr, std::string orderStr, std::string xml
...
@@ -392,6 +395,15 @@ bool PrintLib::DoPrint(std::string prtStr, std::string orderStr, std::string xml
{
{
LOG
()
<<
"_ParseJson failed"
;
LOG
()
<<
"_ParseJson failed"
;
}
}
//}
//catch (std::exception* e)
//{
// LOG() << "std::exception : " << e->what();
//}
//catch(...)
//{
// LOG() << "Exception ParseJson";
//}
f_ClosePrinter
(
intType
);
f_ClosePrinter
(
intType
);
return
true
;
return
true
;
}
}
...
...
PrtLib/PrtLib/test.cpp
View file @
ac50e867
...
@@ -208,7 +208,8 @@ int main()
...
@@ -208,7 +208,8 @@ int main()
//char xmlstr[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ticket type=\"OrderPrint\" typeCode=\"1\">\n<line printType=\"Text\" text=\"0001非码测试单\" codeType=\"1\" fontType=\"1\" fontStyle=\"1\" width=\"2\" height=\"2\" leftMargin=\"0\" AlignMode=\"1\"/>\n</ticket>";
//char xmlstr[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ticket type=\"OrderPrint\" typeCode=\"1\">\n<line printType=\"Text\" text=\"0001非码测试单\" codeType=\"1\" fontType=\"1\" fontStyle=\"1\" width=\"2\" height=\"2\" leftMargin=\"0\" AlignMode=\"1\"/>\n</ticket>";
//char xmlstr[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ticket type = \"OrderPrint\" typeCode = \"1\"><line printType=\"Text\" text=\"%1Bulabula%2\" fontType=\"1\" fontStyle=\"1\" width=\"1\" height=\"1\" leftMargin=\"0\" AlignMode=\"0\"><math index=\"1\" content=\"order_title\" /><math index=\"2\" content=\"order_index\" /></line></ticket>";
//char xmlstr[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ticket type = \"OrderPrint\" typeCode = \"1\"><line printType=\"Text\" text=\"%1Bulabula%2\" fontType=\"1\" fontStyle=\"1\" width=\"1\" height=\"1\" leftMargin=\"0\" AlignMode=\"0\"><math index=\"1\" content=\"order_title\" /><math index=\"2\" content=\"order_index\" /></line></ticket>";
//char conf[] = "{\"name\":\"Xprinter\",\"paperwidth\":\"56\",\"type\":3}";
//char conf[] = "{\"name\":\"Xprinter\",\"paperwidth\":\"56\",\"type\":3}";
char
conf
[]
=
"{
\"
name
\"
:
\"
Xprinter
\"
,
\"
high
\"
:
\"
25
\"
,
\"
labelprttype
\"
:0,
\"
type
\"
: 4,
\"
width
\"
:
\"
40
\"
}"
;
//char conf[] = "{\"name\":\"Xprinter\",\"high\":\"25\",\"labelprttype\":0,\"type\": 4,\"width\":\"40\"}";
char
conf
[]
=
"{
\"
name
\"
:
\"
GP-80160(Cut) Series
\"
,
\"
paperwidth
\"
:
\"
80
\"
,
\"
type
\"
:4}"
;
//char order[] = "{\"order_title\":\"AAAA\",\"order_index\":\"0001\"}";
//char order[] = "{\"order_title\":\"AAAA\",\"order_index\":\"0001\"}";
char
err
[
1024
]
=
{};
char
err
[
1024
]
=
{};
...
@@ -221,7 +222,8 @@ int main()
...
@@ -221,7 +222,8 @@ int main()
GetFileBuf
(
xmlstr
,
xmlfilename
);
GetFileBuf
(
xmlstr
,
xmlfilename
);
GetFileBuf
(
order
,
jsonfilename
);
GetFileBuf
(
order
,
jsonfilename
);
DoLabPrintWithXmls
(
conf
,
order
,
xmlstr
,
err
);
DoPrintWithXmls
(
conf
,
order
,
xmlstr
,
err
);
//DoLabPrintWithXmls(conf, order, xmlstr, err);
system
(
"pause"
);
system
(
"pause"
);
...
...
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