From 2efa3fb879d4ba88c7e7339f09f687e53e9942c8 Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Wed, 3 Aug 2022 10:59:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E5=AE=9A=E6=A0=87=E6=96=87=E4=BB=B6=EF=BC=9A=E5=B0=86=E5=AE=9A?= =?UTF-8?q?=E6=A0=87=E6=96=87=E4=BB=B6=E9=80=9A=E8=BF=87=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E5=86=99=E5=85=A5=E6=96=87=E4=BB=B6=EF=BC=9B=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9atp=E7=9A=84=E6=9C=80=E9=AB=98?= =?UTF-8?q?=E5=AE=9A=E6=A0=87=E6=97=B6=E9=97=B4=EF=BC=9A13s=20=E2=86=92=20?= =?UTF-8?q?65s=EF=BC=8C=E6=AD=A4=E9=97=AE=E9=A2=98=E6=98=AF=E7=94=B1?= =?UTF-8?q?=E4=BA=8E2022-4-21-14:00=E6=9B=B4=E6=96=B0=E5=8D=93=E5=93=A5atp?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=88=B0=E6=9C=80=E6=96=B0=E7=89=88=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Header_Files/calibration.h | 1 + .../Source_Files/ATPControl_Serial_QT.cpp | 6 ++--- .../Source_Files/calibration.cpp | 25 +++++++++++++++++++ .../calibration_console/Source_Files/main.cpp | 4 +-- 4 files changed, 31 insertions(+), 5 deletions(-) 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; }