mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 19:49:42 +08:00
修改了电机部分控制代码&错误打印,优化了电机错误的信息输出。温湿度传感器修改
This commit is contained in:
@ -222,7 +222,7 @@ bool CVSMD12XControl::InitController()
|
||||
|
||||
bool CVSMD12XControl::GetStatus(MSInfo &stuMotorParam)
|
||||
{
|
||||
std::string strCMD = "cts\n";
|
||||
std::string strCMD = "sts\n";
|
||||
|
||||
if (m_iProtocolType)
|
||||
{
|
||||
@ -1432,7 +1432,7 @@ bool CVSMD12XControl::IsMotionFinished()
|
||||
QThread::msleep(200);
|
||||
//Delay_MSec(200);
|
||||
GetStatus(m_stuMSInfo);
|
||||
ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF;
|
||||
ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x00FFFFFF;
|
||||
ucFlag = ucFlag & 0x10;
|
||||
if (m_stuMSInfo.fVelocity == 0)
|
||||
{
|
||||
@ -1445,15 +1445,21 @@ bool CVSMD12XControl::IsMotionFinished()
|
||||
}
|
||||
if (iCountStopped>=50)
|
||||
{
|
||||
QString str = QString("%1").arg(m_stuMSInfo.uiFlags, 30, 2, QChar('0'));
|
||||
qDebug() <<"Warning.Motion Err,should be stopped already.checking register and retry...";
|
||||
qDebug() <<"motion status:"<<ucFlag<<"all status:"<<QString::number(m_stuMSInfo.uiFlags,2);
|
||||
qDebug() << "velocity:" << m_stuMSInfo.fVelocity;
|
||||
qDebug() << "position:" << m_stuMSInfo.iPosition;
|
||||
qDebug() << "motion status:" << ucFlag << "all status:" << str;
|
||||
bFlagIsStopped = true;
|
||||
return false;
|
||||
}
|
||||
if (iCountTotal>1000)
|
||||
{
|
||||
qDebug() << "Err.Motor Hardware Err,should be stopped already";
|
||||
qDebug() << "motion status:" << ucFlag << "all status:" << QString::number(m_stuMSInfo.uiFlags, 2);
|
||||
QString str = QString("%1").arg(m_stuMSInfo.uiFlags, 30, 2, QChar('0'));
|
||||
qDebug() << "Warning.Motion Err,should be stopped already.checking register and retry...";
|
||||
qDebug() << "velocity:" << m_stuMSInfo.fVelocity;
|
||||
qDebug() << "position:" << m_stuMSInfo.iPosition;
|
||||
qDebug() << "motion status:" << ucFlag << "all status:" << str;
|
||||
bFlagIsStopped = true;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user