Removed main window from sdrbase

This commit is contained in:
f4exb 2017-10-22 21:26:07 +02:00
parent 355bff2a8c
commit f9d27cd784
3 changed files with 0 additions and 2050 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,170 +0,0 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
// written by Christian Daniel //
// //
// 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_MAINWINDOW_H
#define INCLUDE_MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QList>
#include "settings/mainsettings.h"
#include "util/messagequeue.h"
#include "util/export.h"
class QLabel;
class QTreeWidgetItem;
class QDir;
class SamplingDeviceControl;
class AudioDeviceInfo;
class DSPEngine;
class DSPDeviceSourceEngine;
class DSPDeviceSinkEngine;
class Indicator;
class SpectrumVis;
class GLSpectrum;
class GLSpectrumGUI;
class ChannelWindow;
class PluginAPI;
class PluginInstanceGUI;
class ChannelMarker;
class PluginManager;
class DeviceSourceAPI;
class DeviceSinkAPI;
class PluginInterface;
class QWidget;
namespace Ui {
class MainWindow;
}
class SDRANGEL_API MainWindow : public QMainWindow {
Q_OBJECT
public:
struct DeviceUISet
{
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;
DeviceUISet(QTimer& timer);
~DeviceUISet();
};
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
void addViewAction(QAction* action);
void addChannelRollup(int deviceTabIndex, QWidget* widget);
void setDeviceGUI(int deviceTabIndex, QWidget* gui, const QString& deviceDisplayName, bool sourceDevice = true);
const QTimer& getMasterTimer() const { return m_masterTimer; }
const MainSettings& getMainSettings() const { return m_settings; }
private:
enum {
PGroup,
PItem
};
struct DeviceWidgetTabData
{
QWidget *gui;
QString displayName;
QString tabName;
};
Ui::MainWindow* ui;
AudioDeviceInfo m_audioDeviceInfo;
MessageQueue m_inputMessageQueue;
MainSettings m_settings;
std::vector<DeviceUISet*> m_deviceUIs;
QList<DeviceWidgetTabData> m_deviceWidgetTabs;
int m_masterTabIndex;
DSPEngine* m_dspEngine;
PluginManager* m_pluginManager;
QTimer m_masterTimer;
QTimer m_statusTimer;
int m_lastEngineState;
QLabel* m_dateTimeWidget;
QLabel* m_showSystemWidget;
QWidget* m_inputGUI;
int m_sampleRate;
quint64 m_centerFrequency;
std::string m_sampleFileName;
void loadSettings();
void loadPresetSettings(const Preset* preset, int tabIndex);
void savePresetSettings(Preset* preset, int tabIndex);
void createStatusBar();
void closeEvent(QCloseEvent*);
void updatePresetControls();
QTreeWidgetItem* addPresetToTree(const Preset* preset);
void applySettings();
void addSourceDevice();
void addSinkDevice();
void removeLastDevice();
private slots:
void handleMessages();
void updateStatus();
void on_action_View_Fullscreen_toggled(bool checked);
void on_presetSave_clicked();
void on_presetUpdate_clicked();
void on_presetExport_clicked();
void on_presetImport_clicked();
void on_settingsSave_clicked();
void on_presetLoad_clicked();
void on_presetDelete_clicked();
void on_presetTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_presetTree_itemActivated(QTreeWidgetItem *item, int column);
void on_action_Audio_triggered();
void on_action_DV_Serial_triggered(bool checked);
void on_action_My_Position_triggered();
void on_sampleSource_confirmClicked(bool checked);
void on_sampleSink_confirmClicked(bool checked);
void on_channel_addClicked(bool checked);
void on_action_Loaded_Plugins_triggered();
void on_action_About_triggered();
void on_action_addSourceDevice_triggered();
void on_action_addSinkDevice_triggered();
void on_action_removeLastDevice_triggered();
void on_action_reloadDevices_triggered();
void on_action_Exit_triggered();
void tabInputViewIndexChanged();
};
#endif // INCLUDE_MAINWINDOW_H

View File

@ -1,719 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1012</width>
<height>767</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string>SDRangel</string>
</property>
<property name="windowIcon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/sdrangel_icon.png</normaloff>:/sdrangel_icon.png</iconset>
</property>
<property name="animated">
<bool>true</bool>
</property>
<widget class="QWidget" name="centralWidget">
<property name="font">
<font>
<family>Sans Serif</family>
</font>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabSpectra">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1012</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="action_Exit"/>
</widget>
<widget class="QMenu" name="menu_Devices">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>&amp;Devices</string>
</property>
<addaction name="action_addSourceDevice"/>
<addaction name="action_addSinkDevice"/>
<addaction name="action_removeLastDevice"/>
<addaction name="action_reloadDevices"/>
</widget>
<widget class="QMenu" name="menu_View">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>&amp;View</string>
</property>
<addaction name="action_View_Fullscreen"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="action_Loaded_Plugins"/>
<addaction name="separator"/>
<addaction name="action_About"/>
</widget>
<widget class="QMenu" name="menu_Window">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>&amp;Window</string>
</property>
</widget>
<widget class="QMenu" name="menuPreferences">
<property name="title">
<string>&amp;Preferences</string>
</property>
<addaction name="action_Audio"/>
<addaction name="action_DV_Serial"/>
<addaction name="action_My_Position"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_View"/>
<addaction name="menu_Devices"/>
<addaction name="menu_Window"/>
<addaction name="menuPreferences"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QStatusBar" name="statusBar">
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
</widget>
<widget class="QDockWidget" name="inputViewDock">
<property name="windowTitle">
<string>Sampling devices</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="intputViewDockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="inputViewDockLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QTabWidget" name="tabInputsView">
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="inputSelectDock">
<property name="windowTitle">
<string>Sampling devices control</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="intputSelectDockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QTabWidget" name="tabInputsSelect">
<property name="minimumSize">
<size>
<width>0</width>
<height>110</height>
</size>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="spectraDisplayDock">
<property name="windowTitle">
<string>Spectrum Display</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QTabWidget" name="tabSpectraGUI">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="presetDock">
<property name="windowTitle">
<string>Presets</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="spacing">
<number>3</number>
</property>
<item row="5" column="1">
<widget class="QToolButton" name="presetSave">
<property name="toolTip">
<string>Save current settings as new preset</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/preset-save.png</normaloff>:/preset-save.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item row="5" column="12">
<widget class="QToolButton" name="presetLoad">
<property name="toolTip">
<string>Load selected preset</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/preset-load.png</normaloff>:/preset-load.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item row="5" column="10" colspan="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="8">
<widget class="QToolButton" name="presetDelete">
<property name="toolTip">
<string>Delete selected preset</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/preset-delete.png</normaloff>:/preset-delete.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="4" colspan="12">
<widget class="QTreeWidget" name="presetTree">
<property name="indentation">
<number>10</number>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<attribute name="headerMinimumSectionSize">
<number>5</number>
</attribute>
<column>
<property name="text">
<string>Freq (MHz)</string>
</property>
<property name="toolTip">
<string>Center frequency in MHz</string>
</property>
</column>
<column>
<property name="text">
<string>M</string>
</property>
<property name="toolTip">
<string>Mode: R: Rx or source, T: Tx or sink</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
</widget>
</item>
<item row="5" column="2">
<widget class="QToolButton" name="presetUpdate">
<property name="toolTip">
<string>Update selected preset with current settings</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/preset-update.png</normaloff>:/preset-update.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item row="5" column="7">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="3">
<widget class="QToolButton" name="settingsSave">
<property name="toolTip">
<string>Save the current settings (inc. presets)</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/preset-last.png</normaloff>:/preset-last.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item row="5" column="5">
<widget class="QToolButton" name="presetExport">
<property name="toolTip">
<string>Export current preset to file</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/export.png</normaloff>:/export.png</iconset>
</property>
</widget>
</item>
<item row="5" column="4">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="6">
<widget class="QToolButton" name="presetImport">
<property name="toolTip">
<string>Import preset from file into current group</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../sdrgui/resources/res.qrc">
<normaloff>:/import.png</normaloff>:/import.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="channelDock">
<property name="windowTitle">
<string>Channels</string>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
</attribute>
<widget class="QWidget" name="channelWidgetContent">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QTabWidget" name="tabChannels">
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<action name="action_Exit">
<property name="text">
<string>E&amp;xit</string>
</property>
<property name="font">
<font/>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="action_Start">
<property name="text">
<string>&amp;Start</string>
</property>
<property name="font">
<font/>
</property>
<property name="shortcut">
<string>F5</string>
</property>
</action>
<action name="action_Stop">
<property name="text">
<string>&amp;Stop</string>
</property>
<property name="font">
<font/>
</property>
<property name="shortcut">
<string>F6</string>
</property>
</action>
<action name="action_View_Fullscreen">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Fullscreen</string>
</property>
<property name="font">
<font/>
</property>
<property name="shortcut">
<string>F11</string>
</property>
</action>
<action name="action_Oscilloscope">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Oscilloscope</string>
</property>
<property name="shortcut">
<string>F8</string>
</property>
</action>
<action name="action_About">
<property name="text">
<string>&amp;About SDRangel...</string>
</property>
<property name="font">
<font/>
</property>
</action>
<action name="action_Preferences">
<property name="text">
<string>&amp;Preferences...</string>
</property>
<property name="font">
<font/>
</property>
</action>
<action name="action_Loaded_Plugins">
<property name="text">
<string>Loaded &amp;Plugins...</string>
</property>
<property name="font">
<font/>
</property>
</action>
<action name="action_addSourceDevice">
<property name="text">
<string>Add source device</string>
</property>
<property name="font">
<font/>
</property>
</action>
<action name="action_removeLastDevice">
<property name="text">
<string>Remove last device</string>
</property>
<property name="font">
<font/>
</property>
</action>
<action name="action_Audio">
<property name="text">
<string>&amp;Audio</string>
</property>
</action>
<action name="action_DV_Serial">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>DV Serial</string>
</property>
</action>
<action name="action_My_Position">
<property name="text">
<string>My Position</string>
</property>
</action>
<action name="action_addSinkDevice">
<property name="text">
<string>Add sink device</string>
</property>
</action>
<action name="action_reloadDevices">
<property name="text">
<string>Reload devices</string>
</property>
</action>
<zorder>presetDock</zorder>
<zorder>channelDock</zorder>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>presetTree</tabstop>
<tabstop>presetSave</tabstop>
<tabstop>presetDelete</tabstop>
<tabstop>presetLoad</tabstop>
</tabstops>
<resources>
<include location="../sdrgui/resources/res.qrc"/>
</resources>
<connections>
<connection>
<sender>action_Exit</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>462</x>
<y>332</y>
</hint>
</hints>
</connection>
</connections>
</ui>