this, SLOT(on_samples_cleared()));
disconnect(data.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
this, SLOT(on_samples_added(QObject*, uint64_t, uint64_t)));
+
+ if (channel_type_ == AnalogChannel) {
+ shared_ptr<Analog> analog = analog_data();
+ assert(analog);
+
+ disconnect(analog.get(), SIGNAL(min_max_changed(float, float)),
+ this, SLOT(on_min_max_changed(float, float)));
+ }
}
data_ = data;
this, SLOT(on_samples_cleared()));
connect(data.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
this, SLOT(on_samples_added(QObject*, uint64_t, uint64_t)));
+
+ if (channel_type_ == AnalogChannel) {
+ shared_ptr<Analog> analog = analog_data();
+ assert(analog);
+
+ connect(analog.get(), SIGNAL(min_max_changed(float, float)),
+ this, SLOT(on_min_max_changed(float, float)));
+ }
}
}
if (channel_type_ == LogicChannel)
result = dynamic_pointer_cast<Logic>(data_);
- if (((conversion_type_ == A2LConversionByTreshold) ||
+ if (((conversion_type_ == A2LConversionByThreshold) ||
(conversion_type_ == A2LConversionBySchmittTrigger)))
result = dynamic_pointer_cast<Logic>(converted_data_);
else
preset = get_current_conversion_preset();
- if (conv_type == A2LConversionByTreshold) {
+ if (conv_type == A2LConversionByThreshold) {
double thr = 0;
if (preset == -1) {
{
vector< pair<QString, int> > presets;
- if (conversion_type_ == A2LConversionByTreshold) {
+ if (conversion_type_ == A2LConversionByThreshold) {
// Source: http://www.interfacebus.com/voltage_threshold.html
presets.emplace_back(tr("Signal average"), 0);
presets.emplace_back(tr("0.9V (for 1.8V CMOS)"), 1);
bool SignalBase::conversion_is_a2l() const
{
return ((channel_type_ == AnalogChannel) &&
- ((conversion_type_ == A2LConversionByTreshold) ||
+ ((conversion_type_ == A2LConversionByThreshold) ||
(conversion_type_ == A2LConversionBySchmittTrigger)));
}
// Convert
uint64_t i = start_sample;
- if (conversion_type_ == A2LConversionByTreshold) {
+ if (conversion_type_ == A2LConversionByThreshold) {
const double threshold = get_conversion_thresholds()[0];
// Convert as many sample blocks as we can
samples_added(segment, start_sample, end_sample);
}
+void SignalBase::on_min_max_changed(float min, float max)
+{
+ (void)min;
+ (void)max;
+
+ // Restart conversion if one is enabled and uses an automatic threshold
+ if ((conversion_type_ != NoConversion) &&
+ (get_current_conversion_preset() == 0))
+ start_conversion();
+}
+
void SignalBase::on_capture_state_changed(int state)
{
if (state == Session::Running) {
- if (conversion_type_ != NoConversion) {
- // Restart conversion
- stop_conversion();
+ // Restart conversion if one is enabled
+ if (conversion_type_ != NoConversion)
start_conversion();
- }
}
}