From d48510a1cc4a505ee61306760d489d095f1dda8c 2019-06-05 19:25:10 From: Alexis Jeandet Date: 2019-06-05 19:25:10 Subject: [PATCH] More fixes on spectrograms Signed-off-by: Alexis Jeandet --- diff --git a/core b/core index 1e3f92d..70d6748 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 1e3f92d40b0ec24443e067aaa9e7bca385ec27b2 +Subproject commit 70d6748a06620f865b683c86c89cc27e1cb0d4b9 diff --git a/gui/src/Visualization/VisualizationGraphHelper.cpp b/gui/src/Visualization/VisualizationGraphHelper.cpp index 1540a6e..e3aa60e 100644 --- a/gui/src/Visualization/VisualizationGraphHelper.cpp +++ b/gui/src/Visualization/VisualizationGraphHelper.cpp @@ -342,12 +342,12 @@ inline std::vector> build_access_pattern(const std::vector> access_pattern; - for (int index = 0, cel_index = 0; index < colormap_properties.v_size_px; index++) + for (int index = 0, cel_index = axis.size() - 1; index < colormap_properties.v_size_px; index++) { double current_y = pow(10., (axisProperties.max_resolution * index) + axisProperties.min); if (current_y > axis[cel_index]) - cel_index++; - access_pattern.push_back({ index, axis.size() - 1 - cel_index }); + cel_index--; + access_pattern.push_back({ index, cel_index }); } return access_pattern; } @@ -405,7 +405,7 @@ struct PlottablesUpdateraxis(1), yAxisProperties, colormap_properties); auto line = serie->begin(); auto next_line = line + 1; @@ -415,7 +415,6 @@ struct PlottablesUpdatermax_sampling, xAxisProperties.max_resolution * 100.); std::vector line_values(serie->size(1)); double avg_coef = 0.; - bool has_nan = false; while (x_index < colormap_properties.h_size_px) { if (next_line != std::end(*serie) and current_time >= next_line->t()) @@ -434,18 +433,9 @@ struct PlottablesUpdatert() + x_min_resolution > current_time) { - if (has_nan) - { - std::transform(std::begin(*line), std::end(*line), - std::begin(line_values), - [](const auto& input) { return input.v(); }); - has_nan = false; - } - else { std::transform(std::begin(*line), std::end(*line), std::cbegin(line_values), std::begin(line_values), @@ -459,13 +449,11 @@ struct PlottablesUpdater 0.) { - has_nan = true; - std::fill( - std::begin(line_values), std::end(line_values), std::nan("")); + std::fill(std::begin(line_values), std::end(line_values), 0); } } } - current_time += xAxisProperties.max_resolution; + current_time += xAxisProperties.max_resolution * 0.9; } } colormap->rescaleDataRange(true);