| 545 | } |
| 546 | |
| 547 | void |
| 548 | FrequencyCorrectionDialog::setCurrentOrbit(const orbit_t *orbit) |
| 549 | { |
| 550 | if (this->haveOrbit) { |
| 551 | if (&this->currentOrbit != orbit) { |
| 552 | orbit_finalize(&this->currentOrbit); |
| 553 | this->currentOrbit.name = nullptr; |
| 554 | } |
| 555 | sgdp4_prediction_finalize(&this->prediction); |
| 556 | this->haveOrbit = false; |
| 557 | this->haveALOS = false; |
| 558 | } |
| 559 | |
| 560 | if (orbit != nullptr) { |
| 561 | if (&this->currentOrbit != orbit) { |
| 562 | this->currentOrbit = *orbit; |
| 563 | this->currentOrbit.name = orbit->name == nullptr |
| 564 | ? nullptr |
| 565 | : strdup(orbit->name); |
| 566 | } |
| 567 | |
| 568 | if (this->haveQth |
| 569 | && sgdp4_prediction_init( |
| 570 | &this->prediction, |
| 571 | &this->currentOrbit, |
| 572 | &this->rxSite)) { |
| 573 | this->haveOrbit = true; |
| 574 | } else { |
| 575 | orbit_finalize(&this->currentOrbit); |
| 576 | this->currentOrbit.name = nullptr; |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | this->updatePrediction(); |
| 581 | } |
| 582 | |
| 583 | void |
| 584 | FrequencyCorrectionDialog::setTimestamp(struct timeval const &tv) |
no test coverage detected