修改:

1. 写配置文件类修改:为了提高帧率 → 直接设置有效窗口,后期不进行roi裁剪;
2. 配合ximea采集类,修改写文件fwrite代码:
3. sbg新端口;
This commit is contained in:
tangchao0503
2022-11-22 23:23:32 +08:00
parent 87a35f5dd4
commit 627f666d30
3 changed files with 13 additions and 13 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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<int>(m_imager.m_image.bp_size),1,hFile);
//fflush(hFile);//只保证了将IO缓冲写入系统缓冲中使IO读操作能成功但系统什么时候写入磁盘由系统决定一般是达到一定量时系统他就写入磁盘。
//sync();//强制系统将系统文件缓冲的内容写入磁盘