mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
fix(safety,openxr,dvr,config): harden RC/firmware failsafes, OpenXR lifecycle, DVR StreamCopy, relay & persistent config
This commit is contained in:
1 parent
8028680f07
commit
d82a65d9e6
24 files changed
+2246
-638
No files matched your search
+34
-1
@@ -91,6 +91,7 @@ pub struct SteamFrameGpuiApp {
|
||||
log_err_count: usize,
|
||||
log_warn_count: usize,
|
||||
last_log_revision: u64,
|
||||
last_config_revision: u64,
|
||||
// Cible réseau éditable & Mock Manuel Nomad
|
||||
target_edit_field: Option<TargetEditField>,
|
||||
target_port_buf: String,
|
||||
@@ -116,6 +117,7 @@ impl SteamFrameGpuiApp {
|
||||
is_closing: Arc<AtomicBool>,
|
||||
) -> Self {
|
||||
let log_revision = log_buffer.lock().revision.clone();
|
||||
let last_config_revision = controls.config_revision();
|
||||
let target_port_buf = cfg.nomad_port.to_string();
|
||||
let initial_control_source = ControlSource::from_str(&cfg.control_source);
|
||||
|
||||
@@ -157,6 +159,7 @@ impl SteamFrameGpuiApp {
|
||||
log_err_count: 0,
|
||||
log_warn_count: 0,
|
||||
last_log_revision: 0,
|
||||
last_config_revision,
|
||||
target_edit_field: None,
|
||||
target_port_buf,
|
||||
target_focus_handle: None,
|
||||
@@ -178,6 +181,16 @@ impl SteamFrameGpuiApp {
|
||||
self.controls
|
||||
.set_preview_active(self.active_tab == ActiveTab::Cockpit);
|
||||
|
||||
// Synchroniser les réglages éventuellement modifiés depuis le Menu VR / G29 / Steam Controller
|
||||
let cfg_rev = self.controls.config_revision();
|
||||
if cfg_rev != self.last_config_revision {
|
||||
self.last_config_revision = cfg_rev;
|
||||
if let Some(live_cfg) = self.controls.snapshot_live_config() {
|
||||
self.cfg = live_cfg;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 1. Snapshot rapide avec maintien minimal du verrou monitor
|
||||
let (preview_frame_seq, new_frame_data) = {
|
||||
let mon = self.engine_monitor.lock();
|
||||
@@ -230,6 +243,19 @@ impl SteamFrameGpuiApp {
|
||||
self.video_frames_total = mon.video_frames_total;
|
||||
changed = true;
|
||||
}
|
||||
let pose_changed = (self.latest_pose.pan_deg - mon.latest_head_pose.pan_deg).abs()
|
||||
> 0.1
|
||||
|| (self.latest_pose.tilt_deg - mon.latest_head_pose.tilt_deg).abs() > 0.1
|
||||
|| (self.latest_pose.roll_deg - mon.latest_head_pose.roll_deg).abs() > 0.1
|
||||
|| self.latest_pose.pan_crsf != mon.latest_head_pose.pan_crsf;
|
||||
let telem_changed =
|
||||
self.latest_telem.packets_received != mon.latest_telemetry.packets_received
|
||||
|| self.latest_telem.is_live() != mon.latest_telemetry.is_live();
|
||||
if (self.active_tab == ActiveTab::Telemetry || self.active_tab == ActiveTab::Cockpit)
|
||||
&& (pose_changed || telem_changed)
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
self.latest_pose = mon.latest_head_pose;
|
||||
self.latest_telem = mon.latest_telemetry.clone();
|
||||
if self.latest_g29.connected != mon.latest_g29.connected
|
||||
@@ -591,6 +617,9 @@ impl SteamFrameGpuiApp {
|
||||
return;
|
||||
}
|
||||
|
||||
self.controls.save_full_config(&self.cfg);
|
||||
self.last_config_revision = self.controls.config_revision();
|
||||
|
||||
let engine_clone = Arc::clone(&self.engine);
|
||||
let cfg_clone = self.cfg.clone();
|
||||
let is_restarting = Arc::clone(&self.is_restarting);
|
||||
@@ -1793,6 +1822,7 @@ impl SteamFrameGpuiApp {
|
||||
!self.cfg.controller_invert_steering,
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.controller_invert_steering = false;
|
||||
this.controls.set_invert_steering(false);
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
@@ -1802,6 +1832,7 @@ impl SteamFrameGpuiApp {
|
||||
self.cfg.controller_invert_steering,
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.controller_invert_steering = true;
|
||||
this.controls.set_invert_steering(true);
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
@@ -3805,7 +3836,9 @@ pub fn run_gpui_app(cfg: AppConfig, log_buffer: Arc<Mutex<LogBuffer>>) -> Result
|
||||
if let Some(view) = weak_view.upgrade() {
|
||||
let mut exit_now = false;
|
||||
view.update(cx, |this, cx| {
|
||||
if this.controls.is_exit_requested() {
|
||||
if this.controls.is_exit_requested()
|
||||
|| crate::is_shutdown_requested()
|
||||
{
|
||||
exit_now = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user