| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2022 F4EXB                                                      //
 | 
					
						
							|  |  |  | // written by Edouard Griffiths                                                  //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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                  //
 | 
					
						
							|  |  |  | // (at your option) any later version.                                           //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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_GUI_WORKSPACE_H_
 | 
					
						
							|  |  |  | #define SDRGUI_GUI_WORKSPACE_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QDockWidget>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "export.h"
 | 
					
						
							|  |  |  | #include "featureadddialog.h"
 | 
					
						
							| 
									
										
										
										
											2022-08-27 10:18:17 +01:00
										 |  |  | #include "device/deviceapi.h"
 | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class QHBoxLayout; | 
					
						
							|  |  |  | class QLabel; | 
					
						
							|  |  |  | class QPushButton; | 
					
						
							|  |  |  | class QStringList; | 
					
						
							|  |  |  | class QMdiArea; | 
					
						
							|  |  |  | class QMdiSubWindow; | 
					
						
							|  |  |  | class QFrame; | 
					
						
							| 
									
										
										
										
											2022-04-27 13:53:56 +02:00
										 |  |  | class ButtonSwitch; | 
					
						
							| 
									
										
										
										
											2022-04-26 18:19:31 +01:00
										 |  |  | class ChannelGUI; | 
					
						
							|  |  |  | class FeatureGUI; | 
					
						
							|  |  |  | class DeviceGUI; | 
					
						
							|  |  |  | class MainSpectrumGUI; | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class SDRGUI_API Workspace : public QDockWidget | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Q_OBJECT | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     Workspace(int index, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); | 
					
						
							|  |  |  |     ~Workspace(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     int getIndex() const { return m_index; } | 
					
						
							| 
									
										
										
										
											2022-04-25 23:48:14 +02:00
										 |  |  |     void setIndex(int index); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  |     void resetAvailableFeatures() { m_featureAddDialog.resetFeatureNames(); } | 
					
						
							|  |  |  |     void addAvailableFeatures(const QStringList& featureNames) { m_featureAddDialog.addFeatureNames(featureNames); } | 
					
						
							|  |  |  |     void addToMdiArea(QMdiSubWindow *sub); | 
					
						
							|  |  |  |     void removeFromMdiArea(QMdiSubWindow *sub); | 
					
						
							| 
									
										
										
										
											2022-04-05 16:26:57 +02:00
										 |  |  |     int getNumberOfSubWindows() const; | 
					
						
							|  |  |  |     QByteArray saveMdiGeometry(); | 
					
						
							|  |  |  |     void restoreMdiGeometry(const QByteArray& blob); | 
					
						
							| 
									
										
										
										
											2022-05-19 15:48:14 +02:00
										 |  |  |     bool getAutoStackOption() const; | 
					
						
							|  |  |  |     void setAutoStackOption(bool autoStack); | 
					
						
							| 
									
										
										
										
											2022-04-25 23:48:14 +02:00
										 |  |  |     QList<QMdiSubWindow *> getSubWindowList() const; | 
					
						
							| 
									
										
										
										
											2022-04-26 18:19:31 +01:00
										 |  |  |     void orderByIndex(QList<ChannelGUI *> &list); | 
					
						
							|  |  |  |     void orderByIndex(QList<FeatureGUI *> &list); | 
					
						
							|  |  |  |     void orderByIndex(QList<DeviceGUI *> &list); | 
					
						
							|  |  |  |     void orderByIndex(QList<MainSpectrumGUI *> &list); | 
					
						
							| 
									
										
										
										
											2022-04-26 19:44:18 +02:00
										 |  |  |     void adjustSubWindowsAfterRestore(); | 
					
						
							| 
									
										
										
										
											2022-08-27 10:18:17 +01:00
										 |  |  |     void updateStartStopButton(bool checked); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     int m_index; | 
					
						
							|  |  |  |     QPushButton *m_addRxDeviceButton; | 
					
						
							|  |  |  |     QPushButton *m_addTxDeviceButton; | 
					
						
							|  |  |  |     QPushButton *m_addMIMODeviceButton; | 
					
						
							| 
									
										
										
										
											2022-08-27 10:18:17 +01:00
										 |  |  |     ButtonSwitch *m_startStopButton; | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  |     QFrame *m_vline1; | 
					
						
							|  |  |  |     QPushButton *m_addFeatureButton; | 
					
						
							|  |  |  |     QPushButton *m_featurePresetsButton; | 
					
						
							|  |  |  |     QFrame *m_vline2; | 
					
						
							|  |  |  |     QPushButton *m_cascadeSubWindows; | 
					
						
							|  |  |  |     QPushButton *m_tileSubWindows; | 
					
						
							| 
									
										
										
										
											2022-04-26 18:19:31 +01:00
										 |  |  |     QPushButton *m_stackSubWindows; | 
					
						
							| 
									
										
										
										
											2022-04-27 13:53:56 +02:00
										 |  |  |     ButtonSwitch *m_autoStackSubWindows; | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  |     QWidget *m_titleBar; | 
					
						
							|  |  |  |     QHBoxLayout *m_titleBarLayout; | 
					
						
							|  |  |  |     QLabel *m_titleLabel; | 
					
						
							|  |  |  |     QPushButton *m_normalButton; | 
					
						
							|  |  |  |     QPushButton *m_closeButton; | 
					
						
							|  |  |  |     FeatureAddDialog m_featureAddDialog; | 
					
						
							|  |  |  |     QMdiArea *m_mdi; | 
					
						
							| 
									
										
										
										
											2022-04-26 18:19:31 +01:00
										 |  |  |     bool m_stacking;                // Set when stackSubWindows() is running
 | 
					
						
							|  |  |  |     int m_userChannelMinWidth;      // Minimum width of channels column for stackSubWindows(), set by user resizing a channel window
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  |     void resizeEvent(QResizeEvent *event) override; | 
					
						
							|  |  |  |     bool eventFilter(QObject *obj, QEvent *event) override; | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     void addRxDeviceClicked(); | 
					
						
							|  |  |  |     void addTxDeviceClicked(); | 
					
						
							|  |  |  |     void addMIMODeviceClicked(); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  |     void addFeatureDialog(); | 
					
						
							|  |  |  |     void featurePresetsDialog(); | 
					
						
							|  |  |  |     void cascadeSubWindows(); | 
					
						
							|  |  |  |     void tileSubWindows(); | 
					
						
							| 
									
										
										
										
											2022-04-26 18:19:31 +01:00
										 |  |  |     void stackSubWindows(); | 
					
						
							|  |  |  |     void autoStackSubWindows(); | 
					
						
							| 
									
										
										
										
											2022-08-27 10:18:17 +01:00
										 |  |  |     void startStopClicked(bool checked = false); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  |     void addFeatureEmitted(int featureIndex); | 
					
						
							|  |  |  |     void toggleFloating(); | 
					
						
							| 
									
										
										
										
											2022-08-27 10:18:17 +01:00
										 |  |  |     void deviceStateChanged(int index, DeviceAPI *deviceAPI); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | signals: | 
					
						
							| 
									
										
										
										
											2022-04-07 16:32:03 +02:00
										 |  |  |     void addRxDevice(Workspace *inWorkspace, int deviceIndex); | 
					
						
							|  |  |  |     void addTxDevice(Workspace *inWorkspace, int deviceIndex); | 
					
						
							|  |  |  |     void addMIMODevice(Workspace *inWorkspace, int deviceIndex); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  |     void addFeature(Workspace*, int); | 
					
						
							|  |  |  |     void featurePresetsDialogRequested(QPoint, Workspace*); | 
					
						
							| 
									
										
										
										
											2022-08-27 10:18:17 +01:00
										 |  |  |     void startAllDevices(Workspace *inWorkspace); | 
					
						
							|  |  |  |     void stopAllDevices(Workspace *inWorkspace); | 
					
						
							| 
									
										
										
										
											2022-04-04 10:23:52 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // SDRGUI_GUI_WORKSPACE_H_
 |