MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / paintSignals

Method paintSignals

DSView/pv/view/viewport.cpp:264–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void Viewport::paintSignals(QPainter &p, QColor fore, QColor back)
265{
266 std::vector<Trace*> traces;
267 _view.get_traces(_type, traces);
268
269 if (_view.session().get_device()->get_work_mode() == LOGIC)
270 {
271 bool bFirst = true;
272 uint64_t end_align_sample;
273
274 for(auto t : traces){
275 if (t->enabled()){
276
277 if (t->signal_type() == SR_CHANNEL_LOGIC)
278 {
279 LogicSignal *logic_signal = (LogicSignal*)t;
280
281 if (bFirst)
282 end_align_sample = logic_signal->data()->get_ring_sample_count();
283
284 logic_signal->paint_mid_align_sample(p, 0, t->get_view_rect().right(), fore, back, end_align_sample);
285 bFirst = false;
286 }
287 else{
288 t->paint_mid(p, 0, t->get_view_rect().right(), fore, back);
289 }
290 }
291 }
292 }
293 else {
294 if (_view.scale() != _curScale ||
295 _view.offset() != _curOffset ||
296 _view.get_signalHeight() != _curSignalHeight ||
297 _need_update) {
298 _curScale = _view.scale();
299 _curOffset = _view.offset();
300 _curSignalHeight = _view.get_signalHeight();
301
302 _pixmap = QPixmap(size());
303 _pixmap.fill(Qt::transparent);
304
305 QPainter dbp(&_pixmap);
306
307 bool isLissa = false;
308
309 if (_view.session().get_device()->get_work_mode() == DSO)
310 {
311 auto lis_trace = _view.session().get_lissajous_trace();
312 if (lis_trace && lis_trace->enabled()){
313 isLissa = true;
314 }
315 }
316
317 for(auto t : traces)
318 {
319 if (t->enabled())
320 {
321 if (isLissa && t->signal_type() == SR_CHANNEL_DSO)

Callers

nothing calls this directly

Calls 15

get_tracesMethod · 0.80
get_work_modeMethod · 0.80
get_deviceMethod · 0.80
sessionMethod · 0.80
signal_typeMethod · 0.80
scaleMethod · 0.80
offsetMethod · 0.80
get_signalHeightMethod · 0.80
get_lissajous_traceMethod · 0.80
xcursors_shownMethod · 0.80
get_map_rectMethod · 0.80

Tested by

no test coverage detected