HGGitLab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
app
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luoliangyi
app
Commits
80071439
Commit
80071439
authored
Apr 20, 2022
by
luoliangyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservice:解决拆分图像返回不正确的问题
parent
901b96d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
5 deletions
+11
-5
release/bin/windows/x86/HGWebService.exe
release/bin/windows/x86/HGWebService.exe
+0
-0
sdk/webservice/HttpUser.cpp
sdk/webservice/HttpUser.cpp
+2
-1
sdk/webservice/Manager.cpp
sdk/webservice/Manager.cpp
+8
-3
sdk/webservice/Manager.h
sdk/webservice/Manager.h
+1
-1
No files found.
release/bin/windows/x86/HGWebService.exe
View file @
80071439
No preview for this file type
sdk/webservice/HttpUser.cpp
View file @
80071439
...
@@ -589,7 +589,8 @@ bool HttpUser::SendResponse(const char* httpVersion, HGUInt errCode, const char*
...
@@ -589,7 +589,8 @@ bool HttpUser::SendResponse(const char* httpVersion, HGUInt errCode, const char*
HGBase_EnterLock
(
m_cs
);
HGBase_EnterLock
(
m_cs
);
send
(
m_sockConn
,
response
,
(
int
)
strlen
(
response
),
0
);
send
(
m_sockConn
,
response
,
(
int
)
strlen
(
response
),
0
);
send
(
m_sockConn
,
head
,
(
int
)
strlen
(
head
),
0
);
send
(
m_sockConn
,
head
,
(
int
)
strlen
(
head
),
0
);
send
(
m_sockConn
,
(
const
char
*
)
data
,
(
int
)
size
,
0
);
if
(
NULL
!=
data
&&
0
!=
size
)
send
(
m_sockConn
,
(
const
char
*
)
data
,
(
int
)
size
,
0
);
HGBase_LeaveLock
(
m_cs
);
HGBase_LeaveLock
(
m_cs
);
return
true
;
return
true
;
}
}
sdk/webservice/Manager.cpp
View file @
80071439
...
@@ -192,6 +192,7 @@ bool Manager::GetImageByDevId(const std::string& devId, std::vector<std::string>
...
@@ -192,6 +192,7 @@ bool Manager::GetImageByDevId(const std::string& devId, std::vector<std::string>
}
}
}
}
SaveFileNameList
(
devId
,
imgNameList
);
return
true
;
return
true
;
}
}
...
@@ -396,7 +397,11 @@ bool Manager::ExportZipFile(HGByte** data, HGUInt* size)
...
@@ -396,7 +397,11 @@ bool Manager::ExportZipFile(HGByte** data, HGUInt* size)
HGImage
img
=
NULL
;
HGImage
img
=
NULL
;
std
::
string
fileName
=
filePath
+
fileNameList
[
i
];
std
::
string
fileName
=
filePath
+
fileNameList
[
i
];
#if defined(HG_CMP_MSC)
zip_source_t
*
s
=
zip_source_file
(
z
,
AnsiToUtf8
(
fileName
.
c_str
()).
c_str
(),
0
,
0
);
#else
zip_source_t
*
s
=
zip_source_file
(
z
,
fileName
.
c_str
(),
0
,
0
);
zip_source_t
*
s
=
zip_source_file
(
z
,
fileName
.
c_str
(),
0
,
0
);
#endif
if
(
NULL
!=
s
)
if
(
NULL
!=
s
)
{
{
if
(
zip_file_add
(
z
,
fileNameList
[
i
].
c_str
(),
s
,
ZIP_FL_OVERWRITE
)
>=
0
)
if
(
zip_file_add
(
z
,
fileNameList
[
i
].
c_str
(),
s
,
ZIP_FL_OVERWRITE
)
>=
0
)
...
@@ -583,7 +588,7 @@ bool Manager::MergeImage(const std::string& devId, bool isHorizontal, const std:
...
@@ -583,7 +588,7 @@ bool Manager::MergeImage(const std::string& devId, bool isHorizontal, const std:
static
bool
LowerSort
(
const
std
::
string
&
str1
,
const
std
::
string
&
str2
)
static
bool
LowerSort
(
const
std
::
string
&
str1
,
const
std
::
string
&
str2
)
{
{
return
str1
<
str2
;
return
atoi
(
str1
.
c_str
())
<
atoi
(
str2
.
c_str
())
;
}
}
bool
Manager
::
BookSort
(
const
std
::
string
&
devId
,
std
::
vector
<
std
::
string
>&
imgNameList
,
bool
Manager
::
BookSort
(
const
std
::
string
&
devId
,
std
::
vector
<
std
::
string
>&
imgNameList
,
...
@@ -591,8 +596,8 @@ bool Manager::BookSort(const std::string& devId, std::vector<std::string>& imgNa
...
@@ -591,8 +596,8 @@ bool Manager::BookSort(const std::string& devId, std::vector<std::string>& imgNa
{
{
std
::
vector
<
std
::
string
>
fileNameList
=
GetFileNameList
(
devId
);
std
::
vector
<
std
::
string
>
fileNameList
=
GetFileNameList
(
devId
);
std
::
sort
(
fileNameList
.
begin
(),
fileNameList
.
end
(),
LowerSort
);
std
::
sort
(
fileNameList
.
begin
(),
fileNameList
.
end
(),
LowerSort
);
SaveFileNameList
(
devId
,
fileNameList
);
SaveFileNameList
(
devId
,
fileNameList
);
return
GetImageByDevId
(
devId
,
imgNameList
,
imgBase64List
);
return
GetImageByDevId
(
devId
,
imgNameList
,
imgBase64List
);
}
}
...
@@ -626,7 +631,7 @@ bool Manager::ResetPatchIndex()
...
@@ -626,7 +631,7 @@ bool Manager::ResetPatchIndex()
}
}
bool
Manager
::
SplitImage
(
const
std
::
string
&
devId
,
const
std
::
string
&
imgName
,
bool
isHorizontal
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
bool
Manager
::
SplitImage
(
const
std
::
string
&
devId
,
const
std
::
string
&
imgName
,
bool
isHorizontal
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
std
::
string
imgName1
,
std
::
string
imgBase64_1
,
std
::
string
imgName2
,
std
::
string
imgBase64_2
)
std
::
string
&
imgName1
,
std
::
string
&
imgBase64_1
,
std
::
string
&
imgName2
,
std
::
string
&
imgBase64_2
)
{
{
imgName1
.
clear
();
imgName1
.
clear
();
imgBase64_1
.
clear
();
imgBase64_1
.
clear
();
...
...
sdk/webservice/Manager.h
View file @
80071439
...
@@ -78,7 +78,7 @@ public:
...
@@ -78,7 +78,7 @@ public:
bool
ResetPatchIndex
();
bool
ResetPatchIndex
();
// 拆分图像
// 拆分图像
bool
SplitImage
(
const
std
::
string
&
devId
,
const
std
::
string
&
imgName
,
bool
isHorizontal
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
bool
SplitImage
(
const
std
::
string
&
devId
,
const
std
::
string
&
imgName
,
bool
isHorizontal
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
std
::
string
imgName1
,
std
::
string
imgBase64_1
,
std
::
string
imgName2
,
std
::
string
imgBase64_2
);
std
::
string
&
imgName1
,
std
::
string
&
imgBase64_1
,
std
::
string
&
imgName2
,
std
::
string
&
imgBase64_2
);
// 获取设备序列号
// 获取设备序列号
bool
GetDevSerialNo
(
const
std
::
string
&
devId
,
std
::
string
&
serialNo
);
bool
GetDevSerialNo
(
const
std
::
string
&
devId
,
std
::
string
&
serialNo
);
// 获取图像Base64
// 获取图像Base64
...
...
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