Skip to content

Commit

Permalink
add external device count, new simplified ethernet param
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Apr 26, 2024
1 parent d333c4c commit 64c9b7b
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 13 deletions.
1 change: 1 addition & 0 deletions app/telemetry/models/aohdsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ void AOHDSystem::process_sys_status1(const mavlink_openhd_sys_status1_t &msg)
{
set_wifi_hotspot_state(msg.wifi_hotspot_state);
set_wifi_hotspot_frequency(msg.wifi_hotspot_frequency);
set_external_devices_count(msg.external_devices_count);
}

void AOHDSystem::process_op_mode(const mavlink_openhd_wifbroadcast_gnd_operating_mode_t &msg)
Expand Down
1 change: 1 addition & 0 deletions app/telemetry/models/aohdsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class AOHDSystem : public QObject
// ---------- WIFI HOTSPOT ----------------------
L_RO_PROP(int,wifi_hotspot_state,set_wifi_hotspot_state,-1) // 0 - not available, 1 - off, 2 - on
L_RO_PROP(int,wifi_hotspot_frequency,set_wifi_hotspot_frequency,-1)
L_RO_PROP(int,external_devices_count,set_external_devices_count,-1)
//
L_RO_PROP(int,wb_gnd_operating_mode,set_wb_gnd_operating_mode,-1)
//
Expand Down
15 changes: 9 additions & 6 deletions app/telemetry/models/openhd_core/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static constexpr int X_CAM_TYPE_RPI_V4L2_VEYE_MVCAM = 63;
// X20 Specific starts here
//
// Right now we only have one camera, but more (might) follow.
static constexpr int X_CAM_TYPE_X20_RUNCAM_NANO = 70;
static constexpr int X_CAM_TYPE_X20_RUNCAM_GENERIC = 70;
// ... 9 reserved for future use
//
// ROCK Specific starts here
Expand Down Expand Up @@ -145,8 +145,8 @@ static std::string x_cam_type_to_string(int camera_type) {
case X_CAM_TYPE_RPI_V4L2_VEYE_MVCAM:
return "VEYE_MVCAM";
// All the x20 begin
case X_CAM_TYPE_X20_RUNCAM_NANO:
return "X20_RUNCAM_NANO";
case X_CAM_TYPE_X20_RUNCAM_GENERIC:
return "X20_RUNCAM_GENERIC";
// All the rock begin
case X_CAM_TYPE_ROCK_HDMI_IN:
return "ROCK_HDMI_IN";
Expand Down Expand Up @@ -511,10 +511,10 @@ static std::vector<ManufacturerForPlatform> get_camera_choices_for_platform(
MANUFACTURER_DEBUG};
} else if (platform_type == X_PLATFORM_TYPE_ALWINNER_X20) {
std::vector<CameraNameAndType> runcam_cameras{
CameraNameAndType{"RUNCAM NANO", X_CAM_TYPE_X20_RUNCAM_NANO},
CameraNameAndType{"GENERIC", X_CAM_TYPE_X20_RUNCAM_GENERIC},
};
return std::vector<ManufacturerForPlatform>{
ManufacturerForPlatform{"RUNCAM", runcam_cameras}};
ManufacturerForPlatform{"HDZERO", runcam_cameras}};
} else if (platform_type == X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W) {
std::vector<CameraNameAndType> arducam_cameras{
CameraNameAndType{"IMX219", X_CAM_TYPE_ROCK_RK3566_IMX219},
Expand All @@ -524,7 +524,10 @@ static std::vector<ManufacturerForPlatform> get_camera_choices_for_platform(
return std::vector<ManufacturerForPlatform>{
ManufacturerForPlatform{"ARDUCAM", arducam_cameras}, MANUFACTURER_USB,
MANUFACTURER_DEBUG};
} else if (platform_type == X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5) {
} else if (platform_type == X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_A) {
return std::vector<ManufacturerForPlatform>{MANUFACTURER_USB,
MANUFACTURER_DEBUG};
} else if (platform_type == X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_B) {
std::vector<CameraNameAndType> hdmi_cameras{
CameraNameAndType{"HDMI IN", X_CAM_TYPE_ROCK_HDMI_IN},
};
Expand Down
12 changes: 7 additions & 5 deletions app/telemetry/models/openhd_core/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static constexpr int X_PLATFORM_TYPE_RPI_5 = 12;
// Numbers 20..30 are reserved for rockchip
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W =
20; // Zero 3 W
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5 =
21; // ROCK 5
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RV1126_UNDEFINED = 22; // FUTRE
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_A = 21;
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_B = 22;
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RV1126_UNDEFINED = 23; // FUTURE

// Numbers 30..35 are reserved for allwinner
static constexpr int X_PLATFORM_TYPE_ALWINNER_X20 = 30;
Expand All @@ -53,8 +53,10 @@ static std::string x_platform_type_to_string(int platform_type) {
// RPI END
case X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W:
return "RADXA ZERO3W";
case X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5:
return "RADXA ROCK5";
case X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_A:
return "RADXA ROCK5 A";
case X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_B:
return "RADXA ROCK5 B";
case X_PLATFORM_TYPE_ROCKCHIP_RV1126_UNDEFINED:
return "RV1126 UNDEFINED";
// ROCK END
Expand Down
5 changes: 5 additions & 0 deletions app/telemetry/settings/documentedparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,11 @@ static std::vector<std::shared_ptr<XParam>> get_parameters_list(){
append_int(ret,"ETH_PASSIVE_F",ImprovedIntSetting::createEnumEnableDisable(),
"Enable automatic video & telemetry forwarding via ethernet if EITH_HOTSPOT_E is false (Recommended)."
"Cannot be used simultaneously with ETH_HOTSPOT_E. Doesn't require reboot.",false);
{
auto values=std::vector<std::string>{"UNMANAGED","HOTSPOT","FORWARD+INTERNET"};
append_int(ret,"ETHERNET",ImprovedIntSetting::createEnum(values),
"Specify the intended usage of the ground station ethernet port (for connecting external devices).");
}
{
auto values=std::vector<std::string>{"untouched","high","low"};
append_int(ret,"GPIO_2",ImprovedIntSetting::createEnum(values),
Expand Down
1 change: 1 addition & 0 deletions qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,6 @@
<file>ui/sidebar/MavlinkChoiceElement2.qml</file>
<file>ui/sidebar/MappedMavlinkChoices.qml</file>
<file>ui/widgets/X20OverheatWidget.qml</file>
<file>ui/sidebar/ActionElement.qml</file>
</qresource>
</RCC>
4 changes: 2 additions & 2 deletions qml/ui/configpopup/status/PanelStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ Rectangle {
Item{
id: mainItem
width: mainRect.width
height: 400+80
height: 440+80

// The 3 status cards (OpenHD AIR & GND, FC)
// next to each other
StatusCardsColumn{
id: statuscardscolumn
width: parent.width
height: 400
height: 440
anchors.leftMargin: 4
anchors.topMargin: 4
anchors.rightMargin: 4
Expand Down
13 changes: 13 additions & 0 deletions qml/ui/configpopup/status/StatusCardBodyOpenHD.qml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,19 @@ Column {
return m_right_text=="UNAVAILABLE";
}
}
StatusCardRow{
visible: m_is_ground;
m_left_text: "EXTERNAL DEVICES:"
m_right_text: {
if(_ohdSystemGround.external_devices_count<0){
return "N/A";
}
if(_ohdSystemGround.external_devices_count==0){
return "NONE";
}
return _ohdSystemGround.external_devices_count+"x";
}
}

// Padding
Item{
Expand Down
22 changes: 22 additions & 0 deletions qml/ui/sidebar/ActionElement.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls.Material 2.12

import Qt.labs.settings 1.0

import OpenHD 1.0

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


//
// Perform a action if needed
// joystick navigatable
//
//
BaseJoyEditElement2{
id: actionElement

}

0 comments on commit 64c9b7b

Please sign in to comment.