24 bit DSP: document in log and Web API. Adding PID information

This commit is contained in:
f4exb 2018-01-22 23:29:09 +01:00
parent a47587e16f
commit 9bafb2d9b3
13 changed files with 196 additions and 41 deletions

View File

@ -24,6 +24,7 @@
#include "loggerwithfile.h"
#include "mainwindow.h"
#include "dsp/dsptypes.h"
static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *logger)
{
@ -95,19 +96,25 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
parser.parse(*qApp);
#if QT_VERSION >= 0x050400
qInfo("%s %s Qt %s %db %s %s",
qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld",
qPrintable(qApp->applicationName()),
qPrintable(qApp->applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8,
qPrintable(QSysInfo::currentCpuArchitecture()),
qPrintable(QSysInfo::prettyProductName()));
qPrintable(QSysInfo::prettyProductName()),
SDR_RX_SAMP_SZ,
SDR_TX_SAMP_SZ,
qApp->applicationPid());
#else
qInfo("%s %s Qt %s %db",
qInfo("%s %s Qt %s %db DSP Rx:%db Tx:%db PID: %lld",
qPrintable(qApp->applicationName()),
qPrintable((qApp->applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8);
QT_POINTER_SIZE*8,
SDR_RX_SAMP_SZ,
SDR_TX_SAMP_SZ,
applicationPid);
#endif
MainWindow w(logger, parser);

View File

@ -25,6 +25,7 @@
#include "loggerwithfile.h"
#include "maincore.h"
#include "dsp/dsptypes.h"
void handler(int sig) {
fprintf(stderr, "quit the application by signal(%d).\n", sig);
@ -65,19 +66,25 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
parser.parse(a);
#if QT_VERSION >= 0x050400
qInfo("%s %s Qt %s %db %s %s",
qPrintable(qApp->applicationName()),
qPrintable(qApp->applicationVersion()),
qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld",
qPrintable(QCoreApplication::applicationName()),
qPrintable(QCoreApplication::applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8,
qPrintable(QSysInfo::currentCpuArchitecture()),
qPrintable(QSysInfo::prettyProductName()));
qPrintable(QSysInfo::prettyProductName()),
SDR_RX_SAMP_SZ,
SDR_TX_SAMP_SZ,
QCoreApplication::applicationPid());
#else
qInfo("%s %s Qt %s %db",
qPrintable(qApp->applicationName()),
qPrintable((qApp->applicationVersion()),
qInfo("%s %s Qt %s %db DSP Rx:%db Tx:%db PID %lld",
qPrintable(QCoreApplication::applicationName()),
qPrintable((QCoreApplication::>applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8);
QT_POINTER_SIZE*8,
SDR_RX_SAMP_SZ,
SDR_TX_SAMP_SZ,
QCoreApplication::applicationPid());
#endif
MainCore m(logger, parser, &a);

View File

@ -1137,7 +1137,7 @@ margin-bottom: 20px;
"description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance"
};
defs.InstanceSummaryResponse = {
"required" : [ "appname", "devicesetlist", "qtVersion", "version" ],
"required" : [ "appname", "devicesetlist", "dspRxBits", "dspTxBits", "pid", "qtVersion", "version" ],
"properties" : {
"version" : {
"type" : "string",
@ -1147,6 +1147,18 @@ margin-bottom: 20px;
"type" : "string",
"description" : "Qt version with which the software was compiled"
},
"dspRxBits" : {
"type" : "integer",
"description" : "Number of samples significant bits in software Rx DSP"
},
"dspTxBits" : {
"type" : "integer",
"description" : "Number of samples significant bits in software Tx DSP"
},
"pid" : {
"type" : "integer",
"description" : "PID of the SDRangel instance"
},
"appname" : {
"type" : "string",
"description" : "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance"
@ -16909,7 +16921,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-01-16T19:54:59.982+01:00
Generated 2018-01-22T23:06:33.396+01:00
</div>
</div>
</div>

View File

@ -1,5 +1,6 @@
#include "gui/aboutdialog.h"
#include "ui_aboutdialog.h"
#include "dsp/dsptypes.h"
AboutDialog::AboutDialog(const QString& apiHost, int apiPort, QWidget* parent) :
QDialog(parent),
@ -8,7 +9,11 @@ AboutDialog::AboutDialog(const QString& apiHost, int apiPort, QWidget* parent) :
ui->setupUi(this);
ui->version->setText(QString("Version %1 - Copyright (C) 2015-2018 Edouard Griffiths, F4EXB.").arg(qApp->applicationVersion()));
ui->build->setText(QString("Build info: Qt %1 %2 bits").arg(QT_VERSION_STR).arg(QT_POINTER_SIZE*8));
ui->restApiUrl->setText(QString("REST API base URL: http://%1:%2/sdrangel").arg(apiHost).arg(apiPort));
ui->dspBits->setText(QString("DSP Rx %1 bits Tx %2 bits").arg(SDR_RX_SAMP_SZ).arg(SDR_TX_SAMP_SZ));
ui->pid->setText(QString("PID: %1").arg(qApp->applicationPid()));
QString apiUrl = QString("http://%1:%2/sdrangel").arg(apiHost).arg(apiPort);
ui->restApiUrl->setText(QString("REST API base URL: <a href=\"%1\">%2</a>").arg(apiUrl).arg(apiUrl));
ui->restApiUrl->setOpenExternalLinks(true);
}
AboutDialog::~AboutDialog()

View File

@ -89,18 +89,46 @@
</widget>
</item>
<item>
<widget class="QLabel" name="build">
<property name="text">
<string>Here goes the build info</string>
</property>
</widget>
<layout class="QHBoxLayout" name="buildLayout">
<item>
<widget class="QLabel" name="build">
<property name="text">
<string>Here goes the build info</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dspBits">
<property name="text">
<string>DSP Rx 24 bits Tx 16 bits</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="restApiUrl">
<property name="text">
<string>Here goes the REST API URL</string>
</property>
</widget>
<layout class="QHBoxLayout" name="runtimeLayout">
<item>
<widget class="QLabel" name="restApiUrl">
<property name="text">
<string>Here goes the REST API URL</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="pid">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>PID: 00000</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="info">

View File

@ -1731,19 +1731,25 @@ void MainWindow::setLoggingOptions()
if (m_settings.getUseLogFile())
{
#if QT_VERSION >= 0x050400
QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6")
QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6 DSP Rx:%7b Tx:%8b PID %9")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8)
.arg(QSysInfo::currentCpuArchitecture())
.arg(QSysInfo::prettyProductName()));
.arg(QSysInfo::prettyProductName())
.arg(SDR_RX_SAMP_SZ)
.arg(SDR_TX_SAMP_SZ)
.arg(qApp->applicationPid()));
#else
QString appInfoStr(tr("%1 %2 Qt %3 %4b")
QString appInfoStr(tr("%1 %2 Qt %3 %4b DSP Rx:%5b Tx:%6b PID %7")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8));
.arg(QT_POINTER_SIZE*8)
.arg(SDR_RX_SAMP_SZ)
.arg(SDR_TX_SAMP_SZ)
.arg(qApp->applicationPid()));
#endif
m_logger->logToFile(QtInfoMsg, appInfoStr);
}

View File

@ -76,6 +76,9 @@ int WebAPIAdapterGUI::instanceSummary(
*response.getAppname() = qApp->applicationName();
*response.getVersion() = qApp->applicationVersion();
*response.getQtVersion() = QString(QT_VERSION_STR);
response.setDspRxBits(SDR_RX_SAMP_SZ);
response.setDspTxBits(SDR_TX_SAMP_SZ);
response.setPid(qApp->applicationPid());
#if QT_VERSION >= 0x050400
*response.getArchitecture() = QString(QSysInfo::currentCpuArchitecture());
*response.getOs() = QString(QSysInfo::prettyProductName());

View File

@ -221,19 +221,25 @@ void MainCore::setLoggingOptions()
if (m_settings.getUseLogFile())
{
#if QT_VERSION >= 0x050400
QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6 DSP Rx:%7b Tx:%8b PID %9")
.arg(QCoreApplication::applicationName())
.arg(QCoreApplication::applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8)
.arg(QSysInfo::currentCpuArchitecture())
.arg(QSysInfo::prettyProductName()));
.arg(QSysInfo::prettyProductName())
.arg(SDR_RX_SAMP_SZ)
.arg(SDR_TX_SAMP_SZ)
.arg(QCoreApplication::applicationPid()));
#else
QString appInfoStr(tr("%1 %2 Qt %3 %4b")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
QString appInfoStr(tr("%1 %2 Qt %3 %4b DSP Rx:%5b Tx:%6b PID %7")
.arg(QCoreApplication::applicationName())
.arg(QCoreApplication::applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8));
.arg(QT_POINTER_SIZE*8)
.arg(SDR_RX_SAMP_SZ)
.arg(SDR_RX_SAMP_SZ)
.arg(QCoreApplication::applicationPid());
#endif
m_logger->logToFile(QtInfoMsg, appInfoStr);
}

View File

@ -69,9 +69,12 @@ int WebAPIAdapterSrv::instanceSummary(
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
*response.getAppname() = QCoreApplication::instance()->applicationName();
*response.getVersion() = QCoreApplication::instance()->applicationVersion();
*response.getAppname() = QCoreApplication::applicationName();
*response.getVersion() = QCoreApplication::applicationVersion();
*response.getQtVersion() = QString(QT_VERSION_STR);
response.setDspRxBits(SDR_RX_SAMP_SZ);
response.setDspTxBits(SDR_TX_SAMP_SZ);
response.setPid(QCoreApplication::applicationPid());
#if QT_VERSION >= 0x050400
*response.getArchitecture() = QString(QSysInfo::currentCpuArchitecture());
*response.getOs() = QString(QSysInfo::prettyProductName());

View File

@ -1010,6 +1010,9 @@ definitions:
required:
- version
- qtVersion
- dspRxBits
- dspTxBits
- pid
- appname
- devicesetlist
properties:
@ -1019,6 +1022,15 @@ definitions:
qtVersion:
description: "Qt version with which the software was compiled"
type: string
dspRxBits:
description: "Number of samples significant bits in software Rx DSP"
type: integer
dspTxBits:
description: "Number of samples significant bits in software Tx DSP"
type: integer
pid:
description: "PID of the SDRangel instance"
type: integer
appname:
description: "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance"
type: string

View File

@ -1137,7 +1137,7 @@ margin-bottom: 20px;
"description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance"
};
defs.InstanceSummaryResponse = {
"required" : [ "appname", "devicesetlist", "qtVersion", "version" ],
"required" : [ "appname", "devicesetlist", "dspRxBits", "dspTxBits", "pid", "qtVersion", "version" ],
"properties" : {
"version" : {
"type" : "string",
@ -1147,6 +1147,18 @@ margin-bottom: 20px;
"type" : "string",
"description" : "Qt version with which the software was compiled"
},
"dspRxBits" : {
"type" : "integer",
"description" : "Number of samples significant bits in software Rx DSP"
},
"dspTxBits" : {
"type" : "integer",
"description" : "Number of samples significant bits in software Tx DSP"
},
"pid" : {
"type" : "integer",
"description" : "PID of the SDRangel instance"
},
"appname" : {
"type" : "string",
"description" : "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance"
@ -16909,7 +16921,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-01-16T19:54:59.982+01:00
Generated 2018-01-22T23:06:33.396+01:00
</div>
</div>
</div>

View File

@ -39,6 +39,9 @@ void
SWGInstanceSummaryResponse::init() {
version = new QString("");
qt_version = new QString("");
dsp_rx_bits = 0;
dsp_tx_bits = 0;
pid = 0;
appname = new QString("");
architecture = new QString("");
os = new QString("");
@ -57,6 +60,9 @@ SWGInstanceSummaryResponse::cleanup() {
delete qt_version;
}
if(appname != nullptr) {
delete appname;
}
@ -91,6 +97,9 @@ void
SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString");
::SWGSDRangel::setValue(&dsp_rx_bits, pJson["dspRxBits"], "qint32", "");
::SWGSDRangel::setValue(&dsp_tx_bits, pJson["dspTxBits"], "qint32", "");
::SWGSDRangel::setValue(&pid, pJson["pid"], "qint32", "");
::SWGSDRangel::setValue(&appname, pJson["appname"], "QString", "QString");
::SWGSDRangel::setValue(&architecture, pJson["architecture"], "QString", "QString");
::SWGSDRangel::setValue(&os, pJson["os"], "QString", "QString");
@ -116,6 +125,12 @@ SWGInstanceSummaryResponse::asJsonObject() {
toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString"));
obj->insert("dspRxBits", QJsonValue(dsp_rx_bits));
obj->insert("dspTxBits", QJsonValue(dsp_tx_bits));
obj->insert("pid", QJsonValue(pid));
toJsonValue(QString("appname"), appname, obj, QString("QString"));
toJsonValue(QString("architecture"), architecture, obj, QString("QString"));
@ -147,6 +162,33 @@ SWGInstanceSummaryResponse::setQtVersion(QString* qt_version) {
this->qt_version = qt_version;
}
qint32
SWGInstanceSummaryResponse::getDspRxBits() {
return dsp_rx_bits;
}
void
SWGInstanceSummaryResponse::setDspRxBits(qint32 dsp_rx_bits) {
this->dsp_rx_bits = dsp_rx_bits;
}
qint32
SWGInstanceSummaryResponse::getDspTxBits() {
return dsp_tx_bits;
}
void
SWGInstanceSummaryResponse::setDspTxBits(qint32 dsp_tx_bits) {
this->dsp_tx_bits = dsp_tx_bits;
}
qint32
SWGInstanceSummaryResponse::getPid() {
return pid;
}
void
SWGInstanceSummaryResponse::setPid(qint32 pid) {
this->pid = pid;
}
QString*
SWGInstanceSummaryResponse::getAppname() {
return appname;

View File

@ -50,6 +50,15 @@ public:
QString* getQtVersion();
void setQtVersion(QString* qt_version);
qint32 getDspRxBits();
void setDspRxBits(qint32 dsp_rx_bits);
qint32 getDspTxBits();
void setDspTxBits(qint32 dsp_tx_bits);
qint32 getPid();
void setPid(qint32 pid);
QString* getAppname();
void setAppname(QString* appname);
@ -69,6 +78,9 @@ public:
private:
QString* version;
QString* qt_version;
qint32 dsp_rx_bits;
qint32 dsp_tx_bits;
qint32 pid;
QString* appname;
QString* architecture;
QString* os;