修改视频辅助检测来车状态时,来车方向判断与识别来车状态时,不一起发送到来导致的不记录方向问题

This commit is contained in:
Mr.V 2024-04-28 15:23:13 +08:00
parent 2cdb0c022a
commit bb41c419de
2 changed files with 16 additions and 3 deletions

View File

@ -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();

View File

@ -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<std::string> 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;
}
}
}