logic_mux_data_.reset();
logic_mux_data_invalid_ = true;
- error_message_ = QString();
+ if (!error_message_.isEmpty()) {
+ error_message_ = QString();
+ qDebug().noquote().nospace() << name() << ": Error cleared";
+ }
decode_reset();
}
reset_decode();
if (stack_.size() == 0) {
- error_message_ = tr("No decoders");
+ set_error_message(tr("No decoders"));
return;
}
assert(channels_.size() > 0);
if (get_assigned_signal_count() == 0) {
- error_message_ = tr("There are no channels assigned to this decoder");
+ set_error_message(tr("There are no channels assigned to this decoder"));
return;
}
// Check that all decoders have the required channels
for (const shared_ptr<decode::Decoder> &dec : stack_)
if (!dec->have_required_channels()) {
- error_message_ = tr("One or more required channels "
- "have not been specified");
+ set_error_message(tr("One or more required channels "
+ "have not been specified"));
return;
}
connect_input_notifiers();
if (get_input_segment_count() == 0) {
- error_message_ = tr("No input data");
+ set_error_message(tr("No input data"));
return;
}
begin_decode();
}
+void DecodeSignal::set_error_message(QString msg)
+{
+ error_message_ = msg;
+ qDebug().noquote().nospace() << name() << ": " << msg;
+}
+
uint32_t DecodeSignal::get_input_segment_count() const
{
uint64_t count = std::numeric_limits<uint64_t>::max();
if (srd_session_send(srd_session_, i, chunk_end, chunk,
data_size, unit_size) != SRD_OK) {
- error_message_ = tr("Decoder reported an error");
+ set_error_message(tr("Decoder reported an error"));
delete[] chunk;
break;
}
srd_decoder_inst *const di = dec->create_decoder_inst(srd_session_);
if (!di) {
- error_message_ = tr("Failed to create decoder instance");
+ set_error_message(tr("Failed to create decoder instance"));
srd_session_destroy(srd_session_);
srd_session_ = nullptr;
return;
#include <QAction>
#include <QApplication>
#include <QCloseEvent>
+#include <QDebug>
#include <QDockWidget>
#include <QHBoxLayout>
#include <QMessageBox>
void MainWindow::session_error(const QString text, const QString info_text)
{
+ qDebug().noquote() << "Notifying user of session error:" << info_text;
+
QMetaObject::invokeMethod(this, "show_session_error",
Qt::QueuedConnection, Q_ARG(QString, text),
Q_ARG(QString, info_text));
filename.toStdString());
set_device(device);
- // TODO Perform error handling
- start_capture([](QString infoMessage) { (void)infoMessage; });
+ start_capture([](QString infoMessage) {
+ qDebug().noquote() << "Session error:" << infoMessage; });
set_name(QFileInfo(filename).fileName());
}
set_capture_state(Stopped);
// Confirm that SR_DF_END was received
- if (cur_logic_segment_) {
- qDebug("SR_DF_END was not received.");
- assert(false);
- }
+ if (cur_logic_segment_)
+ qDebug() << "WARNING: SR_DF_END was not received.";
// Optimize memory usage
free_unused_memory();