2017-11-18 13:34:47 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
|
|
|
|
// //
|
|
|
|
// Swagger server adapter interface //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef SDRGUI_WEBAPI_WEBAPIADAPTERGUI_H_
|
|
|
|
#define SDRGUI_WEBAPI_WEBAPIADAPTERGUI_H_
|
|
|
|
|
2017-11-23 12:43:01 -05:00
|
|
|
#include <QtGlobal>
|
|
|
|
|
2017-11-18 13:34:47 -05:00
|
|
|
#include "webapi/webapiadapterinterface.h"
|
|
|
|
|
|
|
|
class MainWindow;
|
|
|
|
|
|
|
|
class WebAPIAdapterGUI: public WebAPIAdapterInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WebAPIAdapterGUI(MainWindow& mainWindow);
|
|
|
|
virtual ~WebAPIAdapterGUI();
|
|
|
|
|
|
|
|
virtual int instanceSummary(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGInstanceSummaryResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-18 13:34:47 -05:00
|
|
|
|
2017-11-22 12:57:35 -05:00
|
|
|
virtual int instanceDevices(
|
|
|
|
bool tx,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGInstanceDevicesResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-22 12:57:35 -05:00
|
|
|
|
2017-11-22 19:19:32 -05:00
|
|
|
virtual int instanceChannels(
|
|
|
|
bool tx,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGInstanceChannelsResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-22 19:19:32 -05:00
|
|
|
|
2017-11-23 12:43:01 -05:00
|
|
|
virtual int instanceLoggingGet(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGLoggingInfo& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-23 12:43:01 -05:00
|
|
|
|
|
|
|
virtual int instanceLoggingPut(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGLoggingInfo& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-23 12:43:01 -05:00
|
|
|
|
2017-11-24 02:46:12 -05:00
|
|
|
virtual int instanceAudioGet(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGAudioDevices& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-24 02:46:12 -05:00
|
|
|
|
2017-11-24 11:12:53 -05:00
|
|
|
virtual int instanceAudioPatch(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGAudioDevicesSelect& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-24 11:12:53 -05:00
|
|
|
|
2017-11-24 22:02:11 -05:00
|
|
|
virtual int instanceLocationGet(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGLocationInformation& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-24 22:02:11 -05:00
|
|
|
|
|
|
|
virtual int instanceLocationPut(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGLocationInformation& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-24 22:02:11 -05:00
|
|
|
|
2017-11-24 22:43:22 -05:00
|
|
|
virtual int instanceDVSerialPatch(
|
|
|
|
bool dvserial,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGDVSeralDevices& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-24 22:43:22 -05:00
|
|
|
|
2017-12-20 18:50:58 -05:00
|
|
|
virtual int instancePresetsGet(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGPresets& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 05:14:52 -05:00
|
|
|
|
2017-11-25 10:08:18 -05:00
|
|
|
virtual int instancePresetPatch(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGPresetTransfer& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 10:08:18 -05:00
|
|
|
|
2017-11-25 10:47:13 -05:00
|
|
|
virtual int instancePresetPut(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGPresetTransfer& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 10:47:13 -05:00
|
|
|
|
2017-11-25 12:32:37 -05:00
|
|
|
virtual int instancePresetPost(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGPresetTransfer& query,
|
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 12:32:37 -05:00
|
|
|
|
2017-11-25 13:42:56 -05:00
|
|
|
virtual int instancePresetDelete(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGPresetIdentifier& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 13:42:56 -05:00
|
|
|
|
2017-11-25 14:14:16 -05:00
|
|
|
virtual int instanceDeviceSetsGet(
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGDeviceSetList& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 14:14:16 -05:00
|
|
|
|
2017-12-21 19:07:03 -05:00
|
|
|
virtual int instanceDeviceSetPost(
|
2017-11-25 16:52:24 -05:00
|
|
|
bool tx,
|
2017-12-19 11:55:05 -05:00
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 16:52:24 -05:00
|
|
|
|
2017-12-21 19:07:03 -05:00
|
|
|
virtual int instanceDeviceSetDelete(
|
2017-12-19 11:55:05 -05:00
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-25 16:52:24 -05:00
|
|
|
|
2017-11-26 04:37:39 -05:00
|
|
|
virtual int devicesetGet(
|
|
|
|
int deviceSetIndex,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGDeviceSet& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-26 04:37:39 -05:00
|
|
|
|
2017-11-27 02:14:07 -05:00
|
|
|
virtual int devicesetDevicePut(
|
|
|
|
int deviceSetIndex,
|
2017-12-01 23:45:30 -05:00
|
|
|
SWGSDRangel::SWGDeviceListItem& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
2017-11-27 02:14:07 -05:00
|
|
|
|
2017-12-06 16:08:34 -05:00
|
|
|
virtual int devicesetDeviceSettingsGet(
|
2017-12-04 12:22:25 -05:00
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceSettings& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-07 07:55:42 -05:00
|
|
|
virtual int devicesetDeviceSettingsPutPatch(
|
|
|
|
int deviceSetIndex,
|
|
|
|
bool force,
|
2017-12-26 19:46:33 -05:00
|
|
|
const QStringList& deviceSettingsKeys,
|
2017-12-07 07:55:42 -05:00
|
|
|
SWGSDRangel::SWGDeviceSettings& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-09 04:49:20 -05:00
|
|
|
virtual int devicesetDeviceRunGet(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceState& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-08 11:12:33 -05:00
|
|
|
virtual int devicesetDeviceRunPost(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceState& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
|
|
|
virtual int devicesetDeviceRunDelete(
|
|
|
|
int deviceSetIndex,
|
|
|
|
SWGSDRangel::SWGDeviceState& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-10 19:18:10 -05:00
|
|
|
virtual int devicesetChannelPost(
|
|
|
|
int deviceSetIndex,
|
2017-12-19 11:55:05 -05:00
|
|
|
SWGSDRangel::SWGChannelSettings& query,
|
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
2017-12-10 19:18:10 -05:00
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-23 17:41:37 -05:00
|
|
|
virtual int devicesetChannelDelete(
|
|
|
|
int deviceSetIndex,
|
|
|
|
int channelIndex,
|
|
|
|
SWGSDRangel::SWGSuccessResponse& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-10 14:27:08 -05:00
|
|
|
virtual int devicesetChannelSettingsGet(
|
|
|
|
int deviceSetIndex,
|
|
|
|
int channelIndex,
|
|
|
|
SWGSDRangel::SWGChannelSettings& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-12-11 12:18:47 -05:00
|
|
|
virtual int devicesetChannelSettingsPutPatch(
|
|
|
|
int deviceSetIndex,
|
|
|
|
int channelIndex,
|
|
|
|
bool force,
|
2017-12-23 21:27:07 -05:00
|
|
|
const QStringList& channelSettingsKeys,
|
2017-12-11 12:18:47 -05:00
|
|
|
SWGSDRangel::SWGChannelSettings& response,
|
|
|
|
SWGSDRangel::SWGErrorResponse& error);
|
|
|
|
|
2017-11-18 13:34:47 -05:00
|
|
|
private:
|
|
|
|
MainWindow& m_mainWindow;
|
2017-11-23 12:43:01 -05:00
|
|
|
|
2017-12-01 23:45:30 -05:00
|
|
|
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList* deviceSetList);
|
|
|
|
void getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const DeviceUISet* deviceUISet, int deviceUISetIndex);
|
2017-11-23 12:43:01 -05:00
|
|
|
static QtMsgType getMsgTypeFromString(const QString& msgTypeString);
|
|
|
|
static void getMsgTypeString(const QtMsgType& msgType, QString& level);
|
2017-11-18 13:34:47 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SDRGUI_WEBAPI_WEBAPIADAPTERGUI_H_ */
|