X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fdecodetrace.cpp;h=d97d01ef623931c2769c25dc5fe34b798cd6365c;hb=1dc835a4b49104f5b4c9695e91e6ffb7a48d7c23;hp=899de3b238743f320d638c87308719f9f961ddc7;hpb=eae6e30af53f6b3e42dc5be212c82870078276b0;p=pulseview.git diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 899de3b..d97d01e 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -22,6 +22,8 @@ extern "C" { #include } +#include + #include #include @@ -51,10 +53,14 @@ extern "C" { #include #include +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; @@ -150,6 +156,16 @@ const std::shared_ptr& DecodeTrace::decoder() const return _decoder_stack; } +pair 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); @@ -692,7 +708,8 @@ QComboBox* DecodeTrace::create_channel_selector( { assert(dec); - const vector< shared_ptr > sigs = _session.get_signals(); + shared_lock lock(_session.signals_mutex()); + const vector< shared_ptr > &sigs(_session.signals()); assert(_decoder_stack); const auto channel_iter = dec->channels().find(pdch); @@ -725,7 +742,9 @@ void DecodeTrace::commit_decoder_channels(shared_ptr &dec assert(dec); map > channel_map; - const vector< shared_ptr > sigs = _session.get_signals(); + + shared_lock lock(_session.signals_mutex()); + const vector< shared_ptr > &sigs(_session.signals()); for (const ChannelSelector &s : _channel_selectors) {