From af775a1c1c839ee6eea8c468c93ac951f6eb5303 Mon Sep 17 00:00:00 2001 From: bestlqiang Date: Wed, 31 Mar 2021 10:05:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=89=E5=88=A0=E5=B0=BA=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E4=B8=8D=E7=AE=A1=E5=8F=8D=E5=90=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LaiPuLaser/CommonFlowMgr.h | 1 + LaiPuLaser/KnownFileNameVec | Bin 580 -> 588 bytes LaiPuLaser/MotionCard_PCI1245.cpp | 2 +- LaiPuLaser/Product.cpp | 5 +++-- 4 files changed, 5 insertions(+), 3 deletions(-) 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 47f0ffd75df66273efdf3cece95d17de24f09776..b1656984d5b4183e961a7d725bc13f518116cbb2 100644 GIT binary patch delta 35 rcmX@Ya)yObdLrW)Ar1>mb0ZByLro4N10zENV`GDj50e=ue&7NCq(BMI delta 18 ZcmX@Za)gCZaw6lI&4P^9jFS}@Z2&fR1p)v7 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("标刻数据错数!超出标刻范围!"); }