MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / tryApplyGains

Method tryApplyGains

Default/Source/SourceWidget.cpp:314–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314bool
315SourceWidget::tryApplyGains(
316 Suscan::AnalyzerSourceInfo const &info)
317{
318 std::vector<Suscan::Source::GainDescription> gains;
319 DeviceGain *gain;
320 unsigned int i;
321
322 info.getGainInfo(gains);
323
324 if (gains.size() != this->gainControls.size())
325 return false;
326
327 for (i = 0; i < gains.size(); ++i) {
328 if ((gain = this->lookupGain(gains[i].getName())) == nullptr)
329 return false;
330
331 gain->setGain(gains[i].getDefault());
332 }
333
334 return true;
335}
336
337void
338SourceWidget::applySourceInfo(Suscan::AnalyzerSourceInfo const &info)

Callers 1

applySourceInfoMethod · 0.95

Calls 6

lookupGainMethod · 0.95
getGainInfoMethod · 0.80
getDefaultMethod · 0.80
sizeMethod · 0.45
getNameMethod · 0.45
setGainMethod · 0.45

Tested by

no test coverage detected