Added bode plots to GUI.

This commit is contained in:
2025-10-07 10:18:04 +02:00
parent beefe733c0
commit e71b02477a
10 changed files with 331 additions and 49 deletions

View File

@@ -5,11 +5,10 @@ use postcard_rpc::{
};
use std::convert::Infallible;
use bioz_icd_rs::{
PingEndpoint, GetUniqueIdEndpoint, SetGreenLedEndpoint, StartImpedance, StartImpedanceEndpoint,
StopImpedanceEndpoint,
GetUniqueIdEndpoint, PingEndpoint, SetGreenLedEndpoint, StartMultiImpedance, StartMultiImpedanceEndpoint, StartSingleImpedance, StartSingleImpedanceEndpoint, StopSingleImpedanceEndpoint
};
use crate::icd::IcdDftNum;
use crate::icd::{IcdDftNum, NumberOfPoints};
#[derive(Debug)]
pub struct WorkbookClient {
@@ -63,13 +62,24 @@ impl WorkbookClient {
Ok(())
}
pub async fn start_impedancemeter(
pub async fn start_impedancemeter_single(
&self,
frequency: u32,
dft_number: IcdDftNum,
) -> Result<(), WorkbookError<Infallible>> {
self.client
.send_resp::<StartImpedanceEndpoint>(&StartImpedance { update_frequency: 60, sinus_frequency: frequency, dft_number})
.send_resp::<StartSingleImpedanceEndpoint>(&StartSingleImpedance { update_frequency: 60, sinus_frequency: frequency, dft_number})
.await?;
Ok(())
}
pub async fn start_impedancemeter_multi(
&self,
dft_number: IcdDftNum,
number_of_points: NumberOfPoints,
) -> Result<(), WorkbookError<Infallible>> {
self.client
.send_resp::<StartMultiImpedanceEndpoint>(&StartMultiImpedance { dft_number, number_of_points })
.await?;
Ok(())
}
@@ -77,7 +87,7 @@ impl WorkbookClient {
pub async fn stop_impedancemeter(&self) -> Result<bool, WorkbookError<Infallible>> {
let res = self
.client
.send_resp::<StopImpedanceEndpoint>(&())
.send_resp::<StopSingleImpedanceEndpoint>(&())
.await?;
Ok(res)
}