1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 05:41:56 -05:00

SDRdaemon: channel source report

This commit is contained in:
f4exb 2018-08-30 01:56:53 +02:00
parent a8d45fd253
commit 1f7720e8f9
30 changed files with 2141 additions and 86 deletions

View File

@ -365,10 +365,9 @@ void SDRdaemonSinkGui::on_dataPort_returnPressed()
sendSettings();
}
void SDRdaemonSinkGui::on_applyButton_clicked(bool checked __attribute__((unused)))
void SDRdaemonSinkGui::on_apiApplyButton_clicked(bool checked __attribute__((unused)))
{
m_settings.m_apiAddress = ui->apiAddress->text();
m_settings.m_dataAddress = ui->dataAddress->text();
bool apiOk;
int apiPort = ui->apiPort->text().toInt(&apiOk);
@ -378,6 +377,13 @@ void SDRdaemonSinkGui::on_applyButton_clicked(bool checked __attribute__((unused
m_settings.m_apiPort = apiPort;
}
sendSettings();
}
void SDRdaemonSinkGui::on_dataApplyButton_clicked(bool checked __attribute__((unused)))
{
m_settings.m_dataAddress = ui->dataAddress->text();
bool dataOk;
int udpDataPort = ui->dataPort->text().toInt(&dataOk);

View File

@ -105,7 +105,8 @@ private slots:
void on_apiPort_returnPressed();
void on_dataAddress_returnPressed();
void on_dataPort_returnPressed();
void on_applyButton_clicked(bool checked);
void on_apiApplyButton_clicked(bool checked);
void on_dataApplyButton_clicked(bool checked);
void on_startStop_toggled(bool checked);
void on_eventCountsReset_clicked(bool checked);
void updateHardware();

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>217</height>
<width>360</width>
<height>237</height>
</rect>
</property>
<property name="sizePolicy">
@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>400</width>
<width>360</width>
<height>190</height>
</size>
</property>
@ -345,32 +345,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="queueLengthLabel">
<property name="text">
<string>QL:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="queueLengthText">
<property name="minimumSize">
<size>
<width>18</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Current transmitter queue length in number of vectors</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
@ -395,22 +369,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="qualityStatusText">
<property name="minimumSize">
<size>
<width>52</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Tx status since last poll: minimum of blocks received / maximum number of blocks used for recovery</string>
</property>
<property name="text">
<string>100/100</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="eventCountsReset">
<property name="maximumSize">
@ -485,9 +443,61 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="addressLayout">
<layout class="QHBoxLayout" name="queueLengthLayout">
<item>
<widget class="QLabel" name="queueLengthLabel">
<property name="text">
<string>QL</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="queueLengthGauge">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>14</height>
</size>
</property>
<property name="toolTip">
<string>Queue length gauge</string>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="queueLengthText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Queue length / Queue size</string>
</property>
<property name="text">
<string>000/000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="apiAddressLayout">
<item>
<widget class="QLabel" name="apiAddressLabel">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>API</string>
</property>
@ -497,12 +507,12 @@
<widget class="QLineEdit" name="apiAddress">
<property name="minimumSize">
<size>
<width>100</width>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Remote data connection IP address</string>
<string>API IP address</string>
</property>
<property name="inputMask">
<string>000.000.000.000</string>
@ -512,10 +522,23 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="apiPortSeparator">
<property name="text">
<string>:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="apiPort">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remote data connection port</string>
<string>API IP port</string>
</property>
<property name="inputMask">
<string>00000</string>
@ -525,8 +548,47 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="apiApplyButton">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set API address and port</string>
</property>
<property name="text">
<string>Set</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="dataAddressLayout">
<item>
<widget class="QLabel" name="dataAddressLabel">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Data</string>
</property>
@ -536,10 +598,13 @@
<widget class="QLineEdit" name="dataAddress">
<property name="minimumSize">
<size>
<width>100</width>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Remote data address</string>
</property>
<property name="inputMask">
<string>000.000.000.000</string>
</property>
@ -548,8 +613,24 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dataPortSeparator">
<property name="text">
<string>:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="dataPort">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remote data port</string>
</property>
<property name="inputMask">
<string>00000</string>
</property>
@ -559,13 +640,29 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="applyButton">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="dataApplyButton">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set data address and port</string>
</property>
<property name="text">
<string>Set</string>
</property>

View File

@ -22,6 +22,7 @@
<file>webapi/doc/swagger/include/PlutoSdr.yaml</file>
<file>webapi/doc/swagger/include/RtlSdr.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonChannelSink.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonChannelSource.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonSource.yaml</file>
<file>webapi/doc/swagger/include/SDRDaemonSink.yaml</file>
<file>webapi/doc/swagger/include/SDRPlay.yaml</file>

View File

@ -1416,6 +1416,9 @@ margin-bottom: 20px;
"SSBDemodReport" : {
"$ref" : "#/definitions/SSBDemodReport"
},
"SDRDaemonChannelSourceReport" : {
"$ref" : "#/definitions/SDRDaemonChannelSourceReport"
},
"SSBModReport" : {
"$ref" : "#/definitions/SSBModReport"
},
@ -1470,6 +1473,9 @@ margin-bottom: 20px;
"SDRDaemonChannelSinkSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSinkSettings"
},
"SDRDaemonChannelSourceSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSourceSettings"
},
"SSBModSettings" : {
"$ref" : "#/definitions/SSBModSettings"
},
@ -3166,6 +3172,52 @@ margin-bottom: 20px;
}
},
"description" : "Data handling details for SDRDaemon"
};
defs.SDRDaemonChannelSourceReport = {
"properties" : {
"queueLength" : {
"type" : "integer",
"description" : "Data read/write queue length in number of data frames"
},
"queueSize" : {
"type" : "integer",
"description" : "Data read/write queue size in number of data frames"
},
"samplesCount" : {
"type" : "integer",
"description" : "Absolute consumed samples count"
},
"correctableErrorsCount" : {
"type" : "integer",
"description" : "Absolute number of correctable errors"
},
"uncorrectableErrorsCount" : {
"type" : "integer",
"description" : "Absolute number of uncorrectable errors"
},
"tvSec" : {
"type" : "integer",
"description" : "Counts timestamp seconds"
},
"tvUSec" : {
"type" : "integer",
"description" : "Counts timestamp microseconds"
}
},
"description" : "SDRDaemon channel source report"
};
defs.SDRDaemonChannelSourceSettings = {
"properties" : {
"dataAddress" : {
"type" : "string",
"description" : "Remote USB data address"
},
"dataPort" : {
"type" : "integer",
"description" : "Remote USB data port"
}
},
"description" : "Data handling details for SDRDaemon"
};
defs.SDRPlayReport = {
"properties" : {
@ -4024,6 +4076,9 @@ margin-bottom: 20px;
<li class="nav-fixed nav-header active" data-group="_"><a href="#api-_">API Summary</a></li>
<li class="nav-header" data-group="Daemon"><a href="#api-Daemon">API Methods - Daemon</a></li>
<li data-group="Daemon" data-name="daemonChannelReportGet" class="">
<a href="#api-Daemon-daemonChannelReportGet">daemonChannelReportGet</a>
</li>
<li data-group="Daemon" data-name="daemonChannelSettingsGet" class="">
<a href="#api-Daemon-daemonChannelSettingsGet">daemonChannelSettingsGet</a>
</li>
@ -4230,6 +4285,427 @@ margin-bottom: 20px;
<div id="sections">
<section id="api-Daemon">
<h1>Daemon</h1>
<div id="api-Daemon-daemonChannelReportGet">
<article id="api-Daemon-daemonChannelReportGet-0" data-group="User" data-name="daemonChannelReportGet" data-version="0">
<div class="pull-left">
<h1>daemonChannelReportGet</h1>
<p></p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
<p></p>
<p class="marked">get the channel report</p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/sdrdaemon/channel/report</span></code></pre>
<p>
<h3>Usage and SDK Samples</h3>
</p>
<ul class="nav nav-tabs nav-tabs-examples">
<li class="active"><a href="#examples-Daemon-daemonChannelReportGet-0-curl">Curl</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-java">Java</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-csharp">C#</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-php">PHP</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-perl">Perl</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-python">Python</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="examples-Daemon-daemonChannelReportGet-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/sdrdaemon/channel/report"</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-java">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
import SWGSDRangel.auth.*;
import SWGSDRangel.model.*;
import SWGSDRangel.api.DaemonApi;
import java.io.File;
import java.util.*;
public class DaemonApiExample {
public static void main(String[] args) {
DaemonApi apiInstance = new DaemonApi();
try {
ChannelReport result = apiInstance.daemonChannelReportGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DaemonApi#daemonChannelReportGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-android">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.DaemonApi;
public class DaemonApiExample {
public static void main(String[] args) {
DaemonApi apiInstance = new DaemonApi();
try {
ChannelReport result = apiInstance.daemonChannelReportGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DaemonApi#daemonChannelReportGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<!--
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-groovy">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div> -->
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-objc">
<pre class="prettyprint"><code class="language-cpp">
DaemonApi *apiInstance = [[DaemonApi alloc] init];
[apiInstance daemonChannelReportGetWithCompletionHandler:
^(ChannelReport output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-javascript">
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
var api = new SdRangel.DaemonApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.daemonChannelReportGet(callback);
</code></pre>
</div>
<!--<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-angular">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div>-->
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-csharp">
<pre class="prettyprint"><code class="language-cs">using System;
using System.Diagnostics;
using SWGSDRangel.Api;
using SWGSDRangel.Client;
using SWGSDRangel.Model;
namespace Example
{
public class daemonChannelReportGetExample
{
public void main()
{
var apiInstance = new DaemonApi();
try
{
ChannelReport result = apiInstance.daemonChannelReportGet();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DaemonApi.daemonChannelReportGet: " + e.Message );
}
}
}
}
</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-php">
<pre class="prettyprint"><code class="language-php"><&#63;php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DaemonApi();
try {
$result = $api_instance->daemonChannelReportGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DaemonApi->daemonChannelReportGet: ', $e->getMessage(), PHP_EOL;
}
?></code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-perl">
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
use SWGSDRangel::Configuration;
use SWGSDRangel::DaemonApi;
my $api_instance = SWGSDRangel::DaemonApi->new();
eval {
my $result = $api_instance->daemonChannelReportGet();
print Dumper($result);
};
if ($@) {
warn "Exception when calling DaemonApi->daemonChannelReportGet: $@\n";
}</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-python">
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
import time
import swagger_sdrangel
from swagger_sdrangel.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_sdrangel.DaemonApi()
try:
api_response = api_instance.daemon_channel_report_get()
pprint(api_response)
except ApiException as e:
print("Exception when calling DaemonApi->daemonChannelReportGet: %s\n" % e)</code></pre>
</div>
</div>
<h2>Parameters</h2>
<h2>Responses</h2>
<h3> Status: 200 - On success return channel report </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-200-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-200-schema">
<div id='responses-daemonChannelReportGet-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return channel report",
"schema" : {
"$ref" : "#/definitions/ChannelReport"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-200-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-200-schema-200');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-200-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 400 - Invalid device set or channel index </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-400-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-400-schema">
<div id='responses-daemonChannelReportGet-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Invalid device set or channel index",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-400-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-400-schema-400');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-400-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 404 - Device or channel not found </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-404-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-404-schema">
<div id='responses-daemonChannelReportGet-404-schema-404' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Device or channel not found",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-404-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-404-schema-404');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-404-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 500 - Error </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-500-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-500-schema">
<div id='responses-daemonChannelReportGet-500-schema-500' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Error",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-500-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-500-schema-500');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-500-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 501 - Function not implemented </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-501-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-501-schema">
<div id='responses-daemonChannelReportGet-501-schema-501' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Function not implemented",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-501-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-501-schema-501');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-501-schema-data' type='hidden' value=''></input>
</div>
</div>
</article>
</div>
<hr>
<div id="api-Daemon-daemonChannelSettingsGet">
<article id="api-Daemon-daemonChannelSettingsGet-0" data-group="User" data-name="daemonChannelSettingsGet" data-version="0">
<div class="pull-left">
@ -28212,7 +28688,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-08-29T15:59:39.880+02:00
Generated 2018-08-30T01:40:47.594+02:00
</div>
</div>
</div>

View File

@ -0,0 +1,34 @@
SDRDaemonChannelSourceSettings:
description: "Data handling details for SDRDaemon"
properties:
dataAddress:
description: "Remote USB data address"
type: string
dataPort:
description: "Remote USB data port"
type: integer
SDRDaemonChannelSourceReport:
description: "SDRDaemon channel source report"
properties:
queueLength:
description: "Data read/write queue length in number of data frames"
type: integer
queueSize:
description: "Data read/write queue size in number of data frames"
type: integer
samplesCount:
description: "Absolute consumed samples count"
type: integer
correctableErrorsCount:
description: "Absolute number of correctable errors"
type: integer
uncorrectableErrorsCount:
description: "Absolute number of uncorrectable errors"
type: integer
tvSec:
description: "Counts timestamp seconds"
type: integer
tvUSec:
description: "Counts timestamp microseconds"
type: integer

View File

@ -1299,7 +1299,7 @@ paths:
$ref: "#/responses/Response_501"
/sdrdaemon/channel/settings:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: Get channel handling details
operationId: daemonChannelSettingsGet
@ -1360,7 +1360,7 @@ paths:
/sdrdaemon/device/settings:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: Get device settings
operationId: daemonDeviceSettingsGet
@ -1431,7 +1431,7 @@ paths:
$ref: "#/responses/Response_501"
/sdrdaemon/run:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: get device run status
operationId: daemonRunGet
@ -1500,7 +1500,7 @@ paths:
$ref: "#/responses/Response_501"
/sdrdaemon/device/report:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: get the device report
operationId: daemonDeviceReportGet
@ -1524,6 +1524,30 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/channel/report:
x-swagger-router-controller: daemon
get:
description: get the channel report
operationId: daemonChannelReportGet
tags:
- Daemon
responses:
"200":
description: On success return channel report
schema:
$ref: "#/definitions/ChannelReport"
"400":
description: Invalid device set or channel index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device or channel not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/swagger:
x-swagger-pipe: swagger_raw
@ -2196,6 +2220,8 @@ definitions:
$ref: "/doc/swagger/include/NFMMod.yaml#/NFMModSettings"
SDRDaemonChannelSinkSettings:
$ref: "/doc/swagger/include/SDRDaemonChannelSink.yaml#/SDRDaemonChannelSinkSettings"
SDRDaemonChannelSourceSettings:
$ref: "/doc/swagger/include/SDRDaemonChannelSource.yaml#/SDRDaemonChannelSourceSettings"
SSBModSettings:
$ref: "/doc/swagger/include/SSBMod.yaml#/SSBModSettings"
SSBDemodSettings:
@ -2235,6 +2261,8 @@ definitions:
$ref: "/doc/swagger/include/NFMMod.yaml#/NFMModReport"
SSBDemodReport:
$ref: "/doc/swagger/include/SSBDemod.yaml#/SSBDemodReport"
SDRDaemonChannelSourceReport:
$ref: "/doc/swagger/include/SDRDaemonChannelSource.yaml#/SDRDaemonChannelSourceReport"
SSBModReport:
$ref: "/doc/swagger/include/SSBMod.yaml#/SSBModReport"
UDPSinkReport:

View File

@ -2399,6 +2399,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setNfmDemodSettings(0);
channelSettings.setNfmModSettings(0);
channelSettings.setSdrDaemonChannelSinkSettings(0);
channelSettings.setSdrDaemonChannelSourceSettings(0);
channelSettings.setSsbDemodSettings(0);
channelSettings.setSsbModSettings(0);
channelSettings.setUdpSinkSettings(0);
@ -2418,6 +2419,7 @@ void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& chan
channelReport.setDsdDemodReport(0);
channelReport.setNfmDemodReport(0);
channelReport.setNfmModReport(0);
channelReport.setSdrDaemonChannelSourceReport(0);
channelReport.setSsbDemodReport(0);
channelReport.setSsbModReport(0);
channelReport.setUdpSinkReport(0);

View File

@ -20,11 +20,17 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <sys/time.h>
#include <unistd.h>
#include <boost/crc.hpp>
#include <boost/cstdint.hpp>
#include <QDebug>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGSDRDaemonChannelSourceReport.h"
#include "util/simpleserializer.h"
#include "dsp/threadedbasebandsamplesource.h"
#include "dsp/upchannelizer.h"
@ -44,7 +50,9 @@ SDRDaemonChannelSource::SDRDaemonChannelSource(DeviceSinkAPI *deviceAPI) :
m_deviceAPI(deviceAPI),
m_sourceThread(0),
m_running(false),
m_samplesCount(0)
m_samplesCount(0),
m_nbCorrectableErrors(0),
m_nbUncorrectableErrors(0)
{
setObjectName(m_channelId);
@ -226,6 +234,13 @@ void SDRDaemonChannelSource::handleDataBlock(SDRDaemonDataBlock* dataBlock)
paramsCM256.RecoveryCount = m_currentMeta.m_nbFECBlocks;
}
// update counters
if (dataBlock->m_rxControlBlock.m_recoveryCount > paramsCM256.RecoveryCount) {
m_nbUncorrectableErrors += SDRDaemonNbOrginalBlocks - dataBlock->m_rxControlBlock.m_originalCount;
} else {
m_nbCorrectableErrors += dataBlock->m_rxControlBlock.m_recoveryCount;
}
if (m_cm256.cm256_decode(paramsCM256, m_cm256DescriptorBlocks)) // CM256 decode
{
qWarning() << "SDRDaemonChannelSource::handleDataBlock: decode CM256 error:"
@ -315,3 +330,86 @@ uint32_t SDRDaemonChannelSource::calculateDataReadQueueSize(int sampleRate)
qDebug("SDRDaemonChannelSource::calculateDataReadQueueSize: set max queue size to %u blocks", maxSize);
return maxSize;
}
int SDRDaemonChannelSource::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused)))
{
response.setSdrDaemonChannelSourceSettings(new SWGSDRangel::SWGSDRDaemonChannelSourceSettings());
response.getSdrDaemonChannelSourceSettings()->init();
webapiFormatChannelSettings(response, m_settings);
return 200;
}
int SDRDaemonChannelSource::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused)))
{
SDRDaemonChannelSourceSettings settings = m_settings;
if (channelSettingsKeys.contains("dataAddress")) {
settings.m_dataAddress = *response.getSdrDaemonChannelSourceSettings()->getDataAddress();
}
if (channelSettingsKeys.contains("dataPort"))
{
int dataPort = response.getSdrDaemonChannelSourceSettings()->getDataPort();
if ((dataPort < 1024) || (dataPort > 65535)) {
settings.m_dataPort = 9090;
} else {
settings.m_dataPort = dataPort;
}
}
MsgConfigureSDRDaemonChannelSource *msg = MsgConfigureSDRDaemonChannelSource::create(settings, force);
m_inputMessageQueue.push(msg);
qDebug("SDRDaemonChannelSource::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureSDRDaemonChannelSource *msgToGUI = MsgConfigureSDRDaemonChannelSource::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatChannelSettings(response, settings);
return 200;
}
int SDRDaemonChannelSource::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage __attribute__((unused)))
{
response.setSdrDaemonChannelSourceReport(new SWGSDRangel::SWGSDRDaemonChannelSourceReport());
response.getSdrDaemonChannelSourceReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void SDRDaemonChannelSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const SDRDaemonChannelSourceSettings& settings)
{
if (response.getSdrDaemonChannelSourceSettings()->getDataAddress()) {
*response.getSdrDaemonChannelSourceSettings()->getDataAddress() = settings.m_dataAddress;
} else {
response.getSdrDaemonChannelSourceSettings()->setDataAddress(new QString(settings.m_dataAddress));
}
response.getSdrDaemonChannelSourceSettings()->setDataPort(settings.m_dataPort);
}
void SDRDaemonChannelSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
struct timeval tv;
gettimeofday(&tv, 0);
response.getSdrDaemonChannelSourceReport()->setTvSec(tv.tv_sec);
response.getSdrDaemonChannelSourceReport()->setTvUSec(tv.tv_usec);
response.getSdrDaemonChannelSourceReport()->setQueueSize(m_dataReadQueue.size());
response.getSdrDaemonChannelSourceReport()->setQueueLength(m_dataReadQueue.length());
response.getSdrDaemonChannelSourceReport()->setSamplesCount(m_dataReadQueue.readSampleCount());
response.getSdrDaemonChannelSourceReport()->setCorrectableErrorsCount(m_nbCorrectableErrors);
response.getSdrDaemonChannelSourceReport()->setUncorrectableErrorsCount(m_nbUncorrectableErrors);
}

View File

@ -80,6 +80,20 @@ public:
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
void setDataLink(const QString& dataAddress, uint16_t dataPort);
static const QString m_channelIdURI;
@ -103,10 +117,15 @@ private:
SDRDaemonDataReadQueue m_dataReadQueue;
uint32_t m_nbCorrectableErrors; //!< count of correctable errors in number of blocks
uint32_t m_nbUncorrectableErrors; //!< count of uncorrectable errors in number of blocks
void applySettings(const SDRDaemonChannelSourceSettings& settings, bool force = false);
void handleDataBlock(SDRDaemonDataBlock *dataBlock);
void printMeta(const QString& header, SDRDaemonMetaDataFEC *metaData);
uint32_t calculateDataReadQueueSize(int sampleRate);
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const SDRDaemonChannelSourceSettings& settings);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
private slots:
void handleData();

View File

@ -30,6 +30,7 @@ SDRDaemonDataReadQueue::SDRDaemonDataReadQueue() :
m_maxSize(MinimumMaxSize),
m_blockIndex(1),
m_sampleIndex(0),
m_sampleCount(0),
m_full(false)
{}
@ -46,7 +47,7 @@ SDRDaemonDataReadQueue::~SDRDaemonDataReadQueue()
void SDRDaemonDataReadQueue::push(SDRDaemonDataBlock* dataBlock)
{
if (size() >= m_maxSize)
if (length() >= m_maxSize)
{
qWarning("SDRDaemonDataReadQueue::push: queue is full");
m_full = true; // stop filling the queue
@ -55,7 +56,7 @@ void SDRDaemonDataReadQueue::push(SDRDaemonDataBlock* dataBlock)
}
if (m_full) {
m_full = (size() > m_maxSize/2); // do not fill queue again before queue is half size
m_full = (length() > m_maxSize/2); // do not fill queue again before queue is half size
}
if (!m_full) {
@ -78,11 +79,6 @@ SDRDaemonDataBlock* SDRDaemonDataReadQueue::pop()
}
}
uint32_t SDRDaemonDataReadQueue::size() const
{
return m_dataReadQueue.size();
}
void SDRDaemonDataReadQueue::setSize(uint32_t size)
{
if (size != m_maxSize) {
@ -95,13 +91,14 @@ void SDRDaemonDataReadQueue::readSample(Sample& s)
// depletion/repletion state
if (m_dataBlock == 0)
{
if (size() >= m_maxSize/2)
if (length() >= m_maxSize/2)
{
qDebug("SDRDaemonDataReadQueue::readSample: initial pop new block: queue size: %u", size());
qDebug("SDRDaemonDataReadQueue::readSample: initial pop new block: queue size: %u", length());
m_blockIndex = 1;
m_dataBlock = m_dataReadQueue.takeFirst();
s = m_dataBlock->m_superBlocks[m_blockIndex].m_protectedBlock.m_samples[m_sampleIndex];
m_sampleIndex++;
m_sampleCount++;
}
else
{
@ -115,6 +112,7 @@ void SDRDaemonDataReadQueue::readSample(Sample& s)
{
s = m_dataBlock->m_superBlocks[m_blockIndex].m_protectedBlock.m_samples[m_sampleIndex];
m_sampleIndex++;
m_sampleCount++;
}
else
{
@ -125,6 +123,7 @@ void SDRDaemonDataReadQueue::readSample(Sample& s)
{
s = m_dataBlock->m_superBlocks[m_blockIndex].m_protectedBlock.m_samples[m_sampleIndex];
m_sampleIndex++;
m_sampleCount++;
}
else
{
@ -133,18 +132,19 @@ void SDRDaemonDataReadQueue::readSample(Sample& s)
delete m_dataBlock;
m_dataBlock = 0;
if (size() == 0) {
if (length() == 0) {
qWarning("SDRDaemonDataReadQueue::readSample: try to pop new block but queue is empty");
}
}
if (size() > 0)
if (length() > 0)
{
qDebug("SDRDaemonDataReadQueue::readSample: pop new block: queue size: %u", size());
//qDebug("SDRDaemonDataReadQueue::readSample: pop new block: queue size: %u", length());
m_blockIndex = 1;
m_dataBlock = m_dataReadQueue.takeFirst();
s = m_dataBlock->m_superBlocks[m_blockIndex].m_protectedBlock.m_samples[m_sampleIndex];
m_sampleIndex++;
m_sampleCount++;
}
else
{

View File

@ -37,8 +37,10 @@ public:
void push(SDRDaemonDataBlock* dataBlock); //!< push block on the queue
SDRDaemonDataBlock* pop(); //!< Pop block from the queue
void readSample(Sample& s); //!< Read sample from queue
uint32_t size() const; //!< Returns queue size
void setSize(uint32_t size); //!< Sets the queue size
uint32_t length() const { return m_dataReadQueue.size(); } //!< Returns queue length
uint32_t size() const { return m_maxSize; } //!< Returns queue size (max length)
void setSize(uint32_t size); //!< Sets the queue size (max length)
uint32_t readSampleCount() const { return m_sampleCount; } //!< Returns the absolute number of samples read
static const uint32_t MinimumMaxSize;
@ -48,6 +50,7 @@ private:
uint32_t m_maxSize;
uint32_t m_blockIndex;
uint32_t m_sampleIndex;
uint32_t m_sampleCount;
bool m_full; //!< full condition was hit
};

View File

@ -23,6 +23,7 @@
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
#include "SWGDeviceReport.h"
#include "SWGChannelReport.h"
#include "SWGChannelSettings.h"
#include "SWGErrorResponse.h"
@ -44,6 +45,7 @@ QString WebAPIAdapterDaemon::daemonInstanceLoggingURL = "/sdrdaemon/logging";
QString WebAPIAdapterDaemon::daemonChannelSettingsURL = "/sdrdaemon/channel/settings";
QString WebAPIAdapterDaemon::daemonDeviceSettingsURL = "/sdrdaemon/device/settings";
QString WebAPIAdapterDaemon::daemonDeviceReportURL = "/sdrdaemon/device/report";
QString WebAPIAdapterDaemon::daemonChannelReportURL = "/sdrdaemon/channel/report";
QString WebAPIAdapterDaemon::daemonRunURL = "/sdrdaemon/run";
WebAPIAdapterDaemon::WebAPIAdapterDaemon(SDRDaemonMain& sdrDaemonMain) :
@ -179,7 +181,7 @@ int WebAPIAdapterDaemon::daemonInstanceLoggingPut(
}
int WebAPIAdapterDaemon::daemonChannelSettingsGet(
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
SWGSDRangel::SWGChannelSettings& response,
SWGSDRangel::SWGErrorResponse& error)
{
error.init();
@ -226,9 +228,9 @@ int WebAPIAdapterDaemon::daemonChannelSettingsGet(
}
int WebAPIAdapterDaemon::daemonChannelSettingsPutPatch(
bool force __attribute__((unused)),
const QStringList& channelSettingsKeys __attribute__((unused)),
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
SWGSDRangel::SWGErrorResponse& error)
{
error.init();
@ -443,7 +445,7 @@ int WebAPIAdapterDaemon::daemonRunDelete(
}
}
int WebAPIAdapterDaemon::daemonReportGet(
int WebAPIAdapterDaemon::daemonDeviceReportGet(
SWGSDRangel::SWGDeviceReport& response,
SWGSDRangel::SWGErrorResponse& error)
{
@ -470,6 +472,54 @@ int WebAPIAdapterDaemon::daemonReportGet(
}
}
int WebAPIAdapterDaemon::daemonChannelReportGet(
SWGSDRangel::SWGChannelReport& response,
SWGSDRangel::SWGErrorResponse& error)
{
error.init();
if (m_sdrDaemonMain.m_deviceSourceEngine) // Rx
{
ChannelSinkAPI *channelAPI = m_sdrDaemonMain.m_deviceSourceAPI->getChanelAPIAt(0);
if (channelAPI == 0)
{
*error.getMessage() = QString("There is no channel");
return 500; // a SDRDaemon sink channel should have been created so this is a server error
}
else
{
response.setChannelType(new QString());
channelAPI->getIdentifier(*response.getChannelType());
response.setTx(0);
return channelAPI->webapiReportGet(response, *error.getMessage());
}
}
else if (m_sdrDaemonMain.m_deviceSinkEngine) // Tx
{
ChannelSourceAPI *channelAPI = m_sdrDaemonMain.m_deviceSinkAPI->getChanelAPIAt(0);
if (channelAPI == 0)
{
*error.getMessage() = QString("There is no channel");
return 500; // a SDRDaemon source channel should have been created so this is a server error
}
else
{
response.setChannelType(new QString());
channelAPI->getIdentifier(*response.getChannelType());
response.setTx(1);
return channelAPI->webapiReportGet(response, *error.getMessage());
}
}
else
{
*error.getMessage() = QString("Device not created error");
return 500;
}
}
// TODO: put in library in common with SDRangel. Can be static.
QtMsgType WebAPIAdapterDaemon::getMsgTypeFromString(const QString& msgTypeString)
{

View File

@ -30,6 +30,7 @@ namespace SWGSDRangel
class SWGDeviceSettings;
class SWGDeviceState;
class SWGDeviceReport;
class SWGChannelReport;
class SWGSuccessResponse;
class SWGErrorResponse;
class SWGLoggingInfo;
@ -89,15 +90,20 @@ public:
SWGSDRangel::SWGDeviceState& response,
SWGSDRangel::SWGErrorResponse& error);
int daemonReportGet(
int daemonDeviceReportGet(
SWGSDRangel::SWGDeviceReport& response,
SWGSDRangel::SWGErrorResponse& error);
int daemonChannelReportGet(
SWGSDRangel::SWGChannelReport& response,
SWGSDRangel::SWGErrorResponse& error);
static QString daemonInstanceSummaryURL;
static QString daemonInstanceLoggingURL;
static QString daemonChannelSettingsURL;
static QString daemonDeviceSettingsURL;
static QString daemonDeviceReportURL;
static QString daemonChannelReportURL;
static QString daemonRunURL;
private:

View File

@ -27,6 +27,7 @@
#include "SWGDaemonSummaryResponse.h"
#include "SWGInstanceDevicesResponse.h"
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
#include "SWGDeviceReport.h"
@ -98,6 +99,8 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
daemonInstanceLoggingService(request, response);
} else if (path == WebAPIAdapterDaemon::daemonChannelSettingsURL) {
daemonChannelSettingsService(request, response);
} else if (path == WebAPIAdapterDaemon::daemonChannelReportURL) {
daemonChannelReportService(request, response);
} else if (path == WebAPIAdapterDaemon::daemonDeviceSettingsURL) {
daemonDeviceSettingsService(request, response);
} else if (path == WebAPIAdapterDaemon::daemonDeviceReportURL) {
@ -261,6 +264,29 @@ void WebAPIRequestMapper::daemonChannelSettingsService(qtwebapp::HttpRequest& re
}
}
void WebAPIRequestMapper::daemonChannelReportService(
qtwebapp::HttpRequest& request,
qtwebapp::HttpResponse& response)
{
SWGSDRangel::SWGErrorResponse errorResponse;
response.setHeader("Content-Type", "application/json");
response.setHeader("Access-Control-Allow-Origin", "*");
if (request.getMethod() == "GET")
{
SWGSDRangel::SWGChannelReport normalResponse;
resetChannelReport(normalResponse);
int status = m_adapter->daemonChannelReportGet(normalResponse, errorResponse);
response.setStatus(status);
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
}
}
}
void WebAPIRequestMapper::daemonDeviceSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response)
{
SWGSDRangel::SWGErrorResponse errorResponse;
@ -341,7 +367,7 @@ void WebAPIRequestMapper::daemonDeviceReportService(qtwebapp::HttpRequest& reque
{
SWGSDRangel::SWGDeviceReport normalResponse;
resetDeviceReport(normalResponse);
int status = m_adapter->daemonReportGet(normalResponse, errorResponse);
int status = m_adapter->daemonDeviceReportGet(normalResponse, errorResponse);
response.setStatus(status);
if (status/100 == 2) {
@ -992,6 +1018,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setNfmDemodSettings(0);
channelSettings.setNfmModSettings(0);
channelSettings.setSdrDaemonChannelSinkSettings(0);
channelSettings.setSdrDaemonChannelSourceSettings(0);
channelSettings.setSsbDemodSettings(0);
channelSettings.setSsbModSettings(0);
channelSettings.setUdpSinkSettings(0);
@ -1000,6 +1027,26 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setWfmModSettings(0);
}
void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& channelReport)
{
channelReport.cleanup();
channelReport.setChannelType(0);
channelReport.setAmDemodReport(0);
channelReport.setAmModReport(0);
channelReport.setAtvModReport(0);
channelReport.setBfmDemodReport(0);
channelReport.setDsdDemodReport(0);
channelReport.setNfmDemodReport(0);
channelReport.setNfmModReport(0);
channelReport.setSdrDaemonChannelSourceReport(0);
channelReport.setSsbDemodReport(0);
channelReport.setSsbModReport(0);
channelReport.setUdpSinkReport(0);
channelReport.setUdpSrcReport(0);
channelReport.setWfmDemodReport(0);
channelReport.setWfmModReport(0);
}
// TODO: put in library in common with SDRangel. Can be static.
void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings)
{

View File

@ -31,6 +31,7 @@
namespace SWGSDRangel
{
class SWGChannelSettings;
class SWGChannelReport;
class SWGDeviceSettings;
class SWGDeviceReport;
}
@ -58,6 +59,7 @@ private:
void daemonDeviceSettingsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
void daemonRunService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
void daemonDeviceReportService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
void daemonChannelReportService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response);
bool validateChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings, QJsonObject& jsonObject, QStringList& channelSettingsKeys);
bool validateDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings, QJsonObject& jsonObject, QStringList& deviceSettingsKeys);
@ -71,6 +73,7 @@ private:
bool parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response);
void resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings);
void resetChannelReport(SWGSDRangel::SWGChannelReport& deviceSettings);
void resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings);
void resetDeviceReport(SWGSDRangel::SWGDeviceReport& deviceReport);
};

View File

@ -0,0 +1,34 @@
SDRDaemonChannelSourceSettings:
description: "Data handling details for SDRDaemon"
properties:
dataAddress:
description: "Remote USB data address"
type: string
dataPort:
description: "Remote USB data port"
type: integer
SDRDaemonChannelSourceReport:
description: "SDRDaemon channel source report"
properties:
queueLength:
description: "Data read/write queue length in number of data frames"
type: integer
queueSize:
description: "Data read/write queue size in number of data frames"
type: integer
samplesCount:
description: "Absolute consumed samples count"
type: integer
correctableErrorsCount:
description: "Absolute number of correctable errors"
type: integer
uncorrectableErrorsCount:
description: "Absolute number of uncorrectable errors"
type: integer
tvSec:
description: "Counts timestamp seconds"
type: integer
tvUSec:
description: "Counts timestamp microseconds"
type: integer

View File

@ -1299,7 +1299,7 @@ paths:
$ref: "#/responses/Response_501"
/sdrdaemon/channel/settings:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: Get channel handling details
operationId: daemonChannelSettingsGet
@ -1360,7 +1360,7 @@ paths:
/sdrdaemon/device/settings:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: Get device settings
operationId: daemonDeviceSettingsGet
@ -1431,7 +1431,7 @@ paths:
$ref: "#/responses/Response_501"
/sdrdaemon/run:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: get device run status
operationId: daemonRunGet
@ -1500,7 +1500,7 @@ paths:
$ref: "#/responses/Response_501"
/sdrdaemon/device/report:
x-swagger-router-controller: deviceset
x-swagger-router-controller: daemon
get:
description: get the device report
operationId: daemonDeviceReportGet
@ -1524,6 +1524,30 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/channel/report:
x-swagger-router-controller: daemon
get:
description: get the channel report
operationId: daemonChannelReportGet
tags:
- Daemon
responses:
"200":
description: On success return channel report
schema:
$ref: "#/definitions/ChannelReport"
"400":
description: Invalid device set or channel index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device or channel not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/swagger:
x-swagger-pipe: swagger_raw
@ -2196,6 +2220,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/NFMMod.yaml#/NFMModSettings"
SDRDaemonChannelSinkSettings:
$ref: "http://localhost:8081/api/swagger/include/SDRDaemonChannelSink.yaml#/SDRDaemonChannelSinkSettings"
SDRDaemonChannelSourceSettings:
$ref: "http://localhost:8081/api/swagger/include/SDRDaemonChannelSource.yaml#/SDRDaemonChannelSourceSettings"
SSBModSettings:
$ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModSettings"
SSBDemodSettings:
@ -2235,6 +2261,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/NFMMod.yaml#/NFMModReport"
SSBDemodReport:
$ref: "http://localhost:8081/api/swagger/include/SSBDemod.yaml#/SSBDemodReport"
SDRDaemonChannelSourceReport:
$ref: "http://localhost:8081/api/swagger/include/SDRDaemonChannelSource.yaml#/SDRDaemonChannelSourceReport"
SSBModReport:
$ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModReport"
UDPSinkReport:

View File

@ -1416,6 +1416,9 @@ margin-bottom: 20px;
"SSBDemodReport" : {
"$ref" : "#/definitions/SSBDemodReport"
},
"SDRDaemonChannelSourceReport" : {
"$ref" : "#/definitions/SDRDaemonChannelSourceReport"
},
"SSBModReport" : {
"$ref" : "#/definitions/SSBModReport"
},
@ -1470,6 +1473,9 @@ margin-bottom: 20px;
"SDRDaemonChannelSinkSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSinkSettings"
},
"SDRDaemonChannelSourceSettings" : {
"$ref" : "#/definitions/SDRDaemonChannelSourceSettings"
},
"SSBModSettings" : {
"$ref" : "#/definitions/SSBModSettings"
},
@ -3166,6 +3172,52 @@ margin-bottom: 20px;
}
},
"description" : "Data handling details for SDRDaemon"
};
defs.SDRDaemonChannelSourceReport = {
"properties" : {
"queueLength" : {
"type" : "integer",
"description" : "Data read/write queue length in number of data frames"
},
"queueSize" : {
"type" : "integer",
"description" : "Data read/write queue size in number of data frames"
},
"samplesCount" : {
"type" : "integer",
"description" : "Absolute consumed samples count"
},
"correctableErrorsCount" : {
"type" : "integer",
"description" : "Absolute number of correctable errors"
},
"uncorrectableErrorsCount" : {
"type" : "integer",
"description" : "Absolute number of uncorrectable errors"
},
"tvSec" : {
"type" : "integer",
"description" : "Counts timestamp seconds"
},
"tvUSec" : {
"type" : "integer",
"description" : "Counts timestamp microseconds"
}
},
"description" : "SDRDaemon channel source report"
};
defs.SDRDaemonChannelSourceSettings = {
"properties" : {
"dataAddress" : {
"type" : "string",
"description" : "Remote USB data address"
},
"dataPort" : {
"type" : "integer",
"description" : "Remote USB data port"
}
},
"description" : "Data handling details for SDRDaemon"
};
defs.SDRPlayReport = {
"properties" : {
@ -4024,6 +4076,9 @@ margin-bottom: 20px;
<li class="nav-fixed nav-header active" data-group="_"><a href="#api-_">API Summary</a></li>
<li class="nav-header" data-group="Daemon"><a href="#api-Daemon">API Methods - Daemon</a></li>
<li data-group="Daemon" data-name="daemonChannelReportGet" class="">
<a href="#api-Daemon-daemonChannelReportGet">daemonChannelReportGet</a>
</li>
<li data-group="Daemon" data-name="daemonChannelSettingsGet" class="">
<a href="#api-Daemon-daemonChannelSettingsGet">daemonChannelSettingsGet</a>
</li>
@ -4230,6 +4285,427 @@ margin-bottom: 20px;
<div id="sections">
<section id="api-Daemon">
<h1>Daemon</h1>
<div id="api-Daemon-daemonChannelReportGet">
<article id="api-Daemon-daemonChannelReportGet-0" data-group="User" data-name="daemonChannelReportGet" data-version="0">
<div class="pull-left">
<h1>daemonChannelReportGet</h1>
<p></p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
<p></p>
<p class="marked">get the channel report</p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/sdrdaemon/channel/report</span></code></pre>
<p>
<h3>Usage and SDK Samples</h3>
</p>
<ul class="nav nav-tabs nav-tabs-examples">
<li class="active"><a href="#examples-Daemon-daemonChannelReportGet-0-curl">Curl</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-java">Java</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-csharp">C#</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-php">PHP</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-perl">Perl</a></li>
<li class=""><a href="#examples-Daemon-daemonChannelReportGet-0-python">Python</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="examples-Daemon-daemonChannelReportGet-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/sdrdaemon/channel/report"</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-java">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
import SWGSDRangel.auth.*;
import SWGSDRangel.model.*;
import SWGSDRangel.api.DaemonApi;
import java.io.File;
import java.util.*;
public class DaemonApiExample {
public static void main(String[] args) {
DaemonApi apiInstance = new DaemonApi();
try {
ChannelReport result = apiInstance.daemonChannelReportGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DaemonApi#daemonChannelReportGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-android">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.DaemonApi;
public class DaemonApiExample {
public static void main(String[] args) {
DaemonApi apiInstance = new DaemonApi();
try {
ChannelReport result = apiInstance.daemonChannelReportGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DaemonApi#daemonChannelReportGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<!--
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-groovy">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div> -->
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-objc">
<pre class="prettyprint"><code class="language-cpp">
DaemonApi *apiInstance = [[DaemonApi alloc] init];
[apiInstance daemonChannelReportGetWithCompletionHandler:
^(ChannelReport output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-javascript">
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
var api = new SdRangel.DaemonApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.daemonChannelReportGet(callback);
</code></pre>
</div>
<!--<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-angular">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div>-->
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-csharp">
<pre class="prettyprint"><code class="language-cs">using System;
using System.Diagnostics;
using SWGSDRangel.Api;
using SWGSDRangel.Client;
using SWGSDRangel.Model;
namespace Example
{
public class daemonChannelReportGetExample
{
public void main()
{
var apiInstance = new DaemonApi();
try
{
ChannelReport result = apiInstance.daemonChannelReportGet();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DaemonApi.daemonChannelReportGet: " + e.Message );
}
}
}
}
</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-php">
<pre class="prettyprint"><code class="language-php"><&#63;php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DaemonApi();
try {
$result = $api_instance->daemonChannelReportGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DaemonApi->daemonChannelReportGet: ', $e->getMessage(), PHP_EOL;
}
?></code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-perl">
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
use SWGSDRangel::Configuration;
use SWGSDRangel::DaemonApi;
my $api_instance = SWGSDRangel::DaemonApi->new();
eval {
my $result = $api_instance->daemonChannelReportGet();
print Dumper($result);
};
if ($@) {
warn "Exception when calling DaemonApi->daemonChannelReportGet: $@\n";
}</code></pre>
</div>
<div class="tab-pane" id="examples-Daemon-daemonChannelReportGet-0-python">
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
import time
import swagger_sdrangel
from swagger_sdrangel.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_sdrangel.DaemonApi()
try:
api_response = api_instance.daemon_channel_report_get()
pprint(api_response)
except ApiException as e:
print("Exception when calling DaemonApi->daemonChannelReportGet: %s\n" % e)</code></pre>
</div>
</div>
<h2>Parameters</h2>
<h2>Responses</h2>
<h3> Status: 200 - On success return channel report </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-200-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-200-schema">
<div id='responses-daemonChannelReportGet-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return channel report",
"schema" : {
"$ref" : "#/definitions/ChannelReport"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-200-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-200-schema-200');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-200-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 400 - Invalid device set or channel index </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-400-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-400-schema">
<div id='responses-daemonChannelReportGet-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Invalid device set or channel index",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-400-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-400-schema-400');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-400-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 404 - Device or channel not found </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-404-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-404-schema">
<div id='responses-daemonChannelReportGet-404-schema-404' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Device or channel not found",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-404-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-404-schema-404');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-404-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 500 - Error </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-500-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-500-schema">
<div id='responses-daemonChannelReportGet-500-schema-500' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Error",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-500-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-500-schema-500');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-500-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 501 - Function not implemented </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-daemonChannelReportGet-501-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-daemonChannelReportGet-501-schema">
<div id='responses-daemonChannelReportGet-501-schema-501' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "Function not implemented",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-daemonChannelReportGet-501-schema-data').val(stringify(schema));
var result = $('#responses-daemonChannelReportGet-501-schema-501');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-daemonChannelReportGet-501-schema-data' type='hidden' value=''></input>
</div>
</div>
</article>
</div>
<hr>
<div id="api-Daemon-daemonChannelSettingsGet">
<article id="api-Daemon-daemonChannelSettingsGet-0" data-group="User" data-name="daemonChannelSettingsGet" data-version="0">
<div class="pull-left">
@ -28212,7 +28688,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-08-29T15:59:39.880+02:00
Generated 2018-08-30T01:40:47.594+02:00
</div>
</div>
</div>

View File

@ -48,6 +48,8 @@ SWGChannelReport::SWGChannelReport() {
m_nfm_mod_report_isSet = false;
ssb_demod_report = nullptr;
m_ssb_demod_report_isSet = false;
sdr_daemon_channel_source_report = nullptr;
m_sdr_daemon_channel_source_report_isSet = false;
ssb_mod_report = nullptr;
m_ssb_mod_report_isSet = false;
udp_sink_report = nullptr;
@ -86,6 +88,8 @@ SWGChannelReport::init() {
m_nfm_mod_report_isSet = false;
ssb_demod_report = new SWGSSBDemodReport();
m_ssb_demod_report_isSet = false;
sdr_daemon_channel_source_report = new SWGSDRDaemonChannelSourceReport();
m_sdr_daemon_channel_source_report_isSet = false;
ssb_mod_report = new SWGSSBModReport();
m_ssb_mod_report_isSet = false;
udp_sink_report = new SWGUDPSinkReport();
@ -128,6 +132,9 @@ SWGChannelReport::cleanup() {
if(ssb_demod_report != nullptr) {
delete ssb_demod_report;
}
if(sdr_daemon_channel_source_report != nullptr) {
delete sdr_daemon_channel_source_report;
}
if(ssb_mod_report != nullptr) {
delete ssb_mod_report;
}
@ -176,6 +183,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&ssb_demod_report, pJson["SSBDemodReport"], "SWGSSBDemodReport", "SWGSSBDemodReport");
::SWGSDRangel::setValue(&sdr_daemon_channel_source_report, pJson["SDRDaemonChannelSourceReport"], "SWGSDRDaemonChannelSourceReport", "SWGSDRDaemonChannelSourceReport");
::SWGSDRangel::setValue(&ssb_mod_report, pJson["SSBModReport"], "SWGSSBModReport", "SWGSSBModReport");
::SWGSDRangel::setValue(&udp_sink_report, pJson["UDPSinkReport"], "SWGUDPSinkReport", "SWGUDPSinkReport");
@ -232,6 +241,9 @@ SWGChannelReport::asJsonObject() {
if((ssb_demod_report != nullptr) && (ssb_demod_report->isSet())){
toJsonValue(QString("SSBDemodReport"), ssb_demod_report, obj, QString("SWGSSBDemodReport"));
}
if((sdr_daemon_channel_source_report != nullptr) && (sdr_daemon_channel_source_report->isSet())){
toJsonValue(QString("SDRDaemonChannelSourceReport"), sdr_daemon_channel_source_report, obj, QString("SWGSDRDaemonChannelSourceReport"));
}
if((ssb_mod_report != nullptr) && (ssb_mod_report->isSet())){
toJsonValue(QString("SSBModReport"), ssb_mod_report, obj, QString("SWGSSBModReport"));
}
@ -351,6 +363,16 @@ SWGChannelReport::setSsbDemodReport(SWGSSBDemodReport* ssb_demod_report) {
this->m_ssb_demod_report_isSet = true;
}
SWGSDRDaemonChannelSourceReport*
SWGChannelReport::getSdrDaemonChannelSourceReport() {
return sdr_daemon_channel_source_report;
}
void
SWGChannelReport::setSdrDaemonChannelSourceReport(SWGSDRDaemonChannelSourceReport* sdr_daemon_channel_source_report) {
this->sdr_daemon_channel_source_report = sdr_daemon_channel_source_report;
this->m_sdr_daemon_channel_source_report_isSet = true;
}
SWGSSBModReport*
SWGChannelReport::getSsbModReport() {
return ssb_mod_report;
@ -416,6 +438,7 @@ SWGChannelReport::isSet(){
if(nfm_demod_report != nullptr && nfm_demod_report->isSet()){ isObjectUpdated = true; break;}
if(nfm_mod_report != nullptr && nfm_mod_report->isSet()){ isObjectUpdated = true; break;}
if(ssb_demod_report != nullptr && ssb_demod_report->isSet()){ isObjectUpdated = true; break;}
if(sdr_daemon_channel_source_report != nullptr && sdr_daemon_channel_source_report->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_report != nullptr && ssb_mod_report->isSet()){ isObjectUpdated = true; break;}
if(udp_sink_report != nullptr && udp_sink_report->isSet()){ isObjectUpdated = true; break;}
if(udp_src_report != nullptr && udp_src_report->isSet()){ isObjectUpdated = true; break;}

View File

@ -29,6 +29,7 @@
#include "SWGDSDDemodReport.h"
#include "SWGNFMDemodReport.h"
#include "SWGNFMModReport.h"
#include "SWGSDRDaemonChannelSourceReport.h"
#include "SWGSSBDemodReport.h"
#include "SWGSSBModReport.h"
#include "SWGUDPSinkReport.h"
@ -85,6 +86,9 @@ public:
SWGSSBDemodReport* getSsbDemodReport();
void setSsbDemodReport(SWGSSBDemodReport* ssb_demod_report);
SWGSDRDaemonChannelSourceReport* getSdrDaemonChannelSourceReport();
void setSdrDaemonChannelSourceReport(SWGSDRDaemonChannelSourceReport* sdr_daemon_channel_source_report);
SWGSSBModReport* getSsbModReport();
void setSsbModReport(SWGSSBModReport* ssb_mod_report);
@ -134,6 +138,9 @@ private:
SWGSSBDemodReport* ssb_demod_report;
bool m_ssb_demod_report_isSet;
SWGSDRDaemonChannelSourceReport* sdr_daemon_channel_source_report;
bool m_sdr_daemon_channel_source_report_isSet;
SWGSSBModReport* ssb_mod_report;
bool m_ssb_mod_report_isSet;

View File

@ -48,6 +48,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_nfm_mod_settings_isSet = false;
sdr_daemon_channel_sink_settings = nullptr;
m_sdr_daemon_channel_sink_settings_isSet = false;
sdr_daemon_channel_source_settings = nullptr;
m_sdr_daemon_channel_source_settings_isSet = false;
ssb_mod_settings = nullptr;
m_ssb_mod_settings_isSet = false;
ssb_demod_settings = nullptr;
@ -88,6 +90,8 @@ SWGChannelSettings::init() {
m_nfm_mod_settings_isSet = false;
sdr_daemon_channel_sink_settings = new SWGSDRDaemonChannelSinkSettings();
m_sdr_daemon_channel_sink_settings_isSet = false;
sdr_daemon_channel_source_settings = new SWGSDRDaemonChannelSourceSettings();
m_sdr_daemon_channel_source_settings_isSet = false;
ssb_mod_settings = new SWGSSBModSettings();
m_ssb_mod_settings_isSet = false;
ssb_demod_settings = new SWGSSBDemodSettings();
@ -132,6 +136,9 @@ SWGChannelSettings::cleanup() {
if(sdr_daemon_channel_sink_settings != nullptr) {
delete sdr_daemon_channel_sink_settings;
}
if(sdr_daemon_channel_source_settings != nullptr) {
delete sdr_daemon_channel_source_settings;
}
if(ssb_mod_settings != nullptr) {
delete ssb_mod_settings;
}
@ -183,6 +190,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&sdr_daemon_channel_sink_settings, pJson["SDRDaemonChannelSinkSettings"], "SWGSDRDaemonChannelSinkSettings", "SWGSDRDaemonChannelSinkSettings");
::SWGSDRangel::setValue(&sdr_daemon_channel_source_settings, pJson["SDRDaemonChannelSourceSettings"], "SWGSDRDaemonChannelSourceSettings", "SWGSDRDaemonChannelSourceSettings");
::SWGSDRangel::setValue(&ssb_mod_settings, pJson["SSBModSettings"], "SWGSSBModSettings", "SWGSSBModSettings");
::SWGSDRangel::setValue(&ssb_demod_settings, pJson["SSBDemodSettings"], "SWGSSBDemodSettings", "SWGSSBDemodSettings");
@ -241,6 +250,9 @@ SWGChannelSettings::asJsonObject() {
if((sdr_daemon_channel_sink_settings != nullptr) && (sdr_daemon_channel_sink_settings->isSet())){
toJsonValue(QString("SDRDaemonChannelSinkSettings"), sdr_daemon_channel_sink_settings, obj, QString("SWGSDRDaemonChannelSinkSettings"));
}
if((sdr_daemon_channel_source_settings != nullptr) && (sdr_daemon_channel_source_settings->isSet())){
toJsonValue(QString("SDRDaemonChannelSourceSettings"), sdr_daemon_channel_source_settings, obj, QString("SWGSDRDaemonChannelSourceSettings"));
}
if((ssb_mod_settings != nullptr) && (ssb_mod_settings->isSet())){
toJsonValue(QString("SSBModSettings"), ssb_mod_settings, obj, QString("SWGSSBModSettings"));
}
@ -363,6 +375,16 @@ SWGChannelSettings::setSdrDaemonChannelSinkSettings(SWGSDRDaemonChannelSinkSetti
this->m_sdr_daemon_channel_sink_settings_isSet = true;
}
SWGSDRDaemonChannelSourceSettings*
SWGChannelSettings::getSdrDaemonChannelSourceSettings() {
return sdr_daemon_channel_source_settings;
}
void
SWGChannelSettings::setSdrDaemonChannelSourceSettings(SWGSDRDaemonChannelSourceSettings* sdr_daemon_channel_source_settings) {
this->sdr_daemon_channel_source_settings = sdr_daemon_channel_source_settings;
this->m_sdr_daemon_channel_source_settings_isSet = true;
}
SWGSSBModSettings*
SWGChannelSettings::getSsbModSettings() {
return ssb_mod_settings;
@ -438,6 +460,7 @@ SWGChannelSettings::isSet(){
if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(sdr_daemon_channel_sink_settings != nullptr && sdr_daemon_channel_sink_settings->isSet()){ isObjectUpdated = true; break;}
if(sdr_daemon_channel_source_settings != nullptr && sdr_daemon_channel_source_settings->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_settings != nullptr && ssb_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(ssb_demod_settings != nullptr && ssb_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(udp_sink_settings != nullptr && udp_sink_settings->isSet()){ isObjectUpdated = true; break;}

View File

@ -30,6 +30,7 @@
#include "SWGNFMDemodSettings.h"
#include "SWGNFMModSettings.h"
#include "SWGSDRDaemonChannelSinkSettings.h"
#include "SWGSDRDaemonChannelSourceSettings.h"
#include "SWGSSBDemodSettings.h"
#include "SWGSSBModSettings.h"
#include "SWGUDPSinkSettings.h"
@ -86,6 +87,9 @@ public:
SWGSDRDaemonChannelSinkSettings* getSdrDaemonChannelSinkSettings();
void setSdrDaemonChannelSinkSettings(SWGSDRDaemonChannelSinkSettings* sdr_daemon_channel_sink_settings);
SWGSDRDaemonChannelSourceSettings* getSdrDaemonChannelSourceSettings();
void setSdrDaemonChannelSourceSettings(SWGSDRDaemonChannelSourceSettings* sdr_daemon_channel_source_settings);
SWGSSBModSettings* getSsbModSettings();
void setSsbModSettings(SWGSSBModSettings* ssb_mod_settings);
@ -138,6 +142,9 @@ private:
SWGSDRDaemonChannelSinkSettings* sdr_daemon_channel_sink_settings;
bool m_sdr_daemon_channel_sink_settings_isSet;
SWGSDRDaemonChannelSourceSettings* sdr_daemon_channel_source_settings;
bool m_sdr_daemon_channel_source_settings_isSet;
SWGSSBModSettings* ssb_mod_settings;
bool m_ssb_mod_settings_isSet;

View File

@ -28,6 +28,58 @@ SWGDaemonApi::SWGDaemonApi(QString host, QString basePath) {
this->basePath = basePath;
}
void
SWGDaemonApi::daemonChannelReportGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/report");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "GET");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonChannelReportGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonChannelReportGetCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGChannelReport* output = static_cast<SWGChannelReport*>(create(json, QString("SWGChannelReport")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonChannelReportGetSignal(output);
} else {
emit daemonChannelReportGetSignalE(output, error_type, error_str);
emit daemonChannelReportGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonChannelSettingsGet() {
QString fullPath;

View File

@ -15,6 +15,7 @@
#include "SWGHttpRequest.h"
#include "SWGChannelReport.h"
#include "SWGChannelSettings.h"
#include "SWGDaemonSummaryResponse.h"
#include "SWGDeviceReport.h"
@ -39,6 +40,7 @@ public:
QString basePath;
QMap<QString, QString> defaultHeaders;
void daemonChannelReportGet();
void daemonChannelSettingsGet();
void daemonChannelSettingsPatch(SWGChannelSettings& body);
void daemonChannelSettingsPut(SWGChannelSettings& body);
@ -54,6 +56,7 @@ public:
void daemonRunPost();
private:
void daemonChannelReportGetCallback (SWGHttpRequestWorker * worker);
void daemonChannelSettingsGetCallback (SWGHttpRequestWorker * worker);
void daemonChannelSettingsPatchCallback (SWGHttpRequestWorker * worker);
void daemonChannelSettingsPutCallback (SWGHttpRequestWorker * worker);
@ -69,6 +72,7 @@ private:
void daemonRunPostCallback (SWGHttpRequestWorker * worker);
signals:
void daemonChannelReportGetSignal(SWGChannelReport* summary);
void daemonChannelSettingsGetSignal(SWGChannelSettings* summary);
void daemonChannelSettingsPatchSignal(SWGChannelSettings* summary);
void daemonChannelSettingsPutSignal(SWGChannelSettings* summary);
@ -83,6 +87,7 @@ signals:
void daemonRunGetSignal(SWGDeviceState* summary);
void daemonRunPostSignal(SWGDeviceState* summary);
void daemonChannelReportGetSignalE(SWGChannelReport* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsGetSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPatchSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPutSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
@ -97,6 +102,7 @@ signals:
void daemonRunGetSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunPostSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelReportGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);

View File

@ -90,6 +90,8 @@
#include "SWGRtlSdrReport.h"
#include "SWGRtlSdrSettings.h"
#include "SWGSDRDaemonChannelSinkSettings.h"
#include "SWGSDRDaemonChannelSourceReport.h"
#include "SWGSDRDaemonChannelSourceSettings.h"
#include "SWGSDRPlayReport.h"
#include "SWGSDRPlaySettings.h"
#include "SWGSDRdaemonSinkReport.h"
@ -344,6 +346,12 @@ namespace SWGSDRangel {
if(QString("SWGSDRDaemonChannelSinkSettings").compare(type) == 0) {
return new SWGSDRDaemonChannelSinkSettings();
}
if(QString("SWGSDRDaemonChannelSourceReport").compare(type) == 0) {
return new SWGSDRDaemonChannelSourceReport();
}
if(QString("SWGSDRDaemonChannelSourceSettings").compare(type) == 0) {
return new SWGSDRDaemonChannelSourceSettings();
}
if(QString("SWGSDRPlayReport").compare(type) == 0) {
return new SWGSDRPlayReport();
}

View File

@ -0,0 +1,232 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 4.1.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#include "SWGSDRDaemonChannelSourceReport.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGSDRDaemonChannelSourceReport::SWGSDRDaemonChannelSourceReport(QString* json) {
init();
this->fromJson(*json);
}
SWGSDRDaemonChannelSourceReport::SWGSDRDaemonChannelSourceReport() {
queue_length = 0;
m_queue_length_isSet = false;
queue_size = 0;
m_queue_size_isSet = false;
samples_count = 0;
m_samples_count_isSet = false;
correctable_errors_count = 0;
m_correctable_errors_count_isSet = false;
uncorrectable_errors_count = 0;
m_uncorrectable_errors_count_isSet = false;
tv_sec = 0;
m_tv_sec_isSet = false;
tv_u_sec = 0;
m_tv_u_sec_isSet = false;
}
SWGSDRDaemonChannelSourceReport::~SWGSDRDaemonChannelSourceReport() {
this->cleanup();
}
void
SWGSDRDaemonChannelSourceReport::init() {
queue_length = 0;
m_queue_length_isSet = false;
queue_size = 0;
m_queue_size_isSet = false;
samples_count = 0;
m_samples_count_isSet = false;
correctable_errors_count = 0;
m_correctable_errors_count_isSet = false;
uncorrectable_errors_count = 0;
m_uncorrectable_errors_count_isSet = false;
tv_sec = 0;
m_tv_sec_isSet = false;
tv_u_sec = 0;
m_tv_u_sec_isSet = false;
}
void
SWGSDRDaemonChannelSourceReport::cleanup() {
}
SWGSDRDaemonChannelSourceReport*
SWGSDRDaemonChannelSourceReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSDRDaemonChannelSourceReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&queue_length, pJson["queueLength"], "qint32", "");
::SWGSDRangel::setValue(&queue_size, pJson["queueSize"], "qint32", "");
::SWGSDRangel::setValue(&samples_count, pJson["samplesCount"], "qint32", "");
::SWGSDRangel::setValue(&correctable_errors_count, pJson["correctableErrorsCount"], "qint32", "");
::SWGSDRangel::setValue(&uncorrectable_errors_count, pJson["uncorrectableErrorsCount"], "qint32", "");
::SWGSDRangel::setValue(&tv_sec, pJson["tvSec"], "qint32", "");
::SWGSDRangel::setValue(&tv_u_sec, pJson["tvUSec"], "qint32", "");
}
QString
SWGSDRDaemonChannelSourceReport::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGSDRDaemonChannelSourceReport::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_queue_length_isSet){
obj->insert("queueLength", QJsonValue(queue_length));
}
if(m_queue_size_isSet){
obj->insert("queueSize", QJsonValue(queue_size));
}
if(m_samples_count_isSet){
obj->insert("samplesCount", QJsonValue(samples_count));
}
if(m_correctable_errors_count_isSet){
obj->insert("correctableErrorsCount", QJsonValue(correctable_errors_count));
}
if(m_uncorrectable_errors_count_isSet){
obj->insert("uncorrectableErrorsCount", QJsonValue(uncorrectable_errors_count));
}
if(m_tv_sec_isSet){
obj->insert("tvSec", QJsonValue(tv_sec));
}
if(m_tv_u_sec_isSet){
obj->insert("tvUSec", QJsonValue(tv_u_sec));
}
return obj;
}
qint32
SWGSDRDaemonChannelSourceReport::getQueueLength() {
return queue_length;
}
void
SWGSDRDaemonChannelSourceReport::setQueueLength(qint32 queue_length) {
this->queue_length = queue_length;
this->m_queue_length_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceReport::getQueueSize() {
return queue_size;
}
void
SWGSDRDaemonChannelSourceReport::setQueueSize(qint32 queue_size) {
this->queue_size = queue_size;
this->m_queue_size_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceReport::getSamplesCount() {
return samples_count;
}
void
SWGSDRDaemonChannelSourceReport::setSamplesCount(qint32 samples_count) {
this->samples_count = samples_count;
this->m_samples_count_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceReport::getCorrectableErrorsCount() {
return correctable_errors_count;
}
void
SWGSDRDaemonChannelSourceReport::setCorrectableErrorsCount(qint32 correctable_errors_count) {
this->correctable_errors_count = correctable_errors_count;
this->m_correctable_errors_count_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceReport::getUncorrectableErrorsCount() {
return uncorrectable_errors_count;
}
void
SWGSDRDaemonChannelSourceReport::setUncorrectableErrorsCount(qint32 uncorrectable_errors_count) {
this->uncorrectable_errors_count = uncorrectable_errors_count;
this->m_uncorrectable_errors_count_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceReport::getTvSec() {
return tv_sec;
}
void
SWGSDRDaemonChannelSourceReport::setTvSec(qint32 tv_sec) {
this->tv_sec = tv_sec;
this->m_tv_sec_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceReport::getTvUSec() {
return tv_u_sec;
}
void
SWGSDRDaemonChannelSourceReport::setTvUSec(qint32 tv_u_sec) {
this->tv_u_sec = tv_u_sec;
this->m_tv_u_sec_isSet = true;
}
bool
SWGSDRDaemonChannelSourceReport::isSet(){
bool isObjectUpdated = false;
do{
if(m_queue_length_isSet){ isObjectUpdated = true; break;}
if(m_queue_size_isSet){ isObjectUpdated = true; break;}
if(m_samples_count_isSet){ isObjectUpdated = true; break;}
if(m_correctable_errors_count_isSet){ isObjectUpdated = true; break;}
if(m_uncorrectable_errors_count_isSet){ isObjectUpdated = true; break;}
if(m_tv_sec_isSet){ isObjectUpdated = true; break;}
if(m_tv_u_sec_isSet){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,94 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 4.1.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* SWGSDRDaemonChannelSourceReport.h
*
* SDRDaemon channel source report
*/
#ifndef SWGSDRDaemonChannelSourceReport_H_
#define SWGSDRDaemonChannelSourceReport_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGSDRDaemonChannelSourceReport: public SWGObject {
public:
SWGSDRDaemonChannelSourceReport();
SWGSDRDaemonChannelSourceReport(QString* json);
virtual ~SWGSDRDaemonChannelSourceReport();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSDRDaemonChannelSourceReport* fromJson(QString &jsonString) override;
qint32 getQueueLength();
void setQueueLength(qint32 queue_length);
qint32 getQueueSize();
void setQueueSize(qint32 queue_size);
qint32 getSamplesCount();
void setSamplesCount(qint32 samples_count);
qint32 getCorrectableErrorsCount();
void setCorrectableErrorsCount(qint32 correctable_errors_count);
qint32 getUncorrectableErrorsCount();
void setUncorrectableErrorsCount(qint32 uncorrectable_errors_count);
qint32 getTvSec();
void setTvSec(qint32 tv_sec);
qint32 getTvUSec();
void setTvUSec(qint32 tv_u_sec);
virtual bool isSet() override;
private:
qint32 queue_length;
bool m_queue_length_isSet;
qint32 queue_size;
bool m_queue_size_isSet;
qint32 samples_count;
bool m_samples_count_isSet;
qint32 correctable_errors_count;
bool m_correctable_errors_count_isSet;
qint32 uncorrectable_errors_count;
bool m_uncorrectable_errors_count_isSet;
qint32 tv_sec;
bool m_tv_sec_isSet;
qint32 tv_u_sec;
bool m_tv_u_sec_isSet;
};
}
#endif /* SWGSDRDaemonChannelSourceReport_H_ */

View File

@ -0,0 +1,129 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 4.1.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#include "SWGSDRDaemonChannelSourceSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGSDRDaemonChannelSourceSettings::SWGSDRDaemonChannelSourceSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGSDRDaemonChannelSourceSettings::SWGSDRDaemonChannelSourceSettings() {
data_address = nullptr;
m_data_address_isSet = false;
data_port = 0;
m_data_port_isSet = false;
}
SWGSDRDaemonChannelSourceSettings::~SWGSDRDaemonChannelSourceSettings() {
this->cleanup();
}
void
SWGSDRDaemonChannelSourceSettings::init() {
data_address = new QString("");
m_data_address_isSet = false;
data_port = 0;
m_data_port_isSet = false;
}
void
SWGSDRDaemonChannelSourceSettings::cleanup() {
if(data_address != nullptr) {
delete data_address;
}
}
SWGSDRDaemonChannelSourceSettings*
SWGSDRDaemonChannelSourceSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGSDRDaemonChannelSourceSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&data_address, pJson["dataAddress"], "QString", "QString");
::SWGSDRangel::setValue(&data_port, pJson["dataPort"], "qint32", "");
}
QString
SWGSDRDaemonChannelSourceSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGSDRDaemonChannelSourceSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(data_address != nullptr && *data_address != QString("")){
toJsonValue(QString("dataAddress"), data_address, obj, QString("QString"));
}
if(m_data_port_isSet){
obj->insert("dataPort", QJsonValue(data_port));
}
return obj;
}
QString*
SWGSDRDaemonChannelSourceSettings::getDataAddress() {
return data_address;
}
void
SWGSDRDaemonChannelSourceSettings::setDataAddress(QString* data_address) {
this->data_address = data_address;
this->m_data_address_isSet = true;
}
qint32
SWGSDRDaemonChannelSourceSettings::getDataPort() {
return data_port;
}
void
SWGSDRDaemonChannelSourceSettings::setDataPort(qint32 data_port) {
this->data_port = data_port;
this->m_data_port_isSet = true;
}
bool
SWGSDRDaemonChannelSourceSettings::isSet(){
bool isObjectUpdated = false;
do{
if(data_address != nullptr && *data_address != QString("")){ isObjectUpdated = true; break;}
if(m_data_port_isSet){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,65 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 4.1.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* SWGSDRDaemonChannelSourceSettings.h
*
* Data handling details for SDRDaemon
*/
#ifndef SWGSDRDaemonChannelSourceSettings_H_
#define SWGSDRDaemonChannelSourceSettings_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGSDRDaemonChannelSourceSettings: public SWGObject {
public:
SWGSDRDaemonChannelSourceSettings();
SWGSDRDaemonChannelSourceSettings(QString* json);
virtual ~SWGSDRDaemonChannelSourceSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGSDRDaemonChannelSourceSettings* fromJson(QString &jsonString) override;
QString* getDataAddress();
void setDataAddress(QString* data_address);
qint32 getDataPort();
void setDataPort(qint32 data_port);
virtual bool isSet() override;
private:
QString* data_address;
bool m_data_address_isSet;
qint32 data_port;
bool m_data_port_isSet;
};
}
#endif /* SWGSDRDaemonChannelSourceSettings_H_ */