File: astro.h

package info (click to toggle)
wsjtx-improved 3.0.0%2B250924%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 86,260 kB
  • sloc: cpp: 105,882; f90: 60,117; python: 27,241; ansic: 13,372; fortran: 2,382; makefile: 197; sh: 135
file content (118 lines) | stat: -rwxr-xr-x 2,660 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// -*- Mode: C++ -*-
#ifndef ASTRO_H
#define ASTRO_H

#include <utility>

#include <QDialog>
#include <QScopedPointer>

#include "Radio.hpp"

class QSettings;
class Configuration;
namespace Ui {
  class Astro;
}

class Astro final
  : public QDialog
{
  Q_OBJECT;

public:
  using Frequency = Radio::Frequency;
  using FrequencyDelta = Radio::FrequencyDelta;

  explicit Astro(QSettings * settings, Configuration const *, QWidget * parent = nullptr);
  ~Astro ();

  struct Correction
  {
    Correction ()
      : rx {0}
      , tx {0}
      , dop {0}
      , width {0}
      , techo {0}
    {}
    Correction (Correction const&) = default;
    Correction& operator = (Correction const&) = default;

    // testing facility used to test Doppler corrections on
    // terrestrial links
    void reverse ()
    {
      std::swap (rx, tx);
    }

    FrequencyDelta rx;
    FrequencyDelta tx;
    double dop;
    double width;
    double techo;
  };

  Correction astroUpdate(QDateTime const& t,
                         QString const& mygrid,
                         QString const& hisgrid,
                         Frequency frequency,
                         bool dx_is_self,
                         bool bTx,
                         bool bAuto,
                         bool no_tx_QSY,
                         double TR_period);

  bool doppler_tracking () const;
  bool bDither();
  void selectOwnEcho();
  void selectOnDxEcho();
  qint32 nfRIT();
  qint32 DopplerMethod();
  qint32 largeOffset();

  Q_SLOT void nominal_frequency (Frequency rx, Frequency tx);
  Q_SIGNAL void tracking_update () const;

protected:
  void hideEvent (QHideEvent *) override;
  void closeEvent (QCloseEvent *) override;

private slots:
  void on_rbConstFreqOnMoon_clicked(bool);
  void on_rbFullTrack_clicked(bool);
  void on_rbNoDoppler_clicked(bool);
  void on_rbOwnEcho_clicked(bool);
  void on_rbOnDxEcho_clicked(bool);
  void on_rbCallDx_clicked(bool);
  void on_cbDopplerTracking_toggled(bool);

private:
  void read_settings ();
  void write_settings ();
  void check_split ();

  QSettings * settings_;
  Configuration const * configuration_;
  QScopedPointer<Ui::Astro> ui_;

  qint32 m_DopplerMethod;
  int m_dop;
  int m_dop00;
  int ibShift;
  //int m_dx_two_way_dop;
};

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);
}

#endif // ASTRO_H