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

Method paintAzimuthElevationPass

Components/FrequencyCorrectionDialog.cpp:181–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void
182FrequencyCorrectionDialog::paintAzimuthElevationPass(QPainter &p)
183{
184 qreal delta;
185 struct timeval diff;
186 struct timeval tdelta;
187 struct timeval t;
188 struct tm losTm, aosTm;
189 SigDiggerHelpers *hlp = SigDiggerHelpers::instance();
190 bool visible;
191 bool haveSourceStart = false;
192 bool haveSourceEnd = false;
193 QVector<qreal> dashes;
194 xyz_t pAzEl = {{0}, {0}, {0}};
195 xyz_t firstAzel = {{0}, {0}, {0}};
196 xyz_t azel;
197 QPen pen(
198 this->colors.constellationForeground,
199 FREQUENCY_CORRECTION_DIALOG_OVERSAMPLING);
200
201 if (this->haveALOS) {
202 qreal mkwidth =
203 (this->azElAxesRadius / 80) * FREQUENCY_CORRECTION_DIALOG_OVERSAMPLING;
204 time_t lost = this->losTime.tv_sec;
205 time_t aost = this->aosTime.tv_sec;
206 time_t ssrc = this->startTime.tv_sec;
207 time_t esrc = this->endTime.tv_sec;
208
209 if (!this->realTime) {
210 // Non-realtime signals have a defined start time and end time
211 // We overlay this information on the azel plot indicating the
212 // window in which the predictions will apply
213 haveSourceStart = (aost < ssrc) && (ssrc <= lost);
214 haveSourceEnd = (aost < esrc) && (esrc <= lost);
215 }
216
217 // Convert to something printable
218 hlp->pushLocalTZ();
219 localtime_r(&lost, &losTm);
220 localtime_r(&aost, &aosTm);
221 hlp->popTZ();
222
223 timersub(&this->losTime, &this->aosTime, &diff);
224
225 delta = (static_cast<qreal>(diff.tv_sec)
226 + 1e-6 * static_cast<qreal>(diff.tv_usec)) / SAT_PATH_POINTS;
227
228 tdelta.tv_sec = static_cast<time_t>(floor(delta));
229 tdelta.tv_usec = static_cast<unsigned>(1e6 * (delta - floor(delta)));
230
231 // Yay C++
232 dashes << 3 << 4;
233
234 t = this->aosTime;
235
236 visible = timercmp(&this->timeStamp, &this->aosTime, >);
237
238 if (visible) {

Callers 1

Calls 5

azElToPointMethod · 0.95
paintTextAtMethod · 0.95
pushLocalTZMethod · 0.80
popTZMethod · 0.80
setColorMethod · 0.80

Tested by

no test coverage detected