mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2026-03-10 04:10:31 +00:00
Added bode plots to GUI.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user