mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
feat(unified): add 100% wired Radxa/G29 hub (HT, cockpit OSD, CRSF telemetry) & update README
This commit is contained in:
1 parent
f01bf1aeb3
commit
51a5d0c7ad
10 files changed
+1012
-26
No files matched your search
@@ -4,6 +4,7 @@ use crate::dvr::{DvrContainer, DvrMode};
|
||||
use crate::engine::{
|
||||
EngineControlHandle, FpvEngineController, LiveOpticalParams, RuntimeMonitor, SubsystemStatus,
|
||||
};
|
||||
use crate::g29_bridge::G29State;
|
||||
use crate::logger::{LogBuffer, LogEntry, LogFilter};
|
||||
use crate::nomad_elrs::{HeadPoseSample, NomadHeadTracker, NomadProtocol};
|
||||
use crate::telemetry_osd::TelemetryState;
|
||||
@@ -68,6 +69,7 @@ pub struct SteamFrameGpuiApp {
|
||||
xr_status: SubsystemStatus,
|
||||
nomad_status: SubsystemStatus,
|
||||
telem_status: SubsystemStatus,
|
||||
g29_status: SubsystemStatus,
|
||||
dvr_status: SubsystemStatus,
|
||||
dvr_recording: bool,
|
||||
dvr_elapsed_secs: u64,
|
||||
@@ -78,6 +80,7 @@ pub struct SteamFrameGpuiApp {
|
||||
video_frames_total: u64,
|
||||
latest_pose: HeadPoseSample,
|
||||
latest_telem: TelemetryState,
|
||||
latest_g29: G29State,
|
||||
log_entries: Vec<LogEntry>,
|
||||
log_err_count: usize,
|
||||
log_warn_count: usize,
|
||||
@@ -126,6 +129,7 @@ impl SteamFrameGpuiApp {
|
||||
xr_status: SubsystemStatus::Starting,
|
||||
nomad_status: SubsystemStatus::Disabled,
|
||||
telem_status: SubsystemStatus::Disabled,
|
||||
g29_status: SubsystemStatus::Disabled,
|
||||
dvr_status: SubsystemStatus::Stopped,
|
||||
dvr_recording: false,
|
||||
dvr_elapsed_secs: 0,
|
||||
@@ -136,6 +140,7 @@ impl SteamFrameGpuiApp {
|
||||
video_frames_total: 0,
|
||||
latest_pose: HeadPoseSample::default(),
|
||||
latest_telem: TelemetryState::default(),
|
||||
latest_g29: G29State::default(),
|
||||
log_entries: Vec::new(),
|
||||
log_err_count: 0,
|
||||
log_warn_count: 0,
|
||||
@@ -179,6 +184,10 @@ impl SteamFrameGpuiApp {
|
||||
self.telem_status = mon.telemetry_status.clone();
|
||||
changed = true;
|
||||
}
|
||||
if self.g29_status != mon.g29_status {
|
||||
self.g29_status = mon.g29_status.clone();
|
||||
changed = true;
|
||||
}
|
||||
if self.dvr_recording != mon.dvr_recording
|
||||
|| self.dvr_elapsed_secs != mon.dvr_elapsed_secs
|
||||
|| self.dvr_status != mon.dvr_status
|
||||
@@ -201,6 +210,12 @@ impl SteamFrameGpuiApp {
|
||||
}
|
||||
self.latest_pose = mon.latest_head_pose;
|
||||
self.latest_telem = mon.latest_telemetry.clone();
|
||||
if self.latest_g29.packets_received != mon.latest_g29.packets_received
|
||||
|| self.latest_g29.connected != mon.latest_g29.connected
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
self.latest_g29 = mon.latest_g29.clone();
|
||||
|
||||
// Ne cloner et décoder la trame QUE si l'onglet Cockpit est actif !
|
||||
let frame_data: Option<(u32, u32, Vec<u8>)> = if self.active_tab == ActiveTab::Cockpit
|
||||
@@ -1219,6 +1234,18 @@ impl SteamFrameGpuiApp {
|
||||
.flex()
|
||||
.flex_wrap()
|
||||
.gap_2()
|
||||
.child(self.render_selectable_pill(
|
||||
"pill_proto_g29",
|
||||
"G29 Hub ($HT)",
|
||||
self.cfg.ht_protocol.eq_ignore_ascii_case("g29")
|
||||
|| self.cfg.ht_protocol.eq_ignore_ascii_case("g29_bridge")
|
||||
|| self.cfg.ht_protocol.eq_ignore_ascii_case("radxa"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.ht_protocol = "g29".into();
|
||||
this.mock_tracker = None;
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
.child(self.render_selectable_pill(
|
||||
"pill_proto_msp",
|
||||
"MSPv2 0x0383",
|
||||
@@ -1328,6 +1355,15 @@ impl SteamFrameGpuiApp {
|
||||
.flex()
|
||||
.flex_wrap()
|
||||
.gap_2()
|
||||
.child(self.render_selectable_pill(
|
||||
"preset_radxa_g29_unified",
|
||||
"Tout-en-un Radxa usb0 (192.168.1.1:14552)",
|
||||
self.cfg.nomad_ip == "192.168.1.1" && self.cfg.nomad_port == 14552,
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.set_nomad_target("192.168.1.1", 14552, Some("g29"));
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
.child(self.render_selectable_pill(
|
||||
"preset_ap_default",
|
||||
"AP Défaut (10.0.0.1:14550)",
|
||||
@@ -2035,6 +2071,31 @@ impl SteamFrameGpuiApp {
|
||||
&format!("{:.1} m", self.latest_telem.altitude_m),
|
||||
&format!("Cap : {:.0}°", self.latest_telem.drone_heading_deg),
|
||||
COLOR_CYAN,
|
||||
))
|
||||
.child(self.render_stat_box(
|
||||
"🎮 VOLANT G29",
|
||||
&if !self.latest_g29.is_live() {
|
||||
"HORS LIGNE".to_string()
|
||||
} else {
|
||||
format!(
|
||||
"[{}] {}",
|
||||
self.latest_g29.gear_label(),
|
||||
if self.latest_g29.armed { "ARMED" } else { "SAFE" }
|
||||
)
|
||||
},
|
||||
&format!(
|
||||
"Gaz {}% | Frn {}% | FFB {}%",
|
||||
self.latest_g29.throttle_pct,
|
||||
self.latest_g29.brake_pct,
|
||||
self.latest_g29.ffb_pct
|
||||
),
|
||||
if !self.latest_g29.is_live() {
|
||||
COLOR_TEXT_MUTED
|
||||
} else if self.latest_g29.armed {
|
||||
COLOR_GREEN
|
||||
} else {
|
||||
COLOR_ORANGE
|
||||
},
|
||||
)),
|
||||
)
|
||||
// Double Panneau : Suivi de Tête & Radio
|
||||
|
||||
Reference in new issue
Block a user