diff --git a/othersoft/calibration_console/Header_Files/calibration.h b/othersoft/calibration_console/Header_Files/calibration.h index f667515..2f65a7b 100644 --- a/othersoft/calibration_console/Header_Files/calibration.h +++ b/othersoft/calibration_console/Header_Files/calibration.h @@ -1,4 +1,5 @@ #pragma once +#pragma pack(1)//结构体按照1字节对齐存储 #include //#include #include diff --git a/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp b/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp index 9fbda54..31291d1 100644 --- a/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp +++ b/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp @@ -612,12 +612,12 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM bIsLastValueOverflow = bIsValueOverflow; fLastExposureTime = fTempExposureTime; - if (fExposureTime > 13000) + if (fExposureTime > 65000) { bFlagIsAutoExposureOK = false; bFlagIsAutoExposureFailed = true; - fPredictedExposureTime = 13000; - iRes = SetExposureTime(13000); + fPredictedExposureTime = 65000; + iRes = SetExposureTime(65000); if (iRes != 0) { qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3"; diff --git a/othersoft/calibration_console/Source_Files/calibration.cpp b/othersoft/calibration_console/Source_Files/calibration.cpp index fe4a7b4..9ec260d 100644 --- a/othersoft/calibration_console/Source_Files/calibration.cpp +++ b/othersoft/calibration_console/Source_Files/calibration.cpp @@ -242,5 +242,30 @@ void CalibrationAlgorithm::produceCalfile(QString calFilePath, DeviceAttribute d } outfile.close(); + //ļʱֱдṹ + using namespace ZZ_MISCDEF::ZZ_DATAFILE;//tagCalibrationFrame + tagCalibrationFrame calibrationFrame; + + calibrationFrame.uiExposureTimeInMS = integratingSphereData.usExposureTimeInMS; + calibrationFrame.fTemperature = integratingSphereData.fTemperature; + calibrationFrame.iPixels = deviceAttribute.iPixels; + + for (size_t i = 0; i < deviceAttribute.iPixels; i++) + { + calibrationFrame.fWaveLength[i] = deviceAttribute.fWaveLengthInNM[i]; + calibrationFrame.dCal_Gain[i] = m_gain[i]; + } + + QStringList tmp = calFilePath.split('.'); + QString calFilePath2 = tmp[0] + "_structure." + tmp[1]; + + FILE * calFileHandle2 = fopen(calFilePath2.toStdString().c_str(), "wb"); + + writeCounter = fwrite(&calibrationFrame,sizeof(tagCalibrationFrame), 1, calFileHandle2); + + fclose(calFileHandle2); + + delete[] m_gain; + delete[] m_offset; } diff --git a/othersoft/calibration_console/Source_Files/main.cpp b/othersoft/calibration_console/Source_Files/main.cpp index c865617..ee84323 100644 --- a/othersoft/calibration_console/Source_Files/main.cpp +++ b/othersoft/calibration_console/Source_Files/main.cpp @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) //Զع logout("
AutoExpose!"); - m_FiberSpectrometer->autoExpose();// + m_FiberSpectrometer->autoExpose(); int iExposureTime; m_FiberSpectrometer->getExposureTime(iExposureTime); @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) { QDateTime curDateTime = QDateTime::currentDateTime(); QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss"); - QString calFileName = QDir::cleanPath(query.calFileOutputDirectory + QDir::separator() + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + ".dat"); + QString calFileName = QDir::cleanPath(query.calFileOutputDirectory + QDir::separator() + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + ".cal"); query.calFileOutputName=calFileName; }