summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
f5a5b01)
Three issues that were fixed by this:
1) The SignalBase did notify PDs when its conversion changed
and new sample data was generated but this was dismissed as
the samples_cleared() signal was never fired nor used by the
PD stack.
2) The decode_finished() signal was added so that the decode
trace can immediately paint the trace once the PD is done.
Before, a repaint was only triggered when annotations came in,
resulting in a noticeable "unresolved period" visible if the
last stretch of signal didn't contain any annotations as the
trace wasn't repainted quickly enough.
3) The decode trace indirectly looks at the signal's
samples_decoded_ member when drawing the "unresolved period"
bar. Hence we should update this member before triggering the
repaint via new_annotations().
DecodeSignal::~DecodeSignal()
{
DecodeSignal::~DecodeSignal()
{
- if (decode_thread_.joinable()) {
- decode_interrupt_ = true;
- decode_input_cond_.notify_one();
- decode_thread_.join();
- }
-
- if (logic_mux_thread_.joinable()) {
- logic_mux_interrupt_ = true;
- logic_mux_cond_.notify_one();
- logic_mux_thread_.join();
- }
-
- stop_srd_session();
}
const vector< shared_ptr<Decoder> >& DecodeSignal::decoder_stack() const
}
const vector< shared_ptr<Decoder> >& DecodeSignal::decoder_stack() const
void DecodeSignal::reset_decode()
{
void DecodeSignal::reset_decode()
{
+ if (decode_thread_.joinable()) {
+ decode_interrupt_ = true;
+ decode_input_cond_.notify_one();
+ decode_thread_.join();
+ }
+
+ if (logic_mux_thread_.joinable()) {
+ logic_mux_interrupt_ = true;
+ logic_mux_cond_.notify_one();
+ logic_mux_thread_.join();
+ }
+
stop_srd_session();
frame_complete_ = false;
samples_decoded_ = 0;
error_message_ = QString();
stop_srd_session();
frame_complete_ = false;
samples_decoded_ = 0;
error_message_ = QString();
rows_.clear();
class_rows_.clear();
rows_.clear();
class_rows_.clear();
+
+ logic_mux_data_.reset();
+ logic_mux_data_invalid_ = true;
}
void DecodeSignal::begin_decode()
}
void DecodeSignal::begin_decode()
- // Notify the frontend that we processed some data and
- // possibly have new annotations as well
- new_annotations();
-
{
lock_guard<mutex> lock(output_mutex_);
samples_decoded_ = chunk_end;
}
{
lock_guard<mutex> lock(output_mutex_);
samples_decoded_ = chunk_end;
}
+
+ // Notify the frontend that we processed some data and
+ // possibly have new annotations as well
+ new_annotations();
decode_data(abs_start_samplenum, sample_count);
abs_start_samplenum += sample_count;
}
decode_data(abs_start_samplenum, sample_count);
abs_start_samplenum += sample_count;
}
- } while (error_message_.isEmpty() && (sample_count > 0));
+ } while (error_message_.isEmpty() && (sample_count > 0) && !decode_interrupt_);
+
+ if (error_message_.isEmpty() && !decode_interrupt_) {
+ if (sample_count == 0)
+ decode_finished();
- if (error_message_.isEmpty()) {
// Wait for new input data or an interrupt was requested
unique_lock<mutex> input_wait_lock(input_mutex_);
decode_input_cond_.wait(input_wait_lock);
// Wait for new input data or an interrupt was requested
unique_lock<mutex> input_wait_lock(input_mutex_);
decode_input_cond_.wait(input_wait_lock);
void DecodeSignal::connect_input_notifiers()
{
// Disconnect the notification slot from the previous set of signals
void DecodeSignal::connect_input_notifiers()
{
// Disconnect the notification slot from the previous set of signals
+ disconnect(this, SLOT(on_data_cleared()));
disconnect(this, SLOT(on_data_received()));
// Connect the currently used signals to our slot
disconnect(this, SLOT(on_data_received()));
// Connect the currently used signals to our slot
if (!ch.assigned_signal)
continue;
if (!ch.assigned_signal)
continue;
- shared_ptr<Logic> logic_data = ch.assigned_signal->logic_data();
- connect(logic_data.get(), SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
+ const data::SignalBase *signal = ch.assigned_signal;
+ connect(signal, SIGNAL(samples_cleared()),
+ this, SLOT(on_data_cleared()));
+ connect(signal, SIGNAL(samples_added(QObject*, uint64_t, uint64_t)),
this, SLOT(on_data_received()));
}
}
this, SLOT(on_data_received()));
}
}
+void DecodeSignal::on_data_cleared()
+{
+ reset_decode();
+}
+
void DecodeSignal::on_data_received()
{
void DecodeSignal::on_data_received()
{
- logic_mux_cond_.notify_one();
+ if (!logic_mux_thread_.joinable())
+ begin_decode();
+ else
+ logic_mux_cond_.notify_one();
Q_SIGNALS:
void new_annotations();
Q_SIGNALS:
void new_annotations();
+ void decode_finished();
void channels_updated();
private Q_SLOTS:
void on_capture_state_changed(int state);
void channels_updated();
private Q_SLOTS:
void on_capture_state_changed(int state);
+ void on_data_cleared();
void on_data_received();
private:
void on_data_received();
private:
// Discard converted data
converted_data_.reset();
// Discard converted data
converted_data_.reset();
connect(decode_signal_.get(), SIGNAL(new_annotations()),
this, SLOT(on_new_annotations()));
connect(decode_signal_.get(), SIGNAL(new_annotations()),
this, SLOT(on_new_annotations()));
+ connect(decode_signal_.get(), SIGNAL(decode_finished()),
+ this, SLOT(on_decode_finished()));
connect(decode_signal_.get(), SIGNAL(channels_updated()),
this, SLOT(on_channels_updated()));
connect(decode_signal_.get(), SIGNAL(channels_updated()),
this, SLOT(on_channels_updated()));
owner_->row_item_appearance_changed(false, true);
}
owner_->row_item_appearance_changed(false, true);
}
+void DecodeTrace::on_decode_finished()
+{
+ if (owner_)
+ owner_->row_item_appearance_changed(false, true);
+}
+
void DecodeTrace::delete_pressed()
{
on_delete();
void DecodeTrace::delete_pressed()
{
on_delete();
private Q_SLOTS:
void on_new_annotations();
void on_delayed_trace_update();
private Q_SLOTS:
void on_new_annotations();
void on_delayed_trace_update();
+ void on_decode_finished();