改变光谱bin2的波长计算方式为:通过bin1平均相邻波长获取;

This commit is contained in:
tangchao0503
2023-06-28 11:59:46 +08:00
parent 5337a40837
commit 47002ad894
4 changed files with 106 additions and 7 deletions

View File

@ -166,6 +166,28 @@ bool Configfile::getEffectiveWindowRoi(int &width, int &offsetx)
return true;
}
bool Configfile::getWindowOffsety_HeightOfSpectral(int &offsety, int &height, string spectralBinString)
{
const Setting& root = cfg.getRoot();
try
{
const Setting &spectralArgument = root["effective_window"][spectralBinString]["spectral"];
if(!(spectralArgument.lookupValue("height", height)
&& spectralArgument.lookupValue("offsety", offsety)))
{
return false;
}
}
catch(const SettingNotFoundException &nfex)
{
// Ignore.
return false;
}
return true;
}
bool Configfile::getGainOffset(float &gain, float &offset)
{
const Setting& root = cfg.getRoot();
@ -206,6 +228,35 @@ bool Configfile::getGainOffset(float &gain, float &offset)
return true;
}
bool Configfile::getGainOffsetOfSpectralBin1(float &gain, float &offset)
{
const Setting& root = cfg.getRoot();
try
{
const Setting &gainOffset = root["gainOffset"];
int count = gainOffset.getLength();
string spectralBinString = "spectralBin1";
const Setting &gainOffsetSetting = gainOffset[spectralBinString];
string name = gainOffsetSetting.getName();
if(!(gainOffsetSetting.lookupValue("gain", gain)
&& gainOffsetSetting.lookupValue("offset", offset)))
{
return false;
}
}
catch(const SettingNotFoundException &nfex)
{
// Ignore.
return false;
}
return true;
}
bool Configfile::getSN(QString &SN)
{
try