mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2025-12-05 21:01:18 +00:00
Add units, change topic name.
This commit is contained in:
7
Cargo.lock
generated
7
Cargo.lock
generated
@@ -356,6 +356,12 @@ version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
|
||||
|
||||
[[package]]
|
||||
name = "atomic_float"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "628d228f918ac3b82fe590352cc719d30664a0c13ca3a60266fe02c7132d480a"
|
||||
|
||||
[[package]]
|
||||
name = "atspi"
|
||||
version = "0.25.0"
|
||||
@@ -431,6 +437,7 @@ dependencies = [
|
||||
name = "bioz-host-rs"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"atomic_float",
|
||||
"bioz-icd-rs",
|
||||
"defmt",
|
||||
"eframe",
|
||||
|
||||
10
src/app.rs
10
src/app.rs
@@ -117,15 +117,14 @@ impl eframe::App for App {
|
||||
egui::vec2(ui.available_width(), half_height),
|
||||
Layout::top_down(egui::Align::Min),
|
||||
|ui| {
|
||||
// Magnitude and phase
|
||||
// Magnitude
|
||||
let magnitude = self.magnitude_series.lock().unwrap();
|
||||
let phase = self.phase_series.lock().unwrap();
|
||||
Plot::new("magnitude")
|
||||
.allow_scroll(false)
|
||||
.allow_drag(false)
|
||||
// .center_y_axis(true)
|
||||
.legend(Legend::default().position(Corner::LeftTop))
|
||||
.y_axis_label("Value [...]")
|
||||
.y_axis_label("Magnitude [Ω]")
|
||||
.y_axis_min_width(2.0)
|
||||
.show(ui, |plot_ui| {
|
||||
plot_ui.line(
|
||||
@@ -140,15 +139,14 @@ impl eframe::App for App {
|
||||
egui::vec2(ui.available_width(), half_height),
|
||||
Layout::top_down(egui::Align::Min),
|
||||
|ui| {
|
||||
// Magnitude and phase
|
||||
let magnitude = self.magnitude_series.lock().unwrap();
|
||||
// Phase
|
||||
let phase = self.phase_series.lock().unwrap();
|
||||
Plot::new("phase")
|
||||
.allow_scroll(false)
|
||||
.allow_drag(false)
|
||||
// .center_y_axis(true)
|
||||
.legend(Legend::default().position(Corner::LeftTop))
|
||||
.y_axis_label("Value [...]")
|
||||
.y_axis_label("Phase [rad]")
|
||||
.y_axis_min_width(2.0)
|
||||
.show(ui, |plot_ui| {
|
||||
plot_ui.line(
|
||||
|
||||
@@ -75,7 +75,7 @@ async fn main() {
|
||||
|
||||
let mut sub = client
|
||||
.client
|
||||
.subscribe_multi::<icd::ImpedanceTopic>(8)
|
||||
.subscribe_multi::<icd::ImpedanceOutputTopic>(8)
|
||||
.await
|
||||
.unwrap();
|
||||
client.start_impedancemeter(freq).await.unwrap();
|
||||
|
||||
@@ -29,6 +29,7 @@ fn main() {
|
||||
let magnitude_series_clone = app.magnitude_series.clone();
|
||||
let phase_series_clone = app.phase_series.clone();
|
||||
let connected_clone = app.connected.clone();
|
||||
|
||||
let data_frequency_clone = app.data_frequency.clone();
|
||||
|
||||
// Execute the runtime in its own thread.
|
||||
|
||||
@@ -60,7 +60,7 @@ pub async fn communicate_with_hardware(
|
||||
|
||||
let mut sub = workbook_client
|
||||
.client
|
||||
.subscribe_multi::<icd::ImpedanceTopic>(8)
|
||||
.subscribe_multi::<icd::ImpedanceOutputTopic>(8)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user