Skip to content

Commit

Permalink
src: webpage: src: Add frequency control
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Nov 7, 2024
1 parent 414cdf4 commit 335b29e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webpage/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::collections::BTreeMap;
use std::{collections::BTreeMap, sync::Arc};

use chrono::prelude::*;
use eframe::egui::{CollapsingHeader, Context};
use egui::mutex::Mutex;
use egui_extras::{Column, TableBody, TableBuilder};
use egui_plot::{Line, Plot, PlotPoints};
use ewebsock::{connect, WsReceiver, WsSender};
Expand Down Expand Up @@ -46,13 +47,17 @@ pub struct App {
search_query: String,
collapse_all: bool,
expand_all: bool,
stats_frequency: Arc<Mutex<f32>>,
}

impl Default for App {
fn default() -> Self {
let (mavlink_sender, mavlink_receiver) =
connect_websocket(MAVLINK_MESSAGES_WEBSOCKET_PATH).unwrap();

let stats_frequency = Arc::new(Mutex::new(1.));
crate::stats::stats_frequency::stats_frequency(&stats_frequency);

let (hub_messages_stats_sender, hub_messages_stats_receiver) =
connect_websocket(HUB_MESSAGES_STATS_WEBSOCKET_PATH).unwrap();

Expand All @@ -79,6 +84,7 @@ impl Default for App {
search_query: String::new(),
collapse_all: false,
expand_all: false,
stats_frequency,
}
}
}
Expand Down

0 comments on commit 335b29e

Please sign in to comment.