1.RecvData函数等待时间忘记修改为调试版本,现已修改。

This commit is contained in:
2022-02-24 15:16:44 +08:00
parent de6c6b8efd
commit 4a0b50337f

View File

@ -73,7 +73,6 @@ int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, std::string ucPortNumbe
GetDeviceInfo(m_diDeviceInfo); GetDeviceInfo(m_diDeviceInfo);
GetExposureTime_Init(); GetExposureTime_Init();
std::string::size_type szPostion = m_diDeviceInfo.strSN.find(strDeviceName); std::string::size_type szPostion = m_diDeviceInfo.strSN.find(strDeviceName);
if (szPostion == std::string::npos) if (szPostion == std::string::npos)
{ {
@ -196,6 +195,9 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
} }
m_daDeviceAttr.iMaxIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256; m_daDeviceAttr.iMaxIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
///
int iTempExpTime = 0;
GetExposureTime(iTempExpTime);
iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS); iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS);
if (iRes != 0) if (iRes != 0)
@ -210,7 +212,8 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
return 3; return 3;
} }
SetExposureTime(iTempExpTime);
///
qbSend.clear(); qbSend.clear();
qbRecv.clear(); qbRecv.clear();
qbSend.append(GET_WAVELENGTH_CALIBRATION_COEF); qbSend.append(GET_WAVELENGTH_CALIBRATION_COEF);
@ -321,11 +324,11 @@ int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData)
int iCounter = 0; int iCounter = 0;
while (qbData.size() < 4) while (qbData.size() < 4)
{ {
m_pSerialPort->waitForReadyRead(600); m_pSerialPort->waitForReadyRead(1000);
QByteArray qbTemp = m_pSerialPort->readAll(); QByteArray qbTemp = m_pSerialPort->readAll();
qbData.append(qbTemp); qbData.append(qbTemp);
if (iCounter > 25) if (iCounter > 150)
{ {
qDebug() << "Err:RecvData Failed,Not Enough Data.Exit Code:1" << qbData.size(); qDebug() << "Err:RecvData Failed,Not Enough Data.Exit Code:1" << qbData.size();
return 1; return 1;