Skip to main content

search_motor

Function search_motor 

Source
pub fn search_motor(
    entry: &MachineEntry,
    cfg: &Config,
    supply: &str,
    wanted: &dyn Fn(&str) -> bool,
    gearboxes: Option<&str>,
    motor: &str,
) -> Result<Vec<Candidate>, ConfigError>
Expand description

search_motors for one motor of a machine with several (a machine file’s machine.motor of id motor): each candidate becomes that motor’s own parts, [parts.<motor>] (with_motor_part), and the other motors stay as the config has them. With gearboxes the motor’s own gearbox ratio picks the fitting ones. The cost is that one motor’s and gearbox’s weight; the axis is the config’s.