/* * @Author: xiewenji 527774126@qq.com * @Date: 2025-09-13 20:39:37 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-17 16:39:47 * @FilePath: /BOE_ZB_SOCKET_Detect/AlgorithmModule/src/CameraResult.cpp * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ #include "CameraResult.h" CameraResult::CameraResult() { cameraBaseResult = std::make_shared(); detlog = std::make_shared(); time_start = 0; } CameraResult::~CameraResult() { } void CameraResult::AddLog(std::string str) { LogList.push_back(str); } int CameraResult::AddDetImage(std::shared_ptr p) { if (time_start == 0) { time_start = CheckUtil::getcurTime(); /* code */ } std::shared_ptr imgResult = std::make_shared(); imgResult->cameraBaseResult = cameraBaseResult; imgResult->productBaseResult = productBaseResult; if (p->Det_Mode == DET_MODE_ReJson) { bJson = true; } imgResult->AddDetImage(p); { std::lock_guard lock_cam(mtx_DetImageList); ImageALLDetResultList.push_back(imgResult); } { std::lock_guard lock_cam(mtx_Det); cameraImage_Status.bHaveImg = true; cameraImage_Status.bHave_L255 = true; } std::string strTimg = CheckUtil::getCurTimeHMS(); detlog->AddCheckstr(PrintLevel_0, "PushInImg", " product %s Cam %s add new image channel = %s %s", productBaseResult->strproductName.c_str(), cameraBaseResult->strCameraName.c_str(), imgResult->strChannel.c_str(), strTimg.c_str()); return 0; } bool CameraResult::bCheckCamplate() { std::lock_guard lock_cam(mtx_Det); if (checkStep == Check_Step_Complete) { return true; } return false; } Check_Step CameraResult::GetCheckStep() { std::lock_guard lock_cam(mtx_Det); return checkStep; } void CameraResult::SetCheckStep(Check_Step step) { std::lock_guard lock_cam(mtx_Det); checkStep = step; } bool CameraResult::getImgPushComplate() { std::lock_guard lock_cam(mtx_Det); return bIsImgComplete; } void CameraResult::setImgPushComplate() { std::lock_guard lock_cam(mtx_Det); bIsImgComplete = true; } std::shared_ptr CameraResult::GetNoDetImg() { std::lock_guard lock_cam(mtx_DetImageList); for (auto ptr : ImageALLDetResultList) { if (ptr->IsNotDet()) { return ptr; } } return nullptr; }