diff options
Diffstat (limited to '')
-rw-r--r-- | src/spectro_impls.cc | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/spectro_impls.cc b/src/spectro_impls.cc index c9f9412..7ad78e4 100644 --- a/src/spectro_impls.cc +++ b/src/spectro_impls.cc @@ -82,7 +82,7 @@ public: return this->fss_time_delegate->row_for_time(time_bucket); } - nonstd::optional<struct timeval> time_for_row(vis_line_t row) override + nonstd::optional<row_info> time_for_row(vis_line_t row) override { return this->fss_lines | lnav::itertools::nth(row) | lnav::itertools::flat_map([this](const auto row) { @@ -90,17 +90,14 @@ public: }); } - bool list_value_for_overlay(const listview_curses& lv, - int y, - int bottom, + void list_value_for_overlay(const listview_curses& lv, vis_line_t line, - attr_line_t& value_out) override + std::vector<attr_line_t>& value_out) override { if (this->fss_overlay_delegate != nullptr) { - return this->fss_overlay_delegate->list_value_for_overlay( - lv, y, bottom, line, value_out); + this->fss_overlay_delegate->list_value_for_overlay( + lv, line, value_out); } - return false; } text_sub_source* fss_delegate; @@ -348,7 +345,6 @@ db_spectro_value_source::update_stats() this->dsvs_stats.clear(); auto& dls = lnav_data.ld_db_row_source; - auto& chart = dls.dls_chart; this->dsvs_column_index = dls.column_name_to_index(this->dsvs_colname); @@ -441,12 +437,20 @@ db_spectro_value_source::update_stats() return; } - auto bs = chart.get_stats_for(this->dsvs_colname); - this->dsvs_begin_time = dls.dls_time_column.front().tv_sec; this->dsvs_end_time = dls.dls_time_column.back().tv_sec; - this->dsvs_stats.lvs_min_value = bs.bs_min_value; - this->dsvs_stats.lvs_max_value = bs.bs_max_value; + + auto find_res + = dls.dls_headers | lnav::itertools::find_if([this](const auto& elem) { + return elem.hm_name == this->dsvs_colname; + }); + if (find_res) { + auto hm = find_res.value(); + auto& bs = hm->hm_chart.get_stats_for(this->dsvs_colname); + this->dsvs_stats.lvs_min_value = bs.bs_min_value; + this->dsvs_stats.lvs_max_value = bs.bs_max_value; + } + this->dsvs_stats.lvs_count = dls.dls_rows.size(); } |