pub struct Monitor<D: Directivity, B: Backend> { /* private fields */ }
Expand description
Link to monitoring the status of AUTD and acoustic field
Implementations§
Source§impl Monitor<Sphere, PlottersBackend>
impl Monitor<Sphere, PlottersBackend>
Source§impl<D: Directivity, B: Backend> Monitor<D, B>
impl<D: Directivity, B: Backend> Monitor<D, B>
Sourcepub fn with_directivity<U: Directivity>(self) -> Monitor<U, B>
pub fn with_directivity<U: Directivity>(self) -> Monitor<U, B>
Set directivity
Source§impl<D: Directivity, B: Backend> Monitor<D, B>
impl<D: Directivity, B: Backend> Monitor<D, B>
Sourcepub fn duties_of(&self, idx: usize) -> Vec<f64>
pub fn duties_of(&self, idx: usize) -> Vec<f64>
Get duty ratios of transducers
§Arguments
idx
- Index of STM. If you use Gain, this value should be 0.
Sourcepub fn modulation_raw(&self) -> Vec<f64>
pub fn modulation_raw(&self) -> Vec<f64>
Get raw modulation data
Sourcepub fn modulation(&self) -> Vec<f64>
pub fn modulation(&self) -> Vec<f64>
Get modulation data
Sourcepub fn calc_field<T: Transducer, I: IntoIterator<Item = Vector3>>(
&self,
observe_points: I,
geometry: &Geometry<T>,
) -> Vec<Complex> ⓘ
pub fn calc_field<T: Transducer, I: IntoIterator<Item = Vector3>>( &self, observe_points: I, geometry: &Geometry<T>, ) -> Vec<Complex> ⓘ
Calculate acoustic field at specified points
§Arguments
observe_points
- Observe points iteratorgeometry
- Geometry
Sourcepub fn calc_field_of<T: Transducer, I: IntoIterator<Item = Vector3>>(
&self,
observe_points: I,
geometry: &Geometry<T>,
idx: usize,
) -> Vec<Complex> ⓘ
pub fn calc_field_of<T: Transducer, I: IntoIterator<Item = Vector3>>( &self, observe_points: I, geometry: &Geometry<T>, idx: usize, ) -> Vec<Complex> ⓘ
Calculate acoustic field at specified points
§Arguments
observe_points
- Observe points iteratorgeometry
- Geometryidx
- Index of STM. If you use Gain, this value should be 0.
Sourcepub fn plot_field<T: Transducer>(
&self,
range: PlotRange,
config: B::PlotConfig,
geometry: &Geometry<T>,
) -> Result<(), MonitorError>
pub fn plot_field<T: Transducer>( &self, range: PlotRange, config: B::PlotConfig, geometry: &Geometry<T>, ) -> Result<(), MonitorError>
Sourcepub fn plot_field_of<T: Transducer>(
&self,
range: PlotRange,
config: B::PlotConfig,
geometry: &Geometry<T>,
idx: usize,
) -> Result<(), MonitorError>
pub fn plot_field_of<T: Transducer>( &self, range: PlotRange, config: B::PlotConfig, geometry: &Geometry<T>, idx: usize, ) -> Result<(), MonitorError>
Plot acoustic field
§Arguments
range
- Plot rangeconfig
- Plot configurationgeometry
- Geometryidx
- Index of STM. If you use Gain, this value should be 0.
Sourcepub fn plot_phase<T: Transducer>(
&self,
config: B::PlotConfig,
geometry: &Geometry<T>,
) -> Result<(), MonitorError>
pub fn plot_phase<T: Transducer>( &self, config: B::PlotConfig, geometry: &Geometry<T>, ) -> Result<(), MonitorError>
Sourcepub fn plot_phase_of<T: Transducer>(
&self,
config: B::PlotConfig,
geometry: &Geometry<T>,
idx: usize,
) -> Result<(), MonitorError>
pub fn plot_phase_of<T: Transducer>( &self, config: B::PlotConfig, geometry: &Geometry<T>, idx: usize, ) -> Result<(), MonitorError>
Plot transducers with phases
§Arguments
config
- Plot configurationgeometry
- Geometryidx
- Index of STM. If you use Gain, this value should be 0.
Sourcepub fn plot_modulation(&self, config: B::PlotConfig) -> Result<(), MonitorError>
pub fn plot_modulation(&self, config: B::PlotConfig) -> Result<(), MonitorError>
Plot modulation data
Sourcepub fn plot_modulation_raw(
&self,
config: B::PlotConfig,
) -> Result<(), MonitorError>
pub fn plot_modulation_raw( &self, config: B::PlotConfig, ) -> Result<(), MonitorError>
Plot raw modulation data
Sourcepub fn begin_animation(&self)
pub fn begin_animation(&self)
Begin acoustic field animation
From this call, the monitor will record the drive data until end_animation
is called.
Sourcepub fn end_animation<T: Transducer>(
&self,
range: PlotRange,
config: B::PlotConfig,
geometry: &Geometry<T>,
) -> Result<(), MonitorError>
pub fn end_animation<T: Transducer>( &self, range: PlotRange, config: B::PlotConfig, geometry: &Geometry<T>, ) -> Result<(), MonitorError>
End acoustic field animation and plot the result
Trait Implementations§
Source§impl<T: Transducer, D: Directivity, B: Backend> Link<T> for Monitor<D, B>
impl<T: Transducer, D: Directivity, B: Backend> Link<T> for Monitor<D, B>
Source§fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>
fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>
Send data to devices
Source§fn receive(&mut self, rx: &mut RxDatagram) -> Result<bool, AUTDInternalError>
fn receive(&mut self, rx: &mut RxDatagram) -> Result<bool, AUTDInternalError>
Receive data from devices
Source§fn send_receive(
&mut self,
tx: &TxDatagram,
rx: &mut RxDatagram,
timeout: Duration,
) -> Result<bool, AUTDInternalError>
fn send_receive( &mut self, tx: &TxDatagram, rx: &mut RxDatagram, timeout: Duration, ) -> Result<bool, AUTDInternalError>
Send and receive data
Source§fn wait_msg_processed(
&mut self,
msg_id: u8,
rx: &mut RxDatagram,
timeout: Duration,
) -> Result<bool, AUTDInternalError>
fn wait_msg_processed( &mut self, msg_id: u8, rx: &mut RxDatagram, timeout: Duration, ) -> Result<bool, AUTDInternalError>
Wait until message is processed
Auto Trait Implementations§
impl<D, B> !Freeze for Monitor<D, B>
impl<D, B> !RefUnwindSafe for Monitor<D, B>
impl<D, B> Send for Monitor<D, B>
impl<D, B> !Sync for Monitor<D, B>
impl<D, B> Unpin for Monitor<D, B>
impl<D, B> UnwindSafe for Monitor<D, B>where
B: UnwindSafe,
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.