JS8Call-Improved master
Loading...
Searching...
No Matches
WideGraph.h
1// -*- Mode: C++ -*-
2#ifndef WIDEGRAPH_H
3#define WIDEGRAPH_H
4
5#include "JS8_Include/commons.h"
6#include "JS8_Main/WF.h"
7
8#include <QColor>
9#include <QDir>
10#include <QEvent>
11#include <QMutex>
12#include <QObject>
13#include <QScopedPointer>
14#include <QString>
15#include <QStringView>
16#include <QVector>
17#include <QWidget>
18
19#include <array>
20
21namespace Ui {
22class WideGraph;
23}
24
25class Configuration;
26class QSettings;
27class QTimer;
28
29class WideGraph : public QWidget {
30 Q_OBJECT
31
32 public:
33 explicit WideGraph(QSettings *, QWidget * = nullptr);
34 ~WideGraph();
35
36 // Accessors
37
38 int centerFreq() const;
39 int filterMinimum() const;
40 int filterMaximum() const;
41 bool filterEnabled() const;
42 int filterCenter() const;
43 int filterWidth() const;
44 int freq() const;
45 bool isAutoSyncEnabled() const;
46 int nStartFreq() const;
47 bool shouldDisplayDecodeAttempts() const;
48 bool shouldAutoSyncSubmode(int) const;
49 int smoothYellow() const;
50
51 // Manipulators
52
53 void dataSink(WF::SPlot const &, float);
54 void drawDecodeLine(QColor const &, int, int);
55 void drawHorizontalLine(QColor const &, int, int);
56 void saveSettings();
57 void setBand(QString const &);
58 void setFilterCenter(int);
59 void setFilterWidth(int);
60 void setFilterMinimumBandwidth(int);
61 void setFilterEnabled(bool);
62 void setFilterOpacityPercent(int);
63 void setFreq(int);
64 void setPeriod(int);
65 void setSubMode(int);
66
67 signals:
68 void changeFreq(int);
69 void f11f12(int n);
70 void setXIT(int n);
71 void qsy(int);
72 void want_new_drift(qint64);
73
74 public slots:
75 void setDialFreq(float);
76 void setTimeControlsVisible(bool);
77 bool timeControlsVisible() const;
78 void setControlsVisible(bool, bool = true);
79 bool controlsVisible() const;
80 void onDriftChanged(qint64 drift_ms);
81 void setPaused(bool paused) { m_paused = paused; }
82 void notifyDriftedSignalsDecoded(int);
83
84 protected:
85 void keyPressEvent(QKeyEvent *e) override;
86 void closeEvent(QCloseEvent *) override;
87
88 private slots:
89
90 void on_qsyPushButton_clicked();
91 void on_offsetSpinBox_valueChanged(int n);
92 void on_waterfallAvgSpinBox_valueChanged(int arg1);
93 void on_bppSpinBox_valueChanged(int arg1);
94 void on_spec2dComboBox_currentIndexChanged(int);
95 void on_fStartSpinBox_valueChanged(int n);
96 void on_paletteComboBox_activated(int);
97 void on_cbFlatten_toggled(bool b);
98 void on_adjust_palette_push_button_clicked(bool);
99 void on_gainSlider_valueChanged(int value);
100 void on_zeroSlider_valueChanged(int value);
101 void on_gain2dSlider_valueChanged(int value);
102 void on_zero2dSlider_valueChanged(int value);
103 void on_smoSpinBox_valueChanged(int n);
104 void on_sbPercent2dPlot_valueChanged(int n);
105 void on_filterCenterSpinBox_valueChanged(int n);
106 void on_filterCenterSpinBox_editingFinished();
107 void on_filterWidthSpinBox_valueChanged(int n);
108 void on_filterWidthSpinBox_editingFinished();
109 void on_filterCenterSyncButton_clicked();
110 void on_filterCheckBox_toggled(bool b);
111 void on_filterOpacitySpinBox_valueChanged(int n);
112
113 void on_autoDriftButton_toggled(bool checked);
114 void on_driftSpinBox_valueChanged(int n);
115 void on_driftSyncButton_clicked();
116 void on_driftSyncEndButton_clicked();
117 void on_driftSyncMinuteButton_clicked();
118 void on_driftSyncResetButton_clicked();
119
120 private:
121 void readPalette();
122
123 QScopedPointer<Ui::WideGraph> ui;
124
125 int m_waterfallAvg = 1;
126 int m_waterfallNow = 0;
127 int m_filterCenter = 1500;
128 int m_filterWidth = 120;
129 int m_filterMinWidth = 120;
130 int m_nsmo = 1;
131 int m_TRperiod = 15;
132 int m_lastSecondInPeriod = 0;
133 int m_autoSyncTimeLeft = 0;
134 int m_autoSyncDecodesLeft = 0;
135 bool m_paused = false;
136 bool m_filterEnabled = false;
137 bool m_autoSyncConnected = false;
138
139 QSettings *m_settings;
140 QTimer *m_drawTimer;
141 QTimer *m_autoSyncTimer;
142 QDir m_palettes_path;
143 WF::Palette m_userPalette;
144 WF::SWide m_swide = {};
145 WF::SPlot m_splot = {};
146 WF::State m_state = WF::Sink::Drained;
147 QMutex m_drawLock;
148 QStringView m_timeFormat;
149 QString m_waterfallPalette;
150 QString m_band;
151 QList<int> m_sizes;
152};
153
154#endif // WIDEGRAPH_H
Definition Configuration.h:57
Definition qpriorityqueue.h:39
Definition WF.h:74