1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 22:14:45 -04:00

REST API: config: GET (3): mechanism to deal with channel settings API formatting without creating a complete channel object. Applied to AM demod

This commit is contained in:
f4exb
2019-08-01 18:50:21 +02:00
parent 8ce4788b55
commit 810bbe2979
17 changed files with 250 additions and 38 deletions
+4 -2
View File
@@ -121,10 +121,12 @@ int WebAPIAdapterGUI::instanceConfigGet(
SWGSDRangel::SWGErrorResponse& error)
{
response.init();
WebAPIAdapterBase webAPIAdapterBase;
webAPIAdapterBase.setPluginManager(m_mainWindow.getPluginManager());
SWGSDRangel::SWGPreferences *preferences = response.getPreferences();
WebAPIAdapterBase::webapiFormatPreferences(preferences, m_mainWindow.getMainSettings().getPreferences());
SWGSDRangel::SWGPreset *workingPreset = response.getWorkingPreset();
WebAPIAdapterBase::webapiFormatPreset(workingPreset, m_mainWindow.getMainSettings().getWorkingPresetConst());
webAPIAdapterBase.webapiFormatPreset(workingPreset, m_mainWindow.getMainSettings().getWorkingPresetConst());
int nbPresets = m_mainWindow.m_settings.getPresetCount();
QList<SWGSDRangel::SWGPreset*> *swgPresets = response.getPresets();
@@ -133,7 +135,7 @@ int WebAPIAdapterGUI::instanceConfigGet(
{
const Preset *preset = m_mainWindow.m_settings.getPreset(i);
swgPresets->append(new SWGSDRangel::SWGPreset);
WebAPIAdapterBase::webapiFormatPreset(swgPresets->back(), *preset);
webAPIAdapterBase.webapiFormatPreset(swgPresets->back(), *preset);
}
int nbCommands = m_mainWindow.m_settings.getCommandCount();