From 627f666d304a447b130a07dccafbed2e387d75a9 Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Tue, 22 Nov 2022 23:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=20=E5=86=99?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E7=B1=BB=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=E4=B8=BA=E4=BA=86=E6=8F=90=E9=AB=98=E5=B8=A7=E7=8E=87?= =?UTF-8?q?=20=E2=86=92=20=E7=9B=B4=E6=8E=A5=E8=AE=BE=E7=BD=AE=E6=9C=89?= =?UTF-8?q?=E6=95=88=E7=AA=97=E5=8F=A3=EF=BC=8C=E5=90=8E=E6=9C=9F=E4=B8=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8Croi=E8=A3=81=E5=89=AA=EF=BC=9B=202.=20?= =?UTF-8?q?=E9=85=8D=E5=90=88ximea=E9=87=87=E9=9B=86=E7=B1=BB=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=99=E6=96=87=E4=BB=B6fwrite=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=9A=203.=20sbg=E6=96=B0=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source_Files/configfile.cpp | 10 +++++----- Source_Files/sbgrecorder.cpp | 2 +- Source_Files/ximeaimager.cpp | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source_Files/configfile.cpp b/Source_Files/configfile.cpp index 406d063..e7c30fc 100644 --- a/Source_Files/configfile.cpp +++ b/Source_Files/configfile.cpp @@ -217,7 +217,7 @@ bool Configfile::createConfigFile() // Add some settings to the configuration. Setting &SN = root.add("SN", Setting::TypeString) = "0098"; - Setting &spatialBin = root.add("spatialBin", Setting::TypeInt) = 1; + Setting &spatialBin = root.add("spatialBin", Setting::TypeInt) = 2; Setting &SpectralBin = root.add("spectralBin", Setting::TypeInt) = 2; Setting &effective_window = root.add("effective_window", Setting::TypeGroup); @@ -228,13 +228,13 @@ bool Configfile::createConfigFile() Setting &effective_window_Bin2_spatial = effective_window_Bin2.add("spatial", Setting::TypeGroup); Setting &effective_window_Bin2_Spectral = effective_window_Bin2.add("spectral", Setting::TypeGroup); - effective_window_Bin1_spatial.add("width", Setting::TypeInt) = 1392; - effective_window_Bin1_spatial.add("offsetx", Setting::TypeInt) = 272; + effective_window_Bin1_spatial.add("width", Setting::TypeInt) = 1368; + effective_window_Bin1_spatial.add("offsetx", Setting::TypeInt) = 288; effective_window_Bin1_Spectral.add("height", Setting::TypeInt) = 300; effective_window_Bin1_Spectral.add("offsety", Setting::TypeInt) = 348; - effective_window_Bin2_spatial.add("width", Setting::TypeInt) = 712; - effective_window_Bin2_spatial.add("offsetx", Setting::TypeInt) = 128; + effective_window_Bin2_spatial.add("width", Setting::TypeInt) = 688; + effective_window_Bin2_spatial.add("offsetx", Setting::TypeInt) = 144; effective_window_Bin2_Spectral.add("height", Setting::TypeInt) = 150; effective_window_Bin2_Spectral.add("offsety", Setting::TypeInt) = 174; diff --git a/Source_Files/sbgrecorder.cpp b/Source_Files/sbgrecorder.cpp index e75e7af..2e43f12 100644 --- a/Source_Files/sbgrecorder.cpp +++ b/Source_Files/sbgrecorder.cpp @@ -53,7 +53,7 @@ void sbgtc::SbgRecorder::openSerialPort() } // QString portname = "sbg_serial_port"; - QString portname = "ttyUSB2"; + QString portname = "ttyUSB0"; m_serial->setPortName(portname); m_serial->open(QIODevice::ReadWrite); diff --git a/Source_Files/ximeaimager.cpp b/Source_Files/ximeaimager.cpp index 6bd8774..7b561c3 100644 --- a/Source_Files/ximeaimager.cpp +++ b/Source_Files/ximeaimager.cpp @@ -63,12 +63,12 @@ void XimeaImager::openImger() m_imager.setEffectiveWindow(offsetx, width, offsety, height); } - int width_roi = 0, offsetx_roi = 0; - ret = m_configfile.getEffectiveWindowRoi(width_roi, offsetx_roi); - if (ret) - { - m_imager.setEffectiveWindowRoi(offsetx_roi, width_roi); - } +// int width_roi = 0, offsetx_roi = 0; +// ret = m_configfile.getEffectiveWindowRoi(width_roi, offsetx_roi); +// if (ret) +// { +// m_imager.setEffectiveWindowRoi(offsetx_roi, width_roi); +// } setFramerate(100); @@ -463,7 +463,7 @@ void XimeaImager::startRecord(double TimeDifferenceBetweensOSAndSbg,QString base unsigned short *x=m_imager.get_frame(m_buffer); //fwrite(m_buffer,2,getBandCount()*getSampleCount(),hFile); - fwrite(m_buffer,1,m_iFrameSizeInByte,hFile);//********************************* + fwrite(m_imager.m_image.bp,static_cast(m_imager.m_image.bp_size),1,hFile); //fflush(hFile);//只保证了将IO缓冲写入系统缓冲中,使IO读操作能成功,但系统什么时候写入磁盘,由系统决定,一般是达到一定量时系统他就写入磁盘。 //sync();//强制系统将系统文件缓冲的内容写入磁盘