+ // Enable or disable widgets depending on conversion state
+ conv_threshold_cb_->setEnabled(conv_type != SignalBase::NoConversion);
+ display_type_cb_->setEnabled(conv_type != SignalBase::NoConversion);
+
+ conv_threshold_cb_->clear();
+
+ vector < pair<QString, int> > presets = base_->get_conversion_presets();
+
+ // Prevent the combo box from firing the "edit text changed" signal
+ // as that would involuntarily select the first entry
+ conv_threshold_cb_->blockSignals(true);
+
+ // Set available options depending on chosen conversion
+ for (pair<QString, int> preset : presets)
+ conv_threshold_cb_->addItem(preset.first, preset.second);
+
+ map < QString, QVariant > options = base_->get_conversion_options();
+
+ if (conv_type == SignalBase::A2LConversionByThreshold) {
+ const vector<double> thresholds = base_->get_conversion_thresholds(
+ SignalBase::A2LConversionByThreshold, true);
+ conv_threshold_cb_->addItem(
+ QString("%1V").arg(QString::number(thresholds[0], 'f', 1)), -1);
+ }
+
+ if (conv_type == SignalBase::A2LConversionBySchmittTrigger) {
+ const vector<double> thresholds = base_->get_conversion_thresholds(
+ SignalBase::A2LConversionBySchmittTrigger, true);
+ conv_threshold_cb_->addItem(QString("%1V/%2V").arg(
+ QString::number(thresholds[0], 'f', 1),
+ QString::number(thresholds[1], 'f', 1)), -1);
+ }
+
+ int preset_id = base_->get_current_conversion_preset();
+ conv_threshold_cb_->setCurrentIndex(
+ conv_threshold_cb_->findData(preset_id));
+
+ conv_threshold_cb_->blockSignals(false);