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

Web API: /sdrangel/logging implementation (2)

This commit is contained in:
f4exb 2017-11-24 00:47:42 +01:00
parent 4999b04379
commit 7a2f60fe5d
13 changed files with 173 additions and 96 deletions

View File

@ -779,8 +779,8 @@ margin-bottom: 20px;
"description" : "Key to identify the channel plugin type as short object name" "description" : "Key to identify the channel plugin type as short object name"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "integer",
"description" : "True if this is a Tx channel" "description" : "Not zero (true) if this is a Tx channel"
}, },
"version" : { "version" : {
"type" : "string", "type" : "string",
@ -830,8 +830,8 @@ margin-bottom: 20px;
"description" : "Sequence in the enumeration of same device types" "description" : "Sequence in the enumeration of same device types"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "integer",
"description" : "Set to true if this is a Tx device" "description" : "Set to not zero (true) if this is a Tx device"
}, },
"nbStreams" : { "nbStreams" : {
"type" : "integer", "type" : "integer",
@ -964,7 +964,6 @@ margin-bottom: 20px;
"description" : "Instance geolocation information" "description" : "Instance geolocation information"
}; };
defs.LoggingInfo = { defs.LoggingInfo = {
"required" : [ "consoleLevel", "fileLevel" ],
"properties" : { "properties" : {
"consoleLevel" : { "consoleLevel" : {
"type" : "string", "type" : "string",
@ -975,8 +974,8 @@ margin-bottom: 20px;
"description" : "Minimum level of messages written to file: debug, info, warning, error" "description" : "Minimum level of messages written to file: debug, info, warning, error"
}, },
"dumpToFile" : { "dumpToFile" : {
"type" : "boolean", "type" : "integer",
"description" : "True if messages are written to file" "description" : "not zero (true) if messages are written to file"
}, },
"fileName" : { "fileName" : {
"type" : "string", "type" : "string",
@ -1088,8 +1087,8 @@ margin-bottom: 20px;
"description" : "Key to identify the type of hardware device" "description" : "Key to identify the type of hardware device"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "integer",
"description" : "True if this is a Tx device" "description" : "Not zero (true) if this is a Tx device"
}, },
"nbStreams" : { "nbStreams" : {
"type" : "integer", "type" : "integer",
@ -5099,9 +5098,44 @@ $(document).ready(function() {
<h3> Status: 400 - Invallid data </h3> <h3> Status: 400 - Invallid data </h3>
<ul class="nav nav-tabs nav-tabs-examples" > <ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceLoggingPut-400-schema">Schema</a>
</li>
</ul> </ul>
<div class="tab-content" style='margin-bottom: 10px;'> <div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceLoggingPut-400-schema">
<div id='responses-instanceLoggingPut-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" : "Invallid data",
"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-instanceLoggingPut-400-schema-data').val(stringify(schema));
var result = $('#responses-instanceLoggingPut-400-schema-400');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceLoggingPut-400-schema-data' type='hidden' value=''></input>
</div>
</div> </div>
<h3> Status: 500 - Error </h3> <h3> Status: 500 - Error </h3>
@ -7322,7 +7356,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2017-11-23T00:55:26.644+01:00 Generated 2017-11-24T00:44:01.796+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -17,6 +17,8 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
//#include <QDirIterator> //#include <QDirIterator>
#include <QJsonDocument>
#include <QJsonArray>
#include "httpdocrootsettings.h" #include "httpdocrootsettings.h"
#include "webapirequestmapper.h" #include "webapirequestmapper.h"
@ -43,8 +45,8 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
{ {
if (m_adapter == 0) // format service unavailable if adapter is null if (m_adapter == 0) // format service unavailable if adapter is null
{ {
response.write("Service not available");
response.setStatus(500,"Service not available"); response.setStatus(500,"Service not available");
response.write("Service not available");
} }
else // normal processing else // normal processing
{ {
@ -58,19 +60,18 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
Swagger::SWGErrorResponse errorResponse; Swagger::SWGErrorResponse errorResponse;
int status = m_adapter->instanceSummary(normalResponse, errorResponse); int status = m_adapter->instanceSummary(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) { if (status == 200) {
response.write(normalResponse.asJson().toUtf8()); response.write(normalResponse.asJson().toUtf8());
} else { } else {
response.write(errorResponse.asJson().toUtf8()); response.write(errorResponse.asJson().toUtf8());
} }
response.setStatus(status);
} }
else else
{ {
response.write("Invalid HTTP method");
response.setStatus(405,"Invalid HTTP method"); response.setStatus(405,"Invalid HTTP method");
response.write("Invalid HTTP method");
} }
} }
else if (path == WebAPIAdapterInterface::instanceDevicesURL) else if (path == WebAPIAdapterInterface::instanceDevicesURL)
@ -84,19 +85,18 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
bool tx = (txStr == "true"); bool tx = (txStr == "true");
int status = m_adapter->instanceDevices(tx, normalResponse, errorResponse); int status = m_adapter->instanceDevices(tx, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) { if (status == 200) {
response.write(normalResponse.asJson().toUtf8()); response.write(normalResponse.asJson().toUtf8());
} else { } else {
response.write(errorResponse.asJson().toUtf8()); response.write(errorResponse.asJson().toUtf8());
} }
response.setStatus(status);
} }
else else
{ {
response.write("Invalid HTTP method");
response.setStatus(405,"Invalid HTTP method"); response.setStatus(405,"Invalid HTTP method");
response.write("Invalid HTTP method");
} }
} }
else if (path == WebAPIAdapterInterface::instanceChannelsURL) else if (path == WebAPIAdapterInterface::instanceChannelsURL)
@ -110,19 +110,18 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
bool tx = (txStr == "true"); bool tx = (txStr == "true");
int status = m_adapter->instanceChannels(tx, normalResponse, errorResponse); int status = m_adapter->instanceChannels(tx, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) { if (status == 200) {
response.write(normalResponse.asJson().toUtf8()); response.write(normalResponse.asJson().toUtf8());
} else { } else {
response.write(errorResponse.asJson().toUtf8()); response.write(errorResponse.asJson().toUtf8());
} }
response.setStatus(status);
} }
else else
{ {
response.write("Invalid HTTP method");
response.setStatus(405,"Invalid HTTP method"); response.setStatus(405,"Invalid HTTP method");
response.write("Invalid HTTP method");
} }
} }
else if (path == WebAPIAdapterInterface::instanceLoggingURL) else if (path == WebAPIAdapterInterface::instanceLoggingURL)
@ -133,42 +132,57 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
if (request.getMethod() == "GET") if (request.getMethod() == "GET")
{ {
int status = m_adapter->instanceLoggingGet(normalResponse, errorResponse); int status = m_adapter->instanceLoggingGet(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) { if (status == 200) {
response.write(normalResponse.asJson().toUtf8()); response.write(normalResponse.asJson().toUtf8());
} else { } else {
response.write(errorResponse.asJson().toUtf8()); response.write(errorResponse.asJson().toUtf8());
} }
response.setStatus(status);
} }
else if (request.getMethod() == "PUT") else if (request.getMethod() == "PUT")
{ {
try try
{ {
QString jsonStr = request.getBody(); QString jsonStr = request.getBody();
qDebug("WebAPIRequestMapper::service: /sdrangel/logging (PUT): %s", qPrintable(jsonStr)); QByteArray jsonBytes(jsonStr.toStdString().c_str());
normalResponse.fromJson(jsonStr); QJsonParseError error;
int status = m_adapter->instanceLoggingPut(normalResponse, errorResponse); QJsonDocument doc = QJsonDocument::fromJson(jsonBytes, &error);
if (status == 200) { if (error.error == QJsonParseError::NoError)
response.write(normalResponse.asJson().toUtf8()); {
} else { normalResponse.fromJson(jsonStr);
int status = m_adapter->instanceLoggingPut(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
}
}
else
{
QString errorMsg = QString("Input JSON error: ") + error.errorString();
errorResponse.init();
*errorResponse.getMessage() = errorMsg;
response.setStatus(400, errorMsg.toUtf8());
response.write(errorResponse.asJson().toUtf8()); response.write(errorResponse.asJson().toUtf8());
} }
response.setStatus(status);
} }
catch (const std::exception& ex) catch (const std::exception& ex)
{ {
response.write("Invalid input format"); QString errorMsg = QString("Error parsing request: ") + ex.what();
response.setStatus(400,"Invalid input format"); errorResponse.init();
*errorResponse.getMessage() = errorMsg;
response.setStatus(500, errorMsg.toUtf8());
response.write(errorResponse.asJson().toUtf8());
} }
} }
else else
{ {
response.write("Invalid HTTP method");
response.setStatus(405,"Invalid HTTP method"); response.setStatus(405,"Invalid HTTP method");
response.write("Invalid HTTP method");
} }
} }
else else

View File

@ -58,7 +58,7 @@ int WebAPIAdapterGUI::instanceSummary(
Swagger::SWGLoggingInfo *logging = response.getLogging(); Swagger::SWGLoggingInfo *logging = response.getLogging();
logging->init(); logging->init();
logging->setDumpToFile(m_mainWindow.m_logger->getUseFileLogger()); logging->setDumpToFile(m_mainWindow.m_logger->getUseFileLogger() ? 1 : 0);
if (logging->getDumpToFile()) { if (logging->getDumpToFile()) {
m_mainWindow.m_logger->getLogFileName(*logging->getFileName()); m_mainWindow.m_logger->getLogFileName(*logging->getFileName());
m_mainWindow.m_logger->getFileMinMessageLevelStr(*logging->getFileLevel()); m_mainWindow.m_logger->getFileMinMessageLevelStr(*logging->getFileLevel());
@ -198,9 +198,9 @@ int WebAPIAdapterGUI::instanceChannels(
int WebAPIAdapterGUI::instanceLoggingGet( int WebAPIAdapterGUI::instanceLoggingGet(
Swagger::SWGLoggingInfo& response, Swagger::SWGLoggingInfo& response,
Swagger::SWGErrorResponse& error) Swagger::SWGErrorResponse& error __attribute__((unused)))
{ {
response.setDumpToFile(m_mainWindow.m_logger->getUseFileLogger()); response.setDumpToFile(m_mainWindow.m_logger->getUseFileLogger() ? 1 : 0);
if (response.getDumpToFile()) { if (response.getDumpToFile()) {
m_mainWindow.m_logger->getLogFileName(*response.getFileName()); m_mainWindow.m_logger->getLogFileName(*response.getFileName());
@ -214,10 +214,10 @@ int WebAPIAdapterGUI::instanceLoggingGet(
int WebAPIAdapterGUI::instanceLoggingPut( int WebAPIAdapterGUI::instanceLoggingPut(
Swagger::SWGLoggingInfo& response, Swagger::SWGLoggingInfo& response,
Swagger::SWGErrorResponse& error) Swagger::SWGErrorResponse& error __attribute__((unused)))
{ {
// response input is the query actually // response input is the query actually
bool dumpToFile = response.getDumpToFile(); bool dumpToFile = (response.getDumpToFile() != 0);
QString* consoleLevel = response.getConsoleLevel(); QString* consoleLevel = response.getConsoleLevel();
QString* fileLevel = response.getFileLevel(); QString* fileLevel = response.getFileLevel();
QString* fileName = response.getFileName(); QString* fileName = response.getFileName();
@ -234,21 +234,17 @@ int WebAPIAdapterGUI::instanceLoggingPut(
m_mainWindow.m_settings.setUseLogFile(dumpToFile); m_mainWindow.m_settings.setUseLogFile(dumpToFile);
if (fileName) { if (fileName) {
m_mainWindow.m_settings.setLogFileName(*fileLevel); m_mainWindow.m_settings.setLogFileName(*fileName);
} }
m_mainWindow.setLoggingOpions(); m_mainWindow.setLoggingOpions();
// build response // build response
response.setDumpToFile(m_mainWindow.m_settings.getUseLogFile()); response.init();
if (response.getDumpToFile())
{
*response.getFileName() = m_mainWindow.m_settings.getLogFileName();
getMsgTypeString(m_mainWindow.m_settings.getFileMinLogLevel(), *response.getFileLevel());
}
getMsgTypeString(m_mainWindow.m_settings.getConsoleMinLogLevel(), *response.getConsoleLevel()); getMsgTypeString(m_mainWindow.m_settings.getConsoleMinLogLevel(), *response.getConsoleLevel());
response.setDumpToFile(m_mainWindow.m_settings.getUseLogFile() ? 1 : 0);
getMsgTypeString(m_mainWindow.m_settings.getFileMinLogLevel(), *response.getFileLevel());
*response.getFileName() = m_mainWindow.m_settings.getLogFileName();
return 200; return 200;
} }

View File

@ -121,6 +121,8 @@ paths:
$ref: "#/definitions/LoggingInfo" $ref: "#/definitions/LoggingInfo"
"400": "400":
description: Invallid data description: Invallid data
schema:
$ref: "#/definitions/ErrorResponse"
"500": "500":
description: Error description: Error
schema: schema:
@ -462,9 +464,6 @@ definitions:
type: string type: string
LoggingInfo: LoggingInfo:
description: "Logging parameters setting" description: "Logging parameters setting"
required:
- consoleLevel
- fileLevel
properties: properties:
consoleLevel: consoleLevel:
description: "Minimum level of messages printed to console: debug, info, warning, error" description: "Minimum level of messages printed to console: debug, info, warning, error"
@ -473,8 +472,8 @@ definitions:
description: "Minimum level of messages written to file: debug, info, warning, error" description: "Minimum level of messages written to file: debug, info, warning, error"
type: string type: string
dumpToFile: dumpToFile:
description: "True if messages are written to file" description: "not zero (true) if messages are written to file"
type: boolean type: integer
fileName: fileName:
description: "Name of the log file" description: "Name of the log file"
type: string type: string
@ -496,8 +495,8 @@ definitions:
description: "Sequence in the enumeration of same device types" description: "Sequence in the enumeration of same device types"
type: integer type: integer
tx: tx:
description: "Set to true if this is a Tx device" description: "Set to not zero (true) if this is a Tx device"
type: boolean type: integer
nbStreams: nbStreams:
description: "Number of channels or streams in the device" description: "Number of channels or streams in the device"
type: integer type: integer
@ -526,8 +525,8 @@ definitions:
description: "Key to identify the channel plugin type as short object name" description: "Key to identify the channel plugin type as short object name"
type: string type: string
tx: tx:
description: "True if this is a Tx channel" description: "Not zero (true) if this is a Tx channel"
type: boolean type: integer
version: version:
description: "Channel plugin version number" description: "Channel plugin version number"
type: string type: string
@ -582,8 +581,8 @@ definitions:
description: "Key to identify the type of hardware device" description: "Key to identify the type of hardware device"
type: string type: string
tx: tx:
description: "True if this is a Tx device" description: "Not zero (true) if this is a Tx device"
type: boolean type: integer
nbStreams: nbStreams:
description: "Number of channels or streams in the device" description: "Number of channels or streams in the device"
type: integer type: integer

View File

@ -779,8 +779,8 @@ margin-bottom: 20px;
"description" : "Key to identify the channel plugin type as short object name" "description" : "Key to identify the channel plugin type as short object name"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "integer",
"description" : "True if this is a Tx channel" "description" : "Not zero (true) if this is a Tx channel"
}, },
"version" : { "version" : {
"type" : "string", "type" : "string",
@ -830,8 +830,8 @@ margin-bottom: 20px;
"description" : "Sequence in the enumeration of same device types" "description" : "Sequence in the enumeration of same device types"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "integer",
"description" : "Set to true if this is a Tx device" "description" : "Set to not zero (true) if this is a Tx device"
}, },
"nbStreams" : { "nbStreams" : {
"type" : "integer", "type" : "integer",
@ -964,7 +964,6 @@ margin-bottom: 20px;
"description" : "Instance geolocation information" "description" : "Instance geolocation information"
}; };
defs.LoggingInfo = { defs.LoggingInfo = {
"required" : [ "consoleLevel", "fileLevel" ],
"properties" : { "properties" : {
"consoleLevel" : { "consoleLevel" : {
"type" : "string", "type" : "string",
@ -975,8 +974,8 @@ margin-bottom: 20px;
"description" : "Minimum level of messages written to file: debug, info, warning, error" "description" : "Minimum level of messages written to file: debug, info, warning, error"
}, },
"dumpToFile" : { "dumpToFile" : {
"type" : "boolean", "type" : "integer",
"description" : "True if messages are written to file" "description" : "not zero (true) if messages are written to file"
}, },
"fileName" : { "fileName" : {
"type" : "string", "type" : "string",
@ -1088,8 +1087,8 @@ margin-bottom: 20px;
"description" : "Key to identify the type of hardware device" "description" : "Key to identify the type of hardware device"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "integer",
"description" : "True if this is a Tx device" "description" : "Not zero (true) if this is a Tx device"
}, },
"nbStreams" : { "nbStreams" : {
"type" : "integer", "type" : "integer",
@ -5099,9 +5098,44 @@ $(document).ready(function() {
<h3> Status: 400 - Invallid data </h3> <h3> Status: 400 - Invallid data </h3>
<ul class="nav nav-tabs nav-tabs-examples" > <ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceLoggingPut-400-schema">Schema</a>
</li>
</ul> </ul>
<div class="tab-content" style='margin-bottom: 10px;'> <div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceLoggingPut-400-schema">
<div id='responses-instanceLoggingPut-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" : "Invallid data",
"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-instanceLoggingPut-400-schema-data').val(stringify(schema));
var result = $('#responses-instanceLoggingPut-400-schema-400');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceLoggingPut-400-schema-data' type='hidden' value=''></input>
</div>
</div> </div>
<h3> Status: 500 - Error </h3> <h3> Status: 500 - Error </h3>
@ -7322,7 +7356,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2017-11-23T00:55:26.644+01:00 Generated 2017-11-24T00:44:01.796+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -40,7 +40,7 @@ SWGChannelListItem::init() {
name = new QString(""); name = new QString("");
id_uri = new QString(""); id_uri = new QString("");
id = new QString(""); id = new QString("");
tx = false; tx = 0;
version = new QString(""); version = new QString("");
index = 0; index = 0;
} }
@ -81,7 +81,7 @@ SWGChannelListItem::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&name, pJson["name"], "QString", "QString"); ::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::Swagger::setValue(&id_uri, pJson["idURI"], "QString", "QString"); ::Swagger::setValue(&id_uri, pJson["idURI"], "QString", "QString");
::Swagger::setValue(&id, pJson["id"], "QString", "QString"); ::Swagger::setValue(&id, pJson["id"], "QString", "QString");
::Swagger::setValue(&tx, pJson["tx"], "bool", ""); ::Swagger::setValue(&tx, pJson["tx"], "qint32", "");
::Swagger::setValue(&version, pJson["version"], "QString", "QString"); ::Swagger::setValue(&version, pJson["version"], "QString", "QString");
::Swagger::setValue(&index, pJson["index"], "qint32", ""); ::Swagger::setValue(&index, pJson["index"], "qint32", "");
} }
@ -142,12 +142,12 @@ SWGChannelListItem::setId(QString* id) {
this->id = id; this->id = id;
} }
bool qint32
SWGChannelListItem::getTx() { SWGChannelListItem::getTx() {
return tx; return tx;
} }
void void
SWGChannelListItem::setTx(bool tx) { SWGChannelListItem::setTx(qint32 tx) {
this->tx = tx; this->tx = tx;
} }

View File

@ -51,8 +51,8 @@ public:
QString* getId(); QString* getId();
void setId(QString* id); void setId(QString* id);
bool getTx(); qint32 getTx();
void setTx(bool tx); void setTx(qint32 tx);
QString* getVersion(); QString* getVersion();
void setVersion(QString* version); void setVersion(QString* version);
@ -65,7 +65,7 @@ private:
QString* name; QString* name;
QString* id_uri; QString* id_uri;
QString* id; QString* id;
bool tx; qint32 tx;
QString* version; QString* version;
qint32 index; qint32 index;
}; };

View File

@ -41,7 +41,7 @@ SWGDeviceListItem::init() {
hw_type = new QString(""); hw_type = new QString("");
serial = new QString(""); serial = new QString("");
sequence = 0; sequence = 0;
tx = false; tx = 0;
nb_streams = 0; nb_streams = 0;
stream_index = 0; stream_index = 0;
device_set_index = 0; device_set_index = 0;
@ -85,7 +85,7 @@ SWGDeviceListItem::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&hw_type, pJson["hwType"], "QString", "QString"); ::Swagger::setValue(&hw_type, pJson["hwType"], "QString", "QString");
::Swagger::setValue(&serial, pJson["serial"], "QString", "QString"); ::Swagger::setValue(&serial, pJson["serial"], "QString", "QString");
::Swagger::setValue(&sequence, pJson["sequence"], "qint32", ""); ::Swagger::setValue(&sequence, pJson["sequence"], "qint32", "");
::Swagger::setValue(&tx, pJson["tx"], "bool", ""); ::Swagger::setValue(&tx, pJson["tx"], "qint32", "");
::Swagger::setValue(&nb_streams, pJson["nbStreams"], "qint32", ""); ::Swagger::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
::Swagger::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); ::Swagger::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::Swagger::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", ""); ::Swagger::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", "");
@ -163,12 +163,12 @@ SWGDeviceListItem::setSequence(qint32 sequence) {
this->sequence = sequence; this->sequence = sequence;
} }
bool qint32
SWGDeviceListItem::getTx() { SWGDeviceListItem::getTx() {
return tx; return tx;
} }
void void
SWGDeviceListItem::setTx(bool tx) { SWGDeviceListItem::setTx(qint32 tx) {
this->tx = tx; this->tx = tx;
} }

View File

@ -54,8 +54,8 @@ public:
qint32 getSequence(); qint32 getSequence();
void setSequence(qint32 sequence); void setSequence(qint32 sequence);
bool getTx(); qint32 getTx();
void setTx(bool tx); void setTx(qint32 tx);
qint32 getNbStreams(); qint32 getNbStreams();
void setNbStreams(qint32 nb_streams); void setNbStreams(qint32 nb_streams);
@ -75,7 +75,7 @@ private:
QString* hw_type; QString* hw_type;
QString* serial; QString* serial;
qint32 sequence; qint32 sequence;
bool tx; qint32 tx;
qint32 nb_streams; qint32 nb_streams;
qint32 stream_index; qint32 stream_index;
qint32 device_set_index; qint32 device_set_index;

View File

@ -39,7 +39,7 @@ void
SWGLoggingInfo::init() { SWGLoggingInfo::init() {
console_level = new QString(""); console_level = new QString("");
file_level = new QString(""); file_level = new QString("");
dump_to_file = false; dump_to_file = 0;
file_name = new QString(""); file_name = new QString("");
} }
@ -73,7 +73,7 @@ void
SWGLoggingInfo::fromJsonObject(QJsonObject &pJson) { SWGLoggingInfo::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&console_level, pJson["consoleLevel"], "QString", "QString"); ::Swagger::setValue(&console_level, pJson["consoleLevel"], "QString", "QString");
::Swagger::setValue(&file_level, pJson["fileLevel"], "QString", "QString"); ::Swagger::setValue(&file_level, pJson["fileLevel"], "QString", "QString");
::Swagger::setValue(&dump_to_file, pJson["dumpToFile"], "bool", ""); ::Swagger::setValue(&dump_to_file, pJson["dumpToFile"], "qint32", "");
::Swagger::setValue(&file_name, pJson["fileName"], "QString", "QString"); ::Swagger::setValue(&file_name, pJson["fileName"], "QString", "QString");
} }
@ -120,12 +120,12 @@ SWGLoggingInfo::setFileLevel(QString* file_level) {
this->file_level = file_level; this->file_level = file_level;
} }
bool qint32
SWGLoggingInfo::getDumpToFile() { SWGLoggingInfo::getDumpToFile() {
return dump_to_file; return dump_to_file;
} }
void void
SWGLoggingInfo::setDumpToFile(bool dump_to_file) { SWGLoggingInfo::setDumpToFile(qint32 dump_to_file) {
this->dump_to_file = dump_to_file; this->dump_to_file = dump_to_file;
} }

View File

@ -48,8 +48,8 @@ public:
QString* getFileLevel(); QString* getFileLevel();
void setFileLevel(QString* file_level); void setFileLevel(QString* file_level);
bool getDumpToFile(); qint32 getDumpToFile();
void setDumpToFile(bool dump_to_file); void setDumpToFile(qint32 dump_to_file);
QString* getFileName(); QString* getFileName();
void setFileName(QString* file_name); void setFileName(QString* file_name);
@ -58,7 +58,7 @@ public:
private: private:
QString* console_level; QString* console_level;
QString* file_level; QString* file_level;
bool dump_to_file; qint32 dump_to_file;
QString* file_name; QString* file_name;
}; };

View File

@ -39,7 +39,7 @@ void
SWGSamplingDevice::init() { SWGSamplingDevice::init() {
index = 0; index = 0;
hw_type = new QString(""); hw_type = new QString("");
tx = false; tx = 0;
nb_streams = 0; nb_streams = 0;
stream_index = 0; stream_index = 0;
sequence = 0; sequence = 0;
@ -85,7 +85,7 @@ void
SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) { SWGSamplingDevice::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&index, pJson["index"], "qint32", ""); ::Swagger::setValue(&index, pJson["index"], "qint32", "");
::Swagger::setValue(&hw_type, pJson["hwType"], "QString", "QString"); ::Swagger::setValue(&hw_type, pJson["hwType"], "QString", "QString");
::Swagger::setValue(&tx, pJson["tx"], "bool", ""); ::Swagger::setValue(&tx, pJson["tx"], "qint32", "");
::Swagger::setValue(&nb_streams, pJson["nbStreams"], "qint32", ""); ::Swagger::setValue(&nb_streams, pJson["nbStreams"], "qint32", "");
::Swagger::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); ::Swagger::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::Swagger::setValue(&sequence, pJson["sequence"], "qint32", ""); ::Swagger::setValue(&sequence, pJson["sequence"], "qint32", "");
@ -150,12 +150,12 @@ SWGSamplingDevice::setHwType(QString* hw_type) {
this->hw_type = hw_type; this->hw_type = hw_type;
} }
bool qint32
SWGSamplingDevice::getTx() { SWGSamplingDevice::getTx() {
return tx; return tx;
} }
void void
SWGSamplingDevice::setTx(bool tx) { SWGSamplingDevice::setTx(qint32 tx) {
this->tx = tx; this->tx = tx;
} }

View File

@ -48,8 +48,8 @@ public:
QString* getHwType(); QString* getHwType();
void setHwType(QString* hw_type); void setHwType(QString* hw_type);
bool getTx(); qint32 getTx();
void setTx(bool tx); void setTx(qint32 tx);
qint32 getNbStreams(); qint32 getNbStreams();
void setNbStreams(qint32 nb_streams); void setNbStreams(qint32 nb_streams);
@ -76,7 +76,7 @@ public:
private: private:
qint32 index; qint32 index;
QString* hw_type; QString* hw_type;
bool tx; qint32 tx;
qint32 nb_streams; qint32 nb_streams;
qint32 stream_index; qint32 stream_index;
qint32 sequence; qint32 sequence;