diff --git a/LaiPuLaser/CommonFlowMgr.h b/LaiPuLaser/CommonFlowMgr.h index d8d6e60..132daf2 100644 --- a/LaiPuLaser/CommonFlowMgr.h +++ b/LaiPuLaser/CommonFlowMgr.h @@ -120,6 +120,7 @@ private: bool m_bUseLaser;//是否开关激光 //振镜校准参数-------------------------------------------------------------- double m_CalibrationPointGap;//打点之间的间隔mm +public: double m_CalibrationRange;//振镜校准范围mm }; diff --git a/LaiPuLaser/KnownFileNameVec b/LaiPuLaser/KnownFileNameVec index 47f0ffd..b165698 100644 Binary files a/LaiPuLaser/KnownFileNameVec and b/LaiPuLaser/KnownFileNameVec differ diff --git a/LaiPuLaser/MotionCard_PCI1245.cpp b/LaiPuLaser/MotionCard_PCI1245.cpp index 92ab272..9c213a3 100644 --- a/LaiPuLaser/MotionCard_PCI1245.cpp +++ b/LaiPuLaser/MotionCard_PCI1245.cpp @@ -1210,7 +1210,7 @@ bool MotionCard_PCI1245::CheckMotorActCoord(CMotor &Motor) if(Motor.IsbRevActCoordDir()) ActualCoord *=(-1); - double ActPluseErrCnt = CmdCoord-ActualCoord; + double ActPluseErrCnt = abs(CmdCoord)-abs(ActualCoord); if(fabs(ActPluseErrCnt)>m_MaxActCoordErr) { return false; diff --git a/LaiPuLaser/Product.cpp b/LaiPuLaser/Product.cpp index 29eadae..319e994 100644 --- a/LaiPuLaser/Product.cpp +++ b/LaiPuLaser/Product.cpp @@ -536,10 +536,11 @@ void CProduct::TheoryDataToRealData(vector &vec, Dbxy &AreaCenter, Dbxy Cu (*iter).y += CutAdjust.y; } - if ( (abs(iter->x)>40) || (abs(iter->y)>40) ) + auto DataRange = (gCommonFlowMgr->m_CalibrationRange)/2; + if ( (abs(iter->x)>DataRange) || (abs(iter->y)>DataRange) ) { CExceptionMsg Msg; - Msg.SetMsg(CString("标刻数据错数!超出标刻范围!")); + Msg.SetMsg(CString("标刻数据错数!超出校准范围!")); throw Msg;//抛出异常 //AfxMessageBox("标刻数据错数!超出标刻范围!"); }