+ // Re-create an empty container
+ // so that the signal is recognized as providing logic data
+ // and thus can be assigned to a decoder
+ if (conversion_is_a2l())
+ if (!converted_data_)
+ converted_data_ = make_shared<Logic>(1); // Contains only one channel
+
+ start_conversion();
+
+ conversion_type_changed(t);
+}
+
+map<QString, QVariant> SignalBase::get_conversion_options() const
+{
+ return conversion_options_;
+}
+
+bool SignalBase::set_conversion_option(QString key, QVariant value)
+{
+ QVariant old_value;
+
+ auto key_iter = conversion_options_.find(key);
+ if (key_iter != conversion_options_.end())
+ old_value = key_iter->second;
+
+ conversion_options_[key] = value;
+
+ return (value != old_value);
+}
+
+vector<double> SignalBase::get_conversion_thresholds(const ConversionType t,
+ const bool always_custom) const
+{
+ vector<double> result;
+ ConversionType conv_type = t;
+ ConversionPreset preset;
+
+ // Use currently active conversion if no conversion type was supplied
+ if (conv_type == NoConversion)
+ conv_type = conversion_type_;
+
+ if (always_custom)
+ preset = NoPreset;
+ else
+ preset = get_current_conversion_preset();
+
+ if (conv_type == A2LConversionByThreshold) {
+ double thr = 0;
+
+ if (preset == NoPreset) {
+ auto thr_iter = conversion_options_.find("threshold_value");
+ if (thr_iter != conversion_options_.end())
+ thr = (thr_iter->second).toDouble();
+ }
+
+ if (preset == DynamicPreset)
+ thr = (min_value_ + max_value_) * 0.5; // middle between min and max