Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sidebar dummy in status #663

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="com.openhd.openhd" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="v15" android:versionCode="15" android:installLocation="auto">
<manifest package="com.openhd.openhd" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="v16" android:versionCode="16" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down
31 changes: 17 additions & 14 deletions app/telemetry/models/openhd_core/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,45 +223,47 @@ struct XCamera {
return {ResolutionFramerate{640, 480, 30}};
} else if (requires_rpi_libcamera_pipeline()) {
std::vector<ResolutionFramerate> ret;
if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX462 ||
camera_type==X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX462_LOWLIGHT_MINI){
if (camera_type == X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX462 ||
camera_type ==
X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX462_LOWLIGHT_MINI) {
ret.push_back(ResolutionFramerate{640, 480, 60});
ret.push_back(ResolutionFramerate{896, 504, 60});
ret.push_back(ResolutionFramerate{1280, 720, 60});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}else if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX477M ||
camera_type==X_CAM_TYPE_RPI_LIBCAMERA_RPIF_HQ_IMX477) {
} else if (camera_type == X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX477M ||
camera_type == X_CAM_TYPE_RPI_LIBCAMERA_RPIF_HQ_IMX477) {
ret.push_back(ResolutionFramerate{640, 480, 50});
ret.push_back(ResolutionFramerate{896, 504, 50});
ret.push_back(ResolutionFramerate{1280, 720, 50});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}else if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_RPIF_V2_IMX219){
} else if (camera_type == X_CAM_TYPE_RPI_LIBCAMERA_RPIF_V2_IMX219) {
ret.push_back(ResolutionFramerate{640, 480, 47});
ret.push_back(ResolutionFramerate{896, 504, 47});
ret.push_back(ResolutionFramerate{1280, 720, 47});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}else if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_SKYVISIONPRO_IMX519){
} else if (camera_type ==
X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_SKYVISIONPRO_IMX519) {
ret.push_back(ResolutionFramerate{640, 480, 60});
ret.push_back(ResolutionFramerate{896, 504, 60});
ret.push_back(ResolutionFramerate{1280, 720, 60});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}else if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_SKYMASTERHDR_IMX708 ||
camera_type==X_CAM_TYPE_RPI_LIBCAMERA_RPIF_V3_IMX708){
} else if (camera_type ==
X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_SKYMASTERHDR_IMX708 ||
camera_type == X_CAM_TYPE_RPI_LIBCAMERA_RPIF_V3_IMX708) {
ret.push_back(ResolutionFramerate{640, 480, 60});
ret.push_back(ResolutionFramerate{896, 504, 60});
ret.push_back(ResolutionFramerate{1280, 720, 60});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}else if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX327) {
} else if (camera_type == X_CAM_TYPE_RPI_LIBCAMERA_ARDUCAM_IMX327) {
ret.push_back(ResolutionFramerate{640, 480, 60});
ret.push_back(ResolutionFramerate{896, 504, 60});
ret.push_back(ResolutionFramerate{1280, 720, 60});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}else if(camera_type==X_CAM_TYPE_RPI_LIBCAMERA_RPIF_V1_OV5647){
} else if (camera_type == X_CAM_TYPE_RPI_LIBCAMERA_RPIF_V1_OV5647) {
ret.push_back(ResolutionFramerate{1280, 720, 30});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}
else{
std::cerr<<"Not yet mapped:"<<camera_type<<std::endl;
} else {
std::cerr << "Not yet mapped:" << camera_type << std::endl;
ret.push_back(ResolutionFramerate{1920, 1080, 30});
}
return ret;
Expand Down Expand Up @@ -371,7 +373,8 @@ static std::string get_verbose_string_of_resolution(
resolution_framerate.height_px == 1440) {
ss << "2K 16:9";
} else {
ss << resolution_framerate.width_px << "x" << resolution_framerate.height_px;
ss << resolution_framerate.width_px << "x"
<< resolution_framerate.height_px;
}
ss << "\n" << resolution_framerate.fps << "fps";
return ss.str();
Expand Down
1 change: 1 addition & 0 deletions qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,6 @@
<file>ui/elements/NewSwitch.qml</file>
<file>ui/elements/NewSpinBox.qml</file>
<file>ui/elements/NewSlider.qml</file>
<file>ui/sidebar/InfoElement2.qml</file>
</qresource>
</RCC>
4 changes: 4 additions & 0 deletions qml/ui/HUDOverlayGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ Item {
anchors.leftMargin: 8
anchors.top: parent.top
anchors.topMargin: 0
// If the sidebar is activated, do not show the (button/image) that opens the advanced menu
// since on devices with a funky ratio (e.g. extra wide, like most modern android phones)
// the back button of the sidebar and this button conflict
visible: !sidebar.m_extra_is_visible

MouseArea {
id: settingsButtonMouseArea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@ Card {
property bool argh_is_changing_model:false;
ListModel{
id: resolutions_model
//ListElement {title: "0x0@0 (AUTO)"; value: "0x0@0"}
//ListElement {title: "480p@30fps (4:3)"; value: "640x480@30"}
// NOTE: elements are overridden when we know the camera
ListElement {title: "480p@60fps (4:3)"; value: "640x480@60"}
//ListElement {title: "480p@60fps (16:9)"; value: "848x480@60"}
//ListElement {title: "720p@49fps (16:9)"; value: "1280x720@49"}
//ListElement {title: "720p@60fps (4:3)"; value: "960x720@60"}
ListElement {title: "720p@60fps (16:9)"; value: "1280x720@60"}
ListElement {title: "1080p@30fps (16:9)"; value: "1920x1080@30"}
//ListElement {title: "1080p@30fps (4:3)"; value: "1440x1080@30"}
//ListElement {title: "1080p@49fps (4:3)"; value: "1440x1080@49"}
}

function close(){
Expand Down
36 changes: 36 additions & 0 deletions qml/ui/sidebar/InfoElement2.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.12
import QtQuick.Shapes 1.0
import QtQuick.Controls.Material 2.0

import Qt.labs.settings 1.0

import OpenHD 1.0

import "../elements"

RowLayout {
property string override_text_left: "TODO"
property string override_text_right: "TODO"

Text {
width: 150
text: override_text_left
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: override_text_right
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
197 changes: 19 additions & 178 deletions qml/ui/sidebar/Panel7Status.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,188 +16,29 @@ SideBarBasePanel{

Column {
anchors.top: parent.top
anchors.topMargin: secondaryUiHeight/8
spacing: 5

RowLayout {
Text {
text: "Status:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "Connected"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Screen:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: applicationWindow.width + "x" + applicationWindow.height
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}

RowLayout {
Text {
text: "Frequency:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: _ohdSystemGround.curr_channel_mhz + "Mhz"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Wifi-Adapter:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
id: wifiMessage
property int wifiCode: _ohdSystemAir.ohd_wifi_type

function wifiName(code) {
switch (code) {
case 11: return "Asus AC56";
case 12: return "8812AU CUSTOM";
case 21: return "88XXBU";
default: return "unknown";
}
anchors.topMargin: secondaryUiHeight/8 + 20
anchors.leftMargin: 10
spacing: 10

InfoElement2{
override_text_left: "Connection:"
override_text_right: {
if(_ohdSystemAir.is_alive && _ohdSystemGround.is_alive){
return "Connected";
}

text: wifiName(wifiCode) + "("+_ohdSystemAir.ohd_wifi_type+")"
Layout.leftMargin: 12
}
}
RowLayout {
Text {
text: "Format:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "1080p 60fps"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Version:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "Todo"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Hardware Air:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
id: platformMessage
property int platformCode: _ohdSystemAir.ohd_platform_type

function platformName(code) {
switch (code) {
case 0: return "unknown";
case 10: return "X20";
case 20: return "x86";
case 30: return "rpi";
case 31: return "rpi 4";
case 32: return "rpi 3";
case 33: return "rpi 2";
case 34: return "rpi 1";
case 35: return "rpi 0";
case 40: return "rock";
case 41: return "rk3566";
case 42: return "rock5a";
case 43: return "rock5b";
default: return "unknown";
}
if(_ohdSystemAir.is_alive){
return "AIR only";
}

text: platformName(platformCode) + "("+_ohdSystemAir.ohd_platform_type+")"
Layout.leftMargin: 12
}
}
RowLayout {
Text {
text: "Hardware Ground:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "Todo"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

if(_ohdSystemGround.is_alive){
return "GND only"
}
return "NOT CONNECTED";
}
}
/*InfoElement2{
override_text_left: "TODO"
override_text_right:"TODO"
}*/

Button {
id: button
Expand Down
Loading