最新更改
This commit is contained in:
@ -49,16 +49,18 @@ int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, std::string ucPortNumbe
|
||||
bool bRes = m_pSerialPort->setBaudRate(m_iBaudRate);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "Err:setBaudRate Failed.Exit Code:1";
|
||||
//qDebug() << "Err:setBaudRate Failed.Exit Code:1";
|
||||
//std::cout << "Err.setBaudRate Failed" << std::endl;
|
||||
printf("Err:setBaudRate Failed.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
|
||||
bRes = m_pSerialPort->open(QIODevice::ReadWrite);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "Err:open Failed.Exit Code:2";
|
||||
//qDebug() << "Err:open Failed.Exit Code:2";
|
||||
//std::cout << "Err.open Failed" << std::endl;
|
||||
printf("Err:open Failed.Exit Code:2");
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -75,7 +77,8 @@ int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, std::string ucPortNumbe
|
||||
std::string::size_type szPostion = m_diDeviceInfo.strSN.find(strDeviceName);
|
||||
if (szPostion == std::string::npos)
|
||||
{
|
||||
qDebug() << "Err:FS serial number not match.Exit Code:3";
|
||||
printf("Err:FS serial number not match.Exit Code:3");
|
||||
//qDebug() << "Err:FS serial number not match.Exit Code:3";
|
||||
//return 3;
|
||||
}
|
||||
else
|
||||
@ -99,19 +102,22 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceInfo(DeviceInfo& Info)
|
||||
int iRes = SendCommand(qbSend);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceInfo Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceInfo Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceInfo Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
m_diDeviceInfo.strPN = qbRecv.data();
|
||||
@ -122,19 +128,22 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceInfo(DeviceInfo& Info)
|
||||
iRes = SendCommand(qbSend);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceInfo Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceInfo Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceInfo Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
m_diDeviceInfo.strSN = qbRecv.data();
|
||||
@ -154,19 +163,22 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute& Attr)
|
||||
int iRes = SendCommand(qbSend);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
m_daDeviceAttr.iMinIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
||||
@ -177,19 +189,22 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute& Attr)
|
||||
iRes = SendCommand(qbSend);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
m_daDeviceAttr.iMaxIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
||||
@ -201,13 +216,15 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute& Attr)
|
||||
iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Call SetExposureTime error.Exit Code:2";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Call SetExposureTime error.Exit Code:2";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:2");
|
||||
//return 2;
|
||||
}
|
||||
iRes = SingleShot(m_daDeviceAttr.iPixels);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Call SingleShot error.Exit Code:3";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Call SingleShot error.Exit Code:3";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:3");
|
||||
return 3;
|
||||
}
|
||||
|
||||
@ -222,19 +239,22 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute& Attr)
|
||||
iRes = SendCommand(qbSend);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
//qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
printf("Err:GetDeviceAttribute Failed,Communication error.Exit Code:1");
|
||||
return 1;
|
||||
}
|
||||
float fWaveLengthCoef[4];
|
||||
|
Reference in New Issue
Block a user