MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / paintAzimuthElevationMap

Method paintAzimuthElevationMap

Components/FrequencyCorrectionDialog.cpp:44–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void
45FrequencyCorrectionDialog::paintAzimuthElevationMap(QPixmap &pixmap)
46{
47 QPainter p(&pixmap);
48 QPen pen(
49 this->colors.constellationAxes,
50 FREQUENCY_CORRECTION_DIALOG_OVERSAMPLING);
51 int i;
52
53
54 if (azElAxesPixmap.size() != pixmap.size()) {
55 this->azElAxesPixmap = QPixmap(pixmap.size());
56 QPainter p(&this->azElAxesPixmap);
57 QPointF center;
58 qreal deltaEl;
59 qreal deltaAz;
60 xyz_t azEl = xyz_INITIALIZER;
61
62 // Init parameters
63 this->azElCenterX = .5 * pixmap.width();
64 this->azElCenterY = .5 * pixmap.height();
65 this->azElAxesRadius = .8 * MIN(this->azElCenterX, this->azElCenterY);
66
67 azEl.elevation = .5 * M_PI;
68 deltaEl = this->azElAxesRadius / FREQUENCY_EV_TICKS;
69 deltaAz = 2 * M_PI / FREQUENCY_AZ_TICKS;
70 center = this->azElToPoint(azEl);
71
72 p.fillRect(
73 0, // x
74 0, // y
75 pixmap.width(),
76 pixmap.height(),
77 QBrush(this->colors.constellationBackground));
78
79 // Paint cardinal points
80 p.setPen(pen);
81 azEl.azimuth = 0;
82 azEl.elevation = -.5 * M_PI / FREQUENCY_EV_TICKS;
83
84 this->paintTextAt(p, this->azElToPoint(azEl), "N", true);
85
86 azEl.azimuth = .5 * M_PI;
87 this->paintTextAt(p, this->azElToPoint(azEl), "E", true);
88
89 azEl.azimuth = M_PI;
90 this->paintTextAt(p, this->azElToPoint(azEl), "S", true);
91
92 azEl.azimuth = 1.5 * M_PI;
93 this->paintTextAt(p, this->azElToPoint(azEl), "W", true);
94
95 // Draw elevation circles
96 p.drawEllipse(center, this->azElAxesRadius, this->azElAxesRadius);
97
98 pen.setStyle(Qt::DashLine);
99 p.setPen(pen);
100
101 // TODO: draw individual lines.

Callers 1

repaintSatellitePlotMethod · 0.95

Calls 4

azElToPointMethod · 0.95
paintTextAtMethod · 0.95
widthMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected