Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Scholle committed Oct 4, 2023
1 parent fd41b0a commit a45c689
Show file tree
Hide file tree
Showing 24 changed files with 633 additions and 404 deletions.
4 changes: 2 additions & 2 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ApplicationWindow {
contentOrientation: settings.general_screen_rotation===0 ? Qt.PortraitOrientation : Qt.LandscapeOrientation
contentItem.rotation: settings.general_screen_rotation

minimumWidth: 480
minimumHeight: 320
minimumWidth: 850
minimumHeight: 480
title: qsTr("QOpenHD EVO")
// Transparent background is needed when the video is not rendered via (OpenGL) inside QT,
// but rather done independently by using a pipeline that directly goes to the HW composer (e.g. mmal on pi).
Expand Down
4 changes: 3 additions & 1 deletion qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
<file>resources/master3.png</file>
<file>resources/master4.png</file>
<file>resources/master5.png</file>
<file>resources/noconnection.svg</file>
<file>ui/widgets/AirspeedTempWidget.qml</file>
<file>ui/widgets/AoaWidget.qml</file>
<file>ui/widgets/MessageHUDRow.qml</file>
Expand Down Expand Up @@ -253,7 +254,8 @@
<file>ui/elements/CardToast.qml</file>
<file>ui/elements/ButtonYellow.qml</file>
<file>ui/configpopup/connect/PaneLocalhost.qml</file>
<file>ui/configpopup/connect/PaneInfo.qml</file>
<file>ui/configpopup/connect/PaneTethering.qml</file>
<file>ui/configpopup/connect/GenericInfoPane.qml</file>
<file>ui/elements/ButtonSimple.qml</file>
</qresource>
</RCC>
18 changes: 18 additions & 0 deletions qml/resources/noconnection.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 47 additions & 47 deletions qml/ui/configpopup/connect/ConnectPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ Item {
id: selectItemInStackLayoutBar
width: parent.width
TabButton {
text: qsTr("INFO")
text: qsTr("TCP")
}
TabButton{
text: "LOCAL"
}
TabButton {
text: qsTr("USB Tether")
}
TabButton {
text: qsTr("(USB) Ethernet passive")
}
TabButton {
text: qsTr("(USB) Ethernet active")
}
TabButton {
text: qsTr("WiFi")
}
TabButton {
text: qsTr("Custom (TCP)")
text: "Tethering"
}
// TabButton {
// text: qsTr("USB Tether")
// }
// TabButton {
// text: qsTr("(USB) Ethernet passive")
// }
// TabButton {
// text: qsTr("(USB) Ethernet active")
// }
// TabButton {
// text: qsTr("WiFi")
// }
// TabButton {
// text: qsTr("Custom (TCP)")
// }
}

// placed right below the top bar
Expand All @@ -59,41 +59,41 @@ Item {
currentIndex: selectItemInStackLayoutBar.currentIndex


PaneInfo{
PaneCustom{
}

PaneLocalhost{
}
PaneTethering{
}

PaneUSBTether{
id: pane_usb_tether
}
// PaneUSBTether{
// id: pane_usb_tether
// }

GenericInfoPane{
m_info_text: {
return"1) Make sure ETH_HOTSPOT_E is disabled (Ground param)\n\n"+
"2) Enable ETH_PASSIVE_F on your openhd ground unit (Ground param)\n\n"+
"3) Connect your external device running QOpenHD to your ground station via ethernet\n(e.g. ethernet port on rpi 4).\n\n"+
"4) Make sure to select 'share my internet with ...' when the android connection setup pops up\n\n"+
"Video and telemetry forwarding should start automatically, and your GCS can get internet from your phone."
}
}
GenericInfoPane{
m_info_text: {
return "1) Make sure ETH_PASSIVE_F is disabled (Ground param)\n\n"+
"2) Enable ETH_HOTSPOT_E on your openhd ground unit (Ground param)\n\n"+
"3) Connect your external device running QOpenHD to your ground station via ethernet\n(e.g. ethernet port on rpi 4).\n\n"+
"You might have to disable wifi and cellular on your phone !.\n\n"+
"Video and telemetry forwarding should start automatically."
}
}
// GenericInfoPane{
// m_info_text: {
// return"1) Make sure ETH_HOTSPOT_E is disabled (Ground param)\n\n"+
// "2) Enable ETH_PASSIVE_F on your openhd ground unit (Ground param)\n\n"+
// "3) Connect your external device running QOpenHD to your ground station via ethernet\n(e.g. ethernet port on rpi 4).\n\n"+
// "4) Make sure to select 'share my internet with ...' when the android connection setup pops up\n\n"+
// "Video and telemetry forwarding should start automatically, and your GCS can get internet from your phone."
// }
// }
// GenericInfoPane{
// m_info_text: {
// return "1) Make sure ETH_PASSIVE_F is disabled (Ground param)\n\n"+
// "2) Enable ETH_HOTSPOT_E on your openhd ground unit (Ground param)\n\n"+
// "3) Connect your external device running QOpenHD to your ground station via ethernet\n(e.g. ethernet port on rpi 4).\n\n"+
// "You might have to disable wifi and cellular on your phone !.\n\n"+
// "Video and telemetry forwarding should start automatically."
// }
// }

PaneWIFI{
id: wifi
}
// PaneWIFI{
// id: wifi
// }

PaneCustom{
id: pane_custom
}
// PaneCustom{
// id: pane_custom
// }
}
}
5 changes: 3 additions & 2 deletions qml/ui/configpopup/connect/GenericInfoPane.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ Pane {

ScrollView {
id:mavlinkExtraWBParamPanel
width: parent.width
height: parent.height
width: parent.width-24
height: parent.height-24
anchors.centerIn: parent
contentHeight: mainItem.height
contentWidth: mainItem.width
clip: true
Expand Down
85 changes: 40 additions & 45 deletions qml/ui/configpopup/connect/PaneCustom.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,58 @@ import OpenHD 1.0

import "../../../ui" as Ui
import "../../elements"

Rectangle {
width: parent.width
height: parent.height
//color: "green"

property string m_info_text: "ADVANCED - Connect to a ground station (running OpenHD core) located anywhere in your network using TCP.\n"+
"After connecting (mavlink) via TCP, video will also be streamed to this device (using UDP)."

ColumnLayout{
anchors.fill: parent

spacing: 6
Rectangle {
id: innerRect
width: 300
height: 300
anchors.centerIn: parent
anchors.horizontalCenterOffset: 70
ColumnLayout {
spacing: 6

Text{
Layout.alignment: Qt.AlignTop
width:parent.width
wrapMode: Text.WordWrap
text: m_info_text
}
RowLayout{
TextField {
id: textFieldip
validator: RegExpValidator {
regExp: /^((?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){0,3}(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/
RowLayout {
TextField {
id: textFieldip
validator: RegExpValidator {
regExp: /^((?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){0,3}(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/
}
inputMethodHints: Qt.ImhFormattedNumbersOnly
text: "192.168.178.36" //settings.dev_mavlink_tcp_ip
}
ButtonIconInfoText {
m_info_text: "Connect with a OpenHD Ground Station, via TCP, this will still stream video va UDP for lower latency, after a successful conneciton."
}
inputMethodHints: Qt.ImhFormattedNumbersOnly
text: "192.168.178.36" //settings.dev_mavlink_tcp_ip
}
ButtonIconInfoText{
m_info_text: "Enter your grund station IP, then click 'CONNECT TCP'"

Button {
Layout.alignment: Qt.AlignTop
text: "CONNECT TCP"
onClicked: {
var ip_address = textFieldip.text
if (_qopenhd.is_valid_ip(ip_address)) {
_mavlinkTelemetry.add_tcp_connection_handler(ip_address)
} else {
_qopenhd.show_toast("Please enter a valid ip")
}
}
}
}

Button{
Layout.alignment: Qt.AlignTop
text: "CONNECT TCP"
onClicked: {
var ip_address=textFieldip.text
if(_qopenhd.is_valid_ip(ip_address)){
_mavlinkTelemetry.add_tcp_connection_handler(ip_address)
}else{
_qopenhd.show_toast("Please enter a valid ip")
Button {
text: "RE-ENABLE UDP"
onClicked: {
_mavlinkTelemetry.enable_udp()
}
}
}
Button{
text: "RE-ENABLE UDP"
onClicked: {
_mavlinkTelemetry.enable_udp()

// padding to bottom
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
}
// padding to bottom
Item{
Layout.fillHeight: true
Layout.fillWidth: true
}

}
}
102 changes: 102 additions & 0 deletions qml/ui/configpopup/connect/PaneTethering.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Dialogs 1.0
import QtQuick.Controls.Material 2.12

import Qt.labs.settings 1.0

import OpenHD 1.0

import "../../../ui" as Ui
import "../../elements"
Rectangle {
width: parent.width
height: parent.height
property bool m_local_mode_enabled: _mavlinkTelemetry.udp_localhost_mode_enabled


Rectangle {
id: innerRect
width: 300
height: 300
anchors.centerIn: parent
anchors.horizontalCenterOffset: 40
ColumnLayout {
spacing: 6

RowLayout {
Button{
text: m_local_mode_enabled ? "LOCAL MODE ACTIVE" : "ENABLE LOCAL MODE"
Layout.preferredWidth: 180
onClicked: {
_mavlinkTelemetry.enable_udp()
}
enabled: !m_local_mode_enabled
}
ButtonIconInfoText {
m_info_text: "Use this if you are running QOpenHD on your ground station itself and don't use it as a secondary device."+
"\n\nIt uses UDP localhost to communicate with OpenHD core via mavlink (best performance and latency)."
}
}
RowLayout {
Button{
text: "Android Tethering"
Layout.preferredWidth: 180
onClicked: _qopenhd.android_open_tethering_settings()
}
ButtonIconInfoText {
m_info_text: "1) Connect your phone via high quality USB cable to your ground station.\n\n"+
"2) enable USB Tethering on your phone.\n\n"+
"3) Telemetry and video forwarding is started automatically \n\n"+
" ! Requires a phone and cellular contract that allows USB tethering. !"
}
}
RowLayout {
Button{
text: "Passive Eth tethering"
Layout.preferredWidth: 180
//TODO disable active tethering and enable passive when clicking the button
}
ButtonIconInfoText {
m_info_text: "1) Disable ETH_HOTSPOT_E and Enable ETH_PASSIVE_F\n\n"+
"2) Connect your external device to your ground station via ethernet.\n\n"+
"3) Select 'share my internet with ...' when the android connection setup pops up\n\n"+
"Video and telemetry forwarding should start automatically, internet will be forwarded from your phone."
}
}
RowLayout {
Button{
text: "Active Eth tethering"
Layout.preferredWidth: 180
//TODO disable passive tethering and enable active when clicking the button
}
ButtonIconInfoText {
m_info_text: "1) Disable ETH_PASSIVE_F and Enable ETH_HOTSPOT_E\n\n"+
"2) Connect your external device to your ground station via ethernet.\n\n"+
"You might need to disable wifi and cellular on your phone\n\n"+
"Video and telemetry forwarding should start automatically, internet will not be available."
}
}
RowLayout {
Button{
text: "Wifi tethering"
Layout.preferredWidth: 180
//TODO enable hotspot
}
ButtonIconInfoText {
m_info_text: "1) Enable WIFI_HOTSPOT_E\n\n"+
"2) Connect to WiFi: openhd pw openhdopenhd\n\n"+
"3) Press 'Connect' button.\n\n"+
"NOTE: You cannot use WIFI hotspot during flight (while armed)"
}
}

// padding to bottom
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
}
4 changes: 2 additions & 2 deletions qml/ui/configpopup/credits/Credits.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Rectangle {
id: ee1
visible: true
source: "../../../resources/master1.png"
width: consti.height * 0.7
height: consti.height * 0.7
width: max.height * 0.7
height: max.height * 0.7
}
}
}
Expand Down
Loading

0 comments on commit a45c689

Please sign in to comment.