You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
#include "StdAfx.h"
|
|
#include "WorkCmdCameraCatch.h"
|
|
#include "ExceptionMsg.h"
|
|
#include "Program_SZ_XL_TrackWorkFlow.h"
|
|
#include "CommonFlowMgr.h"
|
|
#include "CameraHawkvis.h"
|
|
CWorkCmdCameraCatch::CWorkCmdCameraCatch(CCamera &Camera)
|
|
:m_Camera(Camera)
|
|
{
|
|
m_pResultVec = NULL;//结果容器
|
|
m_pProduct = NULL;
|
|
m_bCatchMark3 = false;//是否抓取的是mark3
|
|
m_bAlam = true;//是否报警提示
|
|
}
|
|
CWorkCmdCameraCatch::~CWorkCmdCameraCatch(void)
|
|
{
|
|
}
|
|
//抓取定位点
|
|
bool CWorkCmdCameraCatch::Excute()
|
|
{
|
|
Dbxy pt;//结果点
|
|
if(m_Camera.CatchPtToPlatformcoord(pt)==false)
|
|
{
|
|
//if(m_pProduct != NULL)//抓取失败直接报错
|
|
{
|
|
if(m_bAlam)
|
|
{
|
|
gTrackWorkFlow1.RadAlamOnOff(true);//报警提示
|
|
}
|
|
CString str = _T("定位点抓取失败!");
|
|
CExceptionMsg Msg;
|
|
Msg.SetMsg(str);
|
|
throw Msg;
|
|
}
|
|
}
|
|
//设置实际定位点的值
|
|
if(m_pProduct != NULL)
|
|
{
|
|
/*if (m_pProduct->IsbNewAddProduct())
|
|
{
|
|
Dbxy NPoffset = gCommonFlowMgr->GetNPOffset();
|
|
pt.x -= NPoffset.x;
|
|
pt.y -= NPoffset.y;
|
|
}*/
|
|
if(m_bCatchMark3)//抓取的是mark3
|
|
{
|
|
m_pProduct->SetRealMark3Pt(pt);
|
|
}
|
|
else
|
|
{
|
|
m_pProduct->SetRealMarkPt(pt);
|
|
}
|
|
}
|
|
//顺便保存在容器中
|
|
if(m_pResultVec != NULL)
|
|
{
|
|
auto CamCoord = gCameraHawkvis->m_Coord;
|
|
m_pResultVec->push_back(pt- CamCoord);
|
|
}
|
|
return true;
|
|
}
|
|
void CWorkCmdCameraCatch::WirteLog()
|
|
{
|
|
gLogMgr->WriteDebugLog("[WorkCmd][Camera 抓取mark]");
|
|
} |