Skip to main content

search_motors

Function search_motors 

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

Tries every catalogue motor that wanted accepts and that is offered at the supply (SUPPLIES; “s120” the S120 motors) on the cycle of the config, each with the drive the catalogue pairs with it (paired_drive) and retuned as with_parts says, on all processors, and returns them ranked (rank): the passing ones first, cheapest first, then the others, nearest to passing first. No catalogue file has a price; the weight of motor and gearbox stands in for it (Candidate::cost).

With gearboxes (a series, see fitting_gearboxes) and a config whose machine has a gearbox (ratio above 1), each motor is tried with every fitting gearbox of that series in place of the config’s; a motor that none fits is tried with the config’s own gearbox (gearbox “”: before, it was left out without a word).

Every candidate is simulated (run_jobs).