Trait stepper_lib::comp::group::SyncCompGroup
source · pub trait SyncCompGroup<T, const COMP: usize>: IndexMut<usize, Output = Box<T>> + Index<usize, Output = Box<T>>where
T: SyncComp + ?Sized,{
Show 19 methods
// Provided methods
fn setup(&mut self) { ... }
fn setup_async(&mut self) { ... }
fn write_link(&mut self, lk: LinkedData) { ... }
fn drive_rel(
&mut self,
deltas: [Delta; COMP],
omegas: [Omega; COMP]
) -> Result<[Delta; COMP], Error> { ... }
fn drive_abs(
&mut self,
gamma: [Gamma; COMP],
omegas: [Omega; COMP]
) -> Result<[Delta; COMP], Error> { ... }
fn measure(
&mut self,
deltas: [Delta; COMP],
omegas: [Omega; COMP],
set_dist: [Gamma; COMP]
) -> Result<[Delta; COMP], Error> { ... }
fn drive_rel_async(
&mut self,
deltas: [Delta; COMP],
omegas: [Omega; COMP]
) -> Result<(), Error> { ... }
fn drive_abs_async(
&mut self,
gamma: [Gamma; COMP],
omegas: [Omega; COMP]
) -> Result<(), Error> { ... }
fn await_inactive(&mut self) -> Result<[Delta; COMP], Error> { ... }
fn gammas(&self) -> [Gamma; COMP] { ... }
fn write_gammas(&mut self, gammas: &[Gamma; COMP]) { ... }
fn lims_for_gammas(&self, gammas: &[Gamma; COMP]) -> [Delta; COMP] { ... }
fn valid_gammas(&self, gammas: &[Gamma; COMP]) -> bool { ... }
fn valid_gammas_verb(&self, gammas: &[Gamma; COMP]) -> [bool; COMP] { ... }
fn set_ends(&mut self, set_dist: &[Gamma; COMP]) { ... }
fn set_limits(
&mut self,
min: &[Option<Gamma>; COMP],
max: &[Option<Gamma>; COMP]
) { ... }
fn apply_inertias(&mut self, inertias: &[Inertia; COMP]) { ... }
fn apply_forces(&mut self, forces: &[Force; COMP]) { ... }
fn apply_bend_f(&mut self, f_bend: f32) { ... }
}
Expand description
A group of synchronous components that can be implemented for any type of array, vector or list as long as it can be indexed. This trait then allows a lot of functions to be used to execute functions for all components at once.
Provided Methods§
sourcefn setup(&mut self)
fn setup(&mut self)
Runs SyncComp::setup() for all components in the group
sourcefn setup_async(&mut self)
fn setup_async(&mut self)
Runs SyncComp::setup_async() for all components in the group
Feature
This function is only available if the “std” feature is enabled
sourcefn write_link(&mut self, lk: LinkedData)
fn write_link(&mut self, lk: LinkedData)
Runs SyncComp::write_link() for all components in the group. Note that the function is using the same LinkedData for all components
sourcefn drive_rel(
&mut self,
deltas: [Delta; COMP],
omegas: [Omega; COMP]
) -> Result<[Delta; COMP], Error>
fn drive_rel( &mut self, deltas: [Delta; COMP], omegas: [Omega; COMP] ) -> Result<[Delta; COMP], Error>
Runs SyncComp::drive_rel() for all components
sourcefn drive_abs(
&mut self,
gamma: [Gamma; COMP],
omegas: [Omega; COMP]
) -> Result<[Delta; COMP], Error>
fn drive_abs( &mut self, gamma: [Gamma; COMP], omegas: [Omega; COMP] ) -> Result<[Delta; COMP], Error>
Runs SyncComp::drive_abs() for all components
sourcefn measure(
&mut self,
deltas: [Delta; COMP],
omegas: [Omega; COMP],
set_dist: [Gamma; COMP]
) -> Result<[Delta; COMP], Error>
fn measure( &mut self, deltas: [Delta; COMP], omegas: [Omega; COMP], set_dist: [Gamma; COMP] ) -> Result<[Delta; COMP], Error>
Runs SyncComp::measure() for all components in the group
sourcefn drive_rel_async(
&mut self,
deltas: [Delta; COMP],
omegas: [Omega; COMP]
) -> Result<(), Error>
fn drive_rel_async( &mut self, deltas: [Delta; COMP], omegas: [Omega; COMP] ) -> Result<(), Error>
Runs SyncComp::drive_rel_async() for all components
Features
Only available if the “std” feature is enabled
sourcefn drive_abs_async(
&mut self,
gamma: [Gamma; COMP],
omegas: [Omega; COMP]
) -> Result<(), Error>
fn drive_abs_async( &mut self, gamma: [Gamma; COMP], omegas: [Omega; COMP] ) -> Result<(), Error>
Runs SyncComp::drive_abs_async() for all components
Features
Only available if the “std” feature is enabled
sourcefn await_inactive(&mut self) -> Result<[Delta; COMP], Error>
fn await_inactive(&mut self) -> Result<[Delta; COMP], Error>
Runs SyncComp::await_inactive() for all components
Features
Only available if the “std” feature is enabled
sourcefn gammas(&self) -> [Gamma; COMP]
fn gammas(&self) -> [Gamma; COMP]
Runs SyncComp::gamma() for all components
sourcefn write_gammas(&mut self, gammas: &[Gamma; COMP])
fn write_gammas(&mut self, gammas: &[Gamma; COMP])
Runs SyncComp::write_gamma() for all components
sourcefn lims_for_gammas(&self, gammas: &[Gamma; COMP]) -> [Delta; COMP]
fn lims_for_gammas(&self, gammas: &[Gamma; COMP]) -> [Delta; COMP]
Runs SyncComp::lim_for_gamma() for all components
sourcefn valid_gammas(&self, gammas: &[Gamma; COMP]) -> bool
fn valid_gammas(&self, gammas: &[Gamma; COMP]) -> bool
Checks if the given gammas are vaild, which means they are finite and in range of the components
sourcefn valid_gammas_verb(&self, gammas: &[Gamma; COMP]) -> [bool; COMP]
fn valid_gammas_verb(&self, gammas: &[Gamma; COMP]) -> [bool; COMP]
Same as SyncCompGroup::valid_gammas(), but it evaluates the check for each component and returns seperated results for analysis
sourcefn set_ends(&mut self, set_dist: &[Gamma; COMP])
fn set_ends(&mut self, set_dist: &[Gamma; COMP])
Runs SyncComp::set_end() for all components
sourcefn set_limits(
&mut self,
min: &[Option<Gamma>; COMP],
max: &[Option<Gamma>; COMP]
)
fn set_limits( &mut self, min: &[Option<Gamma>; COMP], max: &[Option<Gamma>; COMP] )
Runs SyncComp::set_limit() for all components
sourcefn apply_inertias(&mut self, inertias: &[Inertia; COMP])
fn apply_inertias(&mut self, inertias: &[Inertia; COMP])
Runs SyncComp::apply_inertia() for all components
sourcefn apply_forces(&mut self, forces: &[Force; COMP])
fn apply_forces(&mut self, forces: &[Force; COMP])
Runs SyncComp::apply_force() for all components
sourcefn apply_bend_f(&mut self, f_bend: f32)
fn apply_bend_f(&mut self, f_bend: f32)
Runs SyncComp::apply_bend_f() for all components. Note that the same factor is applied to all components