Skip to main content

Crate sim_machines

Crate sim_machines 

Source
Expand description

The registration list: the one place outside a machine crate that names a machine. App, CLI and PLC link pick every machine up from here.

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).

Constants§

LANGUAGES

Statics§

MACHINES

Functions§

find
json_schema
The JSON Schema of a machine file (sim_netlist::json_schema) as text: what schema/machine-file.schema.json holds.
json_to_toml
A JSON machine file as the TOML text of the same config.
load_file
A machine from a machine file (TOML, or JSON by its extension), checked in full against the tables the registered machines have; see docs/machine-files.md. Front ends take it like an entry of MACHINES. An error names the line in a TOML file; in a JSON file the key alone.
load_text
A machine file’s TOML text, checked as load_file checks a file, with id where machine.id names none: for an FMU, which carries the file among its resources. The same text and id give the same entry, as load_file does.
translations
Everything core, components and machine name, in one language, and every registered machine’s own name (for lists of machines). Front ends add their own labels. A registered machine’s labels come from its own crate first, then from the shared components, never from another machine’s (where several machine crates had the same key, the last registered one’s wording won on every machine without its own). A machine file has no labels of its own: its tables are the registered machines’, so it borrows theirs, beneath the shared ones.