最新更改
This commit is contained in:
@ -137,7 +137,8 @@ int MakeDCT::MakeTable()
|
||||
bool bRes = qfData.open(QFile::WriteOnly | QFile::Text | QIODevice::Truncate);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "WriteData open Failed.";
|
||||
//qDebug() << "WriteData open Failed.";
|
||||
printf("WriteData open Failed.");
|
||||
return 0;
|
||||
}
|
||||
QString qstrTemp;
|
||||
@ -185,7 +186,8 @@ int MakeDCT::LoadTable()
|
||||
bool bRes = qfData.open(QFile::ReadOnly);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "LoadTable open Failed.";
|
||||
//qDebug() << "LoadTable open Failed.";
|
||||
printf("LoadTable open Failed.");
|
||||
return 1;
|
||||
}
|
||||
QString qstrTemp;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
class MakeDCT :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT;
|
||||
public:
|
||||
MakeDCT(QObject* parent = nullptr);
|
||||
virtual ~MakeDCT();
|
||||
|
@ -31,7 +31,8 @@ int CAbsFSController::Initialize()
|
||||
m_pFSCtrl = new OceanOptics_lib;
|
||||
if (m_pFSCtrl->Initialize(false, m_struFSParam.strInterface, m_struFSParam.strSN) != 0)
|
||||
{
|
||||
qDebug() << "Flame Not Opened";
|
||||
//qDebug() << "Flame Not Opened";
|
||||
printf("Flame Not Opened");
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@ -65,7 +66,8 @@ int CAbsFSController::Initialize()
|
||||
//m_pFSCtrl->Initialize(false, m_struFSParam.strInterface, NULL);
|
||||
if (m_pFSCtrl->Initialize(false, m_struFSParam.strInterface, m_struFSParam.strSN) != 0)
|
||||
{
|
||||
qDebug() << "IS1 Not Opened";
|
||||
//qDebug() << "IS1 Not Opened";
|
||||
printf("IS1 Not Opened");
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
@ -86,8 +88,16 @@ int CAbsFSController::Initialize()
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "GetDeviceAttribute Failed" << iRes;
|
||||
printf("GetDeviceAttribute Failed");
|
||||
return 4;
|
||||
}
|
||||
else//mark by zz
|
||||
{
|
||||
if (m_struFSParam.ucDeviceModel== DeviceModel::IS2)
|
||||
{
|
||||
m_struDeviceAttr.iMinIntegrationTimeInMS = 10;
|
||||
}
|
||||
}
|
||||
|
||||
iRes = m_pFSCtrl->SetDeviceTemperature(0);
|
||||
if (iRes != 0)
|
||||
@ -124,7 +134,8 @@ int CAbsFSController::SingleShot(DataFrame& struSingleFrame)
|
||||
int iRes = m_pFSCtrl->SingleShot(m_struSingleFrame);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err. SingleShot";
|
||||
//qDebug() << "Err. SingleShot";
|
||||
printf("Err. SingleShot");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -133,7 +144,8 @@ int CAbsFSController::SingleShot(DataFrame& struSingleFrame)
|
||||
int iRes = m_pFSCtrl->SingleShot(m_struSingleFrame);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err. SingleShot";
|
||||
//qDebug() << "Err. SingleShot";
|
||||
printf("Err. SingleShot");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -209,7 +221,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
int iRes = m_pFSCtrl->SingleShot(dfTemp);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
|
||||
printf("Err:PerformAutoExposure Failed,SingleShot Failed.Exit Code:2");
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -284,7 +297,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
iRes = m_pFSCtrl->SetExposureTime(m_struDeviceAttr.iMinIntegrationTimeInMS);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3" ;
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3" ;
|
||||
printf("Err:PerformAutoExposure Failed,SetExposureTime Failed.Exit Code:2");
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -304,7 +318,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
iRes = m_pFSCtrl->SetExposureTime(m_struDeviceAttr.iMaxIntegrationTimeInMS - 1);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3";
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3";
|
||||
printf("Err:PerformAutoExposure Failed,SetExposureTime Failed.Exit Code:3");
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -318,7 +333,8 @@ int CAbsFSController::PerformAutoExposure()
|
||||
iRes = m_pFSCtrl->SetExposureTime((int)iExposureTime);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" ;
|
||||
//qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4" ;
|
||||
printf("Err:PerformAutoExposure Failed,SetExposureTime Failed.Exit Code:4");
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -342,7 +358,8 @@ int CAbsFSController::CheckAndAdjust_Fast()
|
||||
int iRes = m_pFSCtrl->GetExposureTime(iExposureTime);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err. SingleShot";
|
||||
//qDebug() << "Err. SingleShot";
|
||||
printf("CheckAndAdjust_Fast,Err. SingleShot");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -24,12 +24,15 @@ int CMainGrabber::SetContext(BD357Controller &pctrlGPS, DataFileProcessor &dfpDa
|
||||
{
|
||||
if (&pctrlGPS == NULL)
|
||||
{
|
||||
qDebug() << "GPS Not Initialized";
|
||||
//qDebug() << "GPS Not Initialized";
|
||||
printf("GPS Not Initialized");
|
||||
return 1;
|
||||
}
|
||||
|
||||
m_pctrlGPS = &pctrlGPS;
|
||||
m_dfpDataSaver = &dfpDataSaver;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainGrabber::Initialize()
|
||||
@ -40,6 +43,8 @@ int CMainGrabber::Initialize()
|
||||
|
||||
int CMainGrabber::StartGrab()
|
||||
{
|
||||
system("gpio write 5 1");
|
||||
m_dfpDataSaver->GenerateFilePath();
|
||||
m_pctrlFS->PerformAutoExposure();
|
||||
DataFrame dfTemp;
|
||||
m_iFlagIsCapture = 1;
|
||||
@ -50,20 +55,26 @@ int CMainGrabber::StartGrab()
|
||||
qtTime.start();
|
||||
|
||||
////////////
|
||||
system("gpio write 5 0");
|
||||
qDebug() << "system IO";
|
||||
m_pctrlFS->SingleShot(dfTemp);
|
||||
qDebug() << "SingleShot";
|
||||
RemoveBackground(dfTemp);
|
||||
CheckExposureTime(dfTemp);
|
||||
m_dfpDataSaver->WriteData(dfTemp);
|
||||
system("gpio write 5 1");
|
||||
////////////
|
||||
|
||||
//int iMillisec = qtTime.elapsed();
|
||||
int iSleep =m_struFSRunParams.dMinSamplingInterval - qtTime.elapsed();
|
||||
if (iSleep>0)
|
||||
{
|
||||
Delay_MSec(iSleep);
|
||||
}
|
||||
qDebug() << "Delay_MSec"<<iSleep;
|
||||
int iSleep =m_struFSRunParams.dMinSamplingInterval - qtTime.elapsed();
|
||||
if (iSleep>0)
|
||||
{
|
||||
Delay_MSec(iSleep);
|
||||
}
|
||||
qDebug() << "Delay_MSec"<< iSleep;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainGrabber::Initialize_Self()
|
||||
@ -73,6 +84,8 @@ int CMainGrabber::Initialize_Self()
|
||||
LoadDCT();
|
||||
|
||||
emit Signal_InitFinished();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CMainGrabber::Delay_MSec(ZZ_U16 usMS)
|
||||
@ -100,7 +113,6 @@ int CMainGrabber::InitializeWorkers()
|
||||
Delay_MSec(1000);
|
||||
}
|
||||
m_pctrlFS->GetDeviceAttr(m_struDeviceAttr);
|
||||
m_dfpDataSaver->GenerateFilePath();
|
||||
m_dfpDataSaver->WriteWavelengthInfo(m_struDeviceAttr.fWaveLengthInNM, m_struDeviceAttr.iPixels);
|
||||
return 0;
|
||||
}
|
||||
@ -120,6 +132,8 @@ int CMainGrabber::LoadDCT()
|
||||
m_DCTable.Initialize_Part();
|
||||
m_DCTable.LoadTable();
|
||||
m_DCTable.GetDCTable(m_vecDataFrame);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainGrabber::CheckExposureTime(DataFrame dfTemp)
|
||||
@ -164,9 +178,20 @@ int CMainGrabber::CheckExposureTime(DataFrame dfTemp)
|
||||
|
||||
if ((dExpTimeMS <= m_struDeviceAttr.iMinIntegrationTimeInMS)|| (dExpTimeMS > m_struDeviceAttr.iMaxIntegrationTimeInMS - 1))
|
||||
{
|
||||
qDebug() << "SetExposureTime out of range";
|
||||
return 1;
|
||||
if ((dExpTimeMS <= m_struDeviceAttr.iMinIntegrationTimeInMS))
|
||||
{
|
||||
dExpTimeMS = m_struDeviceAttr.iMinIntegrationTimeInMS;
|
||||
qDebug() << "SetExposureTime out of range-Min";
|
||||
return 1;
|
||||
}
|
||||
if ((dExpTimeMS > m_struDeviceAttr.iMaxIntegrationTimeInMS - 1))
|
||||
{
|
||||
dExpTimeMS = m_struDeviceAttr.iMaxIntegrationTimeInMS - 1;
|
||||
qDebug() << "SetExposureTime out of range-Max";
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_pctrlFS->SetExposureTime((int)dExpTimeMS);
|
||||
|
@ -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];
|
||||
|
@ -30,7 +30,8 @@ int DataFileProcessor::WriteWavelengthInfo(float *pfWaveLength, int iLength)
|
||||
bRes = qfData.open(QFile::WriteOnly | QFile::Text | QFile::Truncate);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "WriteEnvironmentInfo open Failed.";
|
||||
//qDebug() << "WriteEnvironmentInfo open Failed.";
|
||||
printf("WriteWavelengthInfo QFile open Failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -60,26 +61,72 @@ int DataFileProcessor::WriteWavelengthInfo(float *pfWaveLength, int iLength)
|
||||
int DataFileProcessor::WriteData(DataFrame dfDataFrame)
|
||||
{
|
||||
QFile qfData(m_qstrFullFileName);
|
||||
qDebug() << m_qstrFullFileName;
|
||||
bool bRes = qfData.open(QFile::WriteOnly| QIODevice::Append);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "WriteData open Failed.";
|
||||
printf("WriteData QFile open Failed");
|
||||
return 0;
|
||||
}
|
||||
qfData.write((char*)&dfDataFrame, sizeof(DataFrame));
|
||||
qfData.flush();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DataFileProcessor::LoadWaveLengthFile(QString qstrFileName)
|
||||
{
|
||||
//E:\WavelengthInfo.txt
|
||||
QFile qfWavelength(qstrFileName);
|
||||
//QFile qfWavelength();
|
||||
|
||||
bool bRes = qfWavelength.open(QFile::ReadOnly);
|
||||
if (!bRes)
|
||||
{
|
||||
printf("LoadWaveLengthFile open Failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
QString qsData = qfWavelength.readAll();
|
||||
int iTemp = qsData.size();
|
||||
qsData.remove(iTemp - 1, 1);
|
||||
qsData.remove(0, 14);
|
||||
QStringList qsList = qsData.split(',');
|
||||
for (int i=0;i<qsList.size();i++)
|
||||
{
|
||||
qDebug() << qsList[i];
|
||||
}
|
||||
//iTemp = qsData.size();
|
||||
return;
|
||||
}
|
||||
|
||||
void DataFileProcessor::LoadSingleDataFile(QString qstrFileName)
|
||||
{
|
||||
qstrFileName;
|
||||
QFile qfDataFile(qstrFileName);
|
||||
DataFrame dfTemp;
|
||||
|
||||
bool bRes = qfDataFile.open(QFile::ReadOnly);
|
||||
if (!bRes)
|
||||
{
|
||||
printf("LoadWaveLengthFile open Failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
long long int llCount = (qfDataFile.size()) / (sizeof(DataFrame));
|
||||
for (int i=0;i<llCount;i++)
|
||||
{
|
||||
QByteArray qbDataFrame = qfDataFile.read(sizeof(DataFrame));
|
||||
memcpy(&dfTemp, qbDataFrame, sizeof(DataFrame));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void DataFileProcessor::GenerateFilePath()
|
||||
{
|
||||
m_qdtTime = QDateTime::currentDateTime();
|
||||
// QTimeZone curZone;
|
||||
// m_qdtTime.toTimeZone();
|
||||
QString qstrAddYMD = m_qdtTime.toString("/yyyy_MM_dd");
|
||||
m_qdtTime = m_qdtTime.addSecs(3600 * 8);
|
||||
QString qstrAddHMS = m_qdtTime.toString("hh_mm_ss");
|
||||
|
||||
|
||||
@ -94,7 +141,8 @@ void DataFileProcessor::GenerateFilePath()
|
||||
bool bRes = qdirPathTemp.mkdir(m_qstrFilePath);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "DataFileProcessor mkdir Failed.";
|
||||
//qDebug() << "DataFileProcessor mkdir Failed.";
|
||||
printf("DataFileProcessor mkdir Failed");
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +152,8 @@ void DataFileProcessor::GenerateFilePath()
|
||||
bool bRes = qdirPathTempA.mkdir(qstrTemp);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "DataFileProcessor mkdir Failed.";
|
||||
//qDebug() << "DataFileProcessor mkdir Failed.";
|
||||
printf("DataFileProcessor mkdir Failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
int WriteWavelengthInfo(float *pfWaveLength, int iLength);
|
||||
int WriteData(DataFrame dfDataFrame);
|
||||
|
||||
void LoadWaveLengthFile(QString qstrFileName);
|
||||
void LoadSingleDataFile(QString qstrFileName);
|
||||
//void SetEnvironmentContex(EContext struEC);
|
||||
//void SetManmadeEnviromentalContext(MEContext struMEC);
|
||||
|
@ -28,6 +28,7 @@ BD357Controller::~BD357Controller()
|
||||
int BD357Controller::SetContext(CMainGrabber& pMainGrabber)
|
||||
{
|
||||
m_pMainGrabber = &pMainGrabber;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int BD357Controller::SetupMessagePipeline()
|
||||
@ -42,7 +43,7 @@ int BD357Controller::SyncDateOnce()
|
||||
|
||||
bool bFlagFinish = false;
|
||||
size_t uiCount = 0;
|
||||
ZZ_U8 u8Rx,u8Tx;
|
||||
//ZZ_U8 u8Rx,u8Tx;
|
||||
|
||||
|
||||
while (!bFlagFinish)
|
||||
@ -87,7 +88,12 @@ int BD357Controller::SyncDateOnce()
|
||||
time_t stdtime = m_qdtDateTime.toTime_t();
|
||||
time_t stdtimeUTC = m_qdtDateTimeUTC.toTime_t();
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#else
|
||||
stime(&stdtimeUTC);
|
||||
#endif
|
||||
|
||||
|
||||
system("gpio write 4 1");
|
||||
qDebug() << "system(gpio write 4 1)";
|
||||
@ -137,6 +143,8 @@ int BD357Controller::Initialize(GPSInfo &struGPSI)
|
||||
{
|
||||
m_struGPSInfo = struGPSI;
|
||||
emit Signal_InitSelf();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -207,7 +215,8 @@ int BD357Controller::Slot_InitSelf()
|
||||
bool bRes = m_pSerialPort->setBaudRate(m_struGPSInfo.iBaud);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "Err:setBaudRate Failed.Exit Code:1";
|
||||
//qDebug() << "Err:setBaudRate Failed.Exit Code:1";
|
||||
printf("Err:setBaudRate Failed.Exit Code:1");
|
||||
//std::cout << "Err.setBaudRate Failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
@ -215,7 +224,8 @@ int BD357Controller::Slot_InitSelf()
|
||||
bRes = m_pSerialPort->open(QIODevice::ReadWrite);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "Err:open Failed.Exit Code:2";
|
||||
//qDebug() << "Err:open Failed.Exit Code:2";
|
||||
printf("Err:open Failed.Exit Code:2");
|
||||
//std::cout << "Err.open Failed" << std::endl;
|
||||
return 2;
|
||||
}
|
||||
@ -224,6 +234,8 @@ int BD357Controller::Slot_InitSelf()
|
||||
lwgps_init(&m_hLWGPS);
|
||||
|
||||
lwrb_init(&m_hlwrbBuffer, m_u8GPSDataBuffer, sizeof(m_u8GPSDataBuffer));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int BD357Controller::Slot_SyncDateOnce()
|
||||
|
@ -4,7 +4,7 @@
|
||||
ZZ_SysConfigger::ZZ_SysConfigger(QObject* parent /*= nullptr*/)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_qstrDeviceConfigFilePath = "E:/WorkSpace/git/IRIS_FODIS/IRIS_FODIS/Settings/DeviceSettings.ini";
|
||||
m_qstrDeviceSettingsFilePath = "E:/WorkSpace/git/IRIS_FODIS/IRIS_FODIS/Settings/DeviceSettings.ini";
|
||||
#else
|
||||
m_qstrDeviceSettingsFilePath = "/home/data/Setting/DeviceSettings.ini";
|
||||
#endif // DEBUG
|
||||
@ -40,7 +40,8 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
QString qstrTemp = m_qsDeviceSettings->value(QString("FS/Model"), "Null").toString();
|
||||
if(qstrTemp == "Null")
|
||||
{
|
||||
qDebug() << "FS Model Value Err.";
|
||||
//qDebug() << "FS Model Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.ucDeviceModel = ZZ_MISCDEF::IRIS::GetIndex(qstrTemp.toStdString());
|
||||
@ -49,6 +50,7 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
if (qstrTemp == "Null")
|
||||
{
|
||||
qDebug() << "FS Port Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.strInterface = qstrTemp.toStdString();
|
||||
@ -57,6 +59,7 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
if (qstrTemp == "Null")
|
||||
{
|
||||
qDebug() << "FS UID Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.strSN = qstrTemp.toStdString();
|
||||
@ -65,6 +68,7 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
if (fAEMax == -1)
|
||||
{
|
||||
qDebug() << "FS AEMax Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.fMaxFactor = fAEMax;
|
||||
@ -73,6 +77,7 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
if (fAEMin == -1)
|
||||
{
|
||||
qDebug() << "FS AEMin Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.fMinFactor = fAEMin;
|
||||
@ -81,6 +86,7 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
if (lDepth == -1)
|
||||
{
|
||||
qDebug() << "FS Depth Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.lDepth = lDepth;
|
||||
@ -89,6 +95,7 @@ bool ZZ_SysConfigger::LoadSettings_FS(OneFSContext &struOFSC)
|
||||
if (dMSI == -1)
|
||||
{
|
||||
qDebug() << "FS MinSI Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struOneFSContext.dMinSamplingInterval = dMSI;
|
||||
@ -106,6 +113,7 @@ bool ZZ_SysConfigger::LoadSettings_GPS(GPSInfo &struGPSC)
|
||||
if (qstrTemp == "Null")
|
||||
{
|
||||
qDebug() << "GPS Port Value Err.";
|
||||
printf("FS Model Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struGPSContext.qstrInterfaceName = qstrTemp;
|
||||
@ -113,7 +121,8 @@ bool ZZ_SysConfigger::LoadSettings_GPS(GPSInfo &struGPSC)
|
||||
qstrTemp = m_qsDeviceSettings->value(QString("GPS/Baud"), "Null").toString();
|
||||
if (qstrTemp == "Null")
|
||||
{
|
||||
qDebug() << "GPS Port Value Err.";
|
||||
//qDebug() << "GPS Port Value Err.";
|
||||
printf("GPS Port Value Err.");
|
||||
return false;
|
||||
}
|
||||
m_struGPSContext.iBaud = qstrTemp.toInt();
|
||||
|
Reference in New Issue
Block a user