1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Add scanState to FreqScanner Report

This commit is contained in:
srcejon 2024-06-21 10:04:17 +01:00
parent 092efb3780
commit c1d55b9af1
6 changed files with 45 additions and 2 deletions

View File

@ -7278,6 +7278,10 @@ margin-bottom: 20px;
"channelSampleRate" : { "channelSampleRate" : {
"type" : "integer" "type" : "integer"
}, },
"scanState" : {
"type" : "integer",
"description" : "(IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)"
},
"channelState" : { "channelState" : {
"type" : "array", "type" : "array",
"items" : { "items" : {
@ -59115,7 +59119,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2024-06-21T10:02:32.986+02:00 Generated 2024-06-21T11:03:53.536+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -59,6 +59,9 @@ FreqScannerReport:
properties: properties:
channelSampleRate: channelSampleRate:
type: integer type: integer
scanState:
description: (IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)
type: integer
channelState: channelState:
type: array type: array
items: items:

View File

@ -59,6 +59,9 @@ FreqScannerReport:
properties: properties:
channelSampleRate: channelSampleRate:
type: integer type: integer
scanState:
description: (IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)
type: integer
channelState: channelState:
type: array type: array
items: items:

View File

@ -7278,6 +7278,10 @@ margin-bottom: 20px;
"channelSampleRate" : { "channelSampleRate" : {
"type" : "integer" "type" : "integer"
}, },
"scanState" : {
"type" : "integer",
"description" : "(IDLE=0, START_SCAN=1, SCANNING=2, WAIT_FOR_END_TX=3, WAIT_FOR_RETRANSMISSION=4)"
},
"channelState" : { "channelState" : {
"type" : "array", "type" : "array",
"items" : { "items" : {
@ -59115,7 +59119,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2024-06-21T10:02:32.986+02:00 Generated 2024-06-21T11:03:53.536+02:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -30,6 +30,8 @@ SWGFreqScannerReport::SWGFreqScannerReport(QString* json) {
SWGFreqScannerReport::SWGFreqScannerReport() { SWGFreqScannerReport::SWGFreqScannerReport() {
channel_sample_rate = 0; channel_sample_rate = 0;
m_channel_sample_rate_isSet = false; m_channel_sample_rate_isSet = false;
scan_state = 0;
m_scan_state_isSet = false;
channel_state = nullptr; channel_state = nullptr;
m_channel_state_isSet = false; m_channel_state_isSet = false;
} }
@ -42,6 +44,8 @@ void
SWGFreqScannerReport::init() { SWGFreqScannerReport::init() {
channel_sample_rate = 0; channel_sample_rate = 0;
m_channel_sample_rate_isSet = false; m_channel_sample_rate_isSet = false;
scan_state = 0;
m_scan_state_isSet = false;
channel_state = new QList<SWGFreqScannerChannelState*>(); channel_state = new QList<SWGFreqScannerChannelState*>();
m_channel_state_isSet = false; m_channel_state_isSet = false;
} }
@ -49,6 +53,7 @@ SWGFreqScannerReport::init() {
void void
SWGFreqScannerReport::cleanup() { SWGFreqScannerReport::cleanup() {
if(channel_state != nullptr) { if(channel_state != nullptr) {
auto arr = channel_state; auto arr = channel_state;
for(auto o: *arr) { for(auto o: *arr) {
@ -71,6 +76,8 @@ void
SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) { SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", ""); ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&scan_state, pJson["scanState"], "qint32", "");
::SWGSDRangel::setValue(&channel_state, pJson["channelState"], "QList", "SWGFreqScannerChannelState"); ::SWGSDRangel::setValue(&channel_state, pJson["channelState"], "QList", "SWGFreqScannerChannelState");
} }
@ -92,6 +99,9 @@ SWGFreqScannerReport::asJsonObject() {
if(m_channel_sample_rate_isSet){ if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate)); obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
} }
if(m_scan_state_isSet){
obj->insert("scanState", QJsonValue(scan_state));
}
if(channel_state && channel_state->size() > 0){ if(channel_state && channel_state->size() > 0){
toJsonArray((QList<void*>*)channel_state, obj, "channelState", "SWGFreqScannerChannelState"); toJsonArray((QList<void*>*)channel_state, obj, "channelState", "SWGFreqScannerChannelState");
} }
@ -109,6 +119,16 @@ SWGFreqScannerReport::setChannelSampleRate(qint32 channel_sample_rate) {
this->m_channel_sample_rate_isSet = true; this->m_channel_sample_rate_isSet = true;
} }
qint32
SWGFreqScannerReport::getScanState() {
return scan_state;
}
void
SWGFreqScannerReport::setScanState(qint32 scan_state) {
this->scan_state = scan_state;
this->m_scan_state_isSet = true;
}
QList<SWGFreqScannerChannelState*>* QList<SWGFreqScannerChannelState*>*
SWGFreqScannerReport::getChannelState() { SWGFreqScannerReport::getChannelState() {
return channel_state; return channel_state;
@ -127,6 +147,9 @@ SWGFreqScannerReport::isSet(){
if(m_channel_sample_rate_isSet){ if(m_channel_sample_rate_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_scan_state_isSet){
isObjectUpdated = true; break;
}
if(channel_state && (channel_state->size() > 0)){ if(channel_state && (channel_state->size() > 0)){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }

View File

@ -46,6 +46,9 @@ public:
qint32 getChannelSampleRate(); qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate); void setChannelSampleRate(qint32 channel_sample_rate);
qint32 getScanState();
void setScanState(qint32 scan_state);
QList<SWGFreqScannerChannelState*>* getChannelState(); QList<SWGFreqScannerChannelState*>* getChannelState();
void setChannelState(QList<SWGFreqScannerChannelState*>* channel_state); void setChannelState(QList<SWGFreqScannerChannelState*>* channel_state);
@ -56,6 +59,9 @@ private:
qint32 channel_sample_rate; qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet; bool m_channel_sample_rate_isSet;
qint32 scan_state;
bool m_scan_state_isSet;
QList<SWGFreqScannerChannelState*>* channel_state; QList<SWGFreqScannerChannelState*>* channel_state;
bool m_channel_state_isSet; bool m_channel_state_isSet;