From 66929eb02196224d5718ff7cc7dad79fc96ac751 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 19 Dec 2017 01:11:34 +0100 Subject: [PATCH] Server: web API: implemented /sdrangel/preset/file --- sdrbase/resources/index.html | 915 +++++++++++++++++- sdrbase/webapi/webapiadapterinterface.cpp | 1 + sdrbase/webapi/webapiadapterinterface.h | 23 + sdrbase/webapi/webapirequestmapper.cpp | 186 ++++ sdrbase/webapi/webapirequestmapper.h | 2 + sdrsrv/webapi/webapiadaptersrv.cpp | 158 +++ sdrsrv/webapi/webapiadaptersrv.h | 14 + swagger/sdrangel/api/swagger/swagger.yaml | 91 ++ swagger/sdrangel/code/html2/index.html | 915 +++++++++++++++++- .../code/qt5/client/SWGAudioDevice.cpp | 2 +- .../sdrangel/code/qt5/client/SWGAudioDevice.h | 2 +- .../code/qt5/client/SWGAudioDevices.cpp | 2 +- .../code/qt5/client/SWGAudioDevices.h | 2 +- .../code/qt5/client/SWGAudioDevicesSelect.cpp | 2 +- .../code/qt5/client/SWGAudioDevicesSelect.h | 2 +- .../code/qt5/client/SWGCWKeyerSettings.cpp | 2 +- .../code/qt5/client/SWGCWKeyerSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGChannel.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGChannel.h | 2 +- .../code/qt5/client/SWGChannelListItem.cpp | 2 +- .../code/qt5/client/SWGChannelListItem.h | 2 +- .../code/qt5/client/SWGChannelSettings.cpp | 2 +- .../code/qt5/client/SWGChannelSettings.h | 2 +- .../code/qt5/client/SWGDVSeralDevices.cpp | 2 +- .../code/qt5/client/SWGDVSeralDevices.h | 2 +- .../code/qt5/client/SWGDVSerialDevice.cpp | 2 +- .../code/qt5/client/SWGDVSerialDevice.h | 2 +- .../code/qt5/client/SWGDeviceListItem.cpp | 2 +- .../code/qt5/client/SWGDeviceListItem.h | 2 +- .../sdrangel/code/qt5/client/SWGDeviceSet.cpp | 2 +- .../sdrangel/code/qt5/client/SWGDeviceSet.h | 2 +- .../code/qt5/client/SWGDeviceSetApi.cpp | 2 +- .../code/qt5/client/SWGDeviceSetApi.h | 2 +- .../code/qt5/client/SWGDeviceSetList.cpp | 2 +- .../code/qt5/client/SWGDeviceSetList.h | 2 +- .../code/qt5/client/SWGDeviceSettings.cpp | 2 +- .../code/qt5/client/SWGDeviceSettings.h | 2 +- .../code/qt5/client/SWGDeviceState.cpp | 2 +- .../sdrangel/code/qt5/client/SWGDeviceState.h | 2 +- .../code/qt5/client/SWGErrorResponse.cpp | 2 +- .../code/qt5/client/SWGErrorResponse.h | 2 +- .../code/qt5/client/SWGFileSourceSettings.cpp | 2 +- .../code/qt5/client/SWGFileSourceSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGHelpers.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGHelpers.h | 2 +- .../code/qt5/client/SWGHttpRequest.cpp | 2 +- .../sdrangel/code/qt5/client/SWGHttpRequest.h | 2 +- .../code/qt5/client/SWGInstanceApi.cpp | 102 +- .../sdrangel/code/qt5/client/SWGInstanceApi.h | 12 +- .../client/SWGInstanceChannelsResponse.cpp | 2 +- .../qt5/client/SWGInstanceChannelsResponse.h | 2 +- .../qt5/client/SWGInstanceDevicesResponse.cpp | 2 +- .../qt5/client/SWGInstanceDevicesResponse.h | 2 +- .../qt5/client/SWGInstanceSummaryResponse.cpp | 2 +- .../qt5/client/SWGInstanceSummaryResponse.h | 2 +- .../qt5/client/SWGLimeSdrInputSettings.cpp | 2 +- .../code/qt5/client/SWGLimeSdrInputSettings.h | 2 +- .../qt5/client/SWGLimeSdrOutputSettings.cpp | 2 +- .../qt5/client/SWGLimeSdrOutputSettings.h | 2 +- .../qt5/client/SWGLocationInformation.cpp | 2 +- .../code/qt5/client/SWGLocationInformation.h | 2 +- .../code/qt5/client/SWGLoggingInfo.cpp | 2 +- .../sdrangel/code/qt5/client/SWGLoggingInfo.h | 2 +- .../code/qt5/client/SWGModelFactory.h | 10 +- .../code/qt5/client/SWGNFMDemodSettings.cpp | 2 +- .../code/qt5/client/SWGNFMDemodSettings.h | 2 +- .../code/qt5/client/SWGNFMModSettings.cpp | 2 +- .../code/qt5/client/SWGNFMModSettings.h | 2 +- swagger/sdrangel/code/qt5/client/SWGObject.h | 2 +- .../code/qt5/client/SWGPresetExport.cpp | 112 +++ .../code/qt5/client/SWGPresetExport.h | 60 ++ .../code/qt5/client/SWGPresetGroup.cpp | 2 +- .../sdrangel/code/qt5/client/SWGPresetGroup.h | 2 +- .../code/qt5/client/SWGPresetIdentifier.cpp | 2 +- .../code/qt5/client/SWGPresetIdentifier.h | 2 +- .../code/qt5/client/SWGPresetImport.cpp | 129 +++ .../code/qt5/client/SWGPresetImport.h | 63 ++ .../code/qt5/client/SWGPresetItem.cpp | 2 +- .../sdrangel/code/qt5/client/SWGPresetItem.h | 2 +- .../code/qt5/client/SWGPresetTransfer.cpp | 2 +- .../code/qt5/client/SWGPresetTransfer.h | 2 +- .../sdrangel/code/qt5/client/SWGPresets.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGPresets.h | 2 +- .../code/qt5/client/SWGRtlSdrSettings.cpp | 2 +- .../code/qt5/client/SWGRtlSdrSettings.h | 2 +- .../code/qt5/client/SWGSamplingDevice.cpp | 2 +- .../code/qt5/client/SWGSamplingDevice.h | 2 +- 87 files changed, 2859 insertions(+), 76 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGPresetExport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGPresetExport.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGPresetImport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGPresetImport.h diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index d7bcb2132..ab48c0131 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -1335,6 +1335,18 @@ margin-bottom: 20px; "$ref" : "#/definitions/CWKeyerSettings" } } +}; + defs.PresetExport = { + "properties" : { + "filePath" : { + "type" : "string", + "description" : "Path of the import file" + }, + "preset" : { + "$ref" : "#/definitions/PresetIdentifier" + } + }, + "description" : "Details to export a preset to file" }; defs.PresetGroup = { "required" : [ "groupName", "nbPresets" ], @@ -1378,6 +1390,24 @@ margin-bottom: 20px; } }, "description" : "Settings preset item" +}; + defs.PresetImport = { + "required" : [ "filePath" ], + "properties" : { + "groupName" : { + "type" : "string", + "description" : "If present overrides imported preset group name with this name" + }, + "description" : { + "type" : "string", + "description" : "If present overrides imported preset description with this description" + }, + "filePath" : { + "type" : "string", + "description" : "Path of the import file" + } + }, + "description" : "Details to import preset from file in preset list" }; defs.PresetItem = { "required" : [ "centerFrequency", "name", "type" ], @@ -1618,6 +1648,12 @@ margin-bottom: 20px;
  • instancePresetDelete
  • +
  • + instancePresetFilePost +
  • +
  • + instancePresetFilePut +
  • instancePresetGet
  • @@ -1654,6 +1690,7 @@ margin-bottom: 20px;