File: baselineplotpage.cpp

package info (click to toggle)
aoflagger 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 4,476 kB
  • sloc: cpp: 51,868; python: 152; sh: 25; makefile: 17
file content (32 lines) | stat: -rw-r--r-- 1,182 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
#include <limits>

#include "baselineplotpage.h"

#include "controllers/baselinepagecontroller.h"

BaselinePlotPage::BaselinePlotPage(BaselinePageController* controller) :
	GrayScalePlotPage(controller),
	_controller(controller)
{
	grayScaleWidget().OnMouseMovedEvent().connect(sigc::mem_fun(*this, &BaselinePlotPage::onMouseMoved));
	grayScaleWidget().Plot().SetXAxisDescription("Antenna 1 index");
	grayScaleWidget().Plot().SetManualXAxisDescription(true);
	grayScaleWidget().Plot().SetYAxisDescription("Antenna 2 index");
	grayScaleWidget().Plot().SetManualYAxisDescription(true);
}

BaselinePlotPage::~BaselinePlotPage()
{ }

void BaselinePlotPage::onMouseMoved(size_t x, size_t y)
{
	std::string
		antenna1Name = 	_controller->AntennaName(x),
		antenna2Name = _controller->AntennaName(y);
	const QualityTablesFormatter::StatisticKind kind = getSelectedStatisticKind();
	const std::string &kindName = QualityTablesFormatter::KindToName(kind);
	
	std::stringstream text;
	text << "Correlation " << antenna1Name << " (" << x << ") x " << antenna2Name << " (" << y << "), " << kindName << " = " << grayScaleWidget().Plot().Image()->Value(x, y);
	_signalStatusChange(text.str());
}