MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / paint_mark

Method paint_mark

DSView/pv/view/logicsignal.cpp:545–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543
544
545void LogicSignal::paint_mark(QPainter &p, int xstart, int xend, int type)
546{
547 const int ypos = get_y();
548 const int msize = 3;
549 p.setPen(p.brush().color());
550 if (type == SRD_CHANNEL_SDATA) {
551 p.drawEllipse(QPoint(xstart, ypos), msize, msize);
552 } else if (type == SRD_CHANNEL_SCLK) {
553 const QPoint triangle[] = {
554 QPoint(xstart, ypos - 2),
555 QPoint(xstart-1, ypos - 1),
556 QPoint(xstart, ypos - 1),
557 QPoint(xstart+1, ypos - 1),
558 QPoint(xstart-2, ypos),
559 QPoint(xstart-1, ypos),
560 QPoint(xstart, ypos),
561 QPoint(xstart+1, ypos),
562 QPoint(xstart+2, ypos),
563 QPoint(xstart-3, ypos + 1),
564 QPoint(xstart-2, ypos + 1),
565 QPoint(xstart-1, ypos + 1),
566 QPoint(xstart, ypos + 1),
567 QPoint(xstart+1, ypos + 1),
568 QPoint(xstart+2, ypos + 1),
569 QPoint(xstart+3, ypos + 1),
570 };
571 p.drawPoints(triangle, 16);
572 } else if (type == SRD_CHANNEL_ADATA) {
573 p.drawEllipse(QPoint((xstart+xend)/2, ypos), msize, msize);
574 }
575}
576
577void LogicSignal::set_data(data::LogicSnapshot* data)
578{

Callers 1

draw_annotationMethod · 0.80

Calls 1

colorMethod · 0.80

Tested by

no test coverage detected