Created basic sinus output via postcard rpc.

This commit is contained in:
2025-08-06 18:26:17 +02:00
parent 2d8c6d23fd
commit 0b55cdf8b8
10 changed files with 3384 additions and 29 deletions

41
src/bin/main_gui.rs Normal file
View File

@@ -0,0 +1,41 @@
use tokio::runtime::Runtime;
use bioz_host_rs::app::App;
use bioz_host_rs::communication::communicate_with_hardware;
use tokio::sync::mpsc::{self};
fn main() {
let rt = Runtime::new().expect("Unable to create Runtime");
// Enter the runtime so that `tokio::spawn` is available immediately.
// let _enter = rt.enter();
let (run_impedancemeter_tx, run_impedancemeter_rx) = mpsc::channel::<u32>(2);
let app = App::new(run_impedancemeter_tx);
let magnitude_clone = app.magnitude.clone();
let phase_clone = app.phase.clone();
let magnitude_series_clone = app.magnitude_series.clone();
let phase_series_clone = app.phase_series.clone();
// Execute the runtime in its own thread.
std::thread::spawn(move || {
rt.block_on(communicate_with_hardware(
run_impedancemeter_rx,
magnitude_clone,
phase_clone,
magnitude_series_clone,
phase_series_clone
));
});
// Run the GUI in the main thread.
let _ = eframe::run_native(
"Impedance Visualizer [egui + tokio] - Hubald Verzijl - 2025",
eframe::NativeOptions::default(),
Box::new(|_cc| Ok(Box::new(app))),
);
}