diff --git a/doc/img/SatelliteTracker_plugin_control.png b/doc/img/SatelliteTracker_plugin_control.png
index b849f1bab..16b2acb71 100644
Binary files a/doc/img/SatelliteTracker_plugin_control.png and b/doc/img/SatelliteTracker_plugin_control.png differ
diff --git a/plugins/feature/satellitetracker/readme.md b/plugins/feature/satellitetracker/readme.md
index 20f28e48a..52b775dd0 100644
--- a/plugins/feature/satellitetracker/readme.md
+++ b/plugins/feature/satellitetracker/readme.md
@@ -44,7 +44,7 @@ Pressing this button displays the SDRangel Control dialog.
This dialog determines the actions the Satellite Tracker will take when AOS or LOS occurs for a satellite. First, select a satellite from the dropdown box. Information about the satellite's transmit and receive modes should appear in the field at the bottom of the dialog, if available in the SatNogs database.
-To perform an action on an SDRangel device set on AOS or LOS, press the + button. This will add a row in the table, allowing you to select:
+To perform an action on an SDRangel device set on AOS or LOS, press the "Add device set" button. This will add a new, allowing you to select:
* The device set that will be controlled. This will list all currently open device sets. You can also type the name of a new device set.
* The preset to load on AOS. This allows preset device settings (E.g. centre frequency) and demodulators to be opened when the satellite becomes visible.
@@ -56,7 +56,7 @@ To perform an action on an SDRangel device set on AOS or LOS, press the + button
* A command or script to execute on AOS.
* A command or script to execute on LOS.
-Multiple rows can be added, to allow independent control of multiple device sets. To remove a row, select the row by clicking the row number, then press the - button.
+Multiple tabs can be added, to allow independent control of multiple device sets. To remove a tab, click the cross next to the device set name in the tab list.
6: Show Satellite Selection dialog
diff --git a/plugins/feature/satellitetracker/satellitedevicesettingsgui.cpp b/plugins/feature/satellitetracker/satellitedevicesettingsgui.cpp
index 83e610600..58335c18c 100644
--- a/plugins/feature/satellitetracker/satellitedevicesettingsgui.cpp
+++ b/plugins/feature/satellitetracker/satellitedevicesettingsgui.cpp
@@ -16,7 +16,7 @@
///////////////////////////////////////////////////////////////////////////////////
#include
-#include
+#include
#include
#include "satellitedevicesettingsgui.h"
@@ -28,20 +28,25 @@
#include "plugin/pluginapi.h"
SatelliteDeviceSettingsGUI::SatelliteDeviceSettingsGUI(SatelliteTrackerSettings::SatelliteDeviceSettings *devSettings,
- QTableWidget *table)
+ QTabWidget *tab, QWidget *parent) :
+ QWidget(parent),
+ m_tab(tab)
{
m_devSettings = devSettings;
+ QFormLayout *formLayout = new QFormLayout();
+
// Device set
m_deviceSetWidget = new QComboBox();
m_deviceSetWidget->setEditable(true);
- m_deviceSetWidget->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_DEVICESET)->toolTip());
- m_deviceSetItem = new QWidget();
- layout(m_deviceSetItem, m_deviceSetWidget);
+ m_deviceSetWidget->setToolTip("Device set to control");
+ formLayout->addRow("Device set", m_deviceSetWidget);
addDeviceSets();
int devSetIdx = m_deviceSetWidget->findText(devSettings->m_deviceSet);
if (devSetIdx != -1)
+ {
m_deviceSetWidget->setCurrentIndex(devSetIdx);
+ }
else
{
m_deviceSetWidget->addItem(devSettings->m_deviceSet);
@@ -52,9 +57,8 @@ SatelliteDeviceSettingsGUI::SatelliteDeviceSettingsGUI(SatelliteTrackerSettings:
m_presetWidget = new QComboBox();
m_presetWidget->setEditable(false);
m_presetWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
- m_presetWidget->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_PRESET)->toolTip());
- m_presetItem = new QWidget();
- layout(m_presetItem, m_presetWidget);
+ m_presetWidget->setToolTip("Preset to load on AOS");
+ formLayout->addRow("Preset", m_presetWidget);
addPresets(devSettings->m_deviceSet);
const MainSettings& mainSettings = MainCore::instance()->getSettings();
@@ -82,11 +86,10 @@ SatelliteDeviceSettingsGUI::SatelliteDeviceSettingsGUI(SatelliteTrackerSettings:
}
// Doppler
- m_dopplerWidget = new QComboBox();
+ m_dopplerWidget = new QListView();
m_dopplerWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
- m_dopplerWidget->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_DOPPLER)->toolTip());
- m_dopplerItem = new QWidget();
- layout(m_dopplerItem, m_dopplerWidget);
+ m_dopplerWidget->setToolTip("Channels that will have Doppler correction applied");
+ formLayout->addRow("Doppler correction", m_dopplerWidget);
m_dopplerWidget->setModel(&m_dopplerModel);
addChannels();
@@ -96,66 +99,48 @@ SatelliteDeviceSettingsGUI::SatelliteDeviceSettingsGUI(SatelliteTrackerSettings:
// Start on AOS
m_startOnAOSWidget = new QCheckBox();
m_startOnAOSWidget->setChecked(devSettings->m_startOnAOS);
- m_startOnAOSWidget->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_START)->toolTip());
- m_startOnAOSItem = new QWidget();
- layout(m_startOnAOSItem, m_startOnAOSWidget);
+ m_startOnAOSWidget->setToolTip("Start acquisition on AOS");
+ formLayout->addRow("Start acquisition on AOS", m_startOnAOSWidget);
// Stop on AOS
m_stopOnLOSWidget = new QCheckBox();
m_stopOnLOSWidget->setChecked(devSettings->m_stopOnLOS);
- m_stopOnLOSWidget->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_STOP)->toolTip());
- m_stopOnLOSItem = new QWidget();
- layout(m_stopOnLOSItem, m_stopOnLOSWidget);
+ m_stopOnLOSWidget->setToolTip("Stop acquisition on LOS");
+ formLayout->addRow("Stop acquisition on LOS", m_stopOnLOSWidget);
// Start file sink
m_startStopFileSinkWidget = new QCheckBox();
m_startStopFileSinkWidget->setChecked(devSettings->m_startStopFileSink);
- m_startStopFileSinkWidget->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_START_FILE_SINK)->toolTip());
- m_startStopFileSinkItem = new QWidget();
- layout(m_startStopFileSinkItem, m_startStopFileSinkWidget);
+ m_startStopFileSinkWidget->setToolTip("Start file sinks recording on AOS and stop recording on LOS");
+ formLayout->addRow("Start/stop file sinks on AOS/LOS", m_startStopFileSinkWidget);
// Frequency override
- m_frequencyItem = new QTableWidgetItem();
- m_frequencyItem->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_FREQUENCY)->toolTip());
- if (devSettings->m_frequency != 0)
- m_frequencyItem->setData(Qt::DisplayRole, QString("%1").arg(devSettings->m_frequency/1000000.0, 0, 'f', 3, QLatin1Char(' ')));
+ m_frequencyWidget = new QLineEdit();
+ m_frequencyWidget->setToolTip("Override the center frequency in the preset with a value specified here in MHz.\nThis allows a single preset to be shared between different satellites that differ only in frequency.");
+ // FIXME: Set mask for numeric or blank
+ if (devSettings->m_frequency != 0) {
+ m_frequencyWidget->setText(QString("%1").arg(devSettings->m_frequency/1000000.0, 0, 'f', 3, QLatin1Char(' ')));
+ }
+ formLayout->addRow("Override preset frequency (MHz)", m_frequencyWidget);
// AOS command
- m_aosCommandItem = new QTableWidgetItem();
- m_aosCommandItem->setText(devSettings->m_aosCommand);
- m_aosCommandItem->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_AOS_COMMAND)->toolTip());
+ m_aosCommandWidget = new QLineEdit();
+ m_aosCommandWidget->setText(devSettings->m_aosCommand);
+ m_aosCommandWidget->setToolTip("Command to execute on AOS");
+ formLayout->addRow("AOS command", m_aosCommandWidget);
// LOS command
- m_losCommandItem = new QTableWidgetItem();
- m_losCommandItem->setText(devSettings->m_losCommand);
- m_losCommandItem->setToolTip(table->horizontalHeaderItem(SAT_DEVICE_COL_LOS_COMMAND)->toolTip());
+ m_losCommandWidget = new QLineEdit();
+ m_losCommandWidget->setText(devSettings->m_losCommand);
+ m_losCommandWidget->setToolTip("Command to execute on LOS");
+ formLayout->addRow("LOS command", m_losCommandWidget);
- int row = table->rowCount();
- table->setRowCount(row + 1);
- table->setCellWidget(row, SAT_DEVICE_COL_DEVICESET, m_deviceSetItem);
- table->setCellWidget(row, SAT_DEVICE_COL_PRESET, m_presetItem);
- table->setCellWidget(row, SAT_DEVICE_COL_DOPPLER, m_dopplerItem);
- table->setCellWidget(row, SAT_DEVICE_COL_START, m_startOnAOSItem);
- table->setCellWidget(row, SAT_DEVICE_COL_STOP, m_stopOnLOSItem);
- table->setCellWidget(row, SAT_DEVICE_COL_START_FILE_SINK, m_startStopFileSinkItem);
- table->setItem(row, SAT_DEVICE_COL_FREQUENCY, m_frequencyItem);
- table->setItem(row, SAT_DEVICE_COL_AOS_COMMAND, m_aosCommandItem);
- table->setItem(row, SAT_DEVICE_COL_LOS_COMMAND, m_losCommandItem);
- table->resizeColumnsToContents();
+ setLayout(formLayout);
connect(m_deviceSetWidget, SIGNAL(currentTextChanged(const QString &)), this, SLOT(on_m_deviceSetWidget_currentTextChanged(const QString &)));
connect(m_presetWidget, SIGNAL(currentIndexChanged(int)), this, SLOT(on_m_presetWidget_currentIndexChanged(int)));
}
-void SatelliteDeviceSettingsGUI::layout(QWidget *parent, QWidget *child)
-{
- QHBoxLayout* pLayout = new QHBoxLayout(parent);
- pLayout->addWidget(child);
- pLayout->setAlignment(Qt::AlignCenter);
- pLayout->setContentsMargins(0, 0, 0, 0);
- parent->setLayout(pLayout);
-}
-
// Add available devicesets to the combobox
void SatelliteDeviceSettingsGUI::addDeviceSets()
{
@@ -210,8 +195,9 @@ const Preset* SatelliteDeviceSettingsGUI::getSelectedPreset()
|| ((preset->isSinkPreset() && (m_currentPresets == "T")))
|| ((preset->isMIMOPreset() && (m_currentPresets == "M"))))
{
- if (listIdx == presetIdx)
+ if (listIdx == presetIdx) {
return preset;
+ }
presetIdx++;
}
}
@@ -247,8 +233,12 @@ void SatelliteDeviceSettingsGUI::on_m_deviceSetWidget_currentTextChanged(const Q
{
if (!text.isEmpty())
{
- if (text[0] != m_currentPresets)
+ if (text[0] != m_currentPresets) {
addPresets(text[0]);
+ }
+ // Set name of tab to match
+ int currentTabIndex = m_tab->currentIndex();
+ m_tab->setTabText(currentTabIndex, text);
}
}
@@ -279,13 +269,14 @@ void SatelliteDeviceSettingsGUI::accept()
m_devSettings->m_doppler.clear();
for (int i = 0; i < m_dopplerItems.size(); i++)
{
- if (m_dopplerItems[i]->checkState() == Qt::Checked)
+ if (m_dopplerItems[i]->checkState() == Qt::Checked) {
m_devSettings->m_doppler.append(i);
+ }
}
m_devSettings->m_startOnAOS = m_startOnAOSWidget->isChecked();
m_devSettings->m_stopOnLOS = m_stopOnLOSWidget->isChecked();
m_devSettings->m_startStopFileSink = m_startStopFileSinkWidget->isChecked();
- m_devSettings->m_frequency = (quint64)(m_frequencyItem->data(Qt::DisplayRole).toDouble() * 1000000.0);
- m_devSettings->m_aosCommand = m_aosCommandItem->text();
- m_devSettings->m_losCommand = m_losCommandItem->text();
+ m_devSettings->m_frequency = (quint64)(m_frequencyWidget->text().toDouble() * 1000000.0);
+ m_devSettings->m_aosCommand = m_aosCommandWidget->text();
+ m_devSettings->m_losCommand = m_losCommandWidget->text();
}
diff --git a/plugins/feature/satellitetracker/satellitedevicesettingsgui.h b/plugins/feature/satellitetracker/satellitedevicesettingsgui.h
index 9e43c603b..149f90178 100644
--- a/plugins/feature/satellitetracker/satellitedevicesettingsgui.h
+++ b/plugins/feature/satellitetracker/satellitedevicesettingsgui.h
@@ -19,7 +19,10 @@
#define INCLUDE_FEATURE_SATELLITEDEVICESETTINGSGUI_H
#include
+#include
+#include
#include
+#include
#include
#include
#include
@@ -30,19 +33,18 @@
class SatelliteRadioControlDialog;
-class SatelliteDeviceSettingsGUI : public QObject
+class SatelliteDeviceSettingsGUI : public QWidget
{
Q_OBJECT
public:
- SatelliteDeviceSettingsGUI(SatelliteTrackerSettings::SatelliteDeviceSettings *devSettings,
- QTableWidget *table);
+ explicit SatelliteDeviceSettingsGUI(SatelliteTrackerSettings::SatelliteDeviceSettings *devSettings,
+ QTabWidget *tab, QWidget *parent = nullptr);
void accept();
protected:
- void layout(QWidget *parent, QWidget *child);
void addDeviceSets();
void addPresets(const QString& deviceSet);
void addChannels();
@@ -56,21 +58,16 @@ private slots:
protected:
friend SatelliteRadioControlDialog;
- QWidget *m_deviceSetItem;
+ QTabWidget *m_tab;
QComboBox *m_deviceSetWidget;
- QWidget *m_presetItem;
QComboBox *m_presetWidget;
- QWidget *m_dopplerItem;
- QComboBox *m_dopplerWidget;
- QWidget *m_startOnAOSItem;
+ QListView *m_dopplerWidget;
QCheckBox *m_startOnAOSWidget;
- QWidget *m_stopOnLOSItem;
QCheckBox *m_stopOnLOSWidget;
- QWidget *m_startStopFileSinkItem;
QCheckBox *m_startStopFileSinkWidget;
- QTableWidgetItem *m_frequencyItem;
- QTableWidgetItem *m_aosCommandItem;
- QTableWidgetItem *m_losCommandItem;
+ QLineEdit *m_frequencyWidget;
+ QLineEdit *m_aosCommandWidget;
+ QLineEdit *m_losCommandWidget;
QChar m_currentPresets;
QStandardItemModel m_dopplerModel;
@@ -78,17 +75,6 @@ protected:
SatelliteTrackerSettings::SatelliteDeviceSettings *m_devSettings;
- enum SatDeviceCol {
- SAT_DEVICE_COL_DEVICESET,
- SAT_DEVICE_COL_PRESET,
- SAT_DEVICE_COL_DOPPLER,
- SAT_DEVICE_COL_START,
- SAT_DEVICE_COL_STOP,
- SAT_DEVICE_COL_START_FILE_SINK,
- SAT_DEVICE_COL_FREQUENCY,
- SAT_DEVICE_COL_AOS_COMMAND,
- SAT_DEVICE_COL_LOS_COMMAND
- };
};
#endif // INCLUDE_FEATURE_SATELLITEDEVICESETTINGSGUI_H
diff --git a/plugins/feature/satellitetracker/satelliteradiocontroldialog.cpp b/plugins/feature/satellitetracker/satelliteradiocontroldialog.cpp
index a8fdefd38..018f2bcde 100644
--- a/plugins/feature/satellitetracker/satelliteradiocontroldialog.cpp
+++ b/plugins/feature/satellitetracker/satelliteradiocontroldialog.cpp
@@ -37,13 +37,13 @@ SatelliteRadioControlDialog::SatelliteRadioControlDialog(SatelliteTrackerSetting
{
ui->setupUi(this);
- // Must resize before setting m_deviceSettings
- resizeTable();
-
m_deviceSettings = m_settings->m_deviceSettings;
- for (int i = 0; i < settings->m_satellites.size(); i++)
+ for (int i = 0; i < settings->m_satellites.size(); i++) {
ui->satelliteSelect->addItem(settings->m_satellites[i]);
+ }
+
+ connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(on_tabCloseRequested(int)));
}
SatelliteRadioControlDialog::~SatelliteRadioControlDialog()
@@ -53,28 +53,22 @@ SatelliteRadioControlDialog::~SatelliteRadioControlDialog()
void SatelliteRadioControlDialog::accept()
{
- for (int i = 0; i < m_devSettingsGUIs.size(); i++)
+ for (int i = 0; i < m_devSettingsGUIs.size(); i++) {
m_devSettingsGUIs[i]->accept();
+ }
QDialog::accept();
m_settings->m_deviceSettings = m_deviceSettings;
}
-void SatelliteRadioControlDialog::resizeTable()
-{
- on_add_clicked();
- ui->table->resizeColumnsToContents();
- ui->table->selectRow(0);
- on_remove_clicked();
- ui->table->selectRow(-1);
-}
-
void SatelliteRadioControlDialog::on_add_clicked()
{
QString name = ui->satelliteSelect->currentText();
if (!name.isEmpty())
{
SatelliteTrackerSettings::SatelliteDeviceSettings *devSettings = new SatelliteTrackerSettings::SatelliteDeviceSettings();
- SatelliteDeviceSettingsGUI *devSettingsGUI = new SatelliteDeviceSettingsGUI(devSettings, ui->table);
+ SatelliteDeviceSettingsGUI *devSettingsGUI = new SatelliteDeviceSettingsGUI(devSettings, ui->tabWidget, ui->tabWidget);
+ int index = ui->tabWidget->addTab(devSettingsGUI, "R0");
+ ui->tabWidget->setCurrentIndex(index);
m_devSettingsGUIs.append(devSettingsGUI);
QList *devSettingsList = m_deviceSettings.value(name);
@@ -82,21 +76,15 @@ void SatelliteRadioControlDialog::on_add_clicked()
}
}
-// Remove selected row
-void SatelliteRadioControlDialog::on_remove_clicked()
+// Remove tab
+void SatelliteRadioControlDialog::on_tabCloseRequested(int index)
{
- // Selection mode is single, so only a single row should be returned
- QModelIndexList indexList = ui->table->selectionModel()->selectedRows();
- if (!indexList.isEmpty())
- {
- int row = indexList.at(0).row();
- ui->table->removeRow(row);
- delete m_devSettingsGUIs.takeAt(row);
+ ui->tabWidget->removeTab(index);
+ delete m_devSettingsGUIs.takeAt(index);
- QString name = ui->satelliteSelect->currentText();
- QList *devSettingsList = m_deviceSettings.value(name);
- delete devSettingsList->takeAt(row);
- }
+ QString name = ui->satelliteSelect->currentText();
+ QList *devSettingsList = m_deviceSettings.value(name);
+ delete devSettingsList->takeAt(index);
}
void SatelliteRadioControlDialog::on_satelliteSelect_currentIndexChanged(int index)
@@ -104,23 +92,26 @@ void SatelliteRadioControlDialog::on_satelliteSelect_currentIndexChanged(int ind
(void) index;
// Save details from current GUI elements
- for (int i = 0; i < m_devSettingsGUIs.size(); i++)
+ for (int i = 0; i < m_devSettingsGUIs.size(); i++) {
m_devSettingsGUIs[i]->accept();
+ }
// Clear GUI
- ui->table->setRowCount(0);
+ ui->tabWidget->clear();
qDeleteAll(m_devSettingsGUIs);
m_devSettingsGUIs.clear();
// Create settings list for newly selected satellite, if one doesn't already exist
QString name = ui->satelliteSelect->currentText();
- if (!m_deviceSettings.contains(name))
+ if (!m_deviceSettings.contains(name)) {
m_deviceSettings.insert(name, new QList());
+ }
// Add existing settings to GUI
QList *devSettingsList = m_deviceSettings.value(name);
for (int i = 0; i < devSettingsList->size(); i++)
{
- SatelliteDeviceSettingsGUI *devSettingsGUI = new SatelliteDeviceSettingsGUI(devSettingsList->at(i), ui->table);
+ SatelliteDeviceSettingsGUI *devSettingsGUI = new SatelliteDeviceSettingsGUI(devSettingsList->at(i), ui->tabWidget, ui->tabWidget);
+ ui->tabWidget->addTab(devSettingsGUI, devSettingsList->at(i)->m_deviceSet);
m_devSettingsGUIs.append(devSettingsGUI);
}
diff --git a/plugins/feature/satellitetracker/satelliteradiocontroldialog.h b/plugins/feature/satellitetracker/satelliteradiocontroldialog.h
index 7bd92ce3f..c613fe46a 100644
--- a/plugins/feature/satellitetracker/satelliteradiocontroldialog.h
+++ b/plugins/feature/satellitetracker/satelliteradiocontroldialog.h
@@ -35,12 +35,11 @@ public:
SatelliteTrackerSettings *m_settings;
private:
- void resizeTable();
private slots:
void accept();
void on_add_clicked();
- void on_remove_clicked();
+ void on_tabCloseRequested(int index);
void on_satelliteSelect_currentIndexChanged(int index);
private:
diff --git a/plugins/feature/satellitetracker/satelliteradiocontroldialog.ui b/plugins/feature/satellitetracker/satelliteradiocontroldialog.ui
index 6a4b87daa..0622ca40c 100644
--- a/plugins/feature/satellitetracker/satelliteradiocontroldialog.ui
+++ b/plugins/feature/satellitetracker/satelliteradiocontroldialog.ui
@@ -7,7 +7,7 @@
0
0
955
- 400
+ 771
@@ -26,98 +26,15 @@
-
-
-
-
-
- QAbstractItemView::SingleSelection
+
-
+
+
+ Satellite modes
-
- QAbstractItemView::SelectRows
-
-
-
- Device set
-
-
- Device set to control
-
-
-
-
- Preset to load on AOS
-
-
- Preset to load to device set
-
-
-
-
- Doppler correction
-
-
- Channel numbers that will have Doppler correction applied
-
-
-
-
- Start on AOS
-
-
- Start acquisition on AOS
-
-
-
-
- Stop on LOS
-
-
- Stop acquisition on LOS
-
-
-
-
- Start/stop file sinks
-
-
- Start file sinks recording on AOS and stop recording on LOS
-
-
-
-
- Override frequency (MHz)
-
-
- Override the center frequency in the preset with a value specified here in MHz.
-This allows a single preset to be shared between different satellites that differ only in frequency.
-
-
-
-
- AOS command
-
-
- Command to execute on AOS
-
-
-
-
- LOS command
-
-
- Command to execute on LOS
-
-
- -
-
-
- Satellite modes from SatNOGS
-
-
- true
-
-
+
-
+
-
@@ -138,6 +55,16 @@ This allows a single preset to be shared between different satellites that diffe
+ -
+
+
+ Add device set control settings tab
+
+
+ Add device set
+
+
+
-
@@ -153,47 +80,23 @@ This allows a single preset to be shared between different satellites that diffe
- -
-
-
-
-
-
- Add device set control
-
-
- +
-
-
-
- -
-
-
- Remove device set control
-
-
- -
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
+ -
+
+
+ Satellite modes from SatNOGS
+
+
+ true
+
+
- -
-
-
- Satellite modes
+
-
+
+
+ -1
+
+
+ true
@@ -214,9 +117,6 @@ This allows a single preset to be shared between different satellites that diffe
satelliteSelect
- table
- add
- remove
satelliteModes