fmi
A Rust interface to FMUs (Functional Mockup Units) that follow the FMI Standard.
See http://www.fmi-standard.org
Importing FMUs
The fmi crate implements a Rust interface to FMUs (Functional Mockup Units) that follow the FMI
Standard. This version of the library supports FMI 2.0 and 3.0.
Loading an FMI 2.0 FMU
use ;
// Load an FMU from a file path
let import: Fmi2Import = from_path.unwrap;
assert_eq!;
// Create a Model Exchange instance
let me = import.instantiate_me.unwrap;
assert_eq!;
Loading an FMI 3.0 FMU
use ;
// Load an FMU from a file path
let import: Fmi3Import = from_path.unwrap;
assert_eq!;
// Create a Model Exchange instance
let me = import.instantiate_me.unwrap;
assert_eq!;
Checking FMU version before loading
use ;
// Peek at the FMU metadata without fully extracting it
let model_desc = peek_descr_path.unwrap;
let version = model_desc.major_version.unwrap;
match version
Exporting FMUs
For exporting FMUs, use the fmi-export crate, which provides the traits and helper types for
building FMUs in Rust. See the fmi-export documentation on
docs.rs.
See the fmi-export README for the step-by-step workflow and expected output paths.
Repository Structure
This repository is composed of the following crates:
| Crate | Description | Latest API Docs | README |
|---|---|---|---|
fmi |
Core functionality for importing and executing FMUs | docs.rs | README |
fmi-sys |
Raw generated Rust bindings to the FMI API | docs.rs | README |
fmi-schema |
XML parsing of the FMU Model Description | docs.rs | README |
fmi-sim |
Work-in-progress FMU Simulation master | docs.rs | README |
fmi-test-data |
Reference FMUs for testing | docs.rs | README |
fmi-export |
Types and traits necessary for exporting FMUs | docs.rs | README |
fmi-export-derive |
Procedural macros for fmi-export |
docs.rs | README |
fmi-ls-bus |
FMI-LS-BUS support | docs.rs | README |
fmi-xtask |
FMU export build tooling | docs.rs | README |
Development
For development information, build instructions, and contribution guidelines, see DEVELOP.md.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.