Skip to content

Commit

Permalink
only show active tracking source
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Jul 23, 2024
1 parent 9b0f3fb commit 7b9f5e0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/core/ext_tracking/alvr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::core::{ext_tracking::face2_fb::face2_fb_to_unified, AppState};
use super::unified::{UnifiedExpressions, UnifiedTrackingData, NUM_SHAPES};

static STA_ON: Lazy<Arc<str>> = Lazy::new(|| format!("{}", "ALVR".color(Color::Green)).into());
static STA_OFF: Lazy<Arc<str>> = Lazy::new(|| format!("{}", "ALVR".color(Color::Red)).into());

#[derive(Default)]
struct AlvrTrackingData {
Expand Down Expand Up @@ -94,8 +93,6 @@ impl AlvrReceiver {

if self.last_received.elapsed() < Duration::from_secs(1) {
state.status.add_item(STA_ON.clone());
} else {
state.status.add_item(STA_OFF.clone());
}
}
}
Expand Down Expand Up @@ -137,7 +134,7 @@ fn receive_until_err(
) -> anyhow::Result<()> {
const WS_URL: &str = "ws://127.0.0.1:8082/api/events";
let Ok(mut ws) = ClientBuilder::new(WS_URL)?.connect_insecure() else {
bail!("failed to connect");
return Ok(()); // long retry
};

while let Ok(Some(message)) = ws.receive() {
Expand Down Expand Up @@ -168,7 +165,7 @@ fn receive_until_err(
}
}
});
return Ok(());
return Ok(()); // long retry
}
alvr_events::EventType::Tracking(tracking) => {
let mut data = AlvrTrackingData::default();
Expand Down
3 changes: 0 additions & 3 deletions src/core/ext_tracking/babble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use crate::core::{ext_tracking::unified::UnifiedExpressions, AppState};
use super::unified::UnifiedTrackingData;

static STA_ON: Lazy<Arc<str>> = Lazy::new(|| format!("{}", "BABBLE".color(Color::Green)).into());
static STA_OFF: Lazy<Arc<str>> = Lazy::new(|| format!("{}", "BABBLE".color(Color::Red)).into());

pub(super) struct BabbleReceiver {
sender: SyncSender<Box<BabbleEvent>>,
Expand Down Expand Up @@ -49,8 +48,6 @@ impl BabbleReceiver {

if self.last_received.elapsed() < Duration::from_secs(1) {
state.status.add_item(STA_ON.clone());
} else {
state.status.add_item(STA_OFF.clone());
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/ext_tracking/wivrn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use super::{
};

static STA_ON: Lazy<Arc<str>> = Lazy::new(|| format!("{}", "WIVRN".color(Color::Green)).into());
static STA_OFF: Lazy<Arc<str>> = Lazy::new(|| format!("{}", "WIVRN".color(Color::Red)).into());

struct WivrnPayload {
eyes: [f32; 8],
Expand Down Expand Up @@ -74,8 +73,6 @@ impl WivrnReceiver {

if self.last_received.elapsed() < Duration::from_secs(1) {
state.status.add_item(STA_ON.clone());
} else {
state.status.add_item(STA_OFF.clone());
}
}
}
Expand Down

0 comments on commit 7b9f5e0

Please sign in to comment.