| 324 | } |
| 325 | |
| 326 | void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a, |
| 327 | QPainter &p, QColor text_color, int h, int left, int right, |
| 328 | double samples_per_pixel, double pixels_offset, int y, |
| 329 | size_t base_colour, double min_annWidth, QColor fore, QColor back, double &last_x) |
| 330 | { |
| 331 | const double start = max(a.start_sample() / samples_per_pixel - |
| 332 | pixels_offset, (double)left); |
| 333 | const double end = min(a.end_sample() / samples_per_pixel - |
| 334 | pixels_offset, (double)right); |
| 335 | |
| 336 | const size_t colour = ((base_colour + a.type()) % MaxAnnType) % countof(Colours); |
| 337 | const QColor &fill = Colours[colour]; |
| 338 | const QColor &outline = OutlineColours[colour]; |
| 339 | |
| 340 | if (start > right + DrawPadding || end < left - DrawPadding){ |
| 341 | return; |
| 342 | } |
| 343 | |
| 344 | if (end - last_x <= 0.5 && end - start < 1){ |
| 345 | return; |
| 346 | } |
| 347 | |
| 348 | last_x = end; |
| 349 | |
| 350 | if (_decoder_stack->get_mark_index() == (int64_t)(a.start_sample()+ a.end_sample())/2) { |
| 351 | p.setPen(View::Blue); |
| 352 | int xpos = (start+end)/2; |
| 353 | int ypos = get_y()+_totalHeight*0.5 + 1; |
| 354 | const QPoint triangle[] = { |
| 355 | QPoint(xpos, ypos), |
| 356 | QPoint(xpos-1, ypos + 1), |
| 357 | QPoint(xpos, ypos + 1), |
| 358 | QPoint(xpos+1, ypos + 1), |
| 359 | QPoint(xpos-2, ypos + 2), |
| 360 | QPoint(xpos-1, ypos + 2), |
| 361 | QPoint(xpos, ypos + 2), |
| 362 | QPoint(xpos+1, ypos + 2), |
| 363 | QPoint(xpos+2, ypos + 2), |
| 364 | }; |
| 365 | p.drawPoints(triangle, 9); |
| 366 | } |
| 367 | |
| 368 | if (a.start_sample() == a.end_sample()){ |
| 369 | draw_instant(a, p, fill, outline, text_color, h, |
| 370 | start, y, min_annWidth); |
| 371 | } |
| 372 | else { |
| 373 | draw_range(a, p, fill, outline, text_color, h, |
| 374 | start, end, y, fore, back); |
| 375 | |
| 376 | if ((a.type()/100 == 2) && (end - start > 20)) |
| 377 | { |
| 378 | for(auto dec : _decoder_stack->stack()) |
| 379 | { |
| 380 | auto probes = dec->binded_probe_list(); |
| 381 | |
| 382 | for (auto probe : probes) { |
| 383 | int type = dec->get_channel_type(probe); |
nothing calls this directly
no test coverage detected