diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 96ade0b..0f2f072 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -156,6 +156,8 @@ resources/Kill.svg resources/Shutdown.svg + resources/Antenna_T.svg + resources/Antenna_RC.svg resources/Gps.svg resources/Megaphone.png resources/Yield.png diff --git a/resources/Antenna_RC.svg b/resources/Antenna_RC.svg new file mode 100644 index 0000000..f323ef3 --- /dev/null +++ b/resources/Antenna_RC.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/resources/Antenna_T.svg b/resources/Antenna_T.svg new file mode 100644 index 0000000..3d3f984 --- /dev/null +++ b/resources/Antenna_T.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + diff --git a/resources/Battery_0.svg b/resources/Battery_0.svg index 85faa56..5abc169 100644 --- a/resources/Battery_0.svg +++ b/resources/Battery_0.svg @@ -1,22 +1,16 @@ - -Battery - - - - + + + - + -X diff --git a/resources/Battery_100.svg b/resources/Battery_100.svg index 49d55f6..f06d3ac 100644 --- a/resources/Battery_100.svg +++ b/resources/Battery_100.svg @@ -1,31 +1,18 @@ - -Battery - - - - - - - - - + + + + - + diff --git a/resources/Battery_20.svg b/resources/Battery_20.svg index fcaa00c..f456b06 100644 --- a/resources/Battery_20.svg +++ b/resources/Battery_20.svg @@ -1,24 +1,18 @@ - -Battery - - - - - + + + + - + diff --git a/resources/Battery_40.svg b/resources/Battery_40.svg index b0f7034..3b823ac 100644 --- a/resources/Battery_40.svg +++ b/resources/Battery_40.svg @@ -1,26 +1,18 @@ - -Battery - - - - - - + + + + - + diff --git a/resources/Battery_60.svg b/resources/Battery_60.svg index 299b585..6892d6e 100644 --- a/resources/Battery_60.svg +++ b/resources/Battery_60.svg @@ -1,28 +1,18 @@ - -Battery - - - - - - - + + + + - + diff --git a/resources/Battery_80.svg b/resources/Battery_80.svg index 2e6625c..390a8f3 100644 --- a/resources/Battery_80.svg +++ b/resources/Battery_80.svg @@ -1,30 +1,18 @@ - -Battery - - - - - - - - + + + + - + diff --git a/src/audio/QGCAudioWorker.cpp b/src/audio/QGCAudioWorker.cpp index 69a9e25..4425a79 100644 --- a/src/audio/QGCAudioWorker.cpp +++ b/src/audio/QGCAudioWorker.cpp @@ -100,7 +100,7 @@ void QGCAudioWorker::say(QString inText, int severity) if (!muted) { - QString text = _fixMillisecondString(inText); + QString text = _fixTextMessageForAudio(inText); // Prepend high priority text with alert beep if (severity < GAudioOutput::AUDIO_SEVERITY_CRITICAL) { beep(); @@ -187,10 +187,18 @@ bool QGCAudioWorker::_getMillisecondString(const QString& string, QString& match return false; } -QString QGCAudioWorker::_fixMillisecondString(const QString& string) { +QString QGCAudioWorker::_fixTextMessageForAudio(const QString& string) { QString match; QString newNumber; QString result = string; + //-- Look for modes + if(result.contains("POSCTL", Qt::CaseInsensitive)) { + result.replace("POSCTL", "Position Control", Qt::CaseInsensitive); + } else if(result.contains("ALTCTL", Qt::CaseInsensitive)) { + result.replace("ALTCTL", "Altitude Control", Qt::CaseInsensitive); + } else if(result.contains("RTL", Qt::CaseInsensitive)) { + result.replace("RTL", "Return To Land", Qt::CaseInsensitive); + } int number; if(_getMillisecondString(string, match, number) && number > 1000) { if(number < 60000) { diff --git a/src/audio/QGCAudioWorker.h b/src/audio/QGCAudioWorker.h index beafe42..1d40322 100644 --- a/src/audio/QGCAudioWorker.h +++ b/src/audio/QGCAudioWorker.h @@ -51,7 +51,7 @@ protected: QTimer *emergencyTimer; bool muted; private: - QString _fixMillisecondString(const QString& string); + QString _fixTextMessageForAudio(const QString& string); bool _getMillisecondString(const QString& string, QString& match, int& number); }; diff --git a/src/comm/MAVLinkProtocol.h b/src/comm/MAVLinkProtocol.h index e45aef2..b190008 100644 --- a/src/comm/MAVLinkProtocol.h +++ b/src/comm/MAVLinkProtocol.h @@ -254,7 +254,7 @@ signals: void paramRewriteTimeoutChanged(int ms); /** @brief Emitted if action guard status changed */ void actionGuardChanged(bool enabled); - /** @brief Emitted if actiion request timeout changed */ + /** @brief Emitted if action request timeout changed */ void actionRetransmissionTimeoutChanged(int ms); /** @brief Update the packet loss from one system */ void receiveLossChanged(int uasId, float loss); diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 1eab9d3..1b3c0e3 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -923,10 +923,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) mavlink_rc_channels_t channels; mavlink_msg_rc_channels_decode(&message, &channels); - // UINT8_MAX indicates this value is unknown - if (channels.rssi != UINT8_MAX) { - emit remoteControlRSSIChanged(channels.rssi/100.0f); - } + emit remoteControlRSSIChanged(channels.rssi); if (channels.chan1_raw != UINT16_MAX && channels.chancount > 0) emit remoteControlChannelRawChanged(0, channels.chan1_raw); @@ -967,6 +964,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) } break; + + // TODO: (gg 20150420) PX4 Firmware does not seem to send this message. Don't know what to do about it. case MAVLINK_MSG_ID_RC_CHANNELS_SCALED: { mavlink_rc_channels_scaled_t channels; @@ -974,7 +973,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) const unsigned int portWidth = 8; // XXX magic number - emit remoteControlRSSIChanged(channels.rssi/255.0f); + emit remoteControlRSSIChanged(channels.rssi); if (static_cast(channels.chan1_scaled) != UINT16_MAX) emit remoteControlChannelScaledChanged(channels.port * portWidth + 0, channels.chan1_scaled/10000.0f); if (static_cast(channels.chan2_scaled) != UINT16_MAX) diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index a30f668..4d0c34b 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -570,8 +570,8 @@ signals: void remoteControlChannelRawChanged(int channelId, float raw); /** @brief Value of a remote control channel (scaled)*/ void remoteControlChannelScaledChanged(int channelId, float normalized); - /** @brief Remote control RSSI changed */ - void remoteControlRSSIChanged(float rssi); + /** @brief Remote control RSSI changed (0% - 100%)*/ + void remoteControlRSSIChanged(uint8_t rssi); /** * @brief Localization quality changed diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 8d20f4e..6d203fe 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -148,7 +148,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) emit initStatusChanged(tr("Setting up user interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); _ui.setupUi(this); // Make sure tool bar elements all fit before changing minimum width - setMinimumWidth(926); + setMinimumWidth(1008); configureWindowName(); // Setup central widget with a layout to hold the views diff --git a/src/ui/SettingsDialog.cc b/src/ui/SettingsDialog.cc index 56e3fcf..bbe196c 100644 --- a/src/ui/SettingsDialog.cc +++ b/src/ui/SettingsDialog.cc @@ -81,6 +81,7 @@ _ui(new Ui::SettingsDialog) _ui->showGPS->setChecked(settings.value( TOOL_BAR_SHOW_GPS, true).toBool()); _ui->showMav->setChecked(settings.value( TOOL_BAR_SHOW_MAV, true).toBool()); _ui->showMessages->setChecked(settings.value(TOOL_BAR_SHOW_MESSAGES, true).toBool()); + _ui->showRSSI->setChecked(settings.value( TOOL_BAR_SHOW_RSSI, true).toBool()); settings.endGroup(); // Audio preferences _ui->audioMuteCheckBox->setChecked(GAudioOutput::instance()->isMuted()); @@ -206,3 +207,8 @@ void SettingsDialog::on_showMav_clicked(bool checked) { _mainWindow->getMainToolBar()->viewStateChanged(TOOL_BAR_SHOW_MAV, checked); } + +void SettingsDialog::on_showRSSI_clicked(bool checked) +{ + _mainWindow->getMainToolBar()->viewStateChanged(TOOL_BAR_SHOW_RSSI, checked); +} diff --git a/src/ui/SettingsDialog.h b/src/ui/SettingsDialog.h index e061288..cd85684 100644 --- a/src/ui/SettingsDialog.h +++ b/src/ui/SettingsDialog.h @@ -65,6 +65,8 @@ private slots: void on_showMessages_clicked(bool checked); void on_showMav_clicked(bool checked); + void on_showRSSI_clicked(bool checked); + private: MainWindow* _mainWindow; Ui::SettingsDialog* _ui; diff --git a/src/ui/SettingsDialog.ui b/src/ui/SettingsDialog.ui index 16bcdbe..036595c 100644 --- a/src/ui/SettingsDialog.ui +++ b/src/ui/SettingsDialog.ui @@ -7,7 +7,7 @@ 0 0 500 - 604 + 596 @@ -37,338 +37,326 @@ - - - 10 + + + + 0 + 0 + - - - - - 0 - 0 - - - - Mute all audio output - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Automatically reconnect last link on application startup - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Lowers all update rates to save battery power - - - Enable low power mode - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Prompt to save Flight Data Log after each flight - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Style - - - false - - - false - - + + Mute all audio output + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Automatically reconnect last link on application startup + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Lowers all update rates to save battery power + + + Enable low power mode + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Prompt to save Flight Data Log after each flight + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Style + + + false + + + false + + + + 8 + + + 8 + + + + + 0 + + + QLayout::SetDefaultConstraint + + + 0 + + + 80 + - - - QLayout::SetMinimumSize - - - 0 + + + + 0 + 0 + - - 80 + + + 200 + 0 + - - - - 0 - 0 - - - - - 200 - 0 - - - - - Dark (for indoor use) - - - - - Light (for outdoor use) - - - + + Dark (for indoor use) + - + + + Light (for outdoor use) + + + - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - File Locations - - + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + File Locations + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Specify the location you would like to save files: + + + true + + + + + - - - - 0 - 0 - - + - 0 - 0 + 200 + 21 - - Specify the location you would like to save files: + + 1024 - - true + + + + + + Browse + + + + + + + + + + 0 + 0 + + + + Tool Bar + + + + - + - + - 200 - 21 + 160 + 0 - - 1024 + + Show GPS - + - Browse + Show Messages - - - - - - - - 0 - 0 - - - - Tool Bar - - - + - - - - - - 160 - 0 - - - - Show GPS - - - - - - - Show Messages - - - - + + + + 160 + 0 + + + + Show Battery + + - - - - - - 160 - 0 - - - - Show Battery - - - - - - - Show Mav Icon - - - - + + + Show Mav Icon + + - - - - - - - Reset All Settings to Default - - - + - Delete all saved settings on next boot - - - - - - - - 11 - - - - Note: You can also use --clear-settings as a command line option to accomplish this. - - - true + Show RSSI - - - - - - Qt::Vertical - - - - 20 - 10 - - - - - + + + + + + + + Reset All Settings to Default + + + + + + Delete all saved settings on next boot + + + + + + + + 11 + + + + Note: You can also use --clear-settings as a command line option to accomplish this. + + + true + + + + + - audioMuteCheckBox - reconnectCheckBox - lowPowerCheckBox - promptFlightDataSave - groupBox - fileLocationsLayout - groupBox_2 - groupBox_3 diff --git a/src/ui/flightdisplay/QGCFlightDisplay.cc b/src/ui/flightdisplay/QGCFlightDisplay.cc index 537cdce..d7d2a47 100644 --- a/src/ui/flightdisplay/QGCFlightDisplay.cc +++ b/src/ui/flightdisplay/QGCFlightDisplay.cc @@ -303,10 +303,14 @@ void QGCFlightDisplay::_checkUpdate() emit longitudeChanged(); } if(_mav) { - _latitude = _mav->getLatitude(); - _longitude = _mav->getLongitude(); - if(_latitude) emit latitudeChanged(); - if(_longitude) emit longitudeChanged(); + if(_latitude != _mav->getLatitude()) { + _latitude = _mav->getLatitude(); + emit latitudeChanged(); + } + if(_longitude != _mav->getLongitude()) { + _longitude = _mav->getLongitude(); + emit longitudeChanged(); + } } } diff --git a/src/ui/toolbar/MainToolBar.cc b/src/ui/toolbar/MainToolBar.cc index f10c315..689e154 100644 --- a/src/ui/toolbar/MainToolBar.cc +++ b/src/ui/toolbar/MainToolBar.cc @@ -58,8 +58,12 @@ MainToolBar::MainToolBar(QWidget* parent) , _showGPS(true) , _showMav(true) , _showMessages(true) + , _showRSSI(true) , _showBattery(true) , _progressBarValue(0.0f) + , _remoteRSSI(0) + , _telemetryRRSSI(0) + , _telemetryLRSSI(0) , _rollDownMessages(0) { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -95,10 +99,14 @@ MainToolBar::MainToolBar(QWidget* parent) emit heartbeatTimeoutChanged(_currentHeartbeatTimeout); emit connectionCountChanged(_connectionCount); // Link signals - connect(UASManager::instance(), &UASManager::activeUASSet, this, &MainToolBar::_setActiveUAS); - connect(LinkManager::instance(), &LinkManager::linkConfigurationChanged, this, &MainToolBar::_updateConfigurations); - connect(LinkManager::instance(), &LinkManager::linkConnected, this, &MainToolBar::_linkConnected); - connect(LinkManager::instance(), &LinkManager::linkDisconnected, this, &MainToolBar::_linkDisconnected); + connect(UASManager::instance(), &UASManager::activeUASSet, this, &MainToolBar::_setActiveUAS); + connect(LinkManager::instance(), &LinkManager::linkConfigurationChanged, this, &MainToolBar::_updateConfigurations); + connect(LinkManager::instance(), &LinkManager::linkConnected, this, &MainToolBar::_linkConnected); + connect(LinkManager::instance(), &LinkManager::linkDisconnected, this, &MainToolBar::_linkDisconnected); + // RSSI (didn't like standard connection) + connect(MAVLinkProtocol::instance(), + SIGNAL(radioStatusChanged(LinkInterface*, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned)), this, + SLOT(_telemetryChanged(LinkInterface*, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned))); } MainToolBar::~MainToolBar() @@ -124,6 +132,9 @@ void MainToolBar::_setToolBarState(const QString& key, bool value) } else if(key == TOOL_BAR_SHOW_MESSAGES) { _showMessages = value; emit showMessagesChanged(value); + } else if(key == TOOL_BAR_SHOW_RSSI) { + _showRSSI = value; + emit showRSSIChanged(value); } } @@ -296,6 +307,7 @@ void MainToolBar::_setActiveUAS(UASInterface* active) disconnect(_mav, &UASInterface::nameChanged, this, &MainToolBar::_updateName); disconnect(_mav, &UASInterface::systemTypeSet, this, &MainToolBar::_setSystemType); disconnect(_mav, &UASInterface::localizationChanged, this, &MainToolBar::_setSatLoc); + disconnect(_mav, &UASInterface::remoteControlRSSIChanged, this, &MainToolBar::_remoteControlRSSIChanged); disconnect(_mav, SIGNAL(statusChanged(UASInterface*,QString,QString)), this, SLOT(_updateState(UASInterface*,QString,QString))); disconnect(_mav, SIGNAL(armingChanged(bool)), this, SLOT(_updateArmingState(bool))); if (_mav->getWaypointManager()) @@ -324,6 +336,7 @@ void MainToolBar::_setActiveUAS(UASInterface* active) connect(_mav, &UASInterface::nameChanged, this, &MainToolBar::_updateName); connect(_mav, &UASInterface::systemTypeSet, this, &MainToolBar::_setSystemType); connect(_mav, &UASInterface::localizationChanged, this, &MainToolBar::_setSatLoc); + connect(_mav, &UASInterface::remoteControlRSSIChanged, this, &MainToolBar::_remoteControlRSSIChanged); connect(_mav, SIGNAL(statusChanged(UASInterface*,QString,QString)), this, SLOT(_updateState(UASInterface*, QString,QString))); connect(_mav, SIGNAL(armingChanged(bool)), this, SLOT(_updateArmingState(bool))); if (_mav->getWaypointManager()) @@ -347,6 +360,34 @@ void MainToolBar::_setActiveUAS(UASInterface* active) emit mavPresentChanged(_mav != NULL); } +void MainToolBar::_telemetryChanged(LinkInterface*, unsigned, unsigned, unsigned rssi, unsigned remrssi, unsigned, unsigned, unsigned) +{ + // We only care if we haveone single connection + if(_connectionCount == 1) { + if((unsigned)_telemetryLRSSI != rssi) { + // According to the Silabs data sheet, the RSSI value is 0.5db per bit + _telemetryLRSSI = rssi >> 1; + emit telemetryLRSSIChanged(_telemetryLRSSI); + } + if((unsigned)_telemetryRRSSI != remrssi) { + // According to the Silabs data sheet, the RSSI value is 0.5db per bit + _telemetryRRSSI = remrssi >> 1; + emit telemetryRRSSIChanged(_telemetryRRSSI); + } + } +} + +void MainToolBar::_remoteControlRSSIChanged(uint8_t rssi) +{ + // We only care if we haveone single connection + if(_connectionCount == 1) { + if(_remoteRSSI != rssi) { + _remoteRSSI = rssi; + emit remoteRSSIChanged(_remoteRSSI); + } + } +} + void MainToolBar::_updateArmingState(bool armed) { if(_systemArmed != armed) { @@ -426,6 +467,19 @@ void MainToolBar::_updateConnection(LinkInterface *disconnectedLink) _connectedList = connList; emit connectedListChanged(_connectedList); } + // Update telemetry RSSI display + if(_connectionCount != 1 && _telemetryRRSSI > 0) { + _telemetryRRSSI = 0; + emit telemetryRRSSIChanged(_telemetryRRSSI); + } + if(_connectionCount != 1 && _telemetryLRSSI > 0) { + _telemetryLRSSI = 0; + emit telemetryLRSSIChanged(_telemetryLRSSI); + } + if(_connectionCount != 1 && _remoteRSSI > 0) { + _remoteRSSI = 0; + emit remoteRSSIChanged(_remoteRSSI); + } } void MainToolBar::_updateState(UASInterface*, QString name, QString) diff --git a/src/ui/toolbar/MainToolBar.h b/src/ui/toolbar/MainToolBar.h index 09ded36..bd18a7f 100644 --- a/src/ui/toolbar/MainToolBar.h +++ b/src/ui/toolbar/MainToolBar.h @@ -37,6 +37,7 @@ This file is part of the QGROUNDCONTROL project #define TOOL_BAR_SHOW_GPS "ShowGPS" #define TOOL_BAR_SHOW_MAV "ShowMav" #define TOOL_BAR_SHOW_MESSAGES "ShowMessages" +#define TOOL_BAR_SHOW_RSSI "ShowRSSI" class UASInterface; class UASMessage; @@ -96,12 +97,19 @@ public: Q_PROPERTY(bool showMav MEMBER _showMav NOTIFY showMavChanged) Q_PROPERTY(bool showMessages MEMBER _showMessages NOTIFY showMessagesChanged) Q_PROPERTY(bool showBattery MEMBER _showBattery NOTIFY showBatteryChanged) + Q_PROPERTY(bool showRSSI MEMBER _showRSSI NOTIFY showRSSIChanged) Q_PROPERTY(float progressBarValue MEMBER _progressBarValue NOTIFY progressBarValueChanged) + Q_PROPERTY(int remoteRSSI READ remoteRSSI NOTIFY remoteRSSIChanged) + Q_PROPERTY(int telemetryRRSSI READ telemetryRRSSI NOTIFY telemetryRRSSIChanged) + Q_PROPERTY(int telemetryLRSSI READ telemetryLRSSI NOTIFY telemetryLRSSIChanged) - bool mavPresent () { return _mav != NULL; } + bool mavPresent () { return _mav != NULL; } + int remoteRSSI () { return _remoteRSSI; } + int telemetryRRSSI () { return _telemetryRRSSI; } + int telemetryLRSSI () { return _telemetryLRSSI; } - void setCurrentView (int currentView); - void viewStateChanged (const QString& key, bool value); + void setCurrentView (int currentView); + void viewStateChanged (const QString& key, bool value); signals: void connectionCountChanged (int count); @@ -126,7 +134,11 @@ signals: void showMavChanged (bool value); void showMessagesChanged (bool value); void showBatteryChanged (bool value); + void showRSSIChanged (bool value); void progressBarValueChanged (float value); + void remoteRSSIChanged (int value); + void telemetryRRSSIChanged (int value); + void telemetryLRSSIChanged (int value); private slots: void _setActiveUAS (UASInterface* active); @@ -147,6 +159,8 @@ private slots: void _leaveMessageView (); void _setSatLoc (UASInterface* uas, int fix); void _setProgressBarValue (float value); + void _remoteControlRSSIChanged (uint8_t rssi); + void _telemetryChanged (LinkInterface* link, unsigned rxerrors, unsigned fixed, unsigned rssi, unsigned remrssi, unsigned txbuf, unsigned noise, unsigned remnoise); private: void _updateConnection (LinkInterface *disconnectedLink = NULL); @@ -180,8 +194,12 @@ private: bool _showGPS; bool _showMav; bool _showMessages; + bool _showRSSI; bool _showBattery; float _progressBarValue; + int _remoteRSSI; + int _telemetryRRSSI; + int _telemetryLRSSI; UASMessageViewRollDown* _rollDownMessages; }; diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml index 0830c86..2076169 100644 --- a/src/ui/toolbar/MainToolBar.qml +++ b/src/ui/toolbar/MainToolBar.qml @@ -45,11 +45,10 @@ Rectangle { property int cellSpacerSize: getProportionalDimmension(4) property int cellHeight: getProportionalDimmension(30) - property int cellRadius: getProportionalDimmension(3) property var colorBlue: "#1a6eaa" - property var colorGreen: "#079527" - property var colorRed: "#a81a1b" + property var colorGreen: "#329147" + property var colorRed: "#942324" property var colorOrange: "#a76f26" property var colorWhite: "#f0f0f0" @@ -122,6 +121,14 @@ Rectangle { return colorGreen; } + function getRSSIColor(value) { + if(value < 10) + return colorRed; + if(value < 50) + return colorOrange; + return colorGreen; + } + function showMavStatus() { return (mainToolBar.mavPresent && mainToolBar.heartbeatTimeout === 0 && mainToolBar.connectionCount > 0); } @@ -217,12 +224,11 @@ Rectangle { Rectangle { id: messages - width: (mainToolBar.messageCount > 99) ? getProportionalDimmension(70) : getProportionalDimmension(60) + width: (mainToolBar.messageCount > 99) ? getProportionalDimmension(65) : getProportionalDimmension(60) height: cellHeight visible: (mainToolBar.connectionCount > 0) && (mainToolBar.showMessages) anchors.verticalCenter: parent.verticalCenter color: getMessageColor() - radius: cellRadius border.color: "#00000000" border.width: 0 property bool showTriangle: false @@ -234,10 +240,10 @@ Rectangle { fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left - anchors.leftMargin: getProportionalDimmension(10) + anchors.leftMargin: getProportionalDimmension(8) } - Rectangle { + Item { id: messageTextRect anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right @@ -296,7 +302,6 @@ Rectangle { visible: showMavStatus() && (mainToolBar.showMav) anchors.verticalCenter: parent.verticalCenter color: colorBlue - radius: cellRadius border.color: "#00000000" border.width: 0 Image { @@ -310,12 +315,11 @@ Rectangle { Rectangle { id: satelitte - width: getProportionalDimmension(60) + width: getProportionalDimmension(50) height: cellHeight visible: showMavStatus() && (mainToolBar.showGPS) anchors.verticalCenter: parent.verticalCenter color: getSatelliteColor(); - radius: cellRadius border.color: "#00000000" border.width: 0 @@ -325,32 +329,122 @@ Rectangle { fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left - anchors.leftMargin: getProportionalDimmension(10) + anchors.leftMargin: getProportionalDimmension(6) mipmap: true smooth: true } QGCLabel { id: satelitteText - text: (mainToolBar.satelliteCount > 0) ? mainToolBar.satelliteCount : '' + text: mainToolBar.satelliteCount font.pointSize: screenTools.dpiAdjustedPointSize(14); font.weight: Font.DemiBold anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: getProportionalDimmension(10) + anchors.rightMargin: getProportionalDimmension(6) horizontalAlignment: Text.AlignRight color: colorWhite } } Rectangle { + id: rssiRC + width: getProportionalDimmension(55) + height: cellHeight + visible: showMavStatus() && mainToolBar.showRSSI && mainToolBar.remoteRSSI <= 100 + anchors.verticalCenter: parent.verticalCenter + color: getRSSIColor(mainToolBar.remoteRSSI); + border.color: "#00000000" + border.width: 0 + Image { + source: "qrc:/res/AntennaRC"; + width: cellHeight * 0.7 + fillMode: Image.PreserveAspectFit + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: getProportionalDimmension(6) + mipmap: true + smooth: true + } + QGCLabel { + text: mainToolBar.remoteRSSI + anchors.right: parent.right + anchors.rightMargin: getProportionalDimmension(6) + anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: Text.AlignRight + font.pointSize: screenTools.dpiAdjustedPointSize(12); + font.weight: Font.DemiBold + color: colorWhite + } + } + + Rectangle { + id: rssiTelemetry + width: getProportionalDimmension(80) + height: cellHeight + visible: showMavStatus() && (mainToolBar.showRSSI) && ((mainToolBar.telemetryRRSSI > 0) && (mainToolBar.telemetryLRSSI > 0)) + anchors.verticalCenter: parent.verticalCenter + color: getRSSIColor(Math.min(mainToolBar.telemetryRRSSI,mainToolBar.telemetryLRSSI)); + border.color: "#00000000" + border.width: 0 + Image { + source: "qrc:/res/AntennaT"; + width: cellHeight * 0.7 + fillMode: Image.PreserveAspectFit + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: getProportionalDimmension(6) + mipmap: true + smooth: true + } + Column { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: getProportionalDimmension(6) + Row { + anchors.right: parent.right + QGCLabel { + text: 'R ' + font.pointSize: screenTools.dpiAdjustedPointSize(11); + font.weight: Font.DemiBold + color: colorWhite + } + QGCLabel { + text: mainToolBar.telemetryRRSSI + 'dB' + width: getProportionalDimmension(30) + horizontalAlignment: Text.AlignRight + font.pointSize: screenTools.dpiAdjustedPointSize(11); + font.weight: Font.DemiBold + color: colorWhite + } + } + Row { + anchors.right: parent.right + QGCLabel { + text: 'L ' + font.pointSize: screenTools.dpiAdjustedPointSize(11); + font.weight: Font.DemiBold + color: colorWhite + } + QGCLabel { + text: mainToolBar.telemetryLRSSI + 'dB' + width: getProportionalDimmension(30) + horizontalAlignment: Text.AlignRight + font.pointSize: screenTools.dpiAdjustedPointSize(11); + font.weight: Font.DemiBold + color: colorWhite + } + } + } + } + + Rectangle { id: battery - width: getProportionalDimmension(80) + width: getProportionalDimmension(60) height: cellHeight visible: showMavStatus() && (mainToolBar.showBattery) anchors.verticalCenter: parent.verticalCenter - color: (mainToolBar.batteryPercent > 40.0 || mainToolBar.batteryPercent < 0.01) ? colorBlue : colorRed - radius: cellRadius + color: getBatteryColor(); border.color: "#00000000" border.width: 0 @@ -367,12 +461,12 @@ Rectangle { QGCLabel { id: batteryText - text: mainToolBar.batteryVoltage.toFixed(1) + ' V'; - font.pointSize: screenTools.dpiAdjustedPointSize(14); + text: mainToolBar.batteryVoltage.toFixed(1) + 'V'; + font.pointSize: screenTools.dpiAdjustedPointSize(12); font.weight: Font.DemiBold anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: getProportionalDimmension(8) + anchors.rightMargin: getProportionalDimmension(6) horizontalAlignment: Text.AlignRight color: colorWhite }