You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.7 KiB
101 lines
3.7 KiB
/**************************************************************************** |
|
* |
|
* (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> |
|
* |
|
* QGroundControl is licensed according to the terms in the file |
|
* COPYING.md in the root of the source code directory. |
|
* |
|
* @file |
|
* @author Gus Grubba <gus@auterion.com> |
|
*/ |
|
|
|
import QtQuick 2.11 |
|
import QtQuick.Controls 1.4 |
|
import QtQuick.Layouts 1.11 |
|
|
|
import QGroundControl 1.0 |
|
import QGroundControl.Controls 1.0 |
|
import QGroundControl.MultiVehicleManager 1.0 |
|
import QGroundControl.ScreenTools 1.0 |
|
import QGroundControl.Palette 1.0 |
|
|
|
import Custom.Widgets 1.0 |
|
|
|
//------------------------------------------------------------------------- |
|
//-- RC RSSI Indicator |
|
Item { |
|
id: _root |
|
width: visible ? rssiRow.width : 0 |
|
anchors.top: parent.top |
|
anchors.bottom: parent.bottom |
|
visible: activeVehicle ? activeVehicle.supportsRadio : true |
|
|
|
property bool _rcRSSIAvailable: activeVehicle ? activeVehicle.rcRSSI > 0 && activeVehicle.rcRSSI <= 100 : false |
|
|
|
Component { |
|
id: rcRSSIInfo |
|
|
|
Rectangle { |
|
width: rcrssiCol.width + ScreenTools.defaultFontPixelWidth * 3 |
|
height: rcrssiCol.height + ScreenTools.defaultFontPixelHeight * 2 |
|
radius: ScreenTools.defaultFontPixelHeight * 0.5 |
|
color: qgcPal.window |
|
|
|
Column { |
|
id: rcrssiCol |
|
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
|
width: Math.max(rcrssiGrid.width, rssiLabel.width) |
|
anchors.margins: ScreenTools.defaultFontPixelHeight |
|
anchors.centerIn: parent |
|
|
|
QGCLabel { |
|
id: rssiLabel |
|
text: activeVehicle ? (activeVehicle.rcRSSI !== 255 ? qsTr("RC RSSI Status") : qsTr("RC RSSI Data Unavailable")) : qsTr("N/A", "No data available") |
|
font.family: ScreenTools.demiboldFontFamily |
|
anchors.horizontalCenter: parent.horizontalCenter |
|
} |
|
|
|
GridLayout { |
|
id: rcrssiGrid |
|
visible: _rcRSSIAvailable |
|
anchors.margins: ScreenTools.defaultFontPixelHeight |
|
columnSpacing: ScreenTools.defaultFontPixelWidth |
|
columns: 2 |
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
QGCLabel { text: qsTr("RSSI:") } |
|
QGCLabel { text: activeVehicle ? (activeVehicle.rcRSSI + "%") : 0 } |
|
} |
|
} |
|
} |
|
} |
|
|
|
Row { |
|
id: rssiRow |
|
anchors.top: parent.top |
|
anchors.bottom: parent.bottom |
|
spacing: ScreenTools.defaultFontPixelWidth * 0.25 |
|
QGCColoredImage { |
|
width: height |
|
anchors.top: parent.top |
|
anchors.bottom: parent.bottom |
|
sourceSize.height: height |
|
source: "/custom/img/menu_rc.svg" |
|
color: qgcPal.text |
|
fillMode: Image.PreserveAspectFit |
|
opacity: _rcRSSIAvailable ? 1 : 0.5 |
|
} |
|
CustomSignalStrength { |
|
anchors.verticalCenter: parent.verticalCenter |
|
size: parent.height * 0.75 |
|
percent: _rcRSSIAvailable ? activeVehicle.rcRSSI : 0 |
|
} |
|
} |
|
|
|
MouseArea { |
|
anchors.fill: parent |
|
onClicked: { |
|
mainWindow.showPopUp(_root, rcRSSIInfo) |
|
} |
|
} |
|
}
|
|
|