Skip to main content

Crate sim_netlist

Crate sim_netlist 

Source
Expand description

Machines defined in a file, without Rust code: a machine config (the tables every machine has: [sim], [effects], [belt], [motor], [drive], [ratings], [cycle], …) plus a [machine] table that wires components together as a netlist (see netlist::NODES and docs/machine-files.md).

from_text checks a file’s text into a MachineEntry that every front end takes like a registered machine; sim_machines::load_file reads the file (TOML, or JSON converted).

Re-exports§

pub use machine::ConfigMachine;
pub use netlist::Netlist;
pub use netlist::VERSION;
pub use netlist::json_schema;

Modules§

geometry
Geometry a machine file gives beside its netlist: the belt’s wrap at a driven pulley from where the wheels stand (effects.belt_wrap) and the belt drawn round its wheels, and a body leaning on its carriage (effects.tool_flex).
linkage
LinkageMachine: a planar parallel linkage built from a machine file’s [[machine.linkage]] node: two motor-driven arms in the vertical x-z plane, one at each side of the base, each carrying a pair of forearms down to a plate that keeps its orientation (a five-bar whose lower links are parallelograms: the planar delta). The tool is the plate’s centre; the node’s two axes are its x (across) and z (up).
machine
ConfigMachine: a belt-driven machine of any routing, built from a netlist (Netlist).
netlist
The [machine] part of a machine file: the node lists, what each node may hold, and how they are read and checked. NODES is the schema: the parser refuses a field it does not list, and json_schema is written from it.
scissor
ScissorMachine: a scissor lift from a machine file’s [[machine.scissor]] node. n stages of crossed arm pairs, each arm L from pin to pin, stand on the base; a screw, turned by the motor through its gearbox, pulls the sliding foot of the lowest stage towards the fixed one and so raises the platform. The tool is the platform’s height z.
spatial
Delta picker D3 (Clavel): three motor-driven arms at 120 degrees on a base, each carrying a parallelogram of two forearms down to a platform that stays level. The tool is the platform’s centre, x, y, z.
worm
A worm stage (machine.worm): what it passes on, driven forward by the motor and back by the load.

Structs§

FileError
Why a machine file was refused: the file, the line the error is on where it can be found, and the error (a translation key and the config path it is about).

Functions§

build
MachineEntry::build of every machine file: the netlist is in the config itself.
from_text
A machine file’s TOML text, checked in full: the netlist, every key against known (the default configs of the registered machines, whose tables a machine file shares), and every value the machine and the simulation read. fallback_id names the machine where machine.id does not. lines says whether the text is the file as written, so that an error can name its line (a JSON file arrives here converted, and its lines are not these). The entry lives as long as the program. Files are read, and JSON converted, by sim_machines::load_file.
line_of
The line (from 1) of a TOML text that an error’s path is about: machine.<list>[<id>].<field> (or [#<n>], the n-th node of the list), or a dotted key table.sub.key. Falls back to the node or the table; None where neither is in the text.