Optimize the rendering of decoding results 2

This commit is contained in:
dreamsourcelabTAI 2023-07-14 20:51:30 +08:00
parent 2a9f8bdccc
commit 83bd5c0125
2 changed files with 17 additions and 6 deletions

View File

@ -37,7 +37,7 @@ std::mutex RowData::_global_visitor_mutex;
RowData::RowData() :
_max_annotation(0),
_min_annotation(UINT64_MAX)
_min_annotation(0)
{
_item_count = 0;
}
@ -57,6 +57,7 @@ void RowData::clear()
}
_annotations.clear();
_item_count = 0;
_min_annotation = 0;
}
uint64_t RowData::get_max_sample()
@ -75,7 +76,7 @@ uint64_t RowData::get_max_annotation()
uint64_t RowData::get_min_annotation()
{
if (_min_annotation == UINT64_MAX)
if (_min_annotation == 0)
return 10;
else
return _min_annotation;
@ -120,8 +121,18 @@ bool RowData::push_annotation(Annotation *a)
_item_count = _annotations.size();
_max_annotation = max(_max_annotation, a->end_sample() - a->start_sample());
if (a->end_sample() != a->start_sample())
if (a->end_sample() != a->start_sample()){
if (_min_annotation == 0){
_min_annotation = a->end_sample() - a->start_sample();
}
else{
if (a->end_sample() - a->start_sample() == 2){
int bbb = 0;
bbb++;
}
_min_annotation = min(_min_annotation, a->end_sample() - a->start_sample());
}
}
return true;

View File

@ -279,8 +279,8 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QColo
_decoder_stack->get_max_annotation(row);
const double max_annWidth = max_annotation / samples_per_pixel;
if ((max_annWidth > 20) ||
(max_annWidth > 10 && min_annWidth > 1) ||
if ((max_annWidth > 100) ||
(max_annWidth > 10 && (min_annWidth > 1 || samples_per_pixel < 50)) ||
(max_annWidth == 0 && samples_per_pixel < 10)) {
std::vector<Annotation*> annotations;
_decoder_stack->get_annotation_subset(annotations, row,