改变光谱bin2的波长计算方式为:通过bin1平均相邻波长获取;
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user