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