| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | // Copyright (C) 2015-2019 Edouard Griffiths, F4EXB                              //
 | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 06:57:41 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | #ifndef INCLUDE_FILEINPUTGUI_H
 | 
					
						
							|  |  |  | #define INCLUDE_FILEINPUTGUI_H
 | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-05 19:23:13 +02:00
										 |  |  | #include <device/devicegui.h>
 | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | #include <QTimer>
 | 
					
						
							| 
									
										
										
										
											2017-09-03 17:26:32 +02:00
										 |  |  | #include <QWidget>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-16 22:23:31 +02:00
										 |  |  | #include "util/messagequeue.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | #include "fileinputsettings.h"
 | 
					
						
							|  |  |  | #include "fileinput.h"
 | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  | class DeviceUISet; | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Ui { | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | 	class FileInputGUI; | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-05 19:23:13 +02:00
										 |  |  | class FileInputGUI : public DeviceGUI { | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  | 	explicit FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent = nullptr); | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | 	virtual ~FileInputGUI(); | 
					
						
							| 
									
										
										
										
											2017-09-16 10:45:08 +02:00
										 |  |  | 	virtual void destroy(); | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void resetToDefaults(); | 
					
						
							|  |  |  | 	QByteArray serialize() const; | 
					
						
							|  |  |  | 	bool deserialize(const QByteArray& data); | 
					
						
							| 
									
										
										
										
											2017-09-16 22:23:31 +02:00
										 |  |  | 	virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } | 
					
						
							| 
									
										
										
										
											2015-08-17 08:29:34 +02:00
										 |  |  | 	virtual bool handleMessage(const Message& message); | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-21 07:53:36 +02:00
										 |  |  | protected: | 
					
						
							|  |  |  |     void resizeEvent(QResizeEvent* size); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | 	Ui::FileInputGUI* ui; | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | 	FileInputSettings m_settings; | 
					
						
							| 
									
										
										
										
											2017-12-14 18:02:49 +01:00
										 |  |  | 	bool m_doApplySettings; | 
					
						
							| 
									
										
										
										
											2016-05-11 23:35:16 +02:00
										 |  |  | 	QTimer m_statusTimer; | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 	std::vector<int> m_gains; | 
					
						
							| 
									
										
										
										
											2016-10-02 23:16:40 +02:00
										 |  |  | 	DeviceSampleSource* m_sampleSource; | 
					
						
							| 
									
										
										
										
											2015-08-04 04:17:24 +02:00
										 |  |  |     bool m_acquisition; | 
					
						
							|  |  |  | 	int m_sampleRate; | 
					
						
							| 
									
										
										
										
											2018-01-25 23:52:36 +01:00
										 |  |  | 	quint32 m_sampleSize; | 
					
						
							| 
									
										
										
										
											2015-08-04 04:17:24 +02:00
										 |  |  | 	quint64 m_centerFrequency; | 
					
						
							| 
									
										
										
										
											2020-08-26 00:12:30 +02:00
										 |  |  |     quint64 m_recordLengthMuSec; | 
					
						
							| 
									
										
										
										
											2018-10-12 17:05:03 +02:00
										 |  |  |     quint64 m_startingTimeStamp; | 
					
						
							|  |  |  |     quint64 m_samplesCount; | 
					
						
							| 
									
										
										
										
											2015-08-06 01:43:35 +02:00
										 |  |  | 	std::size_t m_tickCount; | 
					
						
							| 
									
										
										
										
											2016-02-25 14:07:39 +01:00
										 |  |  | 	bool m_enableNavTime; | 
					
						
							| 
									
										
										
										
											2016-05-12 12:29:12 +02:00
										 |  |  |     int m_deviceSampleRate; | 
					
						
							|  |  |  |     quint64 m_deviceCenterFrequency; //!< Center frequency in device
 | 
					
						
							| 
									
										
										
										
											2016-05-11 23:35:16 +02:00
										 |  |  | 	int m_lastEngineState; | 
					
						
							| 
									
										
										
										
											2017-09-16 22:23:31 +02:00
										 |  |  | 	MessageQueue m_inputMessageQueue; | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-14 18:02:49 +01:00
										 |  |  | 	void blockApplySettings(bool block) { m_doApplySettings = !block; } | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 	void displaySettings(); | 
					
						
							| 
									
										
										
										
											2015-08-04 04:17:24 +02:00
										 |  |  | 	void displayTime(); | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 	void sendSettings(); | 
					
						
							| 
									
										
										
										
											2016-05-12 12:29:12 +02:00
										 |  |  |     void updateSampleRateAndFrequency(); | 
					
						
							| 
									
										
										
										
											2015-08-05 03:25:06 +02:00
										 |  |  | 	void configureFileName(); | 
					
						
							|  |  |  | 	void updateWithAcquisition(); | 
					
						
							|  |  |  | 	void updateWithStreamData(); | 
					
						
							|  |  |  | 	void updateWithStreamTime(); | 
					
						
							| 
									
										
										
										
											2018-10-14 01:16:39 +02:00
										 |  |  |     void setAccelerationCombo(); | 
					
						
							|  |  |  |     void setNumberStr(int n, QString& s); | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     void makeUIConnections(); | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							| 
									
										
										
										
											2017-09-17 01:23:54 +02:00
										 |  |  |     void handleInputMessages(); | 
					
						
							| 
									
										
										
										
											2016-05-11 23:35:16 +02:00
										 |  |  | 	void on_startStop_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | 	void on_playLoop_toggled(bool checked); | 
					
						
							|  |  |  | 	void on_play_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2016-02-25 14:07:39 +01:00
										 |  |  | 	void on_navTimeSlider_valueChanged(int value); | 
					
						
							| 
									
										
										
										
											2015-08-05 01:43:30 +02:00
										 |  |  | 	void on_showFileDialog_clicked(bool checked); | 
					
						
							| 
									
										
										
										
											2018-10-14 01:16:39 +02:00
										 |  |  | 	void on_acceleration_currentIndexChanged(int index); | 
					
						
							| 
									
										
										
										
											2016-05-11 23:35:16 +02:00
										 |  |  |     void updateStatus(); | 
					
						
							| 
									
										
										
										
											2015-08-06 01:43:35 +02:00
										 |  |  | 	void tick(); | 
					
						
							| 
									
										
										
										
											2018-12-26 11:06:37 +01:00
										 |  |  |     void openDeviceSettingsDialog(const QPoint& p); | 
					
						
							| 
									
										
										
										
											2015-08-03 01:04:20 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-08 00:59:04 +02:00
										 |  |  | #endif // INCLUDE_FILEINPUTGUI_H
 |