Skip to main content

fmi_schema/fmi2/
attribute_groups.rs

1#[derive(Default, Debug, PartialEq, hard_xml::XmlRead, hard_xml::XmlWrite)]
2#[xml(tag = "Real")]
3pub struct RealAttributes {
4    #[xml(attr = "quantity")]
5    pub quantity: Option<String>,
6
7    #[xml(attr = "unit")]
8    pub unit: Option<String>,
9
10    /// Default display unit, provided the conversion of values in "unit" to values in
11    /// "displayUnit" is defined in UnitDefinitions / Unit / DisplayUnit.
12    #[xml(attr = "displayUnit")]
13    pub display_unit: Option<String>,
14
15    /// If relativeQuantity=true, offset for displayUnit must be ignored.
16    #[xml(attr = "relativeQuantity")]
17    pub relative_quantity: Option<bool>,
18
19    #[xml(attr = "min")]
20    pub min: Option<f64>,
21
22    /// max >= min required
23    #[xml(attr = "max")]
24    pub max: Option<f64>,
25
26    /// nominal >= min and <= max required
27    #[xml(attr = "nominal")]
28    pub nominal: Option<f64>,
29
30    /// Set to true, e.g., for crank angle. If true and variable is a state, relative tolerance
31    /// should be zero on this variable.
32    #[xml(attr = "unbounded")]
33    pub unbounded: Option<bool>,
34}
35
36#[derive(Default, Debug, PartialEq, hard_xml::XmlRead, hard_xml::XmlWrite)]
37#[xml(tag = "Integer")]
38pub struct IntegerAttributes {
39    #[xml(attr = "quantity")]
40    pub quantity: Option<String>,
41
42    #[xml(attr = "min")]
43    pub min: Option<f64>,
44
45    /// max >= min required
46    #[xml(attr = "max")]
47    pub max: Option<f64>,
48}