@@ -426,8 +426,10 @@ void SamplingBar::update_sample_count_selector()
426426 bool stream_mode = false ;
427427 uint64_t hw_depth = 0 ;
428428 uint64_t sw_depth;
429+ uint64_t rle_depth = 0 ;
429430 double pre_duration = SR_SEC (1 );
430431 double duration;
432+ bool rle_support = false ;
431433
432434 if (_updating_sample_count)
433435 return ;
@@ -464,23 +466,38 @@ void SamplingBar::update_sample_count_selector()
464466 sw_depth = AnalogMaxSWDepth;
465467 }
466468
469+ if (dev_inst->dev_inst ()->mode == LOGIC) {
470+ gvar = dev_inst->get_config (NULL , NULL , SR_CONF_RLE_SUPPORT);
471+ if (gvar != NULL ) {
472+ rle_support = g_variant_get_boolean (gvar);
473+ g_variant_unref (gvar);
474+ }
475+ if (rle_support)
476+ rle_depth = min (hw_depth*SR_KB (1 ), sw_depth);
477+ }
478+
467479 if (0 != _sample_count.count ())
468480 pre_duration = _sample_count.itemData (
469481 _sample_count.currentIndex ()).value <double >();
470482 _sample_count.clear ();
471483 const uint64_t samplerate = _sample_rate.itemData (
472484 _sample_rate.currentIndex ()).value <uint64_t >();
485+ const double hw_duration = hw_depth / (samplerate * (1.0 / SR_SEC (1 )));
473486 if (dev_inst->dev_inst ()->mode == DSO)
474487 duration = SR_SEC (10 );
475488 else if (stream_mode)
476489 duration = sw_depth / (samplerate * (1.0 / SR_SEC (1 )));
490+ else if (rle_support)
491+ duration = rle_depth / (samplerate * (1.0 / SR_SEC (1 )));
477492 else
478- duration = hw_depth / (samplerate * ( 1.0 / SR_SEC ( 1 ))) ;
493+ duration = hw_duration ;
479494
480495 bool not_last = true ;
481496 do {
497+ QString suffix = (dev_inst->dev_inst ()->mode == DSO) ? DIVString :
498+ (!stream_mode & duration > hw_duration) ? RLEString : " " ;
482499 char *const s = sr_time_string (duration);
483- _sample_count.addItem (QString (s) + ((dev_inst-> dev_inst ()-> mode == DSO) ? DIVString : " " ) ,
500+ _sample_count.addItem (QString (s) + suffix ,
484501 qVariantFromValue (duration));
485502 g_free (s);
486503
0 commit comments