1. 配置文件:ximeadll加入 getBufferPolicy 和 getAcqBufferSize;

2. 增大内存池的大小,以便100帧写一次硬盘;
3. 增加ximea报错代码:10/11,将报错代码添加时间写入文件;
This commit is contained in:
tangchao0503
2023-06-21 16:43:33 +08:00
parent 09d224075a
commit 6fc2680a1c
5 changed files with 149 additions and 45 deletions

View File

@ -222,6 +222,50 @@ bool Configfile::getSN(QString &SN)
}
}
bool Configfile::getBufferPolicy(int &bufferPolicy)
{
const Setting& root = cfg.getRoot();
const Setting &ximeadll = root["ximeadll"];
try
{
if(!(ximeadll.lookupValue("buffer_policy", bufferPolicy)
))
{
return false;
}
}
catch(const SettingNotFoundException &nfex)
{
cerr << "No 'spectralBin' setting in configuration file." << endl;
return false;
}
return true;
}
bool Configfile::getAcqBufferSize(int &acqBufferSize)
{
const Setting& root = cfg.getRoot();
const Setting &ximeadll = root["ximeadll"];
try
{
if(!(ximeadll.lookupValue("acq_buffer_size", acqBufferSize)
))
{
return false;
}
}
catch(const SettingNotFoundException &nfex)
{
cerr << "No 'spectralBin' setting in configuration file." << endl;
return false;
}
return true;
}
bool Configfile::createConfigFile()
{
using namespace std;
@ -279,6 +323,11 @@ bool Configfile::createConfigFile()
gainOffsetSpectralBin2.add("offset", Setting::TypeFloat) = -299.46126663407176;
Setting &ximeadll = root.add("ximeadll", Setting::TypeGroup);
ximeadll.add("buffer_policy", Setting::TypeInt) = 0;
ximeadll.add("acq_buffer_size", Setting::TypeInt) = 400;
// Write out the new configuration.
QString output_file = "/media/nvme/300TC/config/ximea.cfg";
try