syact 0.15.0

A library that defines actuators and their interaction with each other
Documentation
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};

use syunit::*;

use crate::SyncActuator;
use crate::parent::{ActuatorParent, RatioActuatorParent};

/// A gear component, translating the incomming movement by a given ratio
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Gear<C : SyncActuator> {
    /// Steppercontrol for the motor of the bearing
    pub actuator : C,
    
    /// Angle ration from motor to bearing (velocity_b / velocity_m)
    pub ratio : f32
}

impl<C : SyncActuator> Gear<C> {
    /// Creates a new `Gearbearing`
    /// - `device`: The parent component driving the cylinder
    pub fn new(ctrl : C, ratio : f32) -> Self {
        Self {
            actuator: ctrl,
            ratio
        }
    }
}

// Parent
    impl<C : SyncActuator> ActuatorParent for Gear<C> {
        type Child = C;

        fn child(&self) -> &Self::Child {
            &self.actuator
        }

        fn child_mut(&mut self) -> &mut Self::Child {
            &mut self.actuator
        }
    }

    impl<C : SyncActuator> RatioActuatorParent for Gear<C> {
        type Input = Rotary;
        type Output = Rotary;
        type Ratio = f32;

        fn ratio(&self) -> Self::Ratio {
            self.ratio
        }
    }
//