Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
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
1
Merge Requests
1
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
liusq
gamera_videos_no_ui
Commits
0110e48a
Commit
0110e48a
authored
Sep 03, 2024
by
郭峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/mqtt-feature' into 'release'
修复ping命令进程生命周期问题最近内联 See merge request
!9
parents
ad174f19
ed7719b4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
35 deletions
+35
-35
HttpService.cpp
+19
-19
Httpclient.cpp
+7
-7
HumanDetection.cpp
+2
-2
LicensePlateRecognition.cpp
+2
-2
LogHandler.cpp
+1
-1
MediaFaceImage.cpp
+3
-3
VidesData.h
+1
-1
No files found.
HttpService.cpp
View file @
0110e48a
...
...
@@ -53,7 +53,7 @@ vides_data::response* HttpService::httpPostDeviceStatus(vides_data::requestDevic
resp
->
code
=
map
[
"code"
].
toInt
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
"httpPostDeviceStatus"
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
"httpPostDeviceStatus"
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
m_httpClient
.
errorString
();
}
...
...
@@ -86,7 +86,7 @@ vides_data::response* HttpService::httpPostRecord(int id,int recongnition_type,Q
resp
->
code
=
map
[
"code"
].
toInt
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
OPERATION_FAILED
;
}
...
...
@@ -159,7 +159,7 @@ vides_data::response *HttpService::httpFindCameras(QString &serialNumber,vides_d
}
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
OPERATION_FAILED
;
}
...
...
@@ -244,8 +244,8 @@ vides_data::response *HttpService::httpLicensePlateRecognition(vides_data::reque
// 将 res 添加到结果列表或进行其他操作
}
}
else
{
q
Debug
()
<<
"httpLicensePlateRecognition"
<<
m_httpClient
.
errorCode
();
q
Debug
()
<<
"httpLicensePlateRecognition msg"
<<
m_httpClient
.
errorString
();
q
Info
()
<<
"httpLicensePlateRecognition"
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
"httpLicensePlateRecognition msg"
<<
m_httpClient
.
errorString
();
resp
->
code
=
2
;
resp
->
msg
=
m_httpClient
.
errorCode
();
...
...
@@ -282,7 +282,7 @@ vides_data::response* HttpService::httpFindFaceReconition(QString &serialNumber,
}
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
OPERATION_FAILED
;
}
...
...
@@ -313,8 +313,8 @@ vides_data::response *HttpService::httpPostUniforms(QByteArray &img,QString &id,
resp
->
code
=
map
[
"code"
].
toInt
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Debug
()
<<
"httpPostUniforms"
<<
m_httpClient
.
errorString
();
q
Info
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
"httpPostUniforms"
<<
m_httpClient
.
errorString
();
resp
->
code
=
2
;
resp
->
msg
=
m_httpClient
.
errorCode
();
}
...
...
@@ -354,10 +354,10 @@ vides_data::response *HttpService::httpPostFacePopulation(QByteArray &img,int &h
resp
->
code
=
map
[
"code"
].
toInt
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
"httpPostFacePopulation===>"
;
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Debug
()
<<
m_httpClient
.
errorString
();
q
Debug
()
<<
"httpPostFacePopulation===>end"
;
q
Info
()
<<
"httpPostFacePopulation===>"
;
q
Info
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorString
();
q
Info
()
<<
"httpPostFacePopulation===>end"
;
resp
->
code
=
2
;
resp
->
msg
=
m_httpClient
.
errorCode
();
...
...
@@ -367,7 +367,7 @@ vides_data::response *HttpService::httpPostFacePopulation(QByteArray &img,int &h
vides_data
::
response
*
HttpService
::
httpPostFaceReconition
(
vides_data
::
requestFaceReconition
&
faceReconition
){
httpUrl
.
append
(
"/api/v1.0/recongnition/face"
);
q
Debug
()
<<
"httpPostFaceReconition"
<<
httpUrl
;
q
Info
()
<<
"httpPostFaceReconition"
<<
httpUrl
;
QJsonObject
json
;
json
.
insert
(
"id"
,
QJsonValue
::
fromVariant
(
faceReconition
.
id
.
toInt
()));
json
.
insert
(
"img"
,
QJsonValue
::
fromVariant
(
faceReconition
.
img
));
...
...
@@ -447,7 +447,7 @@ vides_data::response*HttpService::httpFindGb28181Config(QString &serialNumber){
resp
->
data
=
response
;
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
m_httpClient
.
errorString
();
}
...
...
@@ -559,7 +559,7 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
m_httpClient
.
errorString
();
}
...
...
@@ -594,7 +594,7 @@ vides_data::response*HttpService::httpFindStream(QString &serialNumber){
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
OPERATION_FAILED
;
}
...
...
@@ -618,8 +618,8 @@ vides_data::response *HttpService::httpDownload( const QString &filePath,QString
resp
->
code
=
map
[
"code"
].
toInt
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
OPERATION_FAILED
;
...
...
@@ -642,7 +642,7 @@ vides_data::response*HttpService::httpUploadFile(const QString &filePath,QString
resp
->
code
=
map
[
"code"
].
toInt
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
q
Debug
()
<<
m_httpClient
.
errorCode
();
q
Info
()
<<
m_httpClient
.
errorCode
();
resp
->
code
=
2
;
resp
->
msg
=
OPERATION_FAILED
;
}
...
...
Httpclient.cpp
View file @
0110e48a
...
...
@@ -87,7 +87,7 @@ bool HttpClient::downloadFile(QNetworkRequest request, const QString &filePath,
QFile
file
(
filePa
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
))
{
q
Debug
()
<<
"Failed to open file for writing"
;
q
Info
()
<<
"Failed to open file for writing"
;
reply
->
deleteLater
();
// 确保释放网络回复资源
return
false
;
}
...
...
@@ -98,7 +98,7 @@ bool HttpClient::downloadFile(QNetworkRequest request, const QString &filePath,
QObject
::
connect
(
reply
,
&
QNetworkReply
::
finished
,
[
&
,
reply
]()
{
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
q
Debug
()
<<
"Download failed:"
<<
reply
->
errorString
();
q
Info
()
<<
"Download failed:"
<<
reply
->
errorString
();
file
.
remove
();
// 删除不完整的文件
}
else
{
success
=
true
;
...
...
@@ -120,15 +120,15 @@ bool HttpClient::uploadFile(QNetworkRequest request,const QString& accessKeyId,
bool
success
=
false
;
QFile
*
file
=
new
QFile
(
filePath
,
this
);
q
Debug
()
<<
"filePath"
<<
filePath
;
q
Info
()
<<
"filePath"
<<
filePath
;
if
(
!
file
->
open
(
QIODevice
::
ReadOnly
))
{
q
Debug
()
<<
"uploadFile Failed to open file for reading"
;
q
Info
()
<<
"uploadFile Failed to open file for reading"
;
return
false
;
}
QByteArray
fileData
=
file
->
readAll
();
if
(
fileData
.
isEmpty
()){
q
Debug
()
<<
"uploadFile = file.readAll()"
;
q
Info
()
<<
"uploadFile = file.readAll()"
;
return
false
;
}
...
...
@@ -167,11 +167,11 @@ bool HttpClient::uploadFile(QNetworkRequest request,const QString& accessKeyId,
QEventLoop
loop
;
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
reply
,
file
,
&
loop
,
&
success
]()
{
if
(
reply
->
error
()
==
QNetworkReply
::
NoError
)
{
q
Debug
()
<<
"Upload successful!"
;
q
Info
()
<<
"Upload successful!"
;
file
->
remove
();
success
=
true
;
}
else
{
q
Debug
()
<<
"Upload failed:"
<<
reply
->
errorString
();
q
Info
()
<<
"Upload failed:"
<<
reply
->
errorString
();
}
file
->
close
();
file
->
deleteLater
();
...
...
HumanDetection.cpp
View file @
0110e48a
...
...
@@ -66,9 +66,9 @@ void HumanDetection::draw_human_on_image(const cv::Mat& image, const TCV_ObjectL
bool
success
=
cv
::
imwrite
(
fileName
.
toStdString
(),
image
);
if
(
success
)
{
q
Debug
()
<<
"车型图片已成功保存至:"
<<
fileName
;
q
Info
()
<<
"车型图片已成功保存至:"
<<
fileName
;
}
else
{
q
Debug
()
<<
"图片保存失败!"
;
q
Info
()
<<
"图片保存失败!"
;
}
}
...
...
LicensePlateRecognition.cpp
View file @
0110e48a
...
...
@@ -82,7 +82,7 @@ void LicensePlateRecognition::oldLicensePlateNumber(const cv::Mat &source,const
}
else
{
type
=
types
[
results
.
plates
[
i
].
type
];
}
q
Debug
()
<<
QString
(
"车牌号:%1"
).
arg
(
results
.
plates
[
i
].
code
);
q
Info
()
<<
QString
(
"车牌号:%1"
).
arg
(
results
.
plates
[
i
].
code
);
QString
plateResult
=
QString
(
"第%1个,%2,车牌号:%3,置信度:%4,左上角点x坐标:%5,左上角点y坐标:%6,右下角点x坐标:%7,右下角点y坐标:%8"
)
.
arg
(
i
+
1
).
arg
(
type
.
c_str
()).
arg
(
results
.
plates
[
i
].
code
)
.
arg
(
results
.
plates
[
i
].
text_confidence
).
arg
(
results
.
plates
[
i
].
x1
,
0
,
'Q'
,
4
)
...
...
@@ -168,7 +168,7 @@ void LicensePlateRecognition::licensePlateNumber(const cv::Mat &source, QString
newPlate
.
new_color
=
QString
::
fromStdString
(
type
);
QString
car_nuber
=
QString
::
fromUtf8
(
results
.
plates
[
i
].
code
);
replaceWith1And0
(
car_nuber
);
q
Debug
()
<<
"I O (i o)大小写替换为 1 0结果:==>"
<<
car_nuber
;
q
Info
()
<<
"I O (i o)大小写替换为 1 0结果:==>"
<<
car_nuber
;
newPlate
.
new_plate
=
car_nuber
;
newPlate
.
text_confidence
=
results
.
plates
[
i
].
text_confidence
;
vides_data
::
ParkingArea
area
;
...
...
LogHandler.cpp
View file @
0110e48a
...
...
@@ -38,7 +38,7 @@ LogHandlerPrivate::LogHandlerPrivate() {
flushLogFileTimer
.
setInterval
(
1000
);
// TODO: 可从配置文件读取
flushLogFileTimer
.
start
();
QObject
::
connect
(
&
flushLogFileTimer
,
&
QTimer
::
timeout
,
[]
{
// q
Debug
() << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); // 测试不停的写入内容到日志文件
// q
Info
() << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); // 测试不停的写入内容到日志文件
QMutexLocker
locker
(
&
LogHandlerPrivate
::
logMutex
);
if
(
nullptr
!=
logOut
)
{
logOut
->
flush
();
...
...
MediaFaceImage.cpp
View file @
0110e48a
...
...
@@ -82,7 +82,7 @@ int MediaFaceImage::SdkSearchDevicesSyn(std::map<QString, vides_data::localDevic
printf
(
"nCount:%d
\r\n
"
,
nActualCount
);
if
(
nActualCount
<=
0
)
{
q
Debug
()
<<
QString
(
"Search no Device"
);
q
Info
()
<<
QString
(
"Search no Device"
);
delete
[]
pRet
;
return
-
1
;
}
...
...
@@ -91,7 +91,7 @@ int MediaFaceImage::SdkSearchDevicesSyn(std::map<QString, vides_data::localDevic
{
for
(
int
i
=
0
;
i
<
nActualCount
;
i
++
)
{
q
Debug
()
<<
QString
(
"[%1][IP:%2.%3.%4.%5][SN:%6][Mac:%7]"
)
q
Info
()
<<
QString
(
"[%1][IP:%2.%3.%4.%5][SN:%6][Mac:%7]"
)
.
arg
(
i
)
.
arg
(
pRet
[
i
].
HostIP
.
c
[
0
])
.
arg
(
pRet
[
i
].
HostIP
.
c
[
1
])
...
...
@@ -139,7 +139,7 @@ int MediaFaceImage::SdkInit(QString &szConfigPath, QString &szTempPath) {
void
MediaFaceImage
::
ParserImageData
(
const
unsigned
char
*
pData
,
int
nDataLen
,
char
*
pJpg
,
int
*
nJpgLen
,
char
*
pJson
)
{
quint32
nPicLen
=
static_cast
<
quint32
>
(
pData
[
0
])
|
(
static_cast
<
quint32
>
(
pData
[
1
])
<<
8
)
|
(
static_cast
<
quint32
>
(
pData
[
2
])
<<
16
)
|
(
static_cast
<
quint32
>
(
pData
[
3
])
<<
24
);
q
Debug
()
<<
"nPicLen ="
<<
nPicLen
;
q
Info
()
<<
"nPicLen ="
<<
nPicLen
;
*
nJpgLen
=
static_cast
<
int
>
(
nPicLen
);
memcpy
(
pJpg
,
(
pData
+
32
),
*
nJpgLen
);
const
unsigned
char
*
pInfoHead
=
nullptr
;
...
...
VidesData.h
View file @
0110e48a
...
...
@@ -391,7 +391,7 @@ inline QString getDefaultGateway() {
return
gateway
;
}
bool
pingAddress
(
const
QString
&
address
)
{
inline
bool
pingAddress
(
const
QString
&
address
)
{
QProcess
process
;
QString
program
=
"ping"
;
QStringList
arguments
;
...
...
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