##// END OF EJS Templates
More fixes on spectrograms...
jeandet -
r1471:d48510a1cc4a
parent child
Show More
@@ -1,1 +1,1
1 Subproject commit 1e3f92d40b0ec24443e067aaa9e7bca385ec27b2
1 Subproject commit 70d6748a06620f865b683c86c89cc27e1cb0d4b9
@@ -342,12 +342,12 inline std::vector<std::pair<int, int>> build_access_pattern(const std::vector<d
342 const ColomapProperties& colormap_properties)
342 const ColomapProperties& colormap_properties)
343 {
343 {
344 std::vector<std::pair<int, int>> access_pattern;
344 std::vector<std::pair<int, int>> access_pattern;
345 for (int index = 0, cel_index = 0; index < colormap_properties.v_size_px; index++)
345 for (int index = 0, cel_index = axis.size() - 1; index < colormap_properties.v_size_px; index++)
346 {
346 {
347 double current_y = pow(10., (axisProperties.max_resolution * index) + axisProperties.min);
347 double current_y = pow(10., (axisProperties.max_resolution * index) + axisProperties.min);
348 if (current_y > axis[cel_index])
348 if (current_y > axis[cel_index])
349 cel_index++;
349 cel_index--;
350 access_pattern.push_back({ index, axis.size() - 1 - cel_index });
350 access_pattern.push_back({ index, cel_index });
351 }
351 }
352 return access_pattern;
352 return access_pattern;
353 }
353 }
@@ -405,7 +405,7 struct PlottablesUpdater<T,
405 QCPRange { xAxisProperties.min, xAxisProperties.max }, { minValue, maxValue });
405 QCPRange { xAxisProperties.min, xAxisProperties.max }, { minValue, maxValue });
406
406
407 auto y_access_pattern
407 auto y_access_pattern
408 = build_access_pattern(yAxis, yAxisProperties, colormap_properties);
408 = build_access_pattern(serie->axis(1), yAxisProperties, colormap_properties);
409
409
410 auto line = serie->begin();
410 auto line = serie->begin();
411 auto next_line = line + 1;
411 auto next_line = line + 1;
@@ -415,7 +415,6 struct PlottablesUpdater<T,
415 = std::fmin(2. * serie->max_sampling, xAxisProperties.max_resolution * 100.);
415 = std::fmin(2. * serie->max_sampling, xAxisProperties.max_resolution * 100.);
416 std::vector<double> line_values(serie->size(1));
416 std::vector<double> line_values(serie->size(1));
417 double avg_coef = 0.;
417 double avg_coef = 0.;
418 bool has_nan = false;
419 while (x_index < colormap_properties.h_size_px)
418 while (x_index < colormap_properties.h_size_px)
420 {
419 {
421 if (next_line != std::end(*serie) and current_time >= next_line->t())
420 if (next_line != std::end(*serie) and current_time >= next_line->t())
@@ -434,18 +433,9 struct PlottablesUpdater<T,
434 std::fill(std::begin(line_values), std::end(line_values), 0.);
433 std::fill(std::begin(line_values), std::end(line_values), 0.);
435 x_index++;
434 x_index++;
436 avg_coef = 0.;
435 avg_coef = 0.;
437 has_nan = false;
438 }
436 }
439 if (line->t() + x_min_resolution > current_time)
437 if (line->t() + x_min_resolution > current_time)
440 {
438 {
441 if (has_nan)
442 {
443 std::transform(std::begin(*line), std::end(*line),
444 std::begin(line_values),
445 [](const auto& input) { return input.v(); });
446 has_nan = false;
447 }
448 else
449 {
439 {
450 std::transform(std::begin(*line), std::end(*line),
440 std::transform(std::begin(*line), std::end(*line),
451 std::cbegin(line_values), std::begin(line_values),
441 std::cbegin(line_values), std::begin(line_values),
@@ -459,13 +449,11 struct PlottablesUpdater<T,
459 {
449 {
460 if (avg_coef > 0.)
450 if (avg_coef > 0.)
461 {
451 {
462 has_nan = true;
452 std::fill(std::begin(line_values), std::end(line_values), 0);
463 std::fill(
464 std::begin(line_values), std::end(line_values), std::nan(""));
465 }
453 }
466 }
454 }
467 }
455 }
468 current_time += xAxisProperties.max_resolution;
456 current_time += xAxisProperties.max_resolution * 0.9;
469 }
457 }
470 }
458 }
471 colormap->rescaleDataRange(true);
459 colormap->rescaleDataRange(true);
General Comments 0
You need to be logged in to leave comments. Login now