+void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
+ int right, double samples_per_pixel, double pixels_offset)
+{
+ using namespace pv::data;
+ using pv::data::decode::Decoder;
+
+ assert(_decoder_stack);
+
+ shared_ptr<Logic> data;
+ shared_ptr<LogicSignal> logic_signal;
+
+ const list< shared_ptr<Decoder> > &stack = _decoder_stack->stack();
+
+ // We get the logic data of the first probe in the list.
+ // This works because we are currently assuming all
+ // LogicSignals have the same data/snapshot
+ BOOST_FOREACH (const shared_ptr<Decoder> &dec, stack)
+ if (dec && !dec->probes().empty() &&
+ ((logic_signal = (*dec->probes().begin()).second)) &&
+ ((data = logic_signal->data())))
+ break;
+
+ if (!data || data->get_snapshots().empty())
+ return;
+
+ const shared_ptr<LogicSnapshot> snapshot =
+ data->get_snapshots().front();
+ assert(snapshot);
+ const int64_t sample_count = (int64_t)snapshot->get_sample_count();
+ if (sample_count == 0)
+ return;
+
+ const int64_t samples_decoded = _decoder_stack->samples_decoded();
+ if (sample_count == samples_decoded)
+ return;
+
+ const int y = get_y();
+ const double start = max(samples_decoded /
+ samples_per_pixel - pixels_offset, left - 1.0);
+ const double end = min(sample_count / samples_per_pixel -
+ pixels_offset, right + 1.0);
+ const QRectF no_decode_rect(start, y - h/2 + 0.5, end - start, h);
+
+ p.setPen(QPen(Qt::NoPen));
+ p.setBrush(Qt::white);
+ p.drawRect(no_decode_rect);
+
+ p.setPen(NoDecodeColour);
+ p.setBrush(QBrush(NoDecodeColour, Qt::Dense6Pattern));
+ p.drawRect(no_decode_rect);
+}
+