use autd3_driver::{ConfigSilencer, Drive, GainAdvancedDuty};
use crate::{datagram::*, error::AUTDInternalError, geometry::*};
#[derive(Default)]
pub struct Stop {}
impl Stop {
pub fn new() -> Self {
Self {}
}
}
impl<T: Transducer> Datagram<T> for Stop {
type H = ConfigSilencer;
type B = GainAdvancedDuty;
fn operation(
&mut self,
geometry: &Geometry<T>,
) -> Result<(Self::H, Self::B), AUTDInternalError> {
Ok((
Self::H::new(10),
<Self::B as autd3_driver::operation::GainOp>::new(
vec![Drive { amp: 0., phase: 0. }; geometry.num_transducers()],
|| vec![4096u16; geometry.num_transducers()],
),
))
}
}