Skip to content

Commit abea90d

Browse files
andrei47wAlexandraTrifan
authored andcommitted
ADC: load time optimization
- avoid widget repolishing, reduced 30% of total loading time Signed-off-by: Andrei Popa <andrei.popa@analog.com>
1 parent 2484bfc commit abea90d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/generic-plugins/plugins/adc/src/adcplugin.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ void ADCPlugin::newInstrument(ADCInstrumentType t, AcqTreeNode *root, GRTopBlock
342342
tme->setRunBtnVisible(true);
343343

344344
adc = new ADCTimeInstrumentController(tme, m_param, "adc" + QString::number(idx), root, this);
345-
adc->init();
346-
347345
ui = adc->ui();
348346
idx++;
349347

@@ -384,7 +382,6 @@ void ADCPlugin::newInstrument(ADCInstrumentType t, AcqTreeNode *root, GRTopBlock
384382
tme->setRunBtnVisible(true);
385383

386384
adc = new ADCFFTInstrumentController(tme, m_param, "adc" + QString::number(idx), root, this);
387-
adc->init();
388385
ui = adc->ui();
389386
idx++;
390387

@@ -425,6 +422,10 @@ void ADCPlugin::newInstrument(ADCInstrumentType t, AcqTreeNode *root, GRTopBlock
425422
Q_EMIT toolListChanged();
426423
tme->setTool(ui);
427424

425+
// only construct sub-widgets (plots, ch, etc) after setting a parent
426+
// this avoids widget repolishing
427+
adc->init();
428+
428429
adc->setEnableAddRemovePlot(Preferences::get("adc_add_remove_plot").toBool());
429430
adc->setEnableAddRemoveInstrument(Preferences::get("adc_add_remove_instrument").toBool());
430431

0 commit comments

Comments
 (0)