mirror of
https://github.com/JS8Call-improved/JS8Call-improved
synced 2026-08-13 17:47:36 -04:00
Hoist averaging lambda
This commit is contained in:
parent
3b787720b9
commit
3cd0a8de91
1 changed files with 6 additions and 6 deletions
|
|
@ -488,8 +488,11 @@ WideGraph::dataSink(WF::SPlot const & s,
|
|||
auto const bpp = ui->widePlot->binsPerPixel();
|
||||
auto sit = m_splot.begin() + static_cast<int>(ui->widePlot->startFreq() / df3 + 0.5f);
|
||||
auto it = m_swide.begin();
|
||||
auto const end = it + std::min(m_swide.size(),
|
||||
static_cast<std::size_t>(5000.0f / (bpp * df3)));
|
||||
auto const end = it + std::min(m_swide.size(), static_cast<std::size_t>(5000.0f / (bpp * df3)));
|
||||
auto const avg = [runs = m_waterfallNow](auto const value)
|
||||
{
|
||||
return value / runs;
|
||||
};
|
||||
|
||||
for (; it != end; ++it, sit += bpp)
|
||||
{
|
||||
|
|
@ -497,10 +500,7 @@ WideGraph::dataSink(WF::SPlot const & s,
|
|||
sit + bpp,
|
||||
0.0f,
|
||||
std::plus<>{},
|
||||
[runs = m_waterfallNow](auto const value)
|
||||
{
|
||||
return value / runs;
|
||||
}));
|
||||
avg));
|
||||
}
|
||||
|
||||
// Next round, we'll need a fresh picture, and we've now progressed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue