2015-08-02 19:04:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_FILESOURCEGUI_H
|
|
|
|
#define INCLUDE_FILESOURCEGUI_H
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
#include "plugin/plugingui.h"
|
|
|
|
|
|
|
|
#include "filesourceinput.h"
|
|
|
|
|
|
|
|
class PluginAPI;
|
2016-05-15 19:12:37 -04:00
|
|
|
class DeviceAPI;
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class FileSourceGui;
|
|
|
|
}
|
|
|
|
|
|
|
|
class FileSourceGui : public QWidget, public PluginGUI {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-05-15 19:12:37 -04:00
|
|
|
explicit FileSourceGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
2015-08-17 02:29:34 -04:00
|
|
|
virtual ~FileSourceGui();
|
2015-08-02 19:04:20 -04:00
|
|
|
void destroy();
|
|
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
QString getName() const;
|
|
|
|
|
|
|
|
void resetToDefaults();
|
2015-09-28 21:35:14 -04:00
|
|
|
virtual qint64 getCenterFrequency() const;
|
|
|
|
virtual void setCenterFrequency(qint64 centerFrequency);
|
2015-08-02 19:04:20 -04:00
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2015-08-17 02:29:34 -04:00
|
|
|
virtual bool handleMessage(const Message& message);
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::FileSourceGui* ui;
|
|
|
|
|
|
|
|
PluginAPI* m_pluginAPI;
|
2016-05-15 19:12:37 -04:00
|
|
|
DeviceAPI* m_deviceAPI;
|
2015-08-02 19:04:20 -04:00
|
|
|
FileSourceInput::Settings m_settings;
|
2016-05-11 17:35:16 -04:00
|
|
|
QTimer m_statusTimer;
|
2015-08-02 19:04:20 -04:00
|
|
|
std::vector<int> m_gains;
|
|
|
|
SampleSource* m_sampleSource;
|
2015-08-03 22:17:24 -04:00
|
|
|
bool m_acquisition;
|
2015-08-04 21:25:06 -04:00
|
|
|
QString m_fileName;
|
2015-08-03 22:17:24 -04:00
|
|
|
int m_sampleRate;
|
|
|
|
quint64 m_centerFrequency;
|
2016-02-24 20:30:50 -05:00
|
|
|
quint32 m_recordLength;
|
2015-08-03 22:17:24 -04:00
|
|
|
std::time_t m_startingTimeStamp;
|
|
|
|
int m_samplesCount;
|
2015-08-05 19:43:35 -04:00
|
|
|
std::size_t m_tickCount;
|
2016-02-25 08:07:39 -05:00
|
|
|
bool m_enableNavTime;
|
2016-05-12 06:29:12 -04:00
|
|
|
int m_deviceSampleRate;
|
|
|
|
quint64 m_deviceCenterFrequency; //!< Center frequency in device
|
2016-05-11 17:35:16 -04:00
|
|
|
int m_lastEngineState;
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
void displaySettings();
|
2015-08-03 22:17:24 -04:00
|
|
|
void displayTime();
|
2015-08-02 19:04:20 -04:00
|
|
|
void sendSettings();
|
2016-05-12 06:29:12 -04:00
|
|
|
void updateSampleRateAndFrequency();
|
2015-08-04 21:25:06 -04:00
|
|
|
void configureFileName();
|
|
|
|
void updateWithAcquisition();
|
|
|
|
void updateWithStreamData();
|
|
|
|
void updateWithStreamTime();
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
private slots:
|
2016-05-12 06:29:12 -04:00
|
|
|
void handleDSPMessages();
|
2015-08-26 03:25:02 -04:00
|
|
|
void handleSourceMessages();
|
2016-05-11 17:35:16 -04:00
|
|
|
void on_startStop_toggled(bool checked);
|
2015-08-02 19:04:20 -04:00
|
|
|
void on_playLoop_toggled(bool checked);
|
|
|
|
void on_play_toggled(bool checked);
|
2016-02-25 08:07:39 -05:00
|
|
|
void on_navTimeSlider_valueChanged(int value);
|
2015-08-04 19:43:30 -04:00
|
|
|
void on_showFileDialog_clicked(bool checked);
|
2016-05-11 17:35:16 -04:00
|
|
|
void updateStatus();
|
2015-08-05 19:43:35 -04:00
|
|
|
void tick();
|
2015-08-02 19:04:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_FILESOURCEGUI_H
|