| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2016 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 SDRGUI_DEVICE_DEVICEUISET_H_
 | 
					
						
							|  |  |  | #define SDRGUI_DEVICE_DEVICEUISET_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QTimer>
 | 
					
						
							|  |  |  | #include <QByteArray>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  | class SpectrumVis; | 
					
						
							|  |  |  | class GLSpectrum; | 
					
						
							|  |  |  | class GLSpectrumGUI; | 
					
						
							|  |  |  | class ChannelWindow; | 
					
						
							|  |  |  | class SamplingDeviceControl; | 
					
						
							|  |  |  | class DSPDeviceSourceEngine; | 
					
						
							|  |  |  | class DeviceSourceAPI; | 
					
						
							|  |  |  | class DSPDeviceSinkEngine; | 
					
						
							|  |  |  | class DeviceSinkAPI; | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  | class ChannelMarker; | 
					
						
							| 
									
										
										
										
											2017-11-01 00:18:10 +01:00
										 |  |  | class PluginAPI; | 
					
						
							| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | class SDRGUI_API DeviceUISet | 
					
						
							| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-02-27 19:26:52 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  |     SpectrumVis *m_spectrumVis; | 
					
						
							|  |  |  |     GLSpectrum *m_spectrum; | 
					
						
							|  |  |  |     GLSpectrumGUI *m_spectrumGUI; | 
					
						
							|  |  |  |     ChannelWindow *m_channelWindow; | 
					
						
							|  |  |  |     SamplingDeviceControl *m_samplingDeviceControl; | 
					
						
							|  |  |  |     DSPDeviceSourceEngine *m_deviceSourceEngine; | 
					
						
							|  |  |  |     DeviceSourceAPI *m_deviceSourceAPI; | 
					
						
							|  |  |  |     DSPDeviceSinkEngine *m_deviceSinkEngine; | 
					
						
							|  |  |  |     DeviceSinkAPI *m_deviceSinkAPI; | 
					
						
							|  |  |  |     QByteArray m_mainWindowState; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-02 03:30:54 +01:00
										 |  |  |     DeviceUISet(int tabIndex, bool rxElseTx, QTimer& timer); | 
					
						
							| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  |     ~DeviceUISet(); | 
					
						
							| 
									
										
										
										
											2017-10-30 00:02:28 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     GLSpectrum *getSpectrum() { return m_spectrum; }     //!< Direct spectrum getter
 | 
					
						
							|  |  |  |     void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum
 | 
					
						
							|  |  |  |     void addRollupWidget(QWidget *widget);               //!< Add rollup widget to channel window
 | 
					
						
							| 
									
										
										
										
											2017-10-30 22:45:53 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-23 23:41:37 +01:00
										 |  |  |     int getNumberOfRxChannels() const { return m_rxChannelInstanceRegistrations.size(); } | 
					
						
							|  |  |  |     int getNumberOfTxChannels() const { return m_txChannelInstanceRegistrations.size(); } | 
					
						
							| 
									
										
										
										
											2017-10-31 22:37:57 +01:00
										 |  |  |     void registerRxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI); | 
					
						
							|  |  |  |     void registerTxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI); | 
					
						
							|  |  |  |     void removeRxChannelInstance(PluginInstanceGUI* pluginGUI); | 
					
						
							|  |  |  |     void removeTxChannelInstance(PluginInstanceGUI* pluginGUI); | 
					
						
							|  |  |  |     void freeRxChannels(); | 
					
						
							|  |  |  |     void freeTxChannels(); | 
					
						
							| 
									
										
										
										
											2017-12-23 23:41:37 +01:00
										 |  |  |     void deleteRxChannel(int channelIndex); | 
					
						
							|  |  |  |     void deleteTxChannel(int channelIndex); | 
					
						
							| 
									
										
										
										
											2017-10-31 22:37:57 +01:00
										 |  |  |     void loadRxChannelSettings(const Preset* preset, PluginAPI *pluginAPI); | 
					
						
							|  |  |  |     void saveRxChannelSettings(Preset* preset); | 
					
						
							|  |  |  |     void loadTxChannelSettings(const Preset* preset, PluginAPI *pluginAPI); | 
					
						
							|  |  |  |     void saveTxChannelSettings(Preset* preset); | 
					
						
							| 
									
										
										
										
											2017-10-30 22:45:53 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     struct ChannelInstanceRegistration | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         QString m_channelName; | 
					
						
							|  |  |  |         PluginInstanceGUI* m_gui; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ChannelInstanceRegistration() : | 
					
						
							|  |  |  |             m_channelName(), | 
					
						
							|  |  |  |             m_gui(NULL) | 
					
						
							|  |  |  |         { } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ChannelInstanceRegistration(const QString& channelName, PluginInstanceGUI* pluginGUI) : | 
					
						
							|  |  |  |             m_channelName(channelName), | 
					
						
							|  |  |  |             m_gui(pluginGUI) | 
					
						
							|  |  |  |         { } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         bool operator<(const ChannelInstanceRegistration& other) const; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     typedef QList<ChannelInstanceRegistration> ChannelInstanceRegistrations; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-31 22:37:57 +01:00
										 |  |  |     ChannelInstanceRegistrations m_rxChannelInstanceRegistrations; | 
					
						
							|  |  |  |     ChannelInstanceRegistrations m_txChannelInstanceRegistrations; | 
					
						
							| 
									
										
										
										
											2017-11-01 20:06:33 +01:00
										 |  |  |     int m_deviceTabIndex; | 
					
						
							| 
									
										
										
										
											2017-10-30 22:45:53 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-31 22:37:57 +01:00
										 |  |  |     void renameRxChannelInstances(); | 
					
						
							|  |  |  |     void renameTxChannelInstances(); | 
					
						
							| 
									
										
										
										
											2017-10-24 18:29:18 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* SDRGUI_DEVICE_DEVICEUISET_H_ */
 |