1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-25 03:24:18 -04:00

Update Web API for latest plugins and features

This commit is contained in:
Jon Beniston
2021-01-13 20:56:45 +00:00
parent 3adea2fd70
commit 721d0a40c2
49 changed files with 5141 additions and 88 deletions
+34 -2
View File
@@ -3916,6 +3916,11 @@ bool WebAPIRequestMapper::getChannelSettings(
channelSettings->setLocalSourceSettings(new SWGSDRangel::SWGLocalSourceSettings());
channelSettings->getLocalSourceSettings()->fromJsonObject(settingsJsonObject);
}
else if (channelSettingsKey == "PacketDemodSettings")
{
channelSettings->setPacketDemodSettings(new SWGSDRangel::SWGPacketDemodSettings());
channelSettings->getPacketDemodSettings()->fromJsonObject(settingsJsonObject);
}
else if (channelSettingsKey == "PacketModSettings")
{
channelSettings->setPacketModSettings(new SWGSDRangel::SWGPacketModSettings());
@@ -4370,16 +4375,31 @@ bool WebAPIRequestMapper::getFeatureSettings(
QJsonObject settingsJsonObject = featureSettingsJson[featureSettingsKey].toObject();
featureSettingsKeys = settingsJsonObject.keys();
if (featureSettingsKey == "GS232ControllerSettings")
if (featureSettingsKey == "APRSSettings")
{
featureSettings->setAprsSettings(new SWGSDRangel::SWGAPRSSettings());
featureSettings->getAprsSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "GS232ControllerSettings")
{
featureSettings->setGs232ControllerSettings(new SWGSDRangel::SWGGS232ControllerSettings());
featureSettings->getGs232ControllerSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "MapSettings")
{
featureSettings->setMapSettings(new SWGSDRangel::SWGMapSettings());
featureSettings->getMapSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "SimplePTTSettings")
{
featureSettings->setSimplePttSettings(new SWGSDRangel::SWGSimplePTTSettings());
featureSettings->getSimplePttSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "StarTrackerSettings")
{
featureSettings->setStarTrackerSettings(new SWGSDRangel::SWGStarTrackerSettings());
featureSettings->getStarTrackerSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "RigCtlServerSettings")
{
featureSettings->setRigCtlServerSettings(new SWGSDRangel::SWGRigCtlServerSettings());
@@ -4412,7 +4432,12 @@ bool WebAPIRequestMapper::getFeatureActions(
QJsonObject actionsJsonObject = featureActionsJson[featureActionsKey].toObject();
featureActionsKeys = actionsJsonObject.keys();
if (featureActionsKey == "SimplePTTActions")
if (featureActionsKey == "MapActions")
{
featureActions->setMapActions(new SWGSDRangel::SWGMapActions());
featureActions->getMapActions()->fromJsonObject(actionsJsonObject);
}
else if (featureActionsKey == "SimplePTTActions")
{
featureActions->setSimplePttActions(new SWGSDRangel::SWGSimplePTTActions());
featureActions->getSimplePttActions()->fromJsonObject(actionsJsonObject);
@@ -4540,6 +4565,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setIeee802154ModSettings(nullptr);
channelSettings.setNfmDemodSettings(nullptr);
channelSettings.setNfmModSettings(nullptr);
channelSettings.setPacketDemodSettings(nullptr);
channelSettings.setPacketModSettings(nullptr);
channelSettings.setRemoteSinkSettings(nullptr);
channelSettings.setRemoteSourceSettings(nullptr);
@@ -4602,7 +4628,12 @@ void WebAPIRequestMapper::resetFeatureSettings(SWGSDRangel::SWGFeatureSettings&
{
featureSettings.cleanup();
featureSettings.setFeatureType(nullptr);
featureSettings.setAprsSettings(nullptr);
featureSettings.setGs232ControllerSettings(nullptr);
featureSettings.setMapSettings(nullptr);
featureSettings.setSimplePttSettings(nullptr);
featureSettings.setStarTrackerSettings(nullptr);
featureSettings.setRigCtlServerSettings(nullptr);
}
void WebAPIRequestMapper::resetFeatureReport(SWGSDRangel::SWGFeatureReport& featureReport)
@@ -4616,6 +4647,7 @@ void WebAPIRequestMapper::resetFeatureActions(SWGSDRangel::SWGFeatureActions& fe
{
featureActions.cleanup();
featureActions.setFeatureType(nullptr);
featureActions.setMapActions(nullptr);
featureActions.setSimplePttActions(nullptr);
}
+11
View File
@@ -47,6 +47,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = {
{"sdrangel.demod.localsink", "LocalSinkSettings"},
{"sdrangel.channel.localsink", "LocalSinkSettings"}, // remap
{"sdrangel.channel.localsource", "LocalSourceSettings"},
{"sdrangel.channelrx.demodpacket", "PacketDemodSettings"},
{"sdrangel.channeltx.modpacket", "PacketModSettings"},
{"sdrangel.channeltx.mod802.15.4", "IEEE_802_15_4_ModSettings"},
{"sdrangel.demod.remotesink", "RemoteSinkSettings"},
@@ -135,6 +136,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToSettingsKey = {
{"IEEE_802_15_4_Mod", "IEEE_802_15_4_ModSettings"},
{"NFMDemod", "NFMDemodSettings"},
{"NFMMod", "NFMModSettings"},
{"PacketDemod", "PacketDemodSettings"},
{"PacketMod", "PacketModSettings"},
{"LocalSink", "LocalSinkSettings"},
{"LocalSource", "LocalSourceSettings"},
@@ -237,16 +239,25 @@ const QMap<QString, QString> WebAPIUtils::m_mimoDeviceHwIdToActionsKey = {
};
const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = {
{"APRS", "APRSSettings"},
{"GS232Controller", "GS232ControllerSettings"},
{"Map", "MapSettings"},
{"SimplePTT", "SimplePTTSettings"},
{"StarTracker", "StarTrackerSettings"},
{"RigCtlServer", "RigCtlServerSettings"}
};
const QMap<QString, QString> WebAPIUtils::m_featureTypeToActionsKey = {
{"Map", "MapActions"},
{"SimplePTT", "SimplePTTActions"}
};
const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = {
{"sdrangel.feature.aprs", "APRSSettings"},
{"sdrangel.feature.gs232controller", "GS232ControllerSettings"},
{"sdrangel.feature.map", "MapSettings"},
{"sdrangel.feature.simpleptt", "SimplePTTSettings"},
{"sdrangel.feature.startracker", "StarTrackerSettings"},
{"sdrangel.feature.rigctlserver", "RigCtlServerSettings"}
};