forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f474e17
commit 99563cb
Showing
8 changed files
with
201 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2020 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. | ||
* | ||
****************************************************************************/ | ||
|
||
import QtQuick 2.11 | ||
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 | ||
|
||
//------------------------------------------------------------------------- | ||
//-- ADSB Vehicle | ||
Item { | ||
id: _root | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
width: adsbIcon.width * 1.1 | ||
|
||
property var adsbManager: QGroundControl.adsbVehicleManager | ||
|
||
// Add a button or icon to display the list of hidden vehicles | ||
QGCColoredImage { | ||
id: adsbIcon | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
width: height | ||
sourceSize.height: height | ||
source: "/qmlimages/AwarenessDrone.svg" | ||
fillMode: Image.PreserveAspectFit | ||
visible: adsbManager && adsbManager.hasHiddenVehicles | ||
} | ||
|
||
MouseArea { | ||
anchors.fill: adsbIcon | ||
onClicked: { | ||
mainWindow.showIndicatorPopup(_root, hiddenVehiclesPopup) | ||
} | ||
} | ||
|
||
Component { | ||
id: hiddenVehiclesPopup | ||
|
||
Rectangle { | ||
width: adsbCol.width + ScreenTools.defaultFontPixelWidth * 3 | ||
height: adsbCol.height + ScreenTools.defaultFontPixelHeight * 2 | ||
radius: ScreenTools.defaultFontPixelHeight * 0.5 | ||
color: qgcPal.window | ||
border.color: qgcPal.text | ||
|
||
Column { | ||
id: adsbCol | ||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 | ||
width: Math.max(hiddenVehiclesList.width, adsbLabel.width) | ||
anchors.margins: ScreenTools.defaultFontPixelHeight | ||
anchors.centerIn: parent | ||
|
||
QGCLabel { | ||
id: adsbLabel | ||
text: qsTr("Hidden ADS-B Vehicles") | ||
font.family: ScreenTools.demiboldFontFamily | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
} | ||
|
||
ListView { | ||
id: hiddenVehiclesList | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
anchors.top: titleLabel.bottom | ||
anchors.bottom: parent.bottom | ||
model: adsbManager.hiddenVehicles | ||
delegate: Item { | ||
width: parent.width | ||
height: ScreenTools.defaultFontPixelHeight * 2 | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
onClicked: { | ||
adsbManager.unhideADSBVehicle(modelData["icaoAddress"]) | ||
mainWindow.hidePopup() | ||
} | ||
} | ||
|
||
Text { | ||
text: modelData["callsign"] !== "" ? modelData["callsign"] : qsTr("Unknown Vehicle") | ||
anchors.verticalCenter: parent.verticalCenter | ||
anchors.left: parent.left | ||
anchors.leftMargin: 10 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |