Fmi2ModelDescription

Struct Fmi2ModelDescription 

Source
pub struct Fmi2ModelDescription {
Show 19 fields pub fmi_version: String, pub model_name: String, pub guid: String, pub description: Option<String>, pub version: Option<String>, pub copyright: Option<String>, pub license: Option<String>, pub generation_tool: Option<String>, pub generation_date_and_time: Option<String>, pub variable_naming_convention: Option<String>, pub number_of_event_indicators: u32, pub model_exchange: Option<ModelExchange>, pub co_simulation: Option<CoSimulation>, pub log_categories: Option<LogCategories>, pub default_experiment: Option<DefaultExperiment>, pub unit_definitions: Option<UnitDefinitions>, pub type_definitions: Option<TypeDefinitions>, pub model_variables: ModelVariables, pub model_structure: ModelStructure,
}

Fields§

§fmi_version: String

Version of FMI (Clarification for FMI 2.0.2: for FMI 2.0.x revisions fmiVersion is defined as “2.0”).

§model_name: String

The name of the model as used in the modeling environment that generated the XML file, such as Modelica.Mechanics.Rotational.Examples.CoupledClutches.

§guid: String

Fingerprint of xml-file content to verify that xml-file and C-functions are compatible to each other

§description: Option<String>§version: Option<String>

Version of FMU, e.g., “1.4.1”

§copyright: Option<String>

Information on intellectual property copyright for this FMU, such as “© MyCompany 2011“

§license: Option<String>

Information on intellectual property licensing for this FMU, such as “BSD license”, “Proprietary”, or “Public Domain”

§generation_tool: Option<String>

Name of the tool that generated the XML file.

§generation_date_and_time: Option<String>

time/date of database creation according to ISO 8601 (preference: YYYY-MM-DDThh:mm:ss) Date and time when the XML file was generated. The format is a subset of dateTime and should be: YYYY-MM-DDThh:mm:ssZ (with one T between date and time; Z characterizes the Zulu time zone, in other words, Greenwich meantime) [for example 2009-12-08T14:33:22Z].

§variable_naming_convention: Option<String>

Defines whether the variable names in and in follow a particular convention.

§number_of_event_indicators: u32§model_exchange: Option<ModelExchange>

If present, the FMU is based on FMI for Model Exchange

§co_simulation: Option<CoSimulation>

If present, the FMU is based on FMI for Co-Simulation

§log_categories: Option<LogCategories>§default_experiment: Option<DefaultExperiment>§unit_definitions: Option<UnitDefinitions>§type_definitions: Option<TypeDefinitions>§model_variables: ModelVariables§model_structure: ModelStructure

Implementations§

Source§

impl Fmi2ModelDescription

Source

pub fn num_variables(&self) -> usize

Total number of variables

Source

pub fn num_states(&self) -> usize

Get the number of continuous states (and derivatives)

Source

pub fn num_event_indicators(&self) -> usize

Source

pub fn get_model_variables(&self) -> impl Iterator<Item = &ScalarVariable>

Get a iterator of the SalarVariables

Source

pub fn model_variable_by_name( &self, name: &str, ) -> Result<&ScalarVariable, Error>

Get a reference to the model variable with the given name

Trait Implementations§

Source§

impl Debug for Fmi2ModelDescription

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Fmi2ModelDescription

Source§

fn default() -> Fmi2ModelDescription

Returns the “default value” for a type. Read more
Source§

impl DefaultExperiment for Fmi2ModelDescription

Source§

impl FmiModelDescription for Fmi2ModelDescription

Source§

fn model_name(&self) -> &str

Returns the model name
Source§

fn version_string(&self) -> &str

Returns the FMI version as a string
Source§

fn version(&self) -> Result<Version, Error>

Returns the parsed FMI version as a semver::Version
Source§

fn major_version(&self) -> Result<MajorVersion, Error>

Returns the parsed FMI version as a MajorVersion
Source§

impl FromStr for Fmi2ModelDescription

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl YaDeserialize for Fmi2ModelDescription

Source§

fn deserialize<R: Read>(reader: &mut Deserializer<R>) -> Result<Self, String>

Source§

impl YaSerialize for Fmi2ModelDescription

Source§

fn serialize<W: Write>(&self, writer: &mut Serializer<W>) -> Result<(), String>

Source§

fn serialize_attributes( &self, source_attributes: Vec<OwnedAttribute>, source_namespace: Namespace, ) -> Result<(Vec<OwnedAttribute>, Namespace), String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.