diff --git a/.vs/-1359169916_indexfilecopy.bin b/.vs/-1359169916_indexfilecopy.bin index c4e5ff7..2247d7e 100644 Binary files a/.vs/-1359169916_indexfilecopy.bin and b/.vs/-1359169916_indexfilecopy.bin differ diff --git a/.vs/IRIS_FODIS/v17/.suo b/.vs/IRIS_FODIS/v17/.suo index f6ff127..2da204c 100644 Binary files a/.vs/IRIS_FODIS/v17/.suo and b/.vs/IRIS_FODIS/v17/.suo differ diff --git a/.vs/IRIS_FODIS/v17/Browse.VC.db b/.vs/IRIS_FODIS/v17/Browse.VC.db index 14a6082..cb69c9d 100644 Binary files a/.vs/IRIS_FODIS/v17/Browse.VC.db and b/.vs/IRIS_FODIS/v17/Browse.VC.db differ diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json index 8f0d733..b308779 100644 --- a/.vs/ProjectSettings.json +++ b/.vs/ProjectSettings.json @@ -1,3 +1,3 @@ { - "CurrentProjectSetting": "x64-Debug" + "CurrentProjectSetting": "Linux-GCC-Debug" } \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 5956f62..c76108e 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -1,12 +1,16 @@ { "ExpandedNodes": [ "", - "\\out", - "\\out\\build", - "\\Settings", "\\Source", - "\\Source\\FS" + "\\Source\\Capture", + "\\Source\\Data", + "\\Source\\Logger", + "\\Source\\OSIF", + "\\Source\\OSIF\\DLib", + "\\Source\\OSIF\\include", + "\\Source\\Settings", + "\\Source\\ZZ_SDK" ], - "SelectedNode": "\\out\\build", + "SelectedNode": "\\main.cpp", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/cmake.db b/.vs/cmake.db index b5cd76b..8eb0cfa 100644 Binary files a/.vs/cmake.db and b/.vs/cmake.db differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index bc3fbcd..5607269 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/CMakeSettings.json b/CMakeSettings.json index 84f80a0..56d077b 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -10,7 +10,7 @@ "ctestCommandArgs": "", "inheritEnvironments": [ "linux_arm" ], "intelliSenseMode": "linux-gcc-arm", - "remoteMachineName": "-237651717;172.16.0.236 (username=root, port=22, authentication=Password)", + "remoteMachineName": "1290204378;172.16.0.83 (username=root, port=22, authentication=Password)", "remoteCMakeListsRoot": "/home/pi/FODIS/src/", "remoteBuildRoot": "/home/pi/FODIS/build_d/${name}", "remoteInstallRoot": "/home/pi/FODIS/out/install/${name}", diff --git a/Settings/DeviceSettings.ini b/Settings/DeviceSettings.ini index 4555824..e69de29 100644 --- a/Settings/DeviceSettings.ini +++ b/Settings/DeviceSettings.ini @@ -1,8 +0,0 @@ -[FS] -Model=FLAME -Port=-1 -UID= -Depth=65535 -AEMax=0.85 -AEMin=0.60 -MinSI=1 \ No newline at end of file diff --git a/Settings/DeviceSettings_IS1.ini b/Settings/DeviceSettings_IS1.ini new file mode 100644 index 0000000..c4e2ed5 --- /dev/null +++ b/Settings/DeviceSettings_IS1.ini @@ -0,0 +1,11 @@ +[FS] +Model=IS1 +Port=/dev/ttyUSB0 +UID=21091035 +Depth=65535 +AEMax=0.85 +AEMin=0.60 +MinSI=1000 +[GPS] +Port=/dev/ttyS1 +Baud=9600 \ No newline at end of file diff --git a/Source/Calibration/MakeDarkCurrentTable.cpp b/Source/Calibration/MakeDarkCurrentTable.cpp index e808ee4..33b4b86 100644 --- a/Source/Calibration/MakeDarkCurrentTable.cpp +++ b/Source/Calibration/MakeDarkCurrentTable.cpp @@ -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; diff --git a/Source/Calibration/MakeDarkCurrentTable.h b/Source/Calibration/MakeDarkCurrentTable.h index 93e05ff..56c9165 100644 --- a/Source/Calibration/MakeDarkCurrentTable.h +++ b/Source/Calibration/MakeDarkCurrentTable.h @@ -4,7 +4,7 @@ class MakeDCT :public QObject { - Q_OBJECT + Q_OBJECT; public: MakeDCT(QObject* parent = nullptr); virtual ~MakeDCT(); diff --git a/Source/Capture/AbsFSController.cpp b/Source/Capture/AbsFSController.cpp index fd0de5e..15c4ce3 100644 --- a/Source/Capture/AbsFSController.cpp +++ b/Source/Capture/AbsFSController.cpp @@ -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; } diff --git a/Source/Capture/MainGrabber.cpp b/Source/Capture/MainGrabber.cpp index d3b510b..309270b 100644 --- a/Source/Capture/MainGrabber.cpp +++ b/Source/Capture/MainGrabber.cpp @@ -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"<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); diff --git a/Source/FS/ATPControl_Serial_QT.cpp b/Source/FS/ATPControl_Serial_QT.cpp index 1bec25c..0ea575e 100644 --- a/Source/FS/ATPControl_Serial_QT.cpp +++ b/Source/FS/ATPControl_Serial_QT.cpp @@ -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]; diff --git a/Source/FS/DataFileProcessor.cpp b/Source/FS/DataFileProcessor.cpp index 0e20333..4068661 100644 --- a/Source/FS/DataFileProcessor.cpp +++ b/Source/FS/DataFileProcessor.cpp @@ -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;isetBaudRate(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() diff --git a/Source/Settings/SysConfigger.cpp b/Source/Settings/SysConfigger.cpp index 2e202df..6385b5e 100644 --- a/Source/Settings/SysConfigger.cpp +++ b/Source/Settings/SysConfigger.cpp @@ -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(); diff --git a/main.cpp b/main.cpp index ed20109..de5634a 100644 --- a/main.cpp +++ b/main.cpp @@ -13,18 +13,18 @@ int main(int argc, char* argv[]) using namespace ZZ_MISCDEF::ZZ_RUNPARAMS; using namespace ZZ_MISCDEF::MISC_DETECTOR; - system("gpio mode 4 out"); - system("gpio mode 5 out"); - qDebug() << "system(gpio mode 4 out)"; - qDebug() << "system(gpio mode 5 out)"; + //DataFrame aaaa; + //int xxxx = sizeof(aaaa); + + QCoreApplication a(argc, argv); - //long long int a1;// 8 - //long long b; // 8 - //double c; // 8 - //qDebug()<