File: timefrequencyplotpage.cpp

package info (click to toggle)
aoflagger 3.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,688 kB
  • sloc: cpp: 83,116; python: 10,187; sh: 260; makefile: 178
file content (26 lines) | stat: -rw-r--r-- 903 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "timefrequencyplotpage.h"

#include "controllers/tfpagecontroller.h"

TimeFrequencyPlotPage::TimeFrequencyPlotPage(TFPageController* controller)
    : GrayScalePlotPage(controller) {
  grayScaleWidget().OnMouseMovedEvent().connect(
      sigc::mem_fun(*this, &TimeFrequencyPlotPage::onMouseMoved));
}

void TimeFrequencyPlotPage::onMouseMoved(double x, double y) {
  std::stringstream text;

  const QualityTablesFormatter::StatisticKind kind = getSelectedStatisticKind();
  const std::string& kindName = QualityTablesFormatter::KindToName(kind);

  const MaskedHeatMap& map =
      static_cast<MaskedHeatMap&>(grayScaleWidget().Plot());
  size_t image_x;
  size_t image_y;
  if (map.UnitToImage(x, y, image_x, image_y)) {
    text << kindName << " = " << map.GetImage2D()->Value(image_x, image_y)
         << " (" << image_x << ", " << image_y << ")";
  }
  _signalStatusChange(text.str());
}