From bb41c419de8ad18f5bea953ad9139cf9e4cc3e23 Mon Sep 17 00:00:00 2001 From: "Mr.V" Date: Sun, 28 Apr 2024 15:23:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E6=A3=80=E6=B5=8B=E6=9D=A5=E8=BD=A6=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9D=A5=E8=BD=A6=E6=96=B9=E5=90=91=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=B8=8E=E8=AF=86=E5=88=AB=E6=9D=A5=E8=BD=A6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=97=B6=EF=BC=8C=E4=B8=8D=E4=B8=80=E8=B5=B7=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=88=B0=E6=9D=A5=E5=AF=BC=E8=87=B4=E7=9A=84=E4=B8=8D?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=96=B9=E5=90=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/GetRfidEngine/GetRfidEngine.cpp | 2 +- .../VideoAuxiliaryEngine.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/engine/GetRfidEngine/GetRfidEngine.cpp b/engine/GetRfidEngine/GetRfidEngine.cpp index 734bf21..a5ea3cb 100644 --- a/engine/GetRfidEngine/GetRfidEngine.cpp +++ b/engine/GetRfidEngine/GetRfidEngine.cpp @@ -75,7 +75,7 @@ APP_ERROR GetRfidEngine::Process() { if (!this->baseScoket_.bRuning()) { - LogError << "TCP 连接失败,重启中 ..."; + LogError << "RFID 连接失败,重启中 ..."; usleep(20 * 1000 * 1000); // 20秒后重试 this->baseScoket_.Close(); this->baseScoket_.Open(); diff --git a/engine/VideoAuxiliaryEngine/VideoAuxiliaryEngine.cpp b/engine/VideoAuxiliaryEngine/VideoAuxiliaryEngine.cpp index 3a88c7c..401a13e 100644 --- a/engine/VideoAuxiliaryEngine/VideoAuxiliaryEngine.cpp +++ b/engine/VideoAuxiliaryEngine/VideoAuxiliaryEngine.cpp @@ -39,7 +39,7 @@ APP_ERROR VideoAuxiliaryEngine::Process() this->baseScoket_.SetPort(this->videoAuxiliaryConfig_.iPort, this->videoAuxiliaryConfig_.strIp); this->baseScoket_.Init(); LogInfo << "视频辅助 服务端IP:" << this->videoAuxiliaryConfig_.strIp << " 端口:" << this->videoAuxiliaryConfig_.iPort; - LogInfo << "开启通讯..."; + LogInfo << "视频辅助 开启通讯..."; while (!isStop_) { @@ -93,6 +93,7 @@ bool VideoAuxiliaryEngine::getOrder(const std::string &recv, Json::Value &order) void VideoAuxiliaryEngine::dealSocketInfo(const std::string &info) { std::string vedioInfo = info; + LogInfo << "接收到:" << vedioInfo; StringUtil::getins()->replace_all_distinct(vedioInfo, "}{", "}&{"); std::vector vecJson = StringUtil::getins()->split(vedioInfo, "&"); for (int i = 0; i < vecJson.size(); ++i) @@ -119,6 +120,7 @@ void VideoAuxiliaryEngine::dealSocketInfo(const std::string &info) { if (iDirection != 0) pComeTrainInfo->iDirection = iDirection; outputQueMap_[strPort0_]->push(pComeTrainInfo); this->carType_ = tmpCarType; + LogInfo << "视频辅助-来车了"; } else if (this->carType_ == "1") { @@ -127,6 +129,7 @@ void VideoAuxiliaryEngine::dealSocketInfo(const std::string &info) { pComeTrainInfo->iDirection = 0; outputQueMap_[strPort0_]->push(pComeTrainInfo); this->carType_ = tmpCarType; + LogInfo << "视频辅助-火车离开了"; } else { @@ -134,11 +137,21 @@ void VideoAuxiliaryEngine::dealSocketInfo(const std::string &info) { continue; } - if (tmpCarType == this->carType_ && iDirection != 0) + if (iDirection != 0) { pComeTrainInfo->bComeTrain = true; pComeTrainInfo->iDirection = iDirection; outputQueMap_[strPort0_]->push(pComeTrainInfo); + LogInfo << "视频辅助-获得是否需要识别判定" << iDirection; + } + } + else { + if (iDirection != 0) + { + pComeTrainInfo->bComeTrain = true; + pComeTrainInfo->iDirection = iDirection; + outputQueMap_[strPort0_]->push(pComeTrainInfo); + LogInfo << "视频辅助-获得是否需要识别判定" << iDirection; } } }