mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 23:55:13 -05:00
API: /sdrangel/featureset (POST, DELETE) implemetned with 202 but messages are not processed yet
This commit is contained in:
parent
a36867af66
commit
d07f7fbb8a
@ -39,6 +39,8 @@ MESSAGE_CLASS_DEFINITION(MainCore::MsgSaveFeatureSetPreset, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteFeatureSetPreset, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddDeviceSet, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgRemoveLastDeviceSet, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddFeatureSet, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgRemoveLastFeatureSet, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgSetDevice, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgAddChannel, Message)
|
||||
MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteChannel, Message)
|
||||
|
@ -250,8 +250,7 @@ public:
|
||||
public:
|
||||
int getDirection() const { return m_direction; }
|
||||
|
||||
static MsgAddDeviceSet* create(int direction)
|
||||
{
|
||||
static MsgAddDeviceSet* create(int direction) {
|
||||
return new MsgAddDeviceSet(direction);
|
||||
}
|
||||
|
||||
@ -268,8 +267,7 @@ public:
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
static MsgRemoveLastDeviceSet* create()
|
||||
{
|
||||
static MsgRemoveLastDeviceSet* create() {
|
||||
return new MsgRemoveLastDeviceSet();
|
||||
}
|
||||
|
||||
@ -279,6 +277,34 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
class SDRBASE_API MsgAddFeatureSet : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
static MsgAddFeatureSet* create() {
|
||||
return new MsgAddFeatureSet();
|
||||
}
|
||||
|
||||
private:
|
||||
MsgAddFeatureSet() :
|
||||
Message()
|
||||
{ }
|
||||
};
|
||||
|
||||
class SDRBASE_API MsgRemoveLastFeatureSet : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
static MsgRemoveLastFeatureSet* create() {
|
||||
return new MsgRemoveLastFeatureSet();
|
||||
}
|
||||
|
||||
private:
|
||||
MsgRemoveLastFeatureSet() :
|
||||
Message()
|
||||
{ }
|
||||
};
|
||||
|
||||
class SDRBASE_API MsgSetDevice : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
|
@ -1408,7 +1408,11 @@ int WebAPIAdapter::instanceDeviceSetDelete(
|
||||
SWGSDRangel::SWGSuccessResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
#ifdef SERVER_MODE
|
||||
if (m_mainCore->m_deviceSets.size() != 0)
|
||||
#else
|
||||
if (m_mainCore->m_deviceSets.size() > 1)
|
||||
#endif
|
||||
{
|
||||
MainCore::MsgRemoveLastDeviceSet *msg = MainCore::MsgRemoveLastDeviceSet::create();
|
||||
m_mainCore->m_mainMessageQueue->push(msg);
|
||||
@ -1431,22 +1435,41 @@ int WebAPIAdapter::instanceFeatureSetPost(
|
||||
SWGSDRangel::SWGSuccessResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
(void) response;
|
||||
error.init();
|
||||
*error.getMessage() = "Not implemented";
|
||||
(void) error;
|
||||
MainCore::MsgAddFeatureSet *msg = MainCore::MsgAddFeatureSet::create();
|
||||
m_mainCore->m_mainMessageQueue->push(msg);
|
||||
|
||||
return 501;
|
||||
response.init();
|
||||
*response.getMessage() = QString("Message to add a new feature set (MsgAddFeatureSet) was submitted successfully");
|
||||
|
||||
return 202;
|
||||
}
|
||||
|
||||
int WebAPIAdapter::instanceFeatureSetDelete(
|
||||
SWGSDRangel::SWGSuccessResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
(void) response;
|
||||
error.init();
|
||||
*error.getMessage() = "Not implemented";
|
||||
#ifdef SERVER_MODE
|
||||
if (m_mainCore->m_featureSets.size() != 0)
|
||||
#else
|
||||
if (m_mainCore->m_featureSets.size() > 1)
|
||||
#endif
|
||||
{
|
||||
MainCore::MsgRemoveLastFeatureSet *msg = MainCore::MsgRemoveLastFeatureSet::create();
|
||||
m_mainCore->m_mainMessageQueue->push(msg);
|
||||
|
||||
return 501;
|
||||
response.init();
|
||||
*response.getMessage() = QString("Message to remove last feature set (MsgRemoveLastFeatureSet) was submitted successfully");
|
||||
|
||||
return 202;
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = "No more feature sets to be removed";
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapter::devicesetGet(
|
||||
|
Loading…
Reference in New Issue
Block a user