#include <libsigrokdecode/libsigrokdecode.h>
}
+#include <mutex>
+
#include <extdef.h>
#include <tuple>
#include <pv/widgets/decodergroupbox.h>
#include <pv/widgets/decodermenu.h>
+using boost::shared_lock;
+using boost::shared_mutex;
using std::dynamic_pointer_cast;
using std::list;
+using std::lock_guard;
using std::make_pair;
using std::max;
+using std::make_pair;
using std::map;
using std::min;
using std::pair;
return _decoder_stack;
}
+pair<int, int> DecodeTrace::v_extents() const
+{
+ /// @todo Replace this with an implementation that knows the true
+ /// height of the trace
+ QFontMetrics m(QApplication::font());
+ const int text_height = m.boundingRect(QRect(), 0, "Tg").height();
+ const int row_height = (text_height * 6) / 4;
+ return make_pair(-row_height / 2, row_height * 7 / 2);
+}
+
void DecodeTrace::paint_back(QPainter &p, int left, int right)
{
Trace::paint_back(p, left, right);
{
assert(dec);
- const vector< shared_ptr<Signal> > sigs = _session.get_signals();
+ shared_lock<shared_mutex> lock(_session.signals_mutex());
+ const vector< shared_ptr<Signal> > &sigs(_session.signals());
assert(_decoder_stack);
const auto channel_iter = dec->channels().find(pdch);
assert(dec);
map<const srd_channel*, shared_ptr<LogicSignal> > channel_map;
- const vector< shared_ptr<Signal> > sigs = _session.get_signals();
+
+ shared_lock<shared_mutex> lock(_session.signals_mutex());
+ const vector< shared_ptr<Signal> > &sigs(_session.signals());
for (const ChannelSelector &s : _channel_selectors)
{