1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-04 14:17:50 -04:00

Web API: added Qt version in the instance summary

This commit is contained in:
f4exb 2017-12-18 13:19:20 +01:00
parent a459982fa7
commit 2784a026d6
7 changed files with 39 additions and 4 deletions

View File

@ -1050,12 +1050,16 @@ margin-bottom: 20px;
"description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance" "description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance"
}; };
defs.InstanceSummaryResponse = { defs.InstanceSummaryResponse = {
"required" : [ "devicesetlist", "version" ], "required" : [ "devicesetlist", "qtVersion", "version" ],
"properties" : { "properties" : {
"version" : { "version" : {
"type" : "string", "type" : "string",
"description" : "Current software version" "description" : "Current software version"
}, },
"qtVersion" : {
"type" : "string",
"description" : "Qt version with which the software was compiled"
},
"logging" : { "logging" : {
"$ref" : "#/definitions/LoggingInfo" "$ref" : "#/definitions/LoggingInfo"
}, },
@ -14085,7 +14089,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2017-12-18T01:56:22.008+01:00 Generated 2017-12-18T13:11:28.683+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -72,6 +72,7 @@ int WebAPIAdapterGUI::instanceSummary(
{ {
*response.getVersion() = qApp->applicationVersion(); *response.getVersion() = qApp->applicationVersion();
*response.getQtVersion() = QString(QT_VERSION_STR);
SWGSDRangel::SWGLoggingInfo *logging = response.getLogging(); SWGSDRangel::SWGLoggingInfo *logging = response.getLogging();
logging->init(); logging->init();

View File

@ -50,6 +50,7 @@ int WebAPIAdapterSrv::instanceSummary(
{ {
*response.getVersion() = QCoreApplication::instance()->applicationVersion(); *response.getVersion() = QCoreApplication::instance()->applicationVersion();
*response.getQtVersion() = QString(QT_VERSION_STR);
SWGSDRangel::SWGLoggingInfo *logging = response.getLogging(); SWGSDRangel::SWGLoggingInfo *logging = response.getLogging();
logging->init(); logging->init();

View File

@ -936,11 +936,15 @@ definitions:
description: "Summarized information about this SDRangel instance" description: "Summarized information about this SDRangel instance"
required: required:
- version - version
- qtVersion
- devicesetlist - devicesetlist
properties: properties:
version: version:
description: "Current software version" description: "Current software version"
type: string type: string
qtVersion:
description: "Qt version with which the software was compiled"
type: string
logging: logging:
$ref: "#/definitions/LoggingInfo" $ref: "#/definitions/LoggingInfo"
devicesetlist: devicesetlist:

View File

@ -1050,12 +1050,16 @@ margin-bottom: 20px;
"description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance" "description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance"
}; };
defs.InstanceSummaryResponse = { defs.InstanceSummaryResponse = {
"required" : [ "devicesetlist", "version" ], "required" : [ "devicesetlist", "qtVersion", "version" ],
"properties" : { "properties" : {
"version" : { "version" : {
"type" : "string", "type" : "string",
"description" : "Current software version" "description" : "Current software version"
}, },
"qtVersion" : {
"type" : "string",
"description" : "Qt version with which the software was compiled"
},
"logging" : { "logging" : {
"$ref" : "#/definitions/LoggingInfo" "$ref" : "#/definitions/LoggingInfo"
}, },
@ -14085,7 +14089,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2017-12-18T01:56:22.008+01:00 Generated 2017-12-18T13:11:28.683+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -38,6 +38,7 @@ SWGInstanceSummaryResponse::~SWGInstanceSummaryResponse() {
void void
SWGInstanceSummaryResponse::init() { SWGInstanceSummaryResponse::init() {
version = new QString(""); version = new QString("");
qt_version = new QString("");
logging = new SWGLoggingInfo(); logging = new SWGLoggingInfo();
devicesetlist = new SWGDeviceSetList(); devicesetlist = new SWGDeviceSetList();
} }
@ -49,6 +50,10 @@ SWGInstanceSummaryResponse::cleanup() {
delete version; delete version;
} }
if(qt_version != nullptr) {
delete qt_version;
}
if(logging != nullptr) { if(logging != nullptr) {
delete logging; delete logging;
} }
@ -70,6 +75,7 @@ SWGInstanceSummaryResponse::fromJson(QString &json) {
void void
SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) { SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString"); ::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString");
::SWGSDRangel::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo"); ::SWGSDRangel::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo");
::SWGSDRangel::setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList"); ::SWGSDRangel::setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList");
} }
@ -90,6 +96,8 @@ SWGInstanceSummaryResponse::asJsonObject() {
toJsonValue(QString("version"), version, obj, QString("QString")); toJsonValue(QString("version"), version, obj, QString("QString"));
toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString"));
toJsonValue(QString("logging"), logging, obj, QString("SWGLoggingInfo")); toJsonValue(QString("logging"), logging, obj, QString("SWGLoggingInfo"));
toJsonValue(QString("devicesetlist"), devicesetlist, obj, QString("SWGDeviceSetList")); toJsonValue(QString("devicesetlist"), devicesetlist, obj, QString("SWGDeviceSetList"));
@ -106,6 +114,15 @@ SWGInstanceSummaryResponse::setVersion(QString* version) {
this->version = version; this->version = version;
} }
QString*
SWGInstanceSummaryResponse::getQtVersion() {
return qt_version;
}
void
SWGInstanceSummaryResponse::setQtVersion(QString* qt_version) {
this->qt_version = qt_version;
}
SWGLoggingInfo* SWGLoggingInfo*
SWGInstanceSummaryResponse::getLogging() { SWGInstanceSummaryResponse::getLogging() {
return logging; return logging;

View File

@ -47,6 +47,9 @@ public:
QString* getVersion(); QString* getVersion();
void setVersion(QString* version); void setVersion(QString* version);
QString* getQtVersion();
void setQtVersion(QString* qt_version);
SWGLoggingInfo* getLogging(); SWGLoggingInfo* getLogging();
void setLogging(SWGLoggingInfo* logging); void setLogging(SWGLoggingInfo* logging);
@ -56,6 +59,7 @@ public:
private: private:
QString* version; QString* version;
QString* qt_version;
SWGLoggingInfo* logging; SWGLoggingInfo* logging;
SWGDeviceSetList* devicesetlist; SWGDeviceSetList* devicesetlist;
}; };