1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Add settings to API.

This commit is contained in:
srcejon 2024-03-03 21:57:33 +00:00
parent 506a0e2fcc
commit eddfa3bec0
5 changed files with 53 additions and 6 deletions

View File

@ -310,6 +310,9 @@ void AISDemod::applySettings(const AISDemodSettings& settings, bool force)
if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) {
reverseAPIKeys.append("logEnabled");
}
if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) {
reverseAPIKeys.append("useFileTime");
}
if (m_settings.m_streamIndex != settings.m_streamIndex)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
@ -495,6 +498,9 @@ void AISDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("logEnabled")) {
settings.m_logEnabled = response.getAisDemodSettings()->getLogEnabled();
}
if (channelSettingsKeys.contains("useFileTime")) {
settings.m_useFileTime = response.getAisDemodSettings()->getUseFileTime();
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getAisDemodSettings()->getRgbColor();
}
@ -543,6 +549,7 @@ void AISDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getAisDemodSettings()->setUdpFormat((int)settings.m_udpFormat);
response.getAisDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
response.getAisDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getAisDemodSettings()->setUseFileTime(settings.m_useFileTime);
response.getAisDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getAisDemodSettings()->getTitle()) {
@ -681,6 +688,9 @@ void AISDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("logEnabled") || force) {
swgAISDemodSettings->setLogEnabled(settings.m_logEnabled);
}
if (channelSettingsKeys.contains("useFileTime") || force) {
swgAISDemodSettings->setUseFileTime(settings.m_useFileTime);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgAISDemodSettings->setRgbColor(settings.m_rgbColor);
}

View File

@ -314,6 +314,9 @@ void DSCDemod::applySettings(const DSCDemodSettings& settings, bool force)
if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) {
reverseAPIKeys.append("logEnabled");
}
if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) {
reverseAPIKeys.append("useFileTime");
}
if (m_settings.m_streamIndex != settings.m_streamIndex)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
@ -502,10 +505,13 @@ void DSCDemod::webapiUpdateChannelSettings(
settings.m_udpPort = response.getDscDemodSettings()->getUdpPort();
}
if (channelSettingsKeys.contains("logFilename")) {
settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename();
settings.m_logFilename = *response.getDscDemodSettings()->getLogFilename();
}
if (channelSettingsKeys.contains("logEnabled")) {
settings.m_logEnabled = response.getAdsbDemodSettings()->getLogEnabled();
settings.m_logEnabled = response.getDscDemodSettings()->getLogEnabled();
}
if (channelSettingsKeys.contains("useFileTime")) {
settings.m_useFileTime = response.getDscDemodSettings()->getUseFileTime();
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getDscDemodSettings()->getRgbColor();
@ -554,6 +560,7 @@ void DSCDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getDscDemodSettings()->setUdpPort(settings.m_udpPort);
response.getDscDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
response.getDscDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getDscDemodSettings()->setUseFileTime(settings.m_useFileTime);
response.getDscDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getDscDemodSettings()->getTitle()) {
@ -698,6 +705,9 @@ void DSCDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("logEnabled") || force) {
swgDSCDemodSettings->setLogEnabled(settings.m_logEnabled);
}
if (channelSettingsKeys.contains("useFileTime") || force) {
swgDSCDemodSettings->setUseFileTime(settings.m_useFileTime);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgDSCDemodSettings->setRgbColor(settings.m_rgbColor);
}

View File

@ -439,10 +439,13 @@ void EndOfTrainDemod::webapiUpdateChannelSettings(
settings.m_udpPort = response.getEndOfTrainDemodSettings()->getUdpPort();
}
if (channelSettingsKeys.contains("logFilename")) {
settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename();
settings.m_logFilename = *response.getEndOfTrainDemodSettings()->getLogFilename();
}
if (channelSettingsKeys.contains("logEnabled")) {
settings.m_logEnabled = response.getAdsbDemodSettings()->getLogEnabled();
settings.m_logEnabled = response.getEndOfTrainDemodSettings()->getLogEnabled();
}
if (channelSettingsKeys.contains("useFileTime")) {
settings.m_useFileTime = response.getEndOfTrainDemodSettings()->getUseFileTime();
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getEndOfTrainDemodSettings()->getRgbColor();
@ -486,6 +489,7 @@ void EndOfTrainDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting
response.getEndOfTrainDemodSettings()->setUdpPort(settings.m_udpPort);
response.getEndOfTrainDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
response.getEndOfTrainDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getEndOfTrainDemodSettings()->setUseFileTime(settings.m_useFileTime);
response.getEndOfTrainDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getEndOfTrainDemodSettings()->getTitle()) {
@ -611,6 +615,9 @@ void EndOfTrainDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("logEnabled") || force) {
swgEndOfTrainDemodSettings->setLogEnabled(settings.m_logEnabled);
}
if (channelSettingsKeys.contains("useFileTime") || force) {
swgEndOfTrainDemodSettings->setUseFileTime(settings.m_useFileTime);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgEndOfTrainDemodSettings->setRgbColor(settings.m_rgbColor);
}

View File

@ -297,6 +297,9 @@ void PacketDemod::applySettings(const PacketDemodSettings& settings, bool force)
if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) {
reverseAPIKeys.append("logEnabled");
}
if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) {
reverseAPIKeys.append("useFileTime");
}
if (m_settings.m_streamIndex != settings.m_streamIndex)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
@ -482,10 +485,13 @@ void PacketDemod::webapiUpdateChannelSettings(
settings.m_udpPort = response.getPacketDemodSettings()->getUdpPort();
}
if (channelSettingsKeys.contains("logFilename")) {
settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename();
settings.m_logFilename = *response.getPacketDemodSettings()->getLogFilename();
}
if (channelSettingsKeys.contains("logEnabled")) {
settings.m_logEnabled = response.getAdsbDemodSettings()->getLogEnabled();
settings.m_logEnabled = response.getPacketDemodSettings()->getLogEnabled();
}
if (channelSettingsKeys.contains("useFileTime")) {
settings.m_useFileTime = response.getPacketDemodSettings()->getUseFileTime();
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getPacketDemodSettings()->getRgbColor();
@ -530,6 +536,7 @@ void PacketDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getPacketDemodSettings()->setUdpPort(settings.m_udpPort);
response.getPacketDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
response.getPacketDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getPacketDemodSettings()->setUseFileTime(settings.m_useFileTime);
response.getPacketDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getPacketDemodSettings()->getTitle()) {
@ -658,6 +665,9 @@ void PacketDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("logEnabled") || force) {
swgPacketDemodSettings->setLogEnabled(settings.m_logEnabled);
}
if (channelSettingsKeys.contains("useFilTime") || force) {
swgPacketDemodSettings->setUseFileTime(settings.m_useFileTime);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgPacketDemodSettings->setRgbColor(settings.m_rgbColor);
}

View File

@ -337,6 +337,9 @@ void RadiosondeDemod::applySettings(const RadiosondeDemodSettings& settings, boo
if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) {
reverseAPIKeys.append("logEnabled");
}
if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) {
reverseAPIKeys.append("useFileTime");
}
if (m_settings.m_streamIndex != settings.m_streamIndex)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
@ -516,6 +519,9 @@ void RadiosondeDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("logEnabled")) {
settings.m_logEnabled = response.getRadiosondeDemodSettings()->getLogEnabled();
}
if (channelSettingsKeys.contains("useFileTime")) {
settings.m_useFileTime = response.getRadiosondeDemodSettings()->getUseFileTime();
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getRadiosondeDemodSettings()->getRgbColor();
}
@ -563,6 +569,7 @@ void RadiosondeDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting
response.getRadiosondeDemodSettings()->setUdpPort(settings.m_udpPort);
response.getRadiosondeDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
response.getRadiosondeDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getRadiosondeDemodSettings()->setUseFileTime(settings.m_useFileTime);
response.getRadiosondeDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getRadiosondeDemodSettings()->getTitle()) {
@ -698,6 +705,9 @@ void RadiosondeDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("logEnabled") || force) {
swgRadiosondeDemodSettings->setLogEnabled(settings.m_logEnabled);
}
if (channelSettingsKeys.contains("useFileTime") || force) {
swgRadiosondeDemodSettings->setUseFileTime(settings.m_useFileTime);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgRadiosondeDemodSettings->setRgbColor(settings.m_rgbColor);
}