| 543 | |
| 544 | |
| 545 | void 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 | |
| 577 | void LogicSignal::set_data(data::LogicSnapshot* data) |
| 578 | { |