1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-05 07:24:44 -04:00

Web API: AM demod and AirspyHF: many fixes

This commit is contained in:
f4exb
2018-03-22 06:34:51 +01:00
parent 0cf53e1dc9
commit 1204734b58
6 changed files with 129 additions and 26 deletions
+45 -2
View File
@@ -1508,6 +1508,21 @@ bool WebAPIRequestMapper::validateDeviceSettings(
return false;
}
}
else if ((*deviceHwType == "AirspyHF") && (deviceSettings.getTx() == 0))
{
if (jsonObject.contains("airspyHFSettings") && jsonObject["airspyHFSettings"].isObject())
{
QJsonObject airspyHFSettingsJsonObject = jsonObject["airspyHFSettings"].toObject();
deviceSettingsKeys = airspyHFSettingsJsonObject.keys();
deviceSettings.setAirspyHfSettings(new SWGSDRangel::SWGAirspyHFSettings());
deviceSettings.getAirspyHfSettings()->fromJsonObject(airspyHFSettingsJsonObject);
return true;
}
else
{
return false;
}
}
else if ((*deviceHwType == "HackRF") && (deviceSettings.getTx() == 0))
{
if (jsonObject.contains("hackRFInputSettings") && jsonObject["hackRFInputSettings"].isObject())
@@ -1608,7 +1623,21 @@ bool WebAPIRequestMapper::validateChannelSettings(
QString *channelType = channelSettings.getChannelType();
if (*channelType == "NFMDemod")
if (*channelType == "AMDemod")
{
if (channelSettings.getTx() == 0)
{
QJsonObject amDemodSettingsJsonObject = jsonObject["AMDemodSettings"].toObject();
channelSettingsKeys = amDemodSettingsJsonObject.keys();
channelSettings.setAmDemodSettings(new SWGSDRangel::SWGAMDemodSettings());
channelSettings.getAmDemodSettings()->fromJsonObject(amDemodSettingsJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "NFMDemod")
{
if (channelSettings.getTx() == 0)
{
@@ -1668,7 +1697,21 @@ bool WebAPIRequestMapper::validateChannelReport(
QString *channelType = channelReport.getChannelType();
if (*channelType == "NFMDemod")
if (*channelType == "AMDemod")
{
if (channelReport.getTx() == 0)
{
QJsonObject amDemodReportJsonObject = jsonObject["AMDemodReport"].toObject();
channelReportKeys = amDemodReportJsonObject.keys();
channelReport.setAmDemodReport(new SWGSDRangel::SWGAMDemodReport());
channelReport.getAmDemodReport()->fromJsonObject(amDemodReportJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "NFMDemod")
{
if (channelReport.getTx() == 0)
{