Commit 339da87a authored by Gus Grubba's avatar Gus Grubba

Add support for Linux and experimenting with settings (there are "set" but no...

Add support for Linux and experimenting with settings (there are "set" but no "get" options for them though)
parent 7059d63e
......@@ -19,8 +19,9 @@
linux {
linux-g++ | linux-g++-64 | linux-g++-32 | linux-clang {
message("Linux build")
CONFIG += LinuxBuild
CONFIG += LinuxBuild
DEFINES += __STDC_LIMIT_MACROS
DEFINES += QGC_GST_TAISYNC_ENABLED
linux-clang {
message("Linux clang")
QMAKE_CXXFLAGS += -Qunused-arguments -fcolor-diagnostics
......
......@@ -66,7 +66,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
_settingsManager = toolbox->settingsManager();
_gpsRtkFactGroup = qgcApp()->gpsRtkFactGroup();
_airspaceManager = toolbox->airspaceManager();
#if defined(QGC_AIRMAP_ENABLED)
#if defined(QGC_GST_TAISYNC_ENABLED)
_taisyncManager = toolbox->taisyncManager();
#endif
}
......
......@@ -19,6 +19,11 @@ TaisyncManager::TaisyncManager(QGCApplication* app, QGCToolbox* toolbox)
{
connect(&_workTimer, &QTimer::timeout, this, &TaisyncManager::_checkTaisync);
_workTimer.setSingleShot(true);
_decodeList.append(tr("Stream"));
_decodeList.append(tr("HDMI Port"));
_rateList.append(tr("Low"));
_rateList.append(tr("Medium"));
_rateList.append(tr("High"));
}
//-----------------------------------------------------------------------------
......@@ -65,6 +70,20 @@ TaisyncManager::setToolbox(QGCToolbox* toolbox)
}
}
//-----------------------------------------------------------------------------
void
TaisyncManager::setDecodeIndex(int idx)
{
(void)idx;
}
//-----------------------------------------------------------------------------
void
TaisyncManager::setRateIndex(int idx)
{
(void)idx;
}
//-----------------------------------------------------------------------------
void
TaisyncManager::_setEnabled()
......@@ -199,6 +218,9 @@ TaisyncManager::_checkTaisync()
case REQ_FREQ_SCAN:
_taiSettings->requestFreqScan();
break;
case REQ_VIDEO_SETTINGS:
_taiSettings->requestVideoSettings();
break;
}
}
_workTimer.start(1000);
......@@ -228,5 +250,10 @@ TaisyncManager::_updateSettings(QByteArray jSonData)
} else if(jSonData.contains("\"firmwareversion\":")) {
_fwVersion = jObj["firmwareversion"].toString(_fwVersion);
_serialNumber = jObj["sn"].toString(_serialNumber);
//-- Video Settings?
} else if(jSonData.contains("\"maxbitrate\":")) {
}
}
......@@ -28,30 +28,42 @@ class TaisyncManager : public QGCTool
Q_OBJECT
public:
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
Q_PROPERTY(bool linkConnected READ linkConnected NOTIFY linkChanged)
Q_PROPERTY(QString linkVidFormat READ linkVidFormat NOTIFY linkChanged)
Q_PROPERTY(int uplinkRSSI READ uplinkRSSI NOTIFY linkChanged)
Q_PROPERTY(int downlinkRSSI READ downlinkRSSI NOTIFY linkChanged)
Q_PROPERTY(QString serialNumber READ serialNumber NOTIFY linkChanged)
Q_PROPERTY(QString fwVersion READ fwVersion NOTIFY linkChanged)
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
Q_PROPERTY(bool linkConnected READ linkConnected NOTIFY linkChanged)
Q_PROPERTY(QString linkVidFormat READ linkVidFormat NOTIFY linkChanged)
Q_PROPERTY(int uplinkRSSI READ uplinkRSSI NOTIFY linkChanged)
Q_PROPERTY(int downlinkRSSI READ downlinkRSSI NOTIFY linkChanged)
Q_PROPERTY(QString serialNumber READ serialNumber NOTIFY linkChanged)
Q_PROPERTY(QString fwVersion READ fwVersion NOTIFY linkChanged)
Q_PROPERTY(QStringList decodeList READ decodeList NOTIFY decodeIndexChanged)
Q_PROPERTY(int decodeIndex READ decodeIndex WRITE setDecodeIndex NOTIFY decodeIndexChanged)
Q_PROPERTY(QStringList rateList READ rateList NOTIFY rateIndexChanged)
Q_PROPERTY(int rateIndex READ rateIndex WRITE setRateIndex NOTIFY rateIndexChanged)
explicit TaisyncManager (QGCApplication* app, QGCToolbox* toolbox);
~TaisyncManager () override;
void setToolbox (QGCToolbox* toolbox) override;
void setToolbox (QGCToolbox* toolbox) override;
bool connected () { return _isConnected; }
bool linkConnected () { return _linkConnected; }
QString linkVidFormat () { return _linkVidFormat; }
int uplinkRSSI () { return _downlinkRSSI; }
int downlinkRSSI () { return _uplinkRSSI; }
QString serialNumber () { return _serialNumber; }
QString fwVersion () { return _fwVersion; }
bool connected () { return _isConnected; }
bool linkConnected () { return _linkConnected; }
QString linkVidFormat () { return _linkVidFormat; }
int uplinkRSSI () { return _downlinkRSSI; }
int downlinkRSSI () { return _uplinkRSSI; }
QString serialNumber () { return _serialNumber; }
QString fwVersion () { return _fwVersion; }
QStringList decodeList () { return _decodeList; }
int decodeIndex () { return _decodeIndex; }
void setDecodeIndex (int idx);
QStringList rateList () { return _rateList; }
int rateIndex () { return _rateIndex; }
void setRateIndex (int idx);
signals:
void linkChanged ();
void connectedChanged ();
void decodeIndexChanged ();
void rateIndexChanged ();
private slots:
void _connected ();
......@@ -70,6 +82,7 @@ private:
REQ_LINK_STATUS,
REQ_DEV_INFO,
REQ_FREQ_SCAN,
REQ_VIDEO_SETTINGS,
REQ_LAST
};
......@@ -91,6 +104,10 @@ private:
QString _linkVidFormat;
int _downlinkRSSI = 0;
int _uplinkRSSI = 0;
QStringList _decodeList;
int _decodeIndex = 0;
QStringList _rateList;
int _rateIndex = 0;
bool _savedVideoState = true;
QVariant _savedVideoSource;
QVariant _savedVideoUDP;
......
......@@ -13,12 +13,13 @@
#include "QGCApplication.h"
#include "VideoManager.h"
/*
static const char* kPostReq =
"POST %1 HTTP/1.1\r\n"
"Content-Type: application/json\r\n"
"Content-Length: %2\r\n\r\n"
"%3";
*/
static const char* kGetReq = "GET %1 HTTP/1.1\r\n\r\n";
......@@ -78,6 +79,19 @@ TaisyncSettings::requestFreqScan()
return false;
}
//-----------------------------------------------------------------------------
bool
TaisyncSettings::requestVideoSettings()
{
if(_tcpSocket) {
QString req = QString(kGetReq).arg("/v1/video.json");
//qCDebug(TaisyncVerbose) << "Request" << req;
_tcpSocket->write(req.toUtf8());
return true;
}
return false;
}
//-----------------------------------------------------------------------------
void
TaisyncSettings::_readBytes()
......
......@@ -18,8 +18,9 @@ public:
explicit TaisyncSettings (QObject* parent = nullptr);
bool start () override;
bool requestLinkStatus ();
bool requestDevInfo ();
bool requestDevInfo ();
bool requestFreqScan ();
bool requestVideoSettings ();
signals:
void updateSettings (QByteArray jSonData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment