2014-12-02 19:06:54 -05:00
|
|
|
// -*- Mode: C++ -*-
|
|
|
|
#ifndef ASTRO_H
|
|
|
|
#define ASTRO_H
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
FrequencyDelta rx;
|
|
|
|
FrequencyDelta tx;
|
|
|
|
};
|
|
|
|
Correction astroUpdate(QDateTime const& t,
|
|
|
|
QString const& mygrid,
|
|
|
|
QString const& hisgrid,
|
|
|
|
Frequency frequency,
|
|
|
|
bool dx_is_self,
|
|
|
|
bool bTx,
|
|
|
|
bool no_tx_QSY,
|
|
|
|
int TR_period);
|
|
|
|
|
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:
|
|
|
|
void on_rbConstFreqOnMoon_clicked();
|
|
|
|
void on_rbFullTrack_clicked();
|
2016-04-06 13:11:58 -04:00
|
|
|
void on_rbRxOnly_clicked();
|
2015-04-22 13:48:03 -04:00
|
|
|
void on_rbNoDoppler_clicked();
|
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;
|
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
|