2014-12-02 19:06:54 -05:00
|
|
|
// -*- Mode: C++ -*-
|
|
|
|
#ifndef ASTRO_H
|
|
|
|
#define ASTRO_H
|
|
|
|
|
2020-11-06 13:28:59 -05:00
|
|
|
#include <utility>
|
|
|
|
|
2016-04-06 13:11:58 -04:00
|
|
|
#include <QDialog>
|
2016-06-10 11:54:16 -04:00
|
|
|
#include <QScopedPointer>
|
2016-04-06 13:11:58 -04:00
|
|
|
|
2015-06-11 09:36:13 -04:00
|
|
|
#include "Radio.hpp"
|
2014-12-02 19:06:54 -05:00
|
|
|
|
|
|
|
class QSettings;
|
2015-06-11 09:36:13 -04:00
|
|
|
class Configuration;
|
2014-12-02 19:06:54 -05:00
|
|
|
namespace Ui {
|
|
|
|
class Astro;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Astro final
|
2016-04-06 13:11:58 -04:00
|
|
|
: public QDialog
|
2014-12-02 19:06:54 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
|
2016-04-06 13:11:58 -04:00
|
|
|
public:
|
2015-06-11 09:36:13 -04:00
|
|
|
using Frequency = Radio::Frequency;
|
|
|
|
using FrequencyDelta = Radio::FrequencyDelta;
|
2014-12-02 19:06:54 -05:00
|
|
|
|
2015-06-11 09:36:13 -04:00
|
|
|
explicit Astro(QSettings * settings, Configuration const *, QWidget * parent = nullptr);
|
2014-12-02 19:06:54 -05:00
|
|
|
~Astro ();
|
2016-04-06 13:11:58 -04:00
|
|
|
|
|
|
|
struct Correction
|
|
|
|
{
|
|
|
|
Correction ()
|
|
|
|
: rx {0}
|
|
|
|
, tx {0}
|
|
|
|
{}
|
|
|
|
Correction (Correction const&) = default;
|
|
|
|
Correction& operator = (Correction const&) = default;
|
|
|
|
|
2020-11-06 13:28:59 -05:00
|
|
|
// testing facility used to test Doppler corrections on
|
|
|
|
// terrestrial links
|
|
|
|
void reverse ()
|
|
|
|
{
|
|
|
|
std::swap (rx, tx);
|
|
|
|
}
|
|
|
|
|
2016-04-06 13:11:58 -04:00
|
|
|
FrequencyDelta rx;
|
|
|
|
FrequencyDelta tx;
|
|
|
|
};
|
2020-11-06 13:28:59 -05:00
|
|
|
|
2016-04-06 13:11:58 -04:00
|
|
|
Correction astroUpdate(QDateTime const& t,
|
|
|
|
QString const& mygrid,
|
|
|
|
QString const& hisgrid,
|
|
|
|
Frequency frequency,
|
|
|
|
bool dx_is_self,
|
|
|
|
bool bTx,
|
|
|
|
bool no_tx_QSY,
|
2019-05-22 12:44:28 -04:00
|
|
|
double TR_period);
|
2016-04-06 13:11:58 -04:00
|
|
|
|
2015-06-11 20:26:44 -04:00
|
|
|
bool doppler_tracking () const;
|
2016-04-06 13:11:58 -04:00
|
|
|
Q_SLOT void nominal_frequency (Frequency rx, Frequency tx);
|
|
|
|
Q_SIGNAL void tracking_update () const;
|
2015-06-09 13:39:59 -04:00
|
|
|
|
2014-12-02 19:06:54 -05:00
|
|
|
protected:
|
2016-04-06 13:11:58 -04:00
|
|
|
void hideEvent (QHideEvent *) override;
|
2014-12-02 19:06:54 -05:00
|
|
|
void closeEvent (QCloseEvent *) override;
|
|
|
|
|
2015-04-22 13:48:03 -04:00
|
|
|
private slots:
|
2020-09-26 16:08:43 -04:00
|
|
|
void on_rbConstFreqOnMoon_clicked(bool);
|
|
|
|
void on_rbFullTrack_clicked(bool);
|
|
|
|
void on_rbOwnEcho_clicked(bool);
|
|
|
|
void on_rbNoDoppler_clicked(bool);
|
|
|
|
void on_rbOnDxEcho_clicked(bool);
|
|
|
|
void on_rbCallDx_clicked(bool);
|
2016-04-06 13:11:58 -04:00
|
|
|
void on_cbDopplerTracking_toggled(bool);
|
2015-04-22 13:48:03 -04:00
|
|
|
|
2014-12-02 19:06:54 -05:00
|
|
|
private:
|
|
|
|
void read_settings ();
|
|
|
|
void write_settings ();
|
2016-04-06 13:11:58 -04:00
|
|
|
void check_split ();
|
2014-12-02 19:06:54 -05:00
|
|
|
|
|
|
|
QSettings * settings_;
|
2015-06-11 09:36:13 -04:00
|
|
|
Configuration const * configuration_;
|
2016-06-10 11:54:16 -04:00
|
|
|
QScopedPointer<Ui::Astro> ui_;
|
2015-06-11 09:36:13 -04:00
|
|
|
|
|
|
|
qint32 m_DopplerMethod;
|
2018-02-07 08:43:32 -05:00
|
|
|
int m_dop;
|
|
|
|
int m_dop00;
|
2020-09-02 16:25:58 -04:00
|
|
|
//int m_dx_two_way_dop;
|
2014-12-02 19:06:54 -05:00
|
|
|
};
|
|
|
|
|
2016-04-06 13:11:58 -04:00
|
|
|
inline
|
|
|
|
bool operator == (Astro::Correction const& lhs, Astro::Correction const& rhs)
|
|
|
|
{
|
|
|
|
return lhs.rx == rhs.rx && lhs.tx == rhs.tx;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
bool operator != (Astro::Correction const& lhs, Astro::Correction const& rhs)
|
|
|
|
{
|
|
|
|
return !(lhs == rhs);
|
2014-12-02 19:06:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ASTRO_H
|