1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-05 15:34:57 -04:00

Feature plugins framework: REST API and server implementationo

This commit is contained in:
f4exb
2020-09-21 03:13:36 +02:00
parent 20ef49ea84
commit 153429cc7f
27 changed files with 2032 additions and 48 deletions
+25
View File
@@ -95,6 +95,8 @@ MESSAGE_CLASS_DEFINITION(MainWindow::MsgAddChannel, Message)
MESSAGE_CLASS_DEFINITION(MainWindow::MsgDeleteChannel, Message)
MESSAGE_CLASS_DEFINITION(MainWindow::MsgDeviceSetFocus, Message)
MESSAGE_CLASS_DEFINITION(MainWindow::MsgApplySettings, Message)
MESSAGE_CLASS_DEFINITION(MainWindow::MsgAddFeature, Message)
MESSAGE_CLASS_DEFINITION(MainWindow::MsgDeleteFeature, Message)
MainWindow *MainWindow::m_instance = 0;
@@ -995,6 +997,20 @@ bool MainWindow::handleMessage(const Message& cmd)
ui->tabInputsView->setCurrentIndex(index);
}
}
else if (MsgAddFeature::match(cmd))
{
MsgAddFeature& notif = (MsgAddFeature&) cmd;
ui->tabFeatures->setCurrentIndex(notif.getFeatureSetIndex());
featureAddClicked(notif.getFeatureRegistrationIndex());
return true;
}
else if (MsgDeleteFeature::match(cmd))
{
MsgDeleteFeature& notif = (MsgDeleteFeature&) cmd;
deleteFeature(notif.getFeatureSetIndex(), notif.getFeatureIndex());
return true;
}
else if (MsgApplySettings::match(cmd))
{
applySettings();
@@ -1901,6 +1917,15 @@ void MainWindow::featureAddClicked(int featureIndex)
}
}
void MainWindow::deleteFeature(int featureSetIndex, int featureIndex)
{
if ((featureSetIndex >= 0) && (featureSetIndex < (int) m_featureUIs.size()))
{
FeatureUISet *featureSet = m_featureUIs[featureSetIndex];
featureSet->deleteFeature(featureIndex);
}
}
void MainWindow::on_action_About_triggered()
{
AboutDialog dlg(m_apiHost, m_apiPort, m_settings, this);