mirror of https://github.com/f4exb/sdrangel.git
API: added index in FeatureSet structure
This commit is contained in:
parent
611171234a
commit
e8ed80167c
|
@ -4913,8 +4913,12 @@ margin-bottom: 20px;
|
||||||
"description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present."
|
"description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present."
|
||||||
};
|
};
|
||||||
defs.FeatureSet = {
|
defs.FeatureSet = {
|
||||||
"required" : [ "featurecount" ],
|
"required" : [ "featurecount", "index" ],
|
||||||
"properties" : {
|
"properties" : {
|
||||||
|
"index" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"description" : "Index in the list of feature sets opened in this instance"
|
||||||
|
},
|
||||||
"featurecount" : {
|
"featurecount" : {
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"description" : "Number of features in the set"
|
"description" : "Number of features in the set"
|
||||||
|
@ -50576,7 +50580,7 @@ except ApiException as e:
|
||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2021-09-05T21:54:27.642+02:00
|
Generated 2021-09-12T20:10:39.058+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2759,8 +2759,12 @@ definitions:
|
||||||
FeatureSet:
|
FeatureSet:
|
||||||
description: "Grouping of features"
|
description: "Grouping of features"
|
||||||
required:
|
required:
|
||||||
|
- index
|
||||||
- featurecount
|
- featurecount
|
||||||
properties:
|
properties:
|
||||||
|
index:
|
||||||
|
description: "Index in the list of feature sets opened in this instance"
|
||||||
|
type: integer
|
||||||
featurecount:
|
featurecount:
|
||||||
description: "Number of features in the set"
|
description: "Number of features in the set"
|
||||||
type: integer
|
type: integer
|
||||||
|
|
|
@ -3767,6 +3767,7 @@ void WebAPIAdapter::getFeatureSet(SWGSDRangel::SWGFeatureSet *swgFeatureSet, con
|
||||||
(void) featureSetIndex; // FIXME: the index should be present in the API FeatureSet structure
|
(void) featureSetIndex; // FIXME: the index should be present in the API FeatureSet structure
|
||||||
swgFeatureSet->init();
|
swgFeatureSet->init();
|
||||||
swgFeatureSet->setFeaturecount(featureSet->getNumberOfFeatures());
|
swgFeatureSet->setFeaturecount(featureSet->getNumberOfFeatures());
|
||||||
|
swgFeatureSet->setIndex(featureSetIndex);
|
||||||
QList<SWGSDRangel::SWGFeature*> *features = swgFeatureSet->getFeatures();
|
QList<SWGSDRangel::SWGFeature*> *features = swgFeatureSet->getFeatures();
|
||||||
|
|
||||||
for (int i = 0; i < featureSet->getNumberOfFeatures(); i++)
|
for (int i = 0; i < featureSet->getNumberOfFeatures(); i++)
|
||||||
|
|
|
@ -2759,8 +2759,12 @@ definitions:
|
||||||
FeatureSet:
|
FeatureSet:
|
||||||
description: "Grouping of features"
|
description: "Grouping of features"
|
||||||
required:
|
required:
|
||||||
|
- index
|
||||||
- featurecount
|
- featurecount
|
||||||
properties:
|
properties:
|
||||||
|
index:
|
||||||
|
description: "Index in the list of feature sets opened in this instance"
|
||||||
|
type: integer
|
||||||
featurecount:
|
featurecount:
|
||||||
description: "Number of features in the set"
|
description: "Number of features in the set"
|
||||||
type: integer
|
type: integer
|
||||||
|
|
|
@ -4913,8 +4913,12 @@ margin-bottom: 20px;
|
||||||
"description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present."
|
"description" : "Base feature report. Only the feature report corresponding to the feature specified in the featureType field is or should be present."
|
||||||
};
|
};
|
||||||
defs.FeatureSet = {
|
defs.FeatureSet = {
|
||||||
"required" : [ "featurecount" ],
|
"required" : [ "featurecount", "index" ],
|
||||||
"properties" : {
|
"properties" : {
|
||||||
|
"index" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"description" : "Index in the list of feature sets opened in this instance"
|
||||||
|
},
|
||||||
"featurecount" : {
|
"featurecount" : {
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"description" : "Number of features in the set"
|
"description" : "Number of features in the set"
|
||||||
|
@ -50576,7 +50580,7 @@ except ApiException as e:
|
||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2021-09-05T21:54:27.642+02:00
|
Generated 2021-09-12T20:10:39.058+02:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,6 +28,8 @@ SWGFeatureSet::SWGFeatureSet(QString* json) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGFeatureSet::SWGFeatureSet() {
|
SWGFeatureSet::SWGFeatureSet() {
|
||||||
|
index = 0;
|
||||||
|
m_index_isSet = false;
|
||||||
featurecount = 0;
|
featurecount = 0;
|
||||||
m_featurecount_isSet = false;
|
m_featurecount_isSet = false;
|
||||||
features = nullptr;
|
features = nullptr;
|
||||||
|
@ -40,6 +42,8 @@ SWGFeatureSet::~SWGFeatureSet() {
|
||||||
|
|
||||||
void
|
void
|
||||||
SWGFeatureSet::init() {
|
SWGFeatureSet::init() {
|
||||||
|
index = 0;
|
||||||
|
m_index_isSet = false;
|
||||||
featurecount = 0;
|
featurecount = 0;
|
||||||
m_featurecount_isSet = false;
|
m_featurecount_isSet = false;
|
||||||
features = new QList<SWGFeature*>();
|
features = new QList<SWGFeature*>();
|
||||||
|
@ -49,6 +53,7 @@ SWGFeatureSet::init() {
|
||||||
void
|
void
|
||||||
SWGFeatureSet::cleanup() {
|
SWGFeatureSet::cleanup() {
|
||||||
|
|
||||||
|
|
||||||
if(features != nullptr) {
|
if(features != nullptr) {
|
||||||
auto arr = features;
|
auto arr = features;
|
||||||
for(auto o: *arr) {
|
for(auto o: *arr) {
|
||||||
|
@ -69,6 +74,8 @@ SWGFeatureSet::fromJson(QString &json) {
|
||||||
|
|
||||||
void
|
void
|
||||||
SWGFeatureSet::fromJsonObject(QJsonObject &pJson) {
|
SWGFeatureSet::fromJsonObject(QJsonObject &pJson) {
|
||||||
|
::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&featurecount, pJson["featurecount"], "qint32", "");
|
::SWGSDRangel::setValue(&featurecount, pJson["featurecount"], "qint32", "");
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,6 +96,9 @@ SWGFeatureSet::asJson ()
|
||||||
QJsonObject*
|
QJsonObject*
|
||||||
SWGFeatureSet::asJsonObject() {
|
SWGFeatureSet::asJsonObject() {
|
||||||
QJsonObject* obj = new QJsonObject();
|
QJsonObject* obj = new QJsonObject();
|
||||||
|
if(m_index_isSet){
|
||||||
|
obj->insert("index", QJsonValue(index));
|
||||||
|
}
|
||||||
if(m_featurecount_isSet){
|
if(m_featurecount_isSet){
|
||||||
obj->insert("featurecount", QJsonValue(featurecount));
|
obj->insert("featurecount", QJsonValue(featurecount));
|
||||||
}
|
}
|
||||||
|
@ -99,6 +109,16 @@ SWGFeatureSet::asJsonObject() {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint32
|
||||||
|
SWGFeatureSet::getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGFeatureSet::setIndex(qint32 index) {
|
||||||
|
this->index = index;
|
||||||
|
this->m_index_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
qint32
|
qint32
|
||||||
SWGFeatureSet::getFeaturecount() {
|
SWGFeatureSet::getFeaturecount() {
|
||||||
return featurecount;
|
return featurecount;
|
||||||
|
@ -124,6 +144,9 @@ bool
|
||||||
SWGFeatureSet::isSet(){
|
SWGFeatureSet::isSet(){
|
||||||
bool isObjectUpdated = false;
|
bool isObjectUpdated = false;
|
||||||
do{
|
do{
|
||||||
|
if(m_index_isSet){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
if(m_featurecount_isSet){
|
if(m_featurecount_isSet){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,9 @@ public:
|
||||||
virtual void fromJsonObject(QJsonObject &json) override;
|
virtual void fromJsonObject(QJsonObject &json) override;
|
||||||
virtual SWGFeatureSet* fromJson(QString &jsonString) override;
|
virtual SWGFeatureSet* fromJson(QString &jsonString) override;
|
||||||
|
|
||||||
|
qint32 getIndex();
|
||||||
|
void setIndex(qint32 index);
|
||||||
|
|
||||||
qint32 getFeaturecount();
|
qint32 getFeaturecount();
|
||||||
void setFeaturecount(qint32 featurecount);
|
void setFeaturecount(qint32 featurecount);
|
||||||
|
|
||||||
|
@ -53,6 +56,9 @@ public:
|
||||||
virtual bool isSet() override;
|
virtual bool isSet() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
qint32 index;
|
||||||
|
bool m_index_isSet;
|
||||||
|
|
||||||
qint32 featurecount;
|
qint32 featurecount;
|
||||||
bool m_featurecount_isSet;
|
bool m_featurecount_isSet;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue