#include <extdef.h>
#include <assert.h>
-#include <math.h>
+#include <cmath>
#include <QApplication>
#include <QFormLayout>
#include <QLineEdit>
#include <QMenu>
-#include <libsigrok/libsigrok.hpp>
+#include <libsigrokcxx/libsigrokcxx.hpp>
#include "signal.hpp"
#include "view.hpp"
"IN",
"OUT",
"RST",
- "Tx",
- "Rx",
+ "TX",
+ "RX",
"EN",
"SCLK",
"MOSI",
Signal::Signal(pv::Session &session,
std::shared_ptr<sigrok::Channel> channel) :
- Trace(channel->name().c_str()),
+ Trace(QString::fromUtf8(channel->name().c_str())),
session_(session),
channel_(channel),
name_widget_(NULL),
updating_name_widget_ = true;
name_widget_->setEditText(name);
updating_name_widget_ = false;
+
+ // Store the channel name in sigrok::Channel so that it
+ // will end up in the .sr file upon save.
+ channel_->set_name(name.toUtf8().constData());
}
bool Signal::enabled() const