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§

source

fn setup(&mut self)

Runs SyncComp::setup() for all components in the group

source

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

Runs SyncComp::write_link() for all components in the group. Note that the function is using the same LinkedData for all components

source

fn drive_rel( &mut self, deltas: [Delta; COMP], omegas: [Omega; COMP] ) -> Result<[Delta; COMP], Error>

Runs SyncComp::drive_rel() for all components

source

fn drive_abs( &mut self, gamma: [Gamma; COMP], omegas: [Omega; COMP] ) -> Result<[Delta; COMP], Error>

Runs SyncComp::drive_abs() for all components

source

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

source

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

source

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

source

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

source

fn gammas(&self) -> [Gamma; COMP]

Runs SyncComp::gamma() for all components

source

fn write_gammas(&mut self, gammas: &[Gamma; COMP])

Runs SyncComp::write_gamma() for all components

source

fn lims_for_gammas(&self, gammas: &[Gamma; COMP]) -> [Delta; COMP]

Runs SyncComp::lim_for_gamma() for all components

source

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

source

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

source

fn set_ends(&mut self, set_dist: &[Gamma; COMP])

Runs SyncComp::set_end() for all components

source

fn set_limits( &mut self, min: &[Option<Gamma>; COMP], max: &[Option<Gamma>; COMP] )

Runs SyncComp::set_limit() for all components

source

fn apply_inertias(&mut self, inertias: &[Inertia; COMP])

Runs SyncComp::apply_inertia() for all components

source

fn apply_forces(&mut self, forces: &[Force; COMP])

Runs SyncComp::apply_force() for all components

source

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

Implementations on Foreign Types§

source§

impl<const N: usize> SyncCompGroup<dyn SyncComp + 'static, N> for [Box<dyn SyncComp>; N]

source§

impl<const N: usize> SyncCompGroup<dyn SyncComp + 'static, N> for Vec<Box<dyn SyncComp>>

Implementors§