Struct Monitor

Source
pub struct Monitor<D: Directivity, B: Backend> { /* private fields */ }
Expand description

Link to monitoring the status of AUTD and acoustic field

Implementations§

Source§

impl<B: Backend> Monitor<Sphere, B>

Source

pub fn new() -> Self

Source§

impl Monitor<Sphere, PlottersBackend>

Source

pub fn plotters() -> Self

Constructor with Plotters backend

Source§

impl Monitor<Sphere, NullBackend>

Source

pub fn null() -> Self

Constructor with Null backend

Source§

impl<D: Directivity, B: Backend> Monitor<D, B>

Source

pub fn with_directivity<U: Directivity>(self) -> Monitor<U, B>

Set directivity

Source§

impl<D: Directivity, B: Backend> Monitor<D, B>

Source

pub fn phases_of(&self, idx: usize) -> Vec<f64>

Get phases of transducers

§Arguments
  • idx - Index of STM. If you use Gain, this value should be 0.
Source

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.
Source

pub fn phases(&self) -> Vec<f64>

Get phases of transducers

Source

pub fn duties(&self) -> Vec<f64>

Get duty ratios of transducers

Source

pub fn modulation_raw(&self) -> Vec<f64>

Get raw modulation data

Source

pub fn modulation(&self) -> Vec<f64>

Get modulation data

Source

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 iterator
  • geometry - Geometry
Source

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 iterator
  • geometry - Geometry
  • idx - Index of STM. If you use Gain, this value should be 0.
Source

pub fn plot_field<T: Transducer>( &self, range: PlotRange, config: B::PlotConfig, geometry: &Geometry<T>, ) -> Result<(), MonitorError>

Plot acoustic field

§Arguments
  • range - Plot range
  • config - Plot configuration
  • geometry - Geometry
Source

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 range
  • config - Plot configuration
  • geometry - Geometry
  • idx - Index of STM. If you use Gain, this value should be 0.
Source

pub fn plot_phase<T: Transducer>( &self, config: B::PlotConfig, geometry: &Geometry<T>, ) -> Result<(), MonitorError>

Plot transducers with phases

§Arguments
  • config - Plot configuration
  • geometry - Geometry
Source

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 configuration
  • geometry - Geometry
  • idx - Index of STM. If you use Gain, this value should be 0.
Source

pub fn plot_modulation(&self, config: B::PlotConfig) -> Result<(), MonitorError>

Plot modulation data

Source

pub fn plot_modulation_raw( &self, config: B::PlotConfig, ) -> Result<(), MonitorError>

Plot raw modulation data

Source

pub fn begin_animation(&self)

Begin acoustic field animation

From this call, the monitor will record the drive data until end_animation is called.

Source

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 Default for Monitor<Sphere, PlottersBackend>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: Transducer, D: Directivity, B: Backend> Link<T> for Monitor<D, B>

Source§

fn open(&mut self, geometry: &Geometry<T>) -> Result<(), AUTDInternalError>

Open link
Source§

fn close(&mut self) -> Result<(), AUTDInternalError>

Close link
Source§

fn send(&mut self, tx: &TxDatagram) -> Result<bool, AUTDInternalError>

Send data to devices
Source§

fn receive(&mut self, rx: &mut RxDatagram) -> Result<bool, AUTDInternalError>

Receive data from devices
Source§

fn is_open(&self) -> bool

Check if link is open
Source§

fn timeout(&self) -> Duration

Get timeout
Source§

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>

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>
where B: Unpin, D: Unpin,

§

impl<D, B> UnwindSafe for Monitor<D, B>
where B: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.